Browse Source

服务器列表读取

master
xyiege 5 months ago
parent
commit
1f24906f04
  1. BIN
      aufs/ups.db
  2. 9
      vue/afvue/src/api/scinfo.js
  3. 39
      vue/afvue/src/views/Setting.vue

BIN
aufs/ups.db

Binary file not shown.

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

@ -9,3 +9,12 @@ export function Sysinfo(host){
})
}
// 服务器的
export function Sclist(host){
return axios({
url: host+'/scdb',
method: 'get'
})
}

39
vue/afvue/src/views/Setting.vue

@ -31,26 +31,16 @@
<th>服务器端口</th>
<th>操作</th>
</tr>
<tr>
<td>服务器1</td>
<td>192.168.1.1</td>
<td>8080</td>
<td>
<button>编辑</button>
<button>删除</button>
</td>
</tr>
<tr>
<td>服务器2</td>
<td>192.168.1.2</td>
<td>8080</td>
<tr v-for="val in serverlist">
<td>{{val.scname}}</td>
<td>{{val.addr}}</td>
<td>{{ val.port }}</td>
<td>
<button>编辑</button>
<button>删除</button>
</td>
</tr>
</table>
</div>
@ -122,3 +112,24 @@ tr:nth-child(odd) {
background-color: #ffffff;
}
</style>
<script>
import { Sclist } from '@/api/scinfo'
export default {
data() {
return {
serverlist: []
}
},
mounted() {
this.getscdb()
},
methods: {
getscdb() {
let host="http://localhost:9099"
Sclist(host).then(res => {
this.serverlist = res.data
})
}
}
}
</script>
Loading…
Cancel
Save