--- /dev/null
+<p i18n *ngIf="null === serverStats">Loading instance statistics...</p>
+
+<section *ngIf="null !== serverStats">
+ <h5 i18n>Local</h5>
+
+ <div class="row">
+ <div class="col-6 col-lg-4 col-xl-3">
+ <div class="card stat">
+ <div class="card-body">
+ <p class="stat-value">{{ serverStats.totalUsers }}</p>
+ <p class="stat-label" i18n>users</p>
+ </div>
+ <i class="glyphicon glyphicon-user icon-bottom"></i>
+ </div>
+ </div>
+
+ <div class="col-6 col-lg-4 col-xl-3">
+ <div class="card stat">
+ <div class="card-body">
+ <p class="stat-value">{{ serverStats.totalLocalVideos }}</p>
+ <p class="stat-label" i18n>videos</p>
+ </div>
+ <i class="glyphicon glyphicon-facetime-video"></i>
+ </div>
+ </div>
+
+ <div class="col-6 col-lg-4 col-xl-3">
+ <div class="card stat">
+ <div class="card-body">
+ <p class="stat-value">{{ serverStats.totalLocalVideoViews }}</p>
+ <p class="stat-label" i18n>videos views</p>
+ </div>
+ <i class="glyphicon glyphicon-eye-open"></i>
+ </div>
+ </div>
+
+ <div class="col-6 col-lg-4 col-xl-3">
+ <div class="card stat">
+ <div class="card-body">
+ <p class="stat-value">{{ serverStats.totalLocalVideoComments }}</p>
+ <p class="stat-label" i18n>videos comments</p>
+ </div>
+ <i class="glyphicon glyphicon-comment"></i>
+ </div>
+ </div>
+
+ <div class="col-6 col-lg-4 col-xl-3">
+ <div class="card stat">
+ <div class="card-body">
+ <p class="stat-value">{{ serverStats.totalLocalVideoFilesSize | bytes:1 }}</p>
+ <p class="stat-label" i18n>of hosted video</p>
+ </div>
+ <i class="glyphicon glyphicon-hdd"></i>
+ </div>
+ </div>
+ </div>
+
+ <h5 i18n>Federation</h5>
+
+ <div class="row">
+ <div class="col-6 col-lg-4 col-xl-3">
+ <div class="card stat">
+ <div class="card-body">
+ <p class="stat-value">{{ serverStats.totalVideos }}</p>
+ <p class="stat-label" i18n>videos</p>
+ </div>
+ <i class="glyphicon glyphicon-facetime-video"></i>
+ </div>
+ </div>
+
+ <div class="col-6 col-lg-4 col-xl-3">
+ <div class="card stat">
+ <div class="card-body">
+ <p class="stat-value">{{ serverStats.totalVideoComments }}</p>
+ <p class="stat-label" i18n>videos comments</p>
+ </div>
+ <i class="glyphicon glyphicon-comment"></i>
+ </div>
+ </div>
+
+ <div class="col-6 col-lg-4 col-xl-3">
+ <div class="card stat">
+ <div class="card-body">
+ <p class="stat-value">{{ serverStats.totalInstanceFollowers }}</p>
+ <p class="stat-label" i18n>followers</p>
+ </div>
+ <i class="glyphicon glyphicon-retweet"></i>
+ </div>
+ </div>
+
+ <div class="col-6 col-lg-4 col-xl-3">
+ <div class="card stat">
+ <div class="card-body">
+ <p class="stat-value">{{ serverStats.totalInstanceFollowing }}</p>
+ <p class="stat-label" i18n>following</p>
+ </div>
+ <i class="glyphicon glyphicon-retweet"></i>
+ </div>
+ </div>
+ </div>
+</section>
--- /dev/null
+import { map } from 'rxjs/operators'
+import { HttpClient } from '@angular/common/http'
+import { Component, OnInit } from '@angular/core'
+import { I18n } from '@ngx-translate/i18n-polyfill'
+import { ServerStats } from '@shared/models/server'
+import { environment } from '../../../environments/environment'
+
+@Component({
+ selector: 'my-instance-statistics',
+ templateUrl: './instance-statistics.component.html',
+ styleUrls: [ './instance-statistics.component.scss' ]
+})
+export class InstanceStatisticsComponent implements OnInit {
+ private static BASE_STATS_URL = environment.apiUrl + '/api/v1/server/stats'
+
+ serverStats: ServerStats = null
+
+ constructor (
+ private http: HttpClient,
+ private i18n: I18n
+ ) {
+ }
+
+ ngOnInit () {
+ this.getStats()
+ .subscribe(
+ res => {
+ this.serverStats = res
+ }
+ )
+ }
+
+ getStats () {
+ return this.http
+ .get<ServerStats>(InstanceStatisticsComponent.BASE_STATS_URL)
+ }
+}
} from '@ng-bootstrap/ng-bootstrap'
import { RemoteSubscribeComponent, SubscribeButtonComponent, UserSubscriptionService } from '@app/shared/user-subscription'
import { InstanceFeaturesTableComponent } from '@app/shared/instance/instance-features-table.component'
+import { InstanceStatisticsComponent } from '@app/shared/instance/instance-statistics.component'
import { OverviewService } from '@app/shared/overview'
import { UserBanModalComponent } from '@app/shared/moderation'
import { UserModerationDropdownComponent } from '@app/shared/moderation/user-moderation-dropdown.component'
SubscribeButtonComponent,
RemoteSubscribeComponent,
InstanceFeaturesTableComponent,
+ InstanceStatisticsComponent,
FeatureBooleanComponent,
UserBanModalComponent,
UserModerationDropdownComponent,
SubscribeButtonComponent,
RemoteSubscribeComponent,
InstanceFeaturesTableComponent,
+ InstanceStatisticsComponent,
UserBanModalComponent,
UserModerationDropdownComponent,
TopMenuDropdownComponent,