给 Node 页面添加了 本节点打包的区块列表模板。

给 各页面都读入了页头的数据,如IP地址,邻居数量。
This commit is contained in:
luk.lu
2018-11-28 16:38:52 +08:00
parent aca23682ca
commit f70e5bd73d
11 changed files with 241 additions and 55 deletions

View File

@@ -1,16 +1,92 @@
<template>
<div class="node-page">
<div class="card-content">
<div class="app-card elevation-1"></div>
<div class="app-card elevation-1">
<div>主机地址 <br> {{ ipAddress }}</div>
</div>
<div class="app-sep"></div>
<div class="app-card elevation-1"></div>
<div class="app-card elevation-1">
<div>在线用户 <br> </div>
</div>
</div>
<div class="table-content elevation-1">
<div class="panel-header">
<h3>{{ $t('node.tableHeader') }}</h3>
<div class="search-input">
<v-text-field
:placeholder="$t('node.searchHolder')"
:value="filter"
@input="inputFilter"
append-icon="search" />
</div>
</div>
<template>
<v-data-table
:headers="headers"
:items="desserts"
:total-items="100"
:rows-per-page-items="pageEntity"
:loading="fetching"
class="panel-content elevation-1"
>
<template slot="headerCell" slot-scope="props">
<span>{{ $t(props.header.text) }}</span>
</template>
<template slot="items" slot-scope="props">
<td>{{ props.item.height }}</td>
<td>{{ props.item.timestamp }}</td>
<td>{{ props.item.type }}</td>
<td>{{ props.item.hash }}</td>
</template>
<template slot="no-results">
{{ $t('node.tableNone') }}
</template>
</v-data-table>
</template>
</div>
</div>
</template>
<script>
import {
createNamespacedHelpers,
} from 'vuex'
const { mapState, mapGetters, mapActions, mapMutations } = createNamespacedHelpers('node')
export default {
name: 'Node',
computed: {
...mapState([
'headers',
'desserts',
'pageEntity',
'fetching',
'filter',
'modal',
'ipAddress',
]),
...mapGetters([]),
},
methods: {
...mapActions([
'updateNodeInfo',
]),
...mapMutations([
'inputFilter',
'updateIpAddress',
]),
},
mounted() {
this.updateNodeInfo()
},
}
</script>
@@ -23,7 +99,7 @@ export default {
.app-card {
flex: 1;
height: 200px;
height: 100px;
background-color: white;
}
@@ -32,5 +108,29 @@ export default {
}
}
.table-content {
flex: 1;
margin: 0 20px 20px;
background-color: white;
display: flex;
flex-direction: column;
.panel-header {
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 20px;
.search-input {
width: 80%;
}
}
.panel-content {
margin: 0 20px 20px;
}
}
}
</style>