| | |
| | | <div class="cloud"> |
| | | <div class="inner"> |
| | | <div class="rect"> |
| | | <div class="node" v-for="(item,index) in insideNodes" :key="item.id" :style="{top:36*(index+1)+'px',left:60*(index+1)+'px'}"> |
| | | <div |
| | | class="node" |
| | | v-for="(item,index) in insideNodes" |
| | | :key="item.id" |
| | | :style="{top:36*(index+1)+'px',left:60*(index+1)+'px'}" |
| | | > |
| | | <span class="node-icon"> |
| | | <!-- <img :src="nodeIcons[item.workType]" alt=""> --> |
| | | </span> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="outer"> |
| | | <div class="node" v-for="(item,index) in insideNodes" :key="item.id" :style="{top:36*(index+1)+'px',left:80*(index+1)+'px'}"> |
| | | <div |
| | | class="node" |
| | | v-for="(item,index) in insideNodes" |
| | | :key="item.id" |
| | | :style="{top:36*(index+1)+'px',left:80*(index+1)+'px'}" |
| | | > |
| | | <span class="node-icon"> |
| | | <!-- <img :src="nodeIcons[item.workType]" alt=""> --> |
| | | </span> |
| | |
| | | </template> |
| | | <script> |
| | | export default { |
| | | name:'cloudNode', |
| | | props:{ |
| | | name: 'cloudNode', |
| | | props: { |
| | | nodes: Array |
| | | }, |
| | | data(){ |
| | | data () { |
| | | return { |
| | | nodeIcons:[], |
| | | mockData:[ |
| | | |
| | | nodeIcons: [], |
| | | mockData: [ |
| | | { |
| | | cluster_id: "b6132bfe-d3af-4710-ba89-436f614c2f46", |
| | | hardwareType: "01", |
| | |
| | | node_id: "DSVAD010120190623", |
| | | node_ip: "192.168.20.10:30190", |
| | | nodeName: "开发测试20.10-1", |
| | | role:'master' |
| | | role: 'master' |
| | | }, |
| | | { |
| | | cluster_id: "b6132bfe-d3af-4710-ba89-436f614c2g", |
| | |
| | | node_id: "DSVAD010120190624", |
| | | node_ip: "192.168.20.10:30190", |
| | | nodeName: "测试20.10-1", |
| | | role:'pc' |
| | | role: 'pc' |
| | | }, |
| | | { |
| | | cluster_id: "b6132bfe-d3af-4710-ba89-436f614c2h", |
| | |
| | | node_id: "DSVAD010120190625", |
| | | node_ip: "192.168.20.10:30190", |
| | | nodeName: "测试20.101-1", |
| | | role:'server' |
| | | role: 'server' |
| | | }, |
| | | ] |
| | | } |
| | | }, |
| | | computed:{ |
| | | |
| | | insideNodes(){ |
| | | //return this.nodes.filter(item=>item.hardwareType=='01'||item.hardwareType=='02'); |
| | | return this.mockData.filter(item=>item.hardwareType=='01'||item.hardwareType=='02'); |
| | | computed: { |
| | | cloudPic () { |
| | | return '/images/settings/cloud.png' |
| | | }, |
| | | outsideNodes(){ |
| | | insideNodes () { |
| | | //return this.nodes.filter(item=>item.hardwareType=='01'||item.hardwareType=='02'); |
| | | return this.mockData.filter(item => item.hardwareType == '01' || item.hardwareType == '02'); |
| | | }, |
| | | outsideNodes () { |
| | | //return this.nodes.filter(item=>item.hardwareType=='03'); |
| | | return this.mockData.filter(item=>item.hardwareType=='03'); |
| | | return this.mockData.filter(item => item.hardwareType == '03'); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss"> |
| | | .cloud{ |
| | | width: 100%; |
| | | height: 500px; |
| | | display: flex; |
| | | .inner{ |
| | | |
| | | background: url('/images/settings/cloud.png') no-repeat; |
| | | background-size: 100%; |
| | | .rect{ |
| | | background:cornflowerblue; |
| | | position: relative; |
| | | .node{ |
| | | position: absolute; |
| | | .node-icon{ |
| | | width:40px; |
| | | height:40px; |
| | | } |
| | | .node-name{ |
| | | font-size:14px; |
| | | color: #333; |
| | | } |
| | | .cloud { |
| | | width: 100%; |
| | | height: 500px; |
| | | display: flex; |
| | | .inner { |
| | | background: url('/images/settings/cloud.png') no-repeat; |
| | | background-size: 100%; |
| | | width: 50%; |
| | | .rect { |
| | | margin: 100px; |
| | | background: cornflowerblue; |
| | | position: relative; |
| | | .node { |
| | | position: absolute; |
| | | .node-icon { |
| | | width: 40px; |
| | | height: 40px; |
| | | } |
| | | .node-name { |
| | | font-size: 14px; |
| | | color: #333; |
| | | } |
| | | } |
| | | } |
| | | .outer{ |
| | | width:50%; |
| | | position: relative; |
| | | } |
| | | .outer { |
| | | width: 50%; |
| | | position: relative; |
| | | .node { |
| | | position: absolute; |
| | | } |
| | | } |
| | | } |
| | | </style> |