|
@@ -1,23 +1,19 @@
|
|
|
<template>
|
|
|
<div class="dashbord-context">
|
|
|
- <div class='dashboard_box'>
|
|
|
- <h3 style="padding-left: 5px;" class="dashboard_box_h3"> <strong>总览</strong>
|
|
|
- <span style="font-size: 12px;">总览网页提供设备和远程服务器的总体状态信息。</span>
|
|
|
- </h3>
|
|
|
- </div>
|
|
|
+
|
|
|
<div class="dashboard_box_sub">
|
|
|
<div class="sub_left">
|
|
|
<Row>
|
|
|
<Col span="24">
|
|
|
<div class="dashboard_chat">
|
|
|
<div class='dashboard_item_title' style='padding-left: 20px;margin-bottom: 10px'>
|
|
|
- <Strong>使能机箱管理</Strong>
|
|
|
+ <Strong>XXX机箱</Strong>
|
|
|
<!-- <i-switch class='switch' v-model="serMode" @on-change="change" />-->
|
|
|
</div>
|
|
|
<div class='model-contect'>
|
|
|
<ul>
|
|
|
<template v-for='(item, index) in serverList'>
|
|
|
- <li :class="item.cardIndex == chassisInfo.curIndex ? 'active' : 'off'" @click="checkIndex(index)">
|
|
|
+ <li :class="index == currentIndex ? 'active' : 'off'" :style="getCursor(item.status)" @click="checkIndex(index, item.status)">
|
|
|
<img class="svg checked-card" id="svg1" src="../assets/checked-card.png">
|
|
|
<template v-if='item.status == 0'>
|
|
|
<span class="active_span off_span">Status</span>
|
|
@@ -39,7 +35,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</Col>
|
|
|
- <Col span="24">
|
|
|
+ <Col span="24">
|
|
|
<div class="dashboard_item">
|
|
|
<div class="dashboard_item_title">
|
|
|
BMC设备信息
|
|
@@ -68,7 +64,7 @@
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
- </Col>
|
|
|
+ </Col>
|
|
|
|
|
|
</Row>
|
|
|
</div>
|
|
@@ -133,6 +129,8 @@
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
</Col>
|
|
|
</Row>
|
|
|
</div>
|
|
@@ -162,8 +160,8 @@ export default {
|
|
|
{
|
|
|
cardIndex: 2,
|
|
|
senserName: 'aa',
|
|
|
- status: 0,
|
|
|
- power: 0,
|
|
|
+ status: 1,
|
|
|
+ power: 1,
|
|
|
isError: false,
|
|
|
isOnline: 1,
|
|
|
isMainCard: false,
|
|
@@ -184,14 +182,27 @@ export default {
|
|
|
sysInfo: {},
|
|
|
chassisInfo: {},
|
|
|
bladeInfo: {},
|
|
|
- sensorsList: []
|
|
|
+ sensorsList: [],
|
|
|
}
|
|
|
},
|
|
|
created() {},
|
|
|
mounted() {
|
|
|
this.init();
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ currentIndex(){
|
|
|
+ return this.$store.state.currentIndex
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
+ getCursor(status){
|
|
|
+ if(status == 1){
|
|
|
+ return {
|
|
|
+ cursor: 'pointer'
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
getImg(status){
|
|
|
if(status == 1) {
|
|
|
return this.okImg
|
|
@@ -203,11 +214,11 @@ export default {
|
|
|
|
|
|
},
|
|
|
async init(){
|
|
|
- this.getDeviceInfo()
|
|
|
- this.getSysInfo()
|
|
|
- await this.getChassisInfo()
|
|
|
- this.getAllBladeInfo()
|
|
|
- this.getAllSensorInfo()
|
|
|
+ await this.getAllBladeInfo()
|
|
|
+ await this.getDeviceInfo()
|
|
|
+ await this.getSysInfo()
|
|
|
+ // await this.getChassisInfo()
|
|
|
+ await this.getAllSensorInfo()
|
|
|
},
|
|
|
|
|
|
getDeviceInfo() {
|
|
@@ -216,8 +227,11 @@ export default {
|
|
|
200 == e.code && (t.deviceInfo = e.data)
|
|
|
})
|
|
|
},
|
|
|
- checkIndex(index){
|
|
|
- sessionStorage.setItem('currentIndex', index)
|
|
|
+ checkIndex(index, status){
|
|
|
+ if(!!!status) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$store.commit('setIndex', index)
|
|
|
this.init();
|
|
|
},
|
|
|
getSysInfo() {
|
|
@@ -244,10 +258,17 @@ export default {
|
|
|
}))
|
|
|
|
|
|
},
|
|
|
- getAllBladeInfo: function() {
|
|
|
+ async getAllBladeInfo() {
|
|
|
var t = this;
|
|
|
- api.Get("/action/getAllBladeInfo", {}).then(res => {
|
|
|
+ await api.Get("/action/getAllBladeInfo", {}).then(res => {
|
|
|
if(200 == res.code){
|
|
|
+ let i;
|
|
|
+ for(i = 0; i < res.data.length; i ++ ){
|
|
|
+ if(res.data[i].isChMC == 1) {
|
|
|
+ this.currentIndex = i
|
|
|
+ this.$store.commit('setIndex', i)
|
|
|
+ }
|
|
|
+ }
|
|
|
t.serverList = res.data
|
|
|
} else {
|
|
|
this.$Message.error(res.msg)
|