feat: stabilize multi-region runtime sync and worker orchestration
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
@explain : 域名筛选界面
|
||||
'''
|
||||
|
||||
import json
|
||||
|
||||
from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QGridLayout, QPushButton, QLabel, QComboBox, QDateEdit, QCheckBox, QTableWidget, QTableWidgetItem, QHeaderView, QFileDialog, QLineEdit, QSpinBox, QInputDialog
|
||||
from PySide6.QtGui import QIntValidator
|
||||
from PySide6.QtCore import Qt, QDate, QThread, Signal
|
||||
@@ -15,6 +17,11 @@ from loguru import logger
|
||||
|
||||
from app.core.export_manager import ExportManager
|
||||
from app.utils.database import Database
|
||||
from app.utils.detection_results import (
|
||||
build_manual_detection_result,
|
||||
load_detection_result,
|
||||
resolve_detection_status,
|
||||
)
|
||||
from app.utils.status_codes import (
|
||||
DETECT_STATUS_BLACKLISTED,
|
||||
DETECT_STATUS_COMPLETED,
|
||||
@@ -205,9 +212,9 @@ class UpdateThread(QThread):
|
||||
baidu_history_value = self.update_values['baidu_history']
|
||||
if baidu_history_value != '不更新':
|
||||
status_value = status_mappings['百度历史收录状态'][baidu_history_value]
|
||||
# 转换为JSON格式
|
||||
import json
|
||||
json_value = json.dumps({"status": status_value})
|
||||
json_value = json.dumps(
|
||||
build_manual_detection_result(status_value, legacy_key='has_history')
|
||||
)
|
||||
if detection_id:
|
||||
cur.execute("UPDATE domain_detections SET baidu_history = %s WHERE domain_id = %s", (json_value, domain_info['id']))
|
||||
else:
|
||||
@@ -219,9 +226,9 @@ class UpdateThread(QThread):
|
||||
baidu_site_value = self.update_values['baidu_site']
|
||||
if baidu_site_value != '不更新':
|
||||
status_value = status_mappings['百度site收录状态'][baidu_site_value]
|
||||
# 转换为JSON格式
|
||||
import json
|
||||
json_value = json.dumps({"status": status_value})
|
||||
json_value = json.dumps(
|
||||
build_manual_detection_result(status_value, legacy_key='has_收录')
|
||||
)
|
||||
if detection_id:
|
||||
cur.execute("UPDATE domain_detections SET baidu_site = %s WHERE domain_id = %s", (json_value, domain_info['id']))
|
||||
else:
|
||||
@@ -244,9 +251,9 @@ class UpdateThread(QThread):
|
||||
qihu360_site_value = self.update_values['qihu360_site']
|
||||
if qihu360_site_value != '不更新':
|
||||
status_value = status_mappings['360 site收录状态'][qihu360_site_value]
|
||||
# 转换为JSON格式
|
||||
import json
|
||||
json_value = json.dumps({"status": status_value})
|
||||
json_value = json.dumps(
|
||||
build_manual_detection_result(status_value, legacy_key='has_收录')
|
||||
)
|
||||
if detection_id:
|
||||
cur.execute("UPDATE domain_detections SET qihu360_site = %s WHERE domain_id = %s", (json_value, domain_info['id']))
|
||||
else:
|
||||
@@ -258,9 +265,9 @@ class UpdateThread(QThread):
|
||||
google_site_value = self.update_values['google_site']
|
||||
if google_site_value != '不更新':
|
||||
status_value = status_mappings['Google site收录状态'][google_site_value]
|
||||
# 转换为JSON格式
|
||||
import json
|
||||
json_value = json.dumps({"status": status_value})
|
||||
json_value = json.dumps(
|
||||
build_manual_detection_result(status_value, legacy_key='has_收录')
|
||||
)
|
||||
if detection_id:
|
||||
cur.execute("UPDATE domain_detections SET google_site = %s WHERE domain_id = %s", (json_value, domain_info['id']))
|
||||
else:
|
||||
@@ -1082,28 +1089,14 @@ class DomainFilterWidget(QWidget):
|
||||
|
||||
# 百度历史收录状态
|
||||
baidu_history = domain.get('baidu_history')
|
||||
if baidu_history is None:
|
||||
baidu_history = {}
|
||||
elif isinstance(baidu_history, str):
|
||||
import json
|
||||
try:
|
||||
baidu_history = json.loads(baidu_history)
|
||||
except:
|
||||
baidu_history = {}
|
||||
baidu_history_status = '是' if baidu_history.get('status') else '否'
|
||||
baidu_history = load_detection_result(baidu_history)
|
||||
baidu_history_status = '是' if resolve_detection_status(baidu_history, 'has_history') else '否'
|
||||
self.table_widget.setItem(row, 12, QTableWidgetItem(baidu_history_status))
|
||||
|
||||
# 百度site收录状态
|
||||
baidu_site = domain.get('baidu_site')
|
||||
if baidu_site is None:
|
||||
baidu_site = {}
|
||||
elif isinstance(baidu_site, str):
|
||||
import json
|
||||
try:
|
||||
baidu_site = json.loads(baidu_site)
|
||||
except:
|
||||
baidu_site = {}
|
||||
baidu_site_status = '是' if baidu_site.get('status') else '否'
|
||||
baidu_site = load_detection_result(baidu_site)
|
||||
baidu_site_status = '是' if resolve_detection_status(baidu_site, 'has_收录') else '否'
|
||||
self.table_widget.setItem(row, 13, QTableWidgetItem(baidu_site_status))
|
||||
|
||||
# title是否有中文
|
||||
@@ -1113,28 +1106,14 @@ class DomainFilterWidget(QWidget):
|
||||
|
||||
# 360site收录
|
||||
qihu360_site = domain.get('qihu360_site')
|
||||
if qihu360_site is None:
|
||||
qihu360_site = {}
|
||||
elif isinstance(qihu360_site, str):
|
||||
import json
|
||||
try:
|
||||
qihu360_site = json.loads(qihu360_site)
|
||||
except:
|
||||
qihu360_site = {}
|
||||
qihu360_site_status = '是' if qihu360_site.get('status') else '否'
|
||||
qihu360_site = load_detection_result(qihu360_site)
|
||||
qihu360_site_status = '是' if resolve_detection_status(qihu360_site, 'has_收录') else '否'
|
||||
self.table_widget.setItem(row, 15, QTableWidgetItem(qihu360_site_status))
|
||||
|
||||
# Google site收录状态
|
||||
google_site = domain.get('google_site')
|
||||
if google_site is None:
|
||||
google_site = {}
|
||||
elif isinstance(google_site, str):
|
||||
import json
|
||||
try:
|
||||
google_site = json.loads(google_site)
|
||||
except:
|
||||
google_site = {}
|
||||
google_site_status = '是' if google_site.get('status') else '否'
|
||||
google_site = load_detection_result(google_site)
|
||||
google_site_status = '是' if resolve_detection_status(google_site, 'has_收录') else '否'
|
||||
self.table_widget.setItem(row, 16, QTableWidgetItem(google_site_status))
|
||||
|
||||
# 友情链接数量
|
||||
|
||||
Reference in New Issue
Block a user