| | |
| | | style="position: absolute; left: 330px;" |
| | | :disabled="syncType === '2'" |
| | | @click="testNTP" |
| | | :loading="ntpTestLoading" |
| | | >测试</el-button> |
| | | </el-form-item> |
| | | |
| | |
| | | </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> |
| | |
| | | cityOptions: [], |
| | | countyOptions: [] |
| | | }, |
| | | webPort: 0, |
| | | ntpTestLoading: false |
| | | }; |
| | | webPort: 0; |
| | | }, |
| | | mounted() { |
| | | this.$nextTick(() => { |
| | |
| | | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | message: "设置成功" |
| | | }); |
| | | } |
| | | |
| | | this.initClockConf(); |
| | | }) |
| | | }, |
| | | testNTP() { |
| | | this.ntpTestLoading = true; |
| | | testNTPserver({ server: this.ntpServer }).then(rsp => { |
| | | if (rsp && rsp.success) { |
| | | this.$notify({ |
| | |
| | | message: "时间同步失败" |
| | | }); |
| | | } |
| | | this.ntpTestLoading = false; |
| | | this.initClockConf(true); |
| | | |
| | | }).catch(err => { |
| | | this.$notify({ |
| | | type: "error", |
| | | message: "时间同步失败,请检查服务器ip" |
| | | }); |
| | | this.ntpTestLoading = false; |
| | | }) |
| | | }, |
| | | submitAlarm() { |