From 5d3fe5712f60fec872870e0b1a3162c72466ab05 Mon Sep 17 00:00:00 2001 From: hanbaoshan <hanbaoshan@aiotlink.com> Date: 星期四, 15 十月 2020 19:07:20 +0800 Subject: [PATCH] 移除应用引入的common.scss文件 --- src/pages/settings/components/BasicSetting.vue | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/pages/settings/components/BasicSetting.vue b/src/pages/settings/components/BasicSetting.vue index f7df2dd..437cf00 100644 --- a/src/pages/settings/components/BasicSetting.vue +++ b/src/pages/settings/components/BasicSetting.vue @@ -232,6 +232,7 @@ style="position: absolute; left: 330px;" :disabled="syncType === '2'" @click="testNTP" + :loading="ntpTestLoading" >娴嬭瘯</el-button> </el-form-item> @@ -310,7 +311,7 @@ </el-menu-item-group> </el-submenu> </el-menu> - </el-tab-pane> --> + </el-tab-pane>--> <el-tab-pane label="鏉冮檺绠$悊" name="user"> <authority-management v-if="activeName === 'user'"></authority-management> </el-tab-pane> @@ -469,8 +470,9 @@ cityOptions: [], countyOptions: [] }, + webPort: 0, + ntpTestLoading: false }; - webPort: 0; }, mounted() { this.$nextTick(() => { @@ -505,7 +507,7 @@ this.sysinfo.cpuInfo = devInfo.cpu[0].modelName; this.sysinfo.disks = devInfo.disk; - this.sysinfo.mem = (devInfo.mem.total / 1024 / 1024 / 1024).toFixed(2) + "KB"; + this.sysinfo.mem = (devInfo.mem.total / 1024 / 1024 / 1024).toFixed(2) + "GB"; // this.sysinfo.arch = devInfo.host.kernelArch; this.sysinfo.uptime = this.secondsFormat(devInfo.host.uptime); } @@ -529,11 +531,13 @@ var second = s - day * 24 * 3600 - hour * 3600 - minute * 60; return day + "澶�" + hour + "鏃�" + minute + "鍒�" + second + "绉�"; }, - initClockConf() { + initClockConf(ntpTest = false) { getClockInfo().then(rsp => { if (rsp && rsp.success) { this.timezone = rsp.data.time_zone; - this.syncType = rsp.data.ntp ? "1" : "2"; + if (!ntpTest) { + this.syncType = rsp.data.ntp ? "1" : "2"; + } if (rsp.data.ntp) { this.ntpServer = rsp.data.ntp_server; this.timeInterval = rsp.data.interval; @@ -690,9 +694,12 @@ message: "璁剧疆鎴愬姛" }); } + + this.initClockConf(); }) }, testNTP() { + this.ntpTestLoading = true; testNTPserver({ server: this.ntpServer }).then(rsp => { if (rsp && rsp.success) { this.$notify({ @@ -705,11 +712,15 @@ message: "鏃堕棿鍚屾澶辫触" }); } + this.ntpTestLoading = false; + this.initClockConf(true); + }).catch(err => { this.$notify({ type: "error", message: "鏃堕棿鍚屾澶辫触,璇锋鏌ユ湇鍔″櫒ip" }); + this.ntpTestLoading = false; }) }, submitAlarm() { -- Gitblit v1.8.0