Browse Source

修改获取服务信息获取方式

master
xyiege 6 months ago
parent
commit
431d9e52d2
  1. 4
      vue/afvue/src/api/scinfo.js
  2. 37
      vue/afvue/src/views/Dashboard.vue

4
vue/afvue/src/api/scinfo.js

@ -1,10 +1,10 @@
import { axios } from '@/utils/request' import { axios } from '@/utils/request'
// 系统配置信息 // 系统配置信息
export function Sysinfo(host){ export function Sysinfo(){
// axios.baseURL =host // axios.baseURL =host
return axios({ return axios({
url: host+'/sysinfo', url: '/sysinfo',
method: 'get' method: 'get'
}) })

37
vue/afvue/src/views/Dashboard.vue

@ -3,7 +3,7 @@
<!-- 服务器列表 可循环 --> <!-- 服务器列表 可循环 -->
<div class="ds_list" v-for="(item,index) in sysdata" :key="index"> <div class="ds_list" v-for="(item,index) in sysdata" :key="index">
<span class="dstit">{{index+1}} {{ sclist[index] }} 服务器概况</span> <span class="dstit">{{index+1}} {{ item.plat }} 服务器概况</span>
<div class="dsinfo"> <div class="dsinfo">
<a href="" class="dsbtn green">文件同步</a> <a href="" class="dsbtn green">文件同步</a>
@ -88,34 +88,25 @@ export default {
} }
}, },
created() { created() {
this.mutSys() this.getSysinfo()
}, },
methods: { methods: {
// //
getSysinfo(host) { getSysinfo() {
SysApi.Sysinfo(host).then(res => { SysApi.Sysinfo().then(res => {
// base64 const syslist = res.data.slist
let afbin= base64ToUint8Array(res.data) // slist
// syslist.forEach(item => {
let data = scinfo.decodeHdinfo(afbin) let afbin= base64ToUint8Array(item)
// //
//this.sysdata = data let data = scinfo.decodeHdinfo(afbin)
this.sysdata.push(data) //
this.sysdata.push(data)
})
}) })
}, },
//
mutSys(){
let chost=['http://127.0.0.1:9099','http://192.168.66.92:9099','http://192.168.66.16:9098']
//
this.sclist = chost
//
for(let i=0;i<chost.length;i++){
this.getSysinfo(chost[i])
}
}
} }

Loading…
Cancel
Save