def get_automobiledevice_reserved(automobiledeviceid): result = 1 if automobiledeviceid != 0: automobiledevice = DAL_AutoMobileDevice.get_automobiledevice( automobiledeviceid) result = automobiledevice.AIsReserved return result
def get_automobiledevice_ip(automobiledeviceid): result = "" if automobiledeviceid != 0: automobiledevice = DAL_AutoMobileDevice.get_automobiledevice( automobiledeviceid) result = automobiledevice.AIP return result
def dm_updateautomobiledevice(request): message = "successful" try: automobiledevice = DAL_AutoMobileDevice.get_automobiledevice( request.POST["automobiledeviceid"]) automobiledevice = AutoMobileDeviceService.initlize_dm_instance( request, automobiledevice) DAL_AutoMobileDevice.add_automobiledevice(automobiledevice) except Exception as ex: message = str(ex) SimpleLogger.error(message) return message
def disable_automobiledevice(request): message = "successful" try: automobiledevice = DAL_AutoMobileDevice.get_automobiledevice( request.POST["automobiledeviceid"]) automobiledevice.TaskIsActive = 0 DAL_AutoMobileDevice.add_automobiledevice(automobiledevice) except Exception as ex: message = str(ex) SimpleLogger.error(message) return message
def copy_automobiledevice(request): message = "successful" try: from_automobiledevice = DAL_AutoMobileDevice.get_automobiledevice( request.POST["automobiledeviceid"]) to_automobiledevice = AutoMobileDevice() to_automobiledevice.AName = from_automobiledevice.AName to_automobiledevice.AOS = from_automobiledevice.AOS to_automobiledevice.AIP = from_automobiledevice.AIP to_automobiledevice.AStatus = 1 to_automobiledevice.AAgentBrowser = from_automobiledevice.AAgentBrowser to_automobiledevice.AIsReserved = from_automobiledevice.AIsReserved DAL_AutoMobileDevice.add_automobiledevice(to_automobiledevice) except Exception as ex: message = str(ex) SimpleLogger.error(message) return message
def get_automobiledevice_types(automobiledeviceid): tasktypes = DAL_DictValue.getdatavaluebytype("AutoTaskType") result = list() for tasktype in tasktypes: temp = dict() temp["text"] = tasktype.DicDataName temp["memberid"] = tasktype.DicDataValue if automobiledeviceid != 0: automobiledevice = DAL_AutoMobileDevice.get_automobiledevice( automobiledeviceid) if tasktype.DicDataValue == automobiledevice.TaskTpye: temp["selected"] = 1 else: temp["selected"] = 0 else: temp["selected"] = 0 result.append(temp) return str(result).replace("u'", "'")
def get_automobiledevice_os(automobiledeviceid): all_os = DAL_DictValue.getdatavaluebytype("AgentOSType") result = list() if automobiledeviceid != 0: automobiledevice = DAL_AutoMobileDevice.get_automobiledevice( automobiledeviceid) for os in all_os: temp = dict() temp["text"] = os.DicDataName temp["memberid"] = os.DicDataValue if automobiledeviceid != 0: if os.DicDataValue == automobiledevice.AOS: temp["selected"] = 1 else: temp["selected"] = 0 else: temp["selected"] = 0 result.append(temp) return str(result).replace("u'", "'")
def get_automobiledevice_browsers(automobiledeviceid): all_browsers = DAL_DictValue.getdatavaluebytype( "AutoTaskRuntime").filter(DicDataDesc='WEB') result = list() if automobiledeviceid != 0: automobiledevice = DAL_AutoMobileDevice.get_automobiledevice( automobiledeviceid) for browser in all_browsers: temp = dict() temp["text"] = browser.DicDataName temp["memberid"] = browser.DicDataValue if automobiledeviceid != 0: if browser.DicDataValue in eval( automobiledevice.AAgentBrowser): temp["selected"] = 1 else: temp["selected"] = 0 else: temp["selected"] = 0 result.append(temp) return str(result).replace("u'", "'")