| | |
| | | type="border-card" |
| | | > |
| | | <!-- 本机信息 --> |
| | | <el-tab-pane label="本机信息" name="first"> |
| | | <el-tab-pane label="本机信息" name="sysInfo" v-if="isShow('settings:sysInfo')"> |
| | | <el-menu |
| | | :default-openeds="openeds" |
| | | background-color="#fff" |
| | |
| | | <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> |
| | | <div class="xiangqin-label">设备ID</div> |
| | | <div class="xiangqing-info">{{sysinfo.server_id}}</div> |
| | | </el-col> |
| | | <el-col :span="12" class="flex-box"> |
| | | <!-- <el-col :span="12" class="flex-box"> |
| | | <div class="xiangqin-label">设备编号</div> |
| | | <div class="xiangqing-info">{{sysinfo.deviceNum}}</div> |
| | | </el-col> |
| | | </el-col>--> |
| | | <el-col :span="12" class="flex-box"> |
| | | <div class="xiangqin-label">设备型号</div> |
| | | <div class="xiangqing-info">{{sysinfo.deviceType}}</div> |
| | | <div class="xiangqing-info">{{sysinfo.deviceModel}}</div> |
| | | </el-col> |
| | | <el-col :span="12" class="flex-box"> |
| | | <div class="xiangqin-label">设备序列号</div> |
| | | <div class="xiangqing-info">{{sysinfo.deviceSerialNum}}</div> |
| | | <div class="xiangqin-label">设备类型</div> |
| | | <div class="xiangqing-info">{{sysinfo.deviceDesc}}</div> |
| | | </el-col> |
| | | <el-col :span="12" class="flex-box"> |
| | | <div class="xiangqin-label">通道个数</div> |
| | | <div class="xiangqing-info">{{sysinfo.channelCount}}</div> |
| | | </el-col> |
| | | <el-col :span="12" class="flex-box"> |
| | | <div class="xiangqin-label">主控版本</div> |
| | |
| | | <el-col :span="12" class="flex-box"> |
| | | <div class="xiangqin-label">web版本</div> |
| | | <div class="xiangqing-info">{{sysinfo.webVersion}}</div> |
| | | </el-col> |
| | | <el-col :span="12" class="flex-box"> |
| | | <div class="xiangqin-label">通道个数</div> |
| | | <div class="xiangqing-info">{{sysinfo.channelCount}}</div> |
| | | </el-col> |
| | | <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> |
| | |
| | | </el-tab-pane> |
| | | |
| | | <!-- 时间配置 --> |
| | | <el-tab-pane label="时间配置" name="second"> |
| | | <el-tab-pane label="时间配置" name="timeSet" v-if="isShow('settings:timeSet')"> |
| | | <el-form label-width="100px"> |
| | | <el-form-item label="设备时间"> |
| | | <!-- <el-input v-model="equipmentTime" placeholder="请输入" size="small"></el-input> --> |
| | |
| | | style="position: absolute; left: 330px;" |
| | | :disabled="syncType === '2'" |
| | | @click="testNTP" |
| | | :loading="ntpTestLoading" |
| | | >测试</el-button> |
| | | </el-form-item> |
| | | |
| | |
| | | </el-tab-pane> |
| | | |
| | | <!-- 集群管理 --> |
| | | <el-tab-pane label="集群管理" name="third"> |
| | | <el-tab-pane label="集群管理" name="cluster" v-if="isShow('settings:cluster')"> |
| | | <cluster-management></cluster-management> |
| | | </el-tab-pane> |
| | | <!-- <el-tab-pane label="外部访问" name="fourth"> |
| | |
| | | </el-submenu> |
| | | </el-menu> |
| | | </el-tab-pane>--> |
| | | <el-tab-pane label="权限管理" name="user"> |
| | | <authority-management v-if="activeName === 'user'"></authority-management> |
| | | <el-tab-pane label="权限管理" name="permission" v-if="isShow('settings:permission')"> |
| | | <authority-management v-if="activeName === 'permission'"></authority-management> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="广播设置" name="radio"> |
| | | <radio-set v-if="activeName === 'radio'"></radio-set> |
| | | <el-tab-pane label="广播设置" name="broadcast" v-if="isShow('settings:broadcast')"> |
| | | <radio-set v-if="activeName === 'broadcast'"></radio-set> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | |
| | | import ClusterManagement from "./ClusterManagement"; |
| | | import AuthorityManagement from "./AuthorityManagement"; |
| | | import RadioSet from "./RadioSet"; |
| | | import config from '../../../../package.json' |
| | | |
| | | export default { |
| | | name: "BasicSettings", |
| | |
| | | })) |
| | | }) |
| | | return options |
| | | } |
| | | }, |
| | | isAdmin() { |
| | | if ( |
| | | sessionStorage.getItem("userInfo") && |
| | | sessionStorage.getItem("userInfo") !== "" |
| | | ) { |
| | | let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username; |
| | | return loginName === "superadmin" || loginName === "basic"; |
| | | } |
| | | |
| | | return false; |
| | | }, |
| | | }, |
| | | directives: { |
| | | focus: { |
| | |
| | | loading: true, |
| | | loadingText: "", |
| | | gutter: 10, |
| | | activeName: "first", |
| | | activeName: "sysInfo", |
| | | timezone: "", |
| | | syncType: "1", |
| | | ntpServer: "", |
| | |
| | | cityOptions: [], |
| | | countyOptions: [] |
| | | }, |
| | | webPort: 0, |
| | | ntpTestLoading: false, |
| | | buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [], |
| | | }; |
| | | webPort: 0; |
| | | }, |
| | | created() { |
| | | if (this.isShow("settings:sysInfo")) { |
| | | this.activeName = "sysInfo"; |
| | | } else if (this.isShow("settings:timeSet")) { |
| | | this.activeName = "timeSet"; |
| | | } else if (this.isShow("settings:cluster")) { |
| | | this.activeName = "cluster"; |
| | | } else if (this.isShow("settings:permission")) { |
| | | this.activeName = "permission"; |
| | | } else if (this.isShow("settings:broadcast")) { |
| | | this.activeName = "broadcast"; |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$nextTick(() => { |
| | |
| | | clearInterval(this.browserTimer); |
| | | }, |
| | | methods: { |
| | | isShow(authority) { |
| | | return this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1 |
| | | }, |
| | | initSysinfo() { |
| | | this.loadingText = "正在获取设备信息..."; |
| | | getDevInfo().then(rsp => { |
| | |
| | | let devInfo = this.sysinfo.deviceInfo; |
| | | |
| | | this.sysinfo.cpuInfo = devInfo.cpu[0].modelName; |
| | | this.sysinfo.disks = devInfo.disk; |
| | | 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); |
| | |
| | | } |
| | | |
| | | this.webPort = this.sysinfo.server_port; |
| | | |
| | | this.sysinfo.webVersion = 'V' + config.version; |
| | | } |
| | | |
| | | this.loading = false; |
| | |
| | | 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; |
| | |
| | | if (this.sysinfo.ip !== this.originNetConfig.ip) { |
| | | let newUri = location.protocol + "//" + this.sysinfo.ip + ":" + this.sysinfo.server_port; |
| | | var changeIPTimer = setTimeout(() => { |
| | | this.$alert('<strong>您已修改了服务器ip, 请重新登录</strong><a href="' + newUri + '"> ' + newUri + '<a/>', '提示', { |
| | | this.$alert('<strong>您已修改了服务器ip, 请重新登录</strong><a target="_parent" href="' + newUri + '"> ' + newUri + '<a/>', '提示', { |
| | | dangerouslyUseHTMLString: true |
| | | }); |
| | | }, 10000) |
| | |
| | | if (this.sysinfo.server_port !== this.webPort) { |
| | | let newUri = location.protocol + "//" + this.sysinfo.ip + ":" + this.sysinfo.server_port; |
| | | var changeIPTimer = setTimeout(() => { |
| | | this.$alert('<strong>您已修改了服务器端口, 请重新登录</strong><a href="' + newUri + '"> ' + newUri + '<a/>', '提示', { |
| | | this.$alert('<strong>您已修改了服务器端口, 请重新登录</strong><a target="_parent" href="' + newUri + '"> ' + newUri + '<a/>', '提示', { |
| | | dangerouslyUseHTMLString: true |
| | | }); |
| | | }, 5000) |
| | |
| | | }); |
| | | }, |
| | | checkTimeZone(val) { |
| | | debugger; |
| | | |
| | | }, |
| | | submitClock() { |
| | |
| | | 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() { |