Skip to content

Commit

Permalink
ダッシュボードを軽く
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed May 10, 2019
1 parent 67ee272 commit 5a58c99
Showing 1 changed file with 1 addition and 43 deletions.
44 changes: 1 addition & 43 deletions src/client/app/admin/views/dashboard.vue
Expand Up @@ -8,12 +8,6 @@
<p>{{ $t('@.ai-chan-kawaii') }}</p>
</header>

<marquee-text v-if="instances.length > 0" class="instances" :repeat="10" :duration="60">
<span v-for="instance in instances" class="instance">
<b :style="{ background: instance.bg }">{{ instance.host }}</b>{{ instance.notesCount | number }} / {{ instance.usersCount | number }}
</span>
</marquee-text>

<div v-if="stats" class="stats">
<div>
<div>
Expand Down Expand Up @@ -80,10 +74,6 @@
<div class="cpu-memory">
<x-cpu-memory :connection="connection"/>
</div>

<div class="ap">
<x-ap-log/>
</div>
</div>
</template>

Expand All @@ -93,10 +83,7 @@ import i18n from '../../i18n';
import XCpuMemory from "./dashboard.cpu-memory.vue";
import XQueue from "./dashboard.queue-charts.vue";
import XCharts from "./dashboard.charts.vue";
import XApLog from "./dashboard.ap-log.vue";
import { faDatabase } from '@fortawesome/free-solid-svg-icons';
import MarqueeText from 'vue-marquee-text-component';
import randomColor from 'randomcolor';
export default Vue.extend({
i18n: i18n('admin/views/dashboard.vue'),
Expand All @@ -105,16 +92,13 @@ export default Vue.extend({
XCpuMemory,
XQueue,
XCharts,
XApLog,
MarqueeText
},
data() {
return {
stats: null,
connection: null,
meta: null,
instances: [],
clock: null,
faDatabase
};
Expand All @@ -124,23 +108,11 @@ export default Vue.extend({
this.connection = this.$root.stream.useSharedConnection('serverStats');
this.updateStats();
this.clock = setInterval(this.updateStats, 1000);
this.clock = setInterval(this.updateStats, 60 * 1000);
this.$root.getMeta().then(meta => {
this.meta = meta;
});
this.$root.api('federation/instances', {
sort: '+notes'
}).then(instances => {
for (const i of instances) {
i.bg = randomColor({
seed: i.host,
luminosity: 'dark'
});
}
this.instances = instances;
});
},
beforeDestroy() {
Expand Down Expand Up @@ -195,20 +167,6 @@ export default Vue.extend({
margin-left auto
margin-right 0
> .instances
padding 16px
color var(--adminDashboardHeaderFg)
font-size 13px
>>> .instance
margin 0 10px
> b
padding 2px 6px
margin-right 4px
border-radius 4px
color #fff
> .stats
display flex
justify-content space-between
Expand Down

0 comments on commit 5a58c99

Please sign in to comment.