class Caztp : public QWidget { Q_OBJECT public: Caztp(QWidget *parent = nullptr, std::shared_ptr shared_authDB = nullptr, int lang = CN); ~Caztp(); server_config_t *getLocalConfig(); void setLogo(QString style); void setCopyRight(QString text); //std::unique_ptr &getSslConfig(); private: Ui::Caztp *ui; bool init_; bool work_thread_; bool load_thread_; bool reg_load_thread_; bool high_risk_thread_; bool vpn_timer_thread_; bool vpn_conn_thread_; bool sso_conn_thread_; bool chk_thread_; bool close_; bool vpn_reconn_; bool init_websso_; bool bl_mode_; bool vpn_status_; bool cert_invalid_; int login_access_; int lang_; int high_fix_flag_; //0:没有高危;1:发现高危,未修复;2:断网隔离 int pre_page_; int net_page_; int vpn_page_; int conn_cnt_; int load_cnt_; int val_; int high_min_; int low_cnt_; int mid_cnt_; int high_cnt_; int vpn_conn_; int vpn_hour_; int vpn_min_; int vpn_sec_; int self_check_total_cnt_; int self_check_fix_cnt_; int invalid_cnt_; int req_type_; int ticket_flag_; //0未处理,1成功,2失败 int jwt_flag_; //0未处理,1成功,2失败 int sso_flag_; //0未处理,1成功,2失败 int websso_flag_; //0:未初始化 1:已初始化 2:已加载 3:未加载 int auth_flag_; //0:成功 1:uid不一致 2:网络错误 int reg_flag_; //0:成功 1:待审核 2:失败 int access_flag_; //0:未进行准入 1:注册中 2:准入中 QString app_name_; QString system_; QString serial_number_; QString user_name_; QString dev_id_; QString version_; QString serv_ip_; QString serv_port_; QString user_ticket_; QString jwt_token_; QString web_code_; QString user_new_; QString eth_card_; QString wifi_card_; QString wifi_ssid_; std::string ra_server_; std::string db_pwd_; QByteArray register_mac_; QByteArray access_mac_; QLineEdit *m_editServIp; QLineEdit *m_editServPort; QLabel *m_labLoad; QLabel *m_labVpnLoad; QLabel *m_labWebLoad; QLabel *m_labAccess; QLabel *m_labSafe; QLabel *m_labSafeTip; QLabel *m_labDisApName; QLabel *m_labDisApMode; QLabel *m_labDisVpnTip; QFrame *m_frmLoad; QFrame *m_frmSafeBg; QPushButton *m_btnServ; QPushButton *m_btnNetCancel; QPushButton *m_btnVpnCancel; QProgressBar *m_progLoad; UiThread *m_loadThread; UiThread *m_regLoadThread; UiThread *m_highRiskThread; UiThread *m_vpnTimerThread; UiThread *m_vpnConnThread; UiThread *m_chkThread; UiThread *m_ssoConnThread; UiThread *m_scanTimerThread; WorkThread *m_workThread; VpnWorkThread *m_vpnWorkThread; VpnMonThread *m_vpnMonThread; BaseLineThread *m_baseLineThread; WifiScanThread *m_wifiScanThread; QMap ruleMapKey_; std::shared_ptr vpnptr; policyInfo *pinfo; std::shared_ptr logger_; std::shared_ptr m_authDB; server_config_t *lconfig_; MyTitleBar* m_titleBar; QNetworkAccessManager *m_accessManager; QWebEngineView *m_WebView; QWebEngineHttpRequest *m_webRequest; CAWebPage *m_WebPage; QWebEngineProfile * m_WebProfile; Bridge *m_Bridge; netstat_t *netstat_; MyCheckBoxHeaderView *m_myHeaderCheckBox; //==== 网络准入线程 ===== connThread *m_connThread; netCardInfo *cardinfo; curStatus *curInfo; clientCert *cli_cert_; bool net_thread_; bool net_result_; char *net_err_; connRunThread *m_connRunThread; net_access_info_t net_access_reg_; //=======终端自检====== bool scan_timer_thread_; bool btn_self_scan_status_; //一键扫描按钮的状态 int scan_hour_; int scan_min_; int scan_sec_; int abnormal_item_num_; //自检:异常检测项总数 int self_scan_page_num_; //当前自检页面号 double self_progIncrement_; //自检进度条单位值 double self_progValue_; //自检进度条当前值 QMovie *m_movieGear; QMovie *m_movieShadow; SelfCheckThread *m_selfCheckThread; checkSelf *check_self_[SELF_SCAN_ITEM_NUM]; // QVector self_check_; QVector self_check_; void writeSelfCheckLog(QString log); void initSelfScanLog(); void selfScanFillLog(int abnormal, int succeed, int faile,int overlook); void initTitleBar(); bool setComBox(QComboBox *, QList&); bool getSelEth(); bool getSelWifi(); void netConn(); bool netDisConn(); // void Sleep(int msec); /*pagelog*/ pagelog *pageLog_ptr; /*version update info*/ agent_up_t upInfo; agentUpdate *uiBoxUpInfo; protected: void closeEvent(QCloseEvent *event) override; bool eventFilter(QObject * watched, QEvent * event) override; void initUiThread(int delay, int timer, int flag); void setRiskStatus(int status); void setVpnLoadStatus(bool status); void setModSwitch(int modswitch); void setModSwitchAll(); void initWebSSO(); void deleteWebSSO(); void flushWebPage(); void chkUserTicket(); void getUserTicket(); void getJwtToken(); void sslPeerVerify(); void logOut(); void readServAddrConfig(); void requestRegister(int nettype, QByteArray mac); int checkRegister(QByteArray mac); void regiser(); void access(); void setLanguage(); int boxInsertList(QComboBox *box, QList list); int boxInsertWList(QComboBox *box, QList list); int boxInsertVpn(QComboBox *box, QMap &vMap, QString head); void checkCardAccessStatus(QString card, int nettype); void setDisconnectNetAccess(int nettype, int curst); void setBaseLineList(QVector &risk, bool first_check); void setHighRiskStatus(); void setBaseLineSafe(); bool setMassageBox(QString text); QString setTooltipText(QString org); void findSelfCheck(); signals: void sigLoginWind(QString name); void sigFinishRule(); void sigRuleMode(); void sigFixMode(int mode); void sigCertDay(int day); void sigLoginWebSSO(); void sigGetSkinMd5(QString serv_ip, QString serv_port); public slots: void setViewPage(); void setLogPage(); void setSysPage(); void setNetPage(); void setSelfCheckPage(); void slotBtnSelfScan(); void returnSelfCheckPage(); void exportSelfCheckLog(); void slotStartSelfScan(int,int,int,int,int); void slotStopSelfScan(); void setVpnPage(); void setSsoPage(); void setRiskPage(); void setBlockPage(); void setBugPage(); void sendBugInfo(); void slotTextChanged(); /*清除问题反馈提示信息,用于定时器*/ void slotRemovePlainText(); void setBack(); void setUiLoad(int timer, int flag); void setUiTimer(int timer, int flag); void setUiFinish(int flag); //void setLoadPage(); void setWifi(bool isChecked); void setEth(bool isChecked); void setSms(bool isChecked); void setOtp(bool isChecked); void setPwd(bool isChecked); void setAddr(); void setCancel(); void loadConfig(); void getWorkResult(int ret, int flag); void getNetConnResult(curStatus *cur, bool *result, char *err); void setZTPInfo(param_pass_t ¶m); void quit(); void closeWindow(); void showZtpWind(); void updateRule(base_line_info_t *data, int num, bool first_check); void fixSingleRule(); void fixAllRule(); //void btnNetConnStatusChange(QByteArray &type, QByteArray &curType, int curst); void btnNetConnStatusChange(int curst); void slotSetRuleMode(); void slotBaseLineOff(); void slotChangeVpnStatus(bool isClicked); void slotVpnQuit(int ret); void slogVpnCancel(); void slotVpnStatus(int status); void slotCertCheck(); void slotCertDay(int day); void slotHttpsFinish(QNetworkReply *reply); void slotSslError(QNetworkReply *reply, const QList &errors); void slotLoad(bool ok); void slotCookie(const QNetworkCookie & cookie); void slotGetWebCode(); void slotLoginWebSSO(); void slotCloseSSO(); void slotReloadWeb(); void slotLoginSuccess(); void slotLoginFailed(); void slotDomComplete(); void slotLogType(const QString &text); void slotVpnEnable(bool enable); void slotGetRegisterStatus(int index); void slotGetWifiSsid(int index); void slotAccessEth(); void slotAccessWifi(); void slotNetworkCardChange(int action, int type); void slotWlanSsidChange(QVector *ssid_list); void slotHeadCheckBoxToggled(bool isChecked); void slotCheckRepair(); void slotCheckBoxChange(bool isClicked); void slotVpnList(); void slotFirstCheck(int flag, QVector *data); void slotUpInfoOld(); void slotUpInfoNew(); /*have new*/ int initVerInfo(int flag); private slots: //void on_btnAccess_clicked(); void on_comApName_currentIndexChanged(const QString &arg1); void on_comApName_activated(const QString &arg1); void on_comLog_currentIndexChanged(int index); void on_logSelBtn_clicked(); void on_btnChk_clicked(); void on_btnUpdate_clicked(); }; Caztp::Caztp(QWidget *parent, std::shared_ptr shared_authDB, int lang) : QWidget(parent), ui(new Ui::Caztp), serial_number_(""), system_(""), user_name_(""), dev_id_(""), version_(""), serv_ip_(""), serv_port_(""), ra_server_(""), db_pwd_(""), pre_page_(P_VIEW), lang_(lang), net_page_(-1), vpn_page_(-1), low_cnt_(0), mid_cnt_(0), high_cnt_(0), high_min_(HIGH_RISK_MIN), high_fix_flag_(0), m_workThread(nullptr), m_loadThread(nullptr), m_chkThread(nullptr), m_highRiskThread(nullptr), m_baseLineThread(nullptr), m_vpnConnThread(nullptr), m_ssoConnThread(nullptr), m_vpnTimerThread(nullptr), m_wifiScanThread(nullptr), m_selfCheckThread(nullptr), work_thread_(false), load_thread_(false), reg_load_thread_(false), chk_thread_(false), high_risk_thread_(false), vpn_timer_thread_(false), vpn_conn_thread_(false), sso_conn_thread_(false), net_thread_(false), m_connThread(nullptr), cardinfo(nullptr), curInfo(nullptr), cli_cert_(nullptr), net_result_(false), net_err_(nullptr), close_(false), init_(false), bl_mode_(RULE), vpn_status_(false), invalid_cnt_(0), self_check_total_cnt_(0), self_check_fix_cnt_(0), scan_hour_(0), scan_min_(0), scan_sec_(0), vpn_hour_(0), vpn_min_(0), vpn_sec_(0), vpn_conn_(-1), vpn_reconn_(false), cert_invalid_(false), m_authDB(shared_authDB), user_ticket_(""), jwt_token_(""), req_type_(-1), ticket_flag_(0), jwt_flag_(0), sso_flag_(0), websso_flag_(0), auth_flag_(0), reg_flag_(-1), login_access_(0), register_mac_(""), access_mac_(""), eth_card_(""), wifi_card_(""), wifi_ssid_(""), netstat_(nullptr), lconfig_(nullptr), btn_self_scan_status_(false), self_scan_page_num_(P_SELFCHECK) { ui->setupUi(this); setStyleSheet("background-color:#F7FAFF;"); setWindowFlags(Qt::FramelessWindowHint); setFixedSize(1150, 725); initTitleBar(); m_titleBar->showUserAndQuit(true); // change log pattern QString log_path = QString("%1%2").arg(CAZTP_INSTALL_PATH).arg(AGENT_LOG); logger_ = rotating_logger_mt("caztp", log_path.toStdString().c_str(), 1*1024*1024, 1); logger_->flush_on(level::info); ui->labDev->setAttribute(Qt::WA_TranslucentBackground); ui->labID->setAttribute(Qt::WA_TranslucentBackground); ui->btnNet->installEventFilter(this); ui->frmNet->installEventFilter(this); ui->labNet->installEventFilter(this); ui->labNetTip->installEventFilter(this); ui->btnVpn->installEventFilter(this); ui->frmVpn->installEventFilter(this); ui->labVpn->installEventFilter(this); ui->labVpnTip->installEventFilter(this); ui->btnRisk->installEventFilter(this); ui->frmRisk->installEventFilter(this); ui->labRisk->installEventFilter(this); ui->labRiskTip->installEventFilter(this); ui->btnBlock->installEventFilter(this); ui->frmBlock->installEventFilter(this); ui->labBlock->installEventFilter(this); ui->labBlockTip->installEventFilter(this); ui->labVpnConn->installEventFilter(this); //ui->comEth->installEventFilter(this); //ui->comWifi->installEventFilter(this); //代码添加修改服务器地址控件 m_editServIp = new QLineEdit(ui->frmLconfig); m_editServPort =new QLineEdit(ui->frmLconfig); m_btnServ = new QPushButton(ui->frmLconfig); m_editServIp->setObjectName("editIp"); m_editServIp->setGeometry(40, 75, 278, 40); m_editServIp->setStyleSheet("QLineEdit#editIp{color:#DCDFE6;font: 18px \"Ubuntu\"; \ border: 1px solid #DCDFE6;border-radius:3px;}\ QLineEdit#editIp:focus{color:#515151;border: 1px solid #117AF2;}"); m_editServIp->hide(); m_editServPort->setObjectName("editPort"); m_editServPort->setGeometry(330, 75, 100, 40); m_editServPort->setStyleSheet("QLineEdit#editPort{color:#DCDFE6;font: 18px \"Ubuntu\"; \ border: 1px solid #DCDFE6;border-radius:3px;}\ QLineEdit#editPort:focus{color:#515151;border: 1px solid #117AF2;}"); m_editServPort->hide(); m_btnServ->setObjectName("btnServ"); m_btnServ->setFocusPolicy(Qt::NoFocus); m_btnServ->setText(tr("确定")); m_btnServ->setShortcut(QKeySequence::InsertParagraphSeparator); //设置快捷键为键盘的“回车” m_btnServ->setShortcut(Qt::Key_Enter); //设置快捷键为enter键 m_btnServ->setShortcut(Qt::Key_Return); //设置快捷键为小键盘上的enter键 m_btnServ->setCursor(Qt::PointingHandCursor); m_btnServ->setGeometry(440, 75, 41, 25); m_btnServ->setStyleSheet("color:#117AF2;font:18px \"Ubuntu\";"); m_btnServ->hide(); //代码添加等待页面 m_frmLoad = new QFrame(ui->pageNet); m_frmLoad->setGeometry(40,92,970,577); m_frmLoad->setStyleSheet("border:0px;background-color:white;"); QMatrix matrix; matrix.rotate(0); m_labLoad = new QLabel(m_frmLoad); m_labLoad->setGeometry(320,107,35,40); m_labLoad->setAttribute(Qt::WA_TranslucentBackground); m_labLoad->setPixmap(QPixmap(":/res/login/初始化.png").transformed(matrix, Qt::SmoothTransformation)); m_labLoad->setAlignment(Qt::AlignCenter); m_labAccess = new QLabel(m_frmLoad); m_labAccess->setGeometry(360,100,300,50); m_labAccess->setText(tr("正在进行身份认证...")); m_labAccess->setStyleSheet("font: 28px \"Ubuntu\";color:#515151;background-color:transparent;border:0px;text-align:left;"); m_btnNetCancel = new QPushButton(m_frmLoad); m_btnNetCancel->setGeometry(560,250,96,30); m_btnNetCancel->setText(tr("取消认证")); m_btnNetCancel->setFocusPolicy(Qt::NoFocus); m_btnNetCancel->setCursor(Qt::PointingHandCursor); m_btnNetCancel->setStyleSheet("font: 22px \"Ubuntu\";color:#117AF2;background-color:transparent;border:0px;text-align:left;"); m_progLoad = new QProgressBar(m_frmLoad); m_progLoad->setObjectName("progLoad"); m_progLoad->setGeometry(320, 170, 350, 8); m_progLoad->setTextVisible(false); m_progLoad->setStyleSheet("QProgressBar#progLoad{border-radius:2px;background-color:#DCDFE6}QProgressBar#progLoad:chunk{background-color:#117AF2}"); m_frmLoad->hide(); ui->frmNetBg->show(); ui->frmCertBack->hide(); m_frmSafeBg = new QFrame(ui->pageRisk); m_frmSafeBg->setGeometry(40,92,970,577); m_frmSafeBg->setStyleSheet("border:0px;background-color:white;"); m_labSafe = new QLabel(m_frmSafeBg); m_labSafe->setGeometry(333,120,304,341); m_labSafe->setStyleSheet("background-image:url(:/res/safe_image/无安全风险.png)"); m_labSafeTip = new QLabel(m_frmSafeBg); m_labSafeTip->setGeometry(407, 428, 156, 33); m_labSafeTip->setStyleSheet("font: 24px \"Ubuntu\";color:#15B41B;"); m_labSafeTip->setText(tr(" 无安全风险")); m_frmSafeBg->hide(); ui->frmRiskBg->hide(); connect(ui->btnView, SIGNAL(clicked()), this, SLOT(setViewPage())); connect(ui->btnLog, SIGNAL(clicked()), this, SLOT(setLogPage())); connect(ui->btnSys, SIGNAL(clicked()), this, SLOT(setSysPage())); connect(ui->btnNet, SIGNAL(clicked()), this, SLOT(setNetPage())); connect(ui->btnSelfCheck, SIGNAL(clicked()), this, SLOT(setSelfCheckPage())); connect(ui->btnSelfScan, SIGNAL(clicked()), this, SLOT(slotBtnSelfScan())); connect(ui->btnSelfComplete, SIGNAL(clicked()), this, SLOT(returnSelfCheckPage())); connect(ui->btnRepComplete, SIGNAL(clicked()), this, SLOT(returnSelfCheckPage())); connect(ui->btnExportLog, SIGNAL(clicked()), this, SLOT(exportSelfCheckLog())); connect(ui->btnBug, SIGNAL(clicked()), this, SLOT(setBugPage())); connect(ui->btnSendBug, SIGNAL(clicked()), this, SLOT(sendBugInfo())); connect(ui->pteBug, SIGNAL(textChanged()), this, SLOT(slotTextChanged())); connect(ui->btnNetBack, SIGNAL(clicked()), this, SLOT(setBack())); connect(ui->btnWifi, SIGNAL(clicked(bool)), this, SLOT(setWifi(bool))); connect(ui->btnEth, SIGNAL(clicked(bool)), this, SLOT(setEth(bool))); //connect(ui->btnVpn, SIGNAL(clicked()), this, SLOT(setVpnPage())); //connect(ui->btnVpnBack, SIGNAL(clicked()), this, SLOT(setBack())); connect(ui->btnVpn, SIGNAL(clicked()), this, SLOT(setSsoPage())); connect(ui->btnSsoBack, SIGNAL(clicked()), this, SLOT(setBack())); connect(ui->btnRisk, SIGNAL(clicked()), this, SLOT(setRiskPage())); connect(ui->btnRiskBack, SIGNAL(clicked()), this, SLOT(setBack())); connect(ui->btnBlock, SIGNAL(clicked()), this, SLOT(setBlockPage())); connect(ui->btnBlockBack, SIGNAL(clicked()), this, SLOT(setBack())); connect(ui->btnSms, SIGNAL(clicked(bool)), this, SLOT(setSms(bool))); connect(ui->btnOtp, SIGNAL(clicked(bool)), this, SLOT(setOtp(bool))); connect(ui->btnPwd, SIGNAL(clicked(bool)), this, SLOT(setPwd(bool))); connect(ui->btnEdit, SIGNAL(clicked()), this, SLOT(setAddr())); connect(ui->btnFixAll, SIGNAL(clicked()), this, SLOT(fixAllRule())); connect(m_btnServ, SIGNAL(clicked()), this, SLOT(loadConfig())); connect(m_btnNetCancel, SIGNAL(clicked()), this, SLOT(setCancel())); connect(this, SIGNAL(sigCertDay(int)), this, SLOT(slotCertDay(int))); //=================================================vpn改版=========================================== m_btnVpnCancel = new QPushButton(ui->vpnframe); m_btnVpnCancel->setGeometry(900,28,56,22); m_btnVpnCancel->setText(tr("取消")); m_btnVpnCancel->setFocusPolicy(Qt::NoFocus); m_btnVpnCancel->setCursor(Qt::PointingHandCursor); m_btnVpnCancel->setFont(QFont("Ubuntu", 12)); m_btnVpnCancel->setStyleSheet("color:#3A424F;background-color:transparent;border:0px;"); m_btnVpnCancel->hide(); ui->labVpnConnTip->hide(); m_labVpnLoad = new QLabel(ui->vpnframe); m_labVpnLoad->setGeometry(199,155,18,18); m_labVpnLoad->setAttribute(Qt::WA_TranslucentBackground); m_labVpnLoad->setPixmap(QPixmap(":/res/vpn/vpn_load_black.png").transformed(matrix, Qt::SmoothTransformation)); m_labVpnLoad->setAlignment(Qt::AlignCenter); m_labVpnLoad->hide(); m_labWebLoad = new QLabel(ui->ssoframe); m_labWebLoad->setGeometry(151,196,18,18); m_labWebLoad->setAttribute(Qt::WA_TranslucentBackground); m_labWebLoad->setPixmap(QPixmap(":/res/vpn/vpn_load_black.png").transformed(matrix, Qt::SmoothTransformation)); m_labWebLoad->setAlignment(Qt::AlignCenter); m_labWebLoad->hide(); m_labDisApName = new QLabel(ui->vpnframe); m_labDisApName->setGeometry(128, 117, 50, 22); m_labDisApName->setStyleSheet("font: 20px \"Ubuntu\"; color:#2B2C33;"); m_labDisApName->setText("-"); m_labDisApName->hide(); m_labDisApMode = new QLabel(ui->vpnframe); m_labDisApMode->setGeometry(439, 117, 50, 22); m_labDisApMode->setStyleSheet("font: 20px \"Ubuntu\"; color:#2B2C33;"); m_labDisApMode->setText("-"); m_labDisApMode->hide(); m_labDisVpnTip = new QLabel(ui->vpnframe); m_labDisVpnTip->setGeometry(642, 27, 550, 22); m_labDisVpnTip->setStyleSheet("font: 16px \"Ubuntu\"; color:#85888F;"); m_labDisVpnTip->setText(tr("未开通远程接入权限,请联系管理员开通~")); m_labDisVpnTip->hide(); ui->labWebSSOTip->hide(); this->pinfo = new policyInfo(); this->vpnptr = std::make_shared(); connect(m_btnVpnCancel, SIGNAL(clicked()), this, SLOT(slogVpnCancel())); connect(ui->btnVpnConn, SIGNAL(clicked(bool)), this, SLOT(slotChangeVpnStatus(bool))); //==============================免密登录========================================================== ui->labChkLoad->setPixmap(QPixmap(":/res/login/初始化.png").transformed(matrix, Qt::SmoothTransformation)); ui->labChkLoad->setAlignment(Qt::AlignCenter); m_accessManager = new QNetworkAccessManager(this); connect(ui->btnWebBack, SIGNAL(clicked()), this, SLOT(setBack())); connect(ui->btnChkBack, SIGNAL(clicked()), this, SLOT(setBack())); connect(ui->btnWebSSO, SIGNAL(clicked()), this, SLOT(slotGetWebCode())); connect(ui->btnCloseSSO, SIGNAL(clicked()), this, SLOT(slotCloseSSO())); connect(ui->btnReloadWeb, SIGNAL(clicked()), this, SLOT(slotReloadWeb())); connect(this, SIGNAL(sigLoginWebSSO()), this, SLOT(slotLoginWebSSO())); connect(m_accessManager, SIGNAL(finished(QNetworkReply *)), this, SLOT(slotHttpsFinish(QNetworkReply *))); connect(m_accessManager, SIGNAL(sslErrors(QNetworkReply *, const QList &)), this, SLOT(slotSslError(QNetworkReply *, const QList &))); //=============================安全日志=========================================================== pageLog_ptr = new pagelog(ui->comLog, ui->secLogTable); ui->comLog->addItem(tr("全部日志")); ui->comLog->addItem(tr("VPN日志")); ui->labLogType->raise(); ui->labLogType->installEventFilter(this); ui->logSelBtn->raise(); ui->logSelBtn->setFocus(); ui->logSelBtn->setShortcut(QKeySequence::InsertParagraphSeparator); //设置快捷键为键盘的“回车” ui->logSelBtn->setShortcut(Qt::Key_Enter); //设置快捷键为enter键 ui->logSelBtn->setShortcut(Qt::Key_Return); //设置快捷键为小键盘上的enter键 connect(ui->comLog, SIGNAL(currentTextChanged(const QString &)), this, SLOT(slotLogType(const QString &))); //============================网络准入带注册=========================================================== QProcess process; int ret = 0; process.start("dmidecode -s system-serial-number"); process.waitForFinished(); system_ = QSysInfo::prettyProductName(); logger_->info("system info: {}", system_.toStdString().c_str()); serial_number_ = process.readAllStandardOutput(); serial_number_ = serial_number_.left(serial_number_.indexOf('\n')); ui->labErrEth->hide(); ui->labErrWifi->hide(); ui->labEthLoad->hide(); ui->labEthLoad->setAttribute(Qt::WA_TranslucentBackground); ui->labEthLoad->setPixmap(QPixmap(":/res/vpn/vpn_load_white.png").transformed(matrix, Qt::SmoothTransformation)); ui->labEthLoad->setAlignment(Qt::AlignCenter); ui->labWifiLoad->hide(); ui->labWifiLoad->setAttribute(Qt::WA_TranslucentBackground); ui->labWifiLoad->setPixmap(QPixmap(":/res/vpn/vpn_load_white.png").transformed(matrix, Qt::SmoothTransformation)); ui->labWifiLoad->setAlignment(Qt::AlignCenter); connect(ui->btnAccessEth, SIGNAL(clicked()), this, SLOT(slotAccessEth())); connect(ui->btnAccessWifi, SIGNAL(clicked()), this, SLOT(slotAccessWifi())); connect(ui->comEth, SIGNAL(activated(int)), this, SLOT(slotGetRegisterStatus(int))); connect(ui->comWifi, SIGNAL(activated(int)), this, SLOT(slotGetRegisterStatus(int))); //connect(ui->comWifi, SIGNAL(clicked()), this, SLOT(slotReloadWifiInfo())); connect(ui->comSsid, SIGNAL(activated(int)), this, SLOT(slotGetWifiSsid(int))); //===========================================终端自检============================================================= //需与checkself.h中的枚举self_item保持一致 check_self_[0] = new checkNetworkAuthServer(); check_self_[1] = new checkNetworkPolicyCenter(); check_self_[2] = new checkNetworkOfficeCon(); check_self_[3] = new checkNetworkStatus(); check_self_[4] = new checkServiceRootCa(); check_self_[5] = new checkServiceKernelMod(); check_self_[6] = new checkServiceConfig(); check_self_[7] = new checkNetworkQueue(); check_self_[8] = new checkServiceDb(); check_self_[9] = new checkServiceCpu(); m_movieShadow = new QMovie(":/res/self_inspection/shadow.webp"); m_movieShadow->setScaledSize(ui->labNetAccSD->size()); ui->labNetAccSD->setMovie(m_movieShadow); ui->labTerProSD->setMovie(m_movieShadow); ui->labTerServSD->setMovie(m_movieShadow); m_movieShadow->start(); m_movieGear = new QMovie(":/res/self_inspection/gear.gif"); ui->labBugGear->setMovie(m_movieGear); m_myHeaderCheckBox = new MyCheckBoxHeaderView(Qt::Horizontal, ui->tabBugRepair); ui->tabBugRepair->setHorizontalHeader(m_myHeaderCheckBox); QStringList headers; headers << "" << tr("修复项") << tr("问题描述") << tr("状态"); ui->tabBugRepair->horizontalHeader()->setStyleSheet("QHeaderView::section{background:#F4F7FC;font:16px \"Ubuntu\";color:#85888F;border:0px;}\ QHeaderView::section:first{border-top-left-radius:8px;}\ QHeaderView::section:last{border-top-right-radius:8px;}"); ui->tabBugRepair->horizontalHeader()->setFixedHeight(44); ui->tabBugRepair->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed); ui->tabBugRepair->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft | Qt::AlignVCenter); ui->tabBugRepair->verticalHeader()->hide(); ui->tabBugRepair->setColumnCount(4); ui->tabBugRepair->setHorizontalHeaderLabels(headers); ui->tabBugRepair->setShowGrid(false); ui->tabBugRepair->setColumnWidth(0, 48); ui->tabBugRepair->setColumnWidth(1, 280); ui->tabBugRepair->setColumnWidth(2, 468); ui->tabBugRepair->setColumnWidth(3, 116); ui->tabBugRepair->setFocusPolicy(Qt::NoFocus); ui->tabBugRepair->horizontalScrollBar()->setEnabled(false); ui->tabBugRepair->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); //隐藏滚动条 ui->tabBugRepair->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->tabBugRepair->setSelectionBehavior(QAbstractItemView::SelectRows); ui->tabBugRepair->setItemDelegate(new ItemDelegate); // 设置条目代理 connect(m_myHeaderCheckBox, SIGNAL(headCheckBoxToggled(bool)), this, SLOT(slotHeadCheckBoxToggled(bool))); connect(ui->btnSelfCheck, SIGNAL(clicked()), this, SLOT(setSelfCheckPage())); connect(ui->btnRepair, SIGNAL(clicked()), this, SLOT(slotCheckRepair())); connect(ui->btnAgainScan, SIGNAL(clicked()), this, SLOT(returnSelfCheckPage())); ui->listRisk->horizontalScrollBar()->setEnabled(false); ui->listRisk->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); //隐藏滚动条 this->move((QApplication::desktop()->width() - this->width())/2,(QApplication::desktop()->height() - this->height())/2); setLanguage(); ui->labDataPol->hide(); ui->labGet4->hide(); ui->labGetDataTime->hide(); ui->labRel4->hide(); ui->labRelDataTime->hide(); ui->btnCloseSSO->hide(); ui->btnBlock->hide(); ui->frmBlock->hide(); ui->labBlock->hide(); ui->labBlockTip->hide(); ui->upEcho->hide(); ui->upEchoTitle->hide(); //this->uiBoxUpInfo = new agentUpdate(this); this->uiBoxUpInfo = new agentUpdate(NULL); }