mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-03 23:14:13 +00:00 
			
		
		
		
	[Client] Improve admin dashboard
This commit is contained in:
		
							parent
							
								
									672b7a4c3d
								
							
						
					
					
						commit
						a3c4e8a1bc
					
				
					 1 changed files with 13 additions and 9 deletions
				
			
		| 
						 | 
					@ -20,7 +20,7 @@
 | 
				
			||||||
				<div><fa icon="user"/></div>
 | 
									<div><fa icon="user"/></div>
 | 
				
			||||||
				<div>
 | 
									<div>
 | 
				
			||||||
					<span>{{ $t('accounts') }}</span>
 | 
										<span>{{ $t('accounts') }}</span>
 | 
				
			||||||
					<b class="primary">{{ stats.originalUsersCount | number }}</b>
 | 
										<b>{{ stats.originalUsersCount | number }}</b>
 | 
				
			||||||
				</div>
 | 
									</div>
 | 
				
			||||||
			</div>
 | 
								</div>
 | 
				
			||||||
			<div>
 | 
								<div>
 | 
				
			||||||
| 
						 | 
					@ -33,7 +33,7 @@
 | 
				
			||||||
				<div><fa icon="pencil-alt"/></div>
 | 
									<div><fa icon="pencil-alt"/></div>
 | 
				
			||||||
				<div>
 | 
									<div>
 | 
				
			||||||
					<span>{{ $t('notes') }}</span>
 | 
										<span>{{ $t('notes') }}</span>
 | 
				
			||||||
					<b class="primary">{{ stats.originalNotesCount | number }}</b>
 | 
										<b>{{ stats.originalNotesCount | number }}</b>
 | 
				
			||||||
				</div>
 | 
									</div>
 | 
				
			||||||
			</div>
 | 
								</div>
 | 
				
			||||||
			<div>
 | 
								<div>
 | 
				
			||||||
| 
						 | 
					@ -109,6 +109,7 @@ export default Vue.extend({
 | 
				
			||||||
			connection: null,
 | 
								connection: null,
 | 
				
			||||||
			meta: null,
 | 
								meta: null,
 | 
				
			||||||
			instances: [],
 | 
								instances: [],
 | 
				
			||||||
 | 
								clock: null,
 | 
				
			||||||
			faDatabase
 | 
								faDatabase
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
| 
						 | 
					@ -116,14 +117,13 @@ export default Vue.extend({
 | 
				
			||||||
	created() {
 | 
						created() {
 | 
				
			||||||
		this.connection = this.$root.stream.useSharedConnection('serverStats');
 | 
							this.connection = this.$root.stream.useSharedConnection('serverStats');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							this.updateStats();
 | 
				
			||||||
 | 
							this.clock = setInterval(this.updateStats, 1000);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		this.$root.getMeta().then(meta => {
 | 
							this.$root.getMeta().then(meta => {
 | 
				
			||||||
			this.meta = meta;
 | 
								this.meta = meta;
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		this.$root.api('stats').then(stats => {
 | 
					 | 
				
			||||||
			this.stats = stats;
 | 
					 | 
				
			||||||
		});
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		this.$root.api('instances', {
 | 
							this.$root.api('instances', {
 | 
				
			||||||
			sort: '+notes'
 | 
								sort: '+notes'
 | 
				
			||||||
		}).then(instances => {
 | 
							}).then(instances => {
 | 
				
			||||||
| 
						 | 
					@ -139,11 +139,18 @@ export default Vue.extend({
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	beforeDestroy() {
 | 
						beforeDestroy() {
 | 
				
			||||||
		this.connection.dispose();
 | 
							this.connection.dispose();
 | 
				
			||||||
 | 
							clearInterval(this.clock);
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	methods: {
 | 
						methods: {
 | 
				
			||||||
		setChartSrc(src) {
 | 
							setChartSrc(src) {
 | 
				
			||||||
			this.$refs.charts.setSrc(src);
 | 
								this.$refs.charts.setSrc(src);
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							updateStats() {
 | 
				
			||||||
 | 
								this.$root.api('stats').then(stats => {
 | 
				
			||||||
 | 
									this.stats = stats;
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
| 
						 | 
					@ -236,9 +243,6 @@ export default Vue.extend({
 | 
				
			||||||
					> b
 | 
										> b
 | 
				
			||||||
						display block
 | 
											display block
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						&.primary
 | 
					 | 
				
			||||||
							color var(--primary)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			> div:last-child
 | 
								> div:last-child
 | 
				
			||||||
				display flex
 | 
									display flex
 | 
				
			||||||
				padding 6px 16px
 | 
									padding 6px 16px
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue