Esempio n. 1
0
def handle_u_key_verify(u_key_ui, u_key_dialog):

    u_key_ui.pushButton_verify.setText("正在验证...")
    QtWidgets.QApplication.processEvents()
    if len(u_key_ui.lineEdit_password.text()) < 6:
        msg_box = QtWidgets.QMessageBox(QtWidgets.QMessageBox.Warning, '警告',
                                        '口令应为6位整数。')
        msg_box.exec_()
        u_key_ui.pushButton_verify.setText("验证")
        QtWidgets.QApplication.processEvents()
        return

    # res=True
    res = RequestManager.make_get_request("/v1.0/ukey/verify?code={}".format(
        u_key_ui.lineEdit_password.text()))

    print(res)
    # if res :
    if True:
        u_key_dialog.accept()
    else:
        msg_box = QtWidgets.QMessageBox(QtWidgets.QMessageBox.Warning, '警告',
                                        '口令不正确,请重新输入。')
        msg_box.exec_()
        u_key_ui.pushButton_verify.setText("验证")
        QtWidgets.QApplication.processEvents()
    def run(self):
        # net_info=json.loads(requests.get("http://localhost/v1.0/native/get_usb_storage_device_using_records").content)
        from requests_manager import RequestManager
        net_info=RequestManager.make_get_request('/v1.0/native/get_usb_storage_device_using_records')

        
        self._signal.emit(net_info); # 信号发送
Esempio n. 3
0
    def run(self):
        # net_info = json.loads(requests.get(
        #     "http://localhost/v1.0/native/get_file_access_records").content)
        from requests_manager import RequestManager
        net_info=RequestManager.make_get_request('/v1.0/native/get_file_access_records')

        self._signal.emit(net_info)  # 信号发送
Esempio n. 4
0
    def get_file_info(self):

        data = {"task_id": self.task_id, "page_size": 1}

        while True:
            # net_info = requests.get("http://localhost/v1.0/files/scan/status?task_id={}&page_size={}".format(data["task_id"],data["page_size"])).content.decode('unicode-escape')
            # # 返回结果中含有 \ ,使得json.loads无法解析,所以需要将返回结果中的 \ 替换为 \\
            # net_info = net_info.replace("\\", "\\\\")
            # net_info = json.loads(net_info)
            net_info = RequestManager.make_get_request(
                "/v1.0/files/scan/status?task_id={}&page_size={}".format(
                    data["task_id"], data["page_size"]))

            for result in net_info["results"]:
                self._signal.emit(result, net_info["progress"],
                                  net_info["status"], data["task_id"])
            if net_info["status"] == "finished":
                break
Esempio n. 5
0
    def get_file_info(self):
        # postdatas = {
        #     "scan_path": ["C://Users//long//Desktop//audit", ],
        #     "file_suffix": [".wps", ".doc", "docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".xlsx"],
        #     "keywords_list": ["秘密", "机密"],
        #     "min_filesize": 1024,
        #     "max_filesize": 1024000000,
        #     "switches": {
        #         "size_switch": True,
        #     }
        # }

        # headers = {"Content-Type": "application/json","Accept": "application/json", }
        # dis_task = requests.post('http://localhost/v1.0/pc/files/scan',data=json.dumps(self.post_info), headers=headers).content
        # dis_task = json.loads(dis_task)
        dis_task = RequestManager.make_post_request("/v1.0/pc/files/scan",
                                                    self.post_info)
        # dis_task = json.loads(dis_task)

        data = {"task_id": dis_task["task_id"], "page_size": 1}

        while True:
            # net_info = requests.get("http://localhost/v1.0/files/scan/status?task_id={}&page_size={}".format(data["task_id"],data["page_size"])).content.decode('unicode-escape')
            # # 返回结果中含有 \ ,使得json.loads无法解析,所以需要将返回结果中的 \ 替换为 \\
            # net_info = net_info.replace("\\", "\\\\")
            # net_info = json.loads(net_info)
            net_info = RequestManager.make_get_request(
                "/v1.0/files/scan/status?task_id={}&page_size={}".format(
                    data["task_id"], data["page_size"]))

            if len(net_info["results"]) == 0:
                self._signal.emit({}, net_info["progress"], net_info["status"],
                                  data["task_id"])

            for result in net_info["results"]:
                self._signal.emit(result, net_info["progress"],
                                  net_info["status"], data["task_id"])
            if net_info["status"] == "finished":
                break
Esempio n. 6
0
    def run(self):
        # net_info=json.loads(requests.get("http://localhost/v1.0/native/get_all_usb_device_records").content)
        net_info = RequestManager.make_get_request(
            '/v1.0/native/get_all_usb_device_records')

        self._signal.emit(net_info)
Esempio n. 7
0
 def run(self):
     # 需要替换
     net_info = RequestManager.make_get_request(
         '/v1.0/native/get_power_off_records')
     self._signal.emit(net_info)
 def run(self):
     # 需要替换
     net_info = RequestManager.make_get_request(
         '/v1.0/native/get_system_logs_records')
     self._signal.emit(net_info)
Esempio n. 9
0
 def run(self):
     print("run")
     from requests_manager import RequestManager
     status_bar_info = j = RequestManager.make_get_request(
         '/v1.0/app/footer/info')
     self._signal_status.emit(status_bar_info)
Esempio n. 10
0
 def run(self):
     # 需要替换
     net_info = RequestManager.make_get_request(
         '/v1.0/native/get_users_groups_records')
     self._signal.emit(net_info)
Esempio n. 11
0
 def run(self):
     # 需要替换
     net_info = RequestManager.make_get_request(
         '/v1.0/native/get_deleted_files_records')
     self._signal.emit(net_info)
    def run(self):
        # net_info = json.loads(requests.get("http://localhost/v1.0/harddisks/info").content)
        from requests_manager import RequestManager
        net_info=RequestManager.make_get_request('/v1.0/harddisks/info')

        self._signal.emit(net_info)  # 信号发送
Esempio n. 13
0
 def run(self):
     net_info = RequestManager.make_get_request('/v1.0/pc/network')
     com_info = RequestManager.make_get_request('/v1.0/pc/info')
     self._signal.emit(net_info, com_info)
 def run(self):
     # net_info=json.loads(requests.get("http://localhost/v1.0/native/get_installed_anti_virus_software_records").content)
     from requests_manager import RequestManager
     net_info = RequestManager.make_get_request(
         '/v1.0/native/get_installed_anti_virus_software_records')
     self._signal.emit(net_info)
Esempio n. 15
0
 def run(self):
     # 需要替换
     net_info = RequestManager.make_get_request(
         '/v1.0/native/get_current_network_records')
     self._signal.emit(net_info)