def __init__(self,cabinet_data): # 元素定位 self.element = element_yaml(yaml_path="/data/element_data/asset_manager.yaml") self.navigation = self.element["cabinet_add"].get("navigation") self.asset_menu = self.element["cabinet_add"].get("asset_menu") self.cabinet_menu = self.element["cabinet_add"].get("cabinet_menu") self.cabinet_button = self.element["cabinet_add"].get("cabinet_button") self.computer = self.element["cabinet_add"].get("computer") self.cabinet = self.element["cabinet_add"].get("cabinet") self.describe = self.element["cabinet_add"].get("describe") self.choice_server = self.element["cabinet_add"].get("choice_server") self.server_right_button = self.element["cabinet_add"].get("server_right_button") self.submit_button = self.element["cabinet_add"].get("submit_button") self.return_button = self.element["cabinet_add"].get("return_button") # 删除 self.checkall = self.element["computer_delete"].get('checkall_button') self.delete_button = self.element["computer_delete"].get('delete_button') self.id_check = self.element["cabinet_add"].get('id_check') # 测试数据 cabinet_add = xlrd_file(sheet_name="asset_manage_data", xlsx_path="/data/data_write/cmdb_write_data.xlsx") cabinet_host_data = cabinet_add[0] print('cabinet_add',cabinet_add) self.computer_data = cabinet_host_data["computer_name"] self.host_name_data = cabinet_host_data["host_name"] self.cabinet_data = cabinet_data["cabinet"] self.describe_data = cabinet_data["describe"]
def __init__(self,group_data): # 元素定位 self.element = element_yaml(yaml_path="/data/element_data/asset_manager.yaml") self.navigation = self.element["group_manage"].get("navigation") self.asset_menu = self.element["group_manage"].get("asset_menu") self.group_menu = self.element["group_manage"].get("group_menu") self.group_button = self.element["group_manage"].get("group_button") self.server_group = self.element["group_manage"].get("server_group") self.describe = self.element["group_manage"].get("describe") self.choice_server = self.element["group_manage"].get("choice_server") self.server_right = self.element["group_manage"].get("server_right") self.submit_button = self.element["group_manage"].get("submit_button") self.return_button = self.element["group_manage"].get("return_button") # 删除 # self.checkall = self.element["computer_delete"].get('checkall_button') # self.delete_button = self.element["computer_delete"].get('delete_button') # # self.id_check = self.element["group_menu"].get("id_check") # 测试数据 group_add = xlrd_file(sheet_name="asset_manage_data", xlsx_path="/data/data_write/cmdb_write_data.xlsx") group_host_data = group_add[0] self.server_group_data = group_data["server_group"] self.describe_data = group_data["describe"] self.host_name_data = group_host_data["host_name"]
def __init__(self, login_data): # 元素 self.login_element = element_yaml( yaml_path="/data/element_data/login.yaml") self.AdminSet = self.login_element['login'].get('AdminSet') self.username = self.login_element['login'].get('username') self.password = self.login_element['login'].get('password') self.denglu = self.login_element['login'].get('denglu') self.error = self.login_element['login'].get('error') self.AST = self.login_element['login'].get('AST') # 测试数据 # login_data1 = xlrd_file(sheet_name="login", xlsx_path="/data/data_source/asset_manager_data.xlsx") # self.login_data = login_data1[login_data] self.username_data = login_data["username"] self.password_data = login_data['password'] # public self.add_pass = self.login_element['login'].get('add_pass') self.add_fail = self.login_element['login'].get('add_fail')
def __init__(self, host_data): self.element = element_yaml( yaml_path="/data/element_data/asset_manager.yaml") # 主机管理_元素定位 self.navigation = self.element['host_manage_add'].get('navigation') self.asset_menu = self.element['host_manage_add'].get('asset_menu') self.host_menu = self.element['host_manage_add'].get('host_menu') self.add_button = self.element['host_manage_add'].get('add_button') self.add_host_content = self.element['host_manage_add'].get( 'add_host_content') self.host_name = self.element['host_manage_add'].get('host_name') self.ip = self.element['host_manage_add'].get('ip') # self.number = self.element['host_manage_add'].get('number') self.computer = self.element['host_manage_add'].get('computer') self.other_ip = self.element['host_manage_add'].get('other_ip') self.asset_number = self.element['host_manage_add'].get('asset_number') self.device_type = self.element['host_manage_add'].get('device_type') self.device = self.element['host_manage_add'].get('device') self.system = self.element['host_manage_add'].get('system') self.equipment = self.element['host_manage_add'].get('equipment') self.upper_time = self.element['host_manage_add'].get('upper_time') self.cpu_type = self.element['host_manage_add'].get('cpu_type') self.cpu_number = self.element['host_manage_add'].get('cpu_number') self.memory = self.element['host_manage_add'].get('memory') self.disk = self.element['host_manage_add'].get('disk') self.sn_number = self.element['host_manage_add'].get('sn_number') self.position = self.element['host_manage_add'].get('position') self.remarks = self.element['host_manage_add'].get('remarks') self.submit_button = self.element['host_manage_add'].get( 'submit_button') self.return_button = self.element['host_manage_add'].get( 'return_button') # 编辑 self.update_button = self.element['host_manage_add'].get( 'update_button') self.host_update_news = self.element['host_manage_add'].get( 'host_update') self.iframe = self.element['host_manage_add'].get('iframe') self.preservation_button = self.element['host_manage_add'].get( 'preservation_button') self.host_name_update = self.element['host_manage_add'].get( 'host_name_update') # 删除 self.checkall_button = self.element['host_delete'].get( 'checkall_button') self.delete_button = self.element['host_delete'].get('delete_button') self.id_check = self.element['host_manage_add'].get('id_check') # 提示信息 self.fail = self.element["checkpoint"].get("fail") self.success = self.element["checkpoint"].get("success") # 主机管理_测试数据 computer_data = xlrd_file( sheet_name="asset_manage_data", xlsx_path="/data/data_write/cmdb_write_data.xlsx") self.computer_data = computer_data[0] self.host_name_data = host_data['host_name'] self.ip_data = host_data['ip'] # self.number_data = host_data['number'] self.computer_data = self.computer_data['computer_name'] # 得到机房管理名称 # print('self.computer_data',self.computer_data) self.other_ip_data = host_data['other_ip'] self.asset_number_data = host_data['asset_number'] self.device_type_data = host_data['device_type'] self.device_data = host_data['device'] self.system_data = host_data['system'] self.equipment_data = host_data['equipment'] self.upper_time_data = host_data['upper_time'] self.cpu_type_data = host_data['cpu_type'] self.cpu_number_data = host_data['cpu_number'] self.memory_data = host_data['memory'] self.disk_data = host_data['disk'] self.sn_number_data = host_data['sn_number'] self.position_data = host_data['position'] self.remarks_data = host_data['remarks']
def __init__(self, computer_data): # 元素定位 self.element = element_yaml( yaml_path="/data/element_data/asset_manager.yaml") self.navigation = self.element["computer_manage_add"].get("navigation") self.asset_menu = self.element["computer_manage_add"].get("asset_menu") self.computer_menu = self.element["computer_manage_add"].get( "computer_menu") self.add_button = self.element["computer_manage_add"].get("add_button") self.sign = self.element["computer_manage_add"].get("sign") self.computer_name = self.element["computer_manage_add"].get( "computer_name") self.address = self.element["computer_manage_add"].get("address") self.computer_phone = self.element["computer_manage_add"].get( "computer_phone") self.manager = self.element["computer_manage_add"].get("manager") self.phone = self.element["computer_manage_add"].get("phone") self.cabinet = self.element["computer_manage_add"].get("cabinet") self.ip = self.element["computer_manage_add"].get("ip") self.bandwidth = self.element["computer_manage_add"].get("bandwidth") self.remarks = self.element["computer_manage_add"].get("remarks") self.submit_button = self.element["computer_manage_add"].get( "submit_button") self.return_button = self.element["computer_manage_add"].get( "return_button") self.add_pass = self.element["computer_manage_add"].get("add_pass") self.add_fail = self.element["computer_manage_add"].get("add_fail") # 编辑 self.update_button = self.element["computer_manage_add"].get( "update_button") # self.get_computer_name = self.element["computer_manage_add"].get("get_computer_name") self.get_remarks = self.element["computer_manage_add"].get( "get_remarks") # 删除 # self.checkall = self.element["computer_delete"].get('checkall_button') # self.delete_button = self.element["computer_delete"].get('delete_button') # # self.fail = self.element["checkpoint"].get('fail') # self.success = self.element["checkpoint"].get('success') # self.id_check = self.element["checkpoint"].get('id_check') # 测试数据 # computer_add = xlrd_file(sheet_name="computer_manage_add",xlsx_path="/data/data_source/asset_manager_data.xlsx") # computer_data = computer_add[computer_add_data] self.sign_data = computer_data['sign'] self.computer_name_data = computer_data['computer_name'] self.address_data = computer_data['address'] self.computer_phone_data = computer_data['computer_phone'] self.manager_data = computer_data['manager'] self.phone_data = computer_data['phone'] self.cabinet_data = computer_data['cabinet'] self.ip_data = computer_data['ip'] self.bandwidth_data = computer_data['bandwidth'] self.remarks_data = computer_data['remarks']