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 | 88 +++++++++++++++++++++++++++++++++++++------ 1 files changed, 75 insertions(+), 13 deletions(-) diff --git a/src/pages/settings/components/BasicSetting.vue b/src/pages/settings/components/BasicSetting.vue index a862654..437cf00 100644 --- a/src/pages/settings/components/BasicSetting.vue +++ b/src/pages/settings/components/BasicSetting.vue @@ -76,7 +76,7 @@ <template slot="title"> <b class="tree-font">璇︾粏淇℃伅</b> </template> - <el-menu-item-group class="item-group"> + <el-menu-item-group class="item-group desc-info"> <el-row :gutter="gutter"> <el-col :span="12" class="flex-box"> <div class="xiangqin-label">ID</div> @@ -109,6 +109,22 @@ <el-col :span="12" class="flex-box"> <div class="xiangqin-label">纭洏涓暟</div> <div class="xiangqing-info">{{sysinfo.diskCount}}</div> + </el-col> + <el-col :span="12" class="flex-box"> + <div class="xiangqin-label">纭洏淇℃伅</div> + <div class="xiangqing-info">{{sysinfo.disks}}</div> + </el-col> + <el-col :span="12" class="flex-box"> + <div class="xiangqin-label">CPU</div> + <div class="xiangqing-info">{{sysinfo.cpuInfo}}</div> + </el-col> + <el-col :span="12" class="flex-box"> + <div class="xiangqin-label">鍐呭瓨</div> + <div class="xiangqing-info">{{sysinfo.mem}}</div> + </el-col> + <el-col :span="12" class="flex-box"> + <div class="xiangqin-label">杩愯鏃堕棿</div> + <div class="xiangqing-info">{{sysinfo.uptime}}</div> </el-col> </el-row> </el-menu-item-group> @@ -159,7 +175,6 @@ </el-menu-item-group> </el-submenu> <!-- 瀵瑰鏈嶅姟IP 鏀瑰悕涓哄閮ㄧ綉缁�(鏂皌ab)--> - </el-menu> </el-tab-pane> @@ -171,12 +186,13 @@ {{ equipmentTime }} </el-form-item> - <el-form-item label="鏃跺尯" prop="timezone"> + <!-- <el-form-item label="鏃跺尯" prop="timezone"> <el-select v-model="timezone" placeholder="璇烽�夋嫨" style="width: 360px; height: 32px" size="small" + @change="checkTimeZone" > <el-option v-for="item in timeZoneOption" @@ -185,7 +201,7 @@ :value="item.value" ></el-option> </el-select> - </el-form-item> + </el-form-item>--> <div style="text-align: left;padding: 10px 0px"> <div class="time-type">NTP鏍℃椂</div> <div style="padding: 10px 0px;"> @@ -216,6 +232,7 @@ style="position: absolute; left: 330px;" :disabled="syncType === '2'" @click="testNTP" + :loading="ntpTestLoading" >娴嬭瘯</el-button> </el-form-item> @@ -233,7 +250,6 @@ placeholder="閫夋嫨鏃ユ湡鏃堕棿" size="small" value-format="yyyy-MM-dd HH:mm:ss" - :readonly="settimeRadio" :disabled="syncType === '1'" ></el-date-picker> <el-checkbox @@ -256,7 +272,7 @@ <el-tab-pane label="闆嗙兢绠$悊" name="third"> <cluster-management></cluster-management> </el-tab-pane> - <el-tab-pane label="澶栭儴璁块棶" name="fourth"> + <!-- <el-tab-pane label="澶栭儴璁块棶" name="fourth"> <el-menu :default-openeds="openeds" background-color="#fff" @@ -294,9 +310,8 @@ </el-form> </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> @@ -455,8 +470,9 @@ cityOptions: [], countyOptions: [] }, + webPort: 0, + ntpTestLoading: false }; - webPort: 0; }, mounted() { this.$nextTick(() => { @@ -464,6 +480,8 @@ // this.initAlarmConf(); this.initResourceConfig(); this.initClockConf(); + //this.markStartTime(); + }); }, beforeDestroy() { @@ -484,6 +502,16 @@ this.alarmConf.min_video_len = rsp.data.min_video_len; this.alarmConf.max_video_len = rsp.data.max_video_len; + if (this.sysinfo.deviceInfo) { + let devInfo = this.sysinfo.deviceInfo; + + this.sysinfo.cpuInfo = devInfo.cpu[0].modelName; + this.sysinfo.disks = devInfo.disk; + 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); + } + if (!this.sysinfo.server_port) { this.sysinfo.server_port = 7003; } @@ -496,11 +524,20 @@ this.loading = false; }); }, - initClockConf() { + secondsFormat(s) { + var day = Math.floor(s / (24 * 3600)); // Math.floor()鍚戜笅鍙栨暣 + var hour = Math.floor((s - day * 24 * 3600) / 3600); + var minute = Math.floor((s - day * 24 * 3600 - hour * 3600) / 60); + var second = s - day * 24 * 3600 - hour * 3600 - minute * 60; + return day + "澶�" + hour + "鏃�" + minute + "鍒�" + second + "绉�"; + }, + 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; @@ -545,6 +582,10 @@ this.settime = this.formatTime(timestamp, 'Y-M-D h:m:s') }, 1000) } + }, + markStartTime() { + let timestamp = new Date().getTime() / 1000; + this.settime = this.formatTime(timestamp, 'Y-M-D h:m:s') }, submitSysinfo() { this.$refs["sysinfo"].validate(valid => { @@ -615,6 +656,10 @@ } }); }, + checkTimeZone(val) { + debugger; + + }, submitClock() { if (this.syncType === '1') { if (this.ntpServer === "") { @@ -649,9 +694,12 @@ message: "璁剧疆鎴愬姛" }); } + + this.initClockConf(); }) }, testNTP() { + this.ntpTestLoading = true; testNTPserver({ server: this.ntpServer }).then(rsp => { if (rsp && rsp.success) { this.$notify({ @@ -664,11 +712,15 @@ message: "鏃堕棿鍚屾澶辫触" }); } + this.ntpTestLoading = false; + this.initClockConf(true); + }).catch(err => { this.$notify({ type: "error", message: "鏃堕棿鍚屾澶辫触,璇锋鏌ユ湇鍔″櫒ip" }); + this.ntpTestLoading = false; }) }, submitAlarm() { @@ -783,8 +835,8 @@ // margin-left: -80px; .el-form-item { text-align: left; - &.is-required:not(.is-no-asterisk)>.el-form-item__label:before{ - margin-left:-8px; + &.is-required:not(.is-no-asterisk) > .el-form-item__label:before { + margin-left: -8px; } .el-button { float: right; @@ -933,6 +985,16 @@ width: 300px; } } +.desc-info { + margin-bottom: 14px; + .flex-box { + height: 40px; + line-height: 40px; + .xiangqin-label { + width: 80px; + } + } +} .menu-css, .el-menu { border-right: none; -- Gitblit v1.8.0