-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- v4.2.24
- 4.6.5
- 4.6.4
- 4.6.3
- 4.6.2
- 4.6.1
- 4.6.0
- 4.5.12
- 4.5.11
- 4.5.10
- 4.5.9
- 4.5.8
- 4.5.7
- 4.5.6
- 4.5.5
- 4.5.4
- 4.5.3
- 4.5.2
- 4.5.1
- 4.5.0
- 4.4.9
- 4.4.8
- 4.4.7
- 4.4.6
- 4.4.5
- 4.4.4
- 4.4.3
- 4.4.2
- 4.4.1
- 4.4.0
- 4.3.9
- 4.3.8
- 4.3.6
- 4.3.5
- 4.3.4
- 4.3.3
- 4.3.2
- 4.3.1
- 4.3.0
- 4.2.26
- 4.2.25
- 4.2.23
- 4.2.22
- 4.2.21
- 4.2.20
- 4.2.19
- 4.2.18
- 4.2.17
1 parent
69466d7
commit 8a00301
Showing
10 changed files
with
606 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<template> | ||
<div class="fill-height pa-8"> | ||
<v-breadcrumbs :items="breadcrumbs" divider="/" class="pl-0" /> | ||
<v-row class="fill-height" no-gutters> | ||
<v-col cols="3"> | ||
<SideBar :loading="loading" :states="states" :network="currentNetwork" /> | ||
</v-col> | ||
<v-col cols="9"> | ||
<router-view :network="currentNetwork" :state="currentState"></router-view> | ||
</v-col> | ||
</v-row> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapActions } from "vuex"; | ||
import SideBar from "./SideBar.vue"; | ||
import capitalize from 'lodash.capitalize'; | ||
export default { | ||
name: "Network", | ||
components: { | ||
SideBar, | ||
}, | ||
data: () => ({ | ||
loading: true, | ||
states: [], | ||
currentNetwork: null, | ||
}), | ||
computed: { | ||
currentState() { | ||
return this.currentNetwork ? this.states.find((item) => item.network === this.currentNetwork) : {}; | ||
}, | ||
breadcrumbs() { | ||
return [{ | ||
text: 'Home', | ||
to: '/', | ||
}, { | ||
text: capitalize(this.currentNetwork), | ||
to: `/${this.currentNetwork}${this.$route.hash !== '#' ? '#' : '##'}` | ||
}] | ||
} | ||
}, | ||
created() { | ||
this.getStats(); | ||
}, | ||
methods: { | ||
...mapActions(["showError"]), | ||
navigate() { | ||
if (this.$route.params.network) | ||
this.currentNetwork = this.$route.params.network; | ||
else if (this.states.length > 0) | ||
this.currentNetwork = this.states[0].network; | ||
}, | ||
getStats() { | ||
this.loading = true; | ||
this.api | ||
.getStats() | ||
.then((res) => { | ||
if (!res) return; | ||
this.states = res.sort(function (a, b) { | ||
if (a.network === "mainnet") { | ||
return -1; | ||
} else if (b.network === "mainnet") { | ||
return 1; | ||
} else { | ||
return b.network.localeCompare(a.network); | ||
} | ||
}); | ||
this.navigate(); | ||
}) | ||
.catch((err) => { | ||
console.log(err); | ||
this.showError(err); | ||
}) | ||
.finally(() => (this.loading = false)); | ||
}, | ||
}, | ||
watch: { | ||
$route: "navigate", | ||
}, | ||
}; | ||
</script> | ||
|
||
<style> | ||
.main-navigation > .v-navigation-drawer__content { | ||
overflow: hidden; | ||
} | ||
</style> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<template> | ||
<div class="fill-height canvas top-margin-from-main-header"> | ||
<v-list-item style="height: 74px;"> | ||
<v-list-item-content two-line> | ||
<v-list-item-title class="headline">Statistics</v-list-item-title> | ||
<v-list-item-subtitle> | ||
<span class="overline">{{ network }}</span> | ||
</v-list-item-subtitle> | ||
</v-list-item-content> | ||
</v-list-item> | ||
<v-divider></v-divider> | ||
|
||
<v-skeleton-loader | ||
:loading="loading" | ||
type="list-item-two-line, list-item-two-line, list-item-two-line, list-item-two-line" | ||
> | ||
<v-expansion-panels flat tile mandatory multiple active-class="opened-panel"> | ||
<v-expansion-panel class="ma-0 bb-1"> | ||
<v-expansion-panel-header color="sidebar" class="pl-4 py-0"> | ||
<span class="caption font-weight-bold text-uppercase text--secondary">Networks</span> | ||
</v-expansion-panel-header> | ||
<v-expansion-panel-content color="data"> | ||
<v-list class="stats-sidebar-list"> | ||
<v-list-item-group v-model="item" mandatory> | ||
<template v-for="(state, idx) in states"> | ||
<v-divider :key="'divider' + idx" v-if="idx > 0"></v-divider> | ||
<v-list-item :key="idx" @click="navigate(state)"> | ||
<v-list-item-content> | ||
<v-list-item-title class="overline text--primary">{{ state.network }}</v-list-item-title> | ||
<v-list-item-subtitle class="body-2">{{ state.protocol.slice(0, 8) }}</v-list-item-subtitle> | ||
</v-list-item-content> | ||
<v-list-item-action> | ||
<v-list-item-action-text | ||
class="overline text--primary" | ||
>{{ helpers.formatDatetime(state.timestamp) }}</v-list-item-action-text> | ||
<v-list-item-action-text class="body-2">level {{ state.level }}</v-list-item-action-text> | ||
</v-list-item-action> | ||
</v-list-item> | ||
</template> | ||
</v-list-item-group> | ||
</v-list> | ||
</v-expansion-panel-content> | ||
</v-expansion-panel> | ||
</v-expansion-panels> | ||
</v-skeleton-loader> | ||
|
||
<BakingBadFooter /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import BakingBadFooter from "@/components/BakingBadFooter.vue"; | ||
export default { | ||
name: "StatsSideBar", | ||
props: { | ||
states: Array, | ||
loading: Boolean, | ||
network: String, | ||
}, | ||
components: { | ||
BakingBadFooter, | ||
}, | ||
created() { | ||
this.setItem(); | ||
}, | ||
watch: { | ||
states() { | ||
this.setItem(); | ||
} | ||
}, | ||
data: () => ({ | ||
item: 0, | ||
}), | ||
methods: { | ||
navigate(state) { | ||
this.$router.push({ | ||
name: this.$router.name, | ||
params: { network: state.network }, | ||
}); | ||
}, | ||
setItem() { | ||
this.states.forEach((x, idx) => { | ||
if (x.network === this.$route.params.network) this.item = idx; | ||
}); | ||
} | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss"> | ||
.opened-panel { | ||
border-bottom: none !important; | ||
} | ||
.opened-panel > .v-expansion-panel-content > .v-expansion-panel-content__wrap { | ||
padding: 0; | ||
} | ||
.opened-panel > .v-expansion-panel-header { | ||
min-height: 48px; | ||
} | ||
.stats-sidebar-list { | ||
max-height: calc(100vh - 75px - 1 * 48px); | ||
overflow-y: auto; | ||
border-radius: 0; | ||
padding: 0; | ||
z-index: 1; | ||
} | ||
</style> |
Oops, something went wrong.