From dbdf2d51c6fe50d761ad6286e09f6c75356d2142 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 13 Dec 2019 10:19:41 +0100 Subject: Add peertube version in features table --- .../app/+about/about-instance/about-instance.component.html | 2 +- client/src/app/app.component.html | 2 +- client/src/app/app.component.ts | 13 ++++--------- client/src/app/core/server/server.service.ts | 10 ++++++++++ .../shared/instance/instance-features-table.component.html | 6 ++++++ .../shared/instance/instance-features-table.component.ts | 4 ++++ 6 files changed, 26 insertions(+), 11 deletions(-) (limited to 'client/src/app') diff --git a/client/src/app/+about/about-instance/about-instance.component.html b/client/src/app/+about/about-instance/about-instance.component.html index 8ed248b60..f5b481158 100644 --- a/client/src/app/+about/about-instance/about-instance.component.html +++ b/client/src/app/+about/about-instance/about-instance.component.html @@ -2,7 +2,7 @@
-
About {{ instanceName }} instance
+
About {{ instanceName }}
Contact administrator
diff --git a/client/src/app/app.component.html b/client/src/app/app.component.html index 81b4351c5..057a4e19e 100644 --- a/client/src/app/app.component.html +++ b/client/src/app/app.component.html @@ -29,7 +29,7 @@
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index f1658ca1b..351620c59 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -51,15 +51,6 @@ export class AppComponent implements OnInit { private modalService: NgbModal ) { } - get serverVersion () { - return this.serverService.getConfig().serverVersion - } - - get serverCommit () { - const commit = this.serverService.getConfig().serverCommit || '' - return (commit !== '') ? '...' + commit : commit - } - get instanceName () { return this.serverService.getConfig().instance.name } @@ -122,6 +113,10 @@ export class AppComponent implements OnInit { this.isMenuDisplayed = window.innerWidth >= 800 && !this.isMenuChangedByUser } + getServerVersionAndCommit () { + return this.serverService.getServerVersionAndCommit() + } + private initRouteEvents () { let resetScroll = true const eventsObs = this.router.events diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index cf9c411a4..fdcc51cc5 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts @@ -174,6 +174,16 @@ export class ServerService { return cloneDeep(this.config) } + getServerVersionAndCommit () { + const serverVersion = this.config.serverVersion + const commit = this.config.serverCommit || '' + + let result = `v${serverVersion}` + if (commit) result += '...' + commit + + return result + } + getVideoCategories () { return cloneDeep(this.videoCategories) } diff --git a/client/src/app/shared/instance/instance-features-table.component.html b/client/src/app/shared/instance/instance-features-table.component.html index d1cb8fcbe..f880a886f 100644 --- a/client/src/app/shared/instance/instance-features-table.component.html +++ b/client/src/app/shared/instance/instance-features-table.component.html @@ -1,6 +1,12 @@
+ + + + + +
PeerTube version{{ getServerVersionAndCommit() }}
Default NSFW/sensitive videos policy
diff --git a/client/src/app/shared/instance/instance-features-table.component.ts b/client/src/app/shared/instance/instance-features-table.component.ts index 46df4d0b2..1661f1efe 100644 --- a/client/src/app/shared/instance/instance-features-table.component.ts +++ b/client/src/app/shared/instance/instance-features-table.component.ts @@ -53,6 +53,10 @@ export class InstanceFeaturesTableComponent implements OnInit { return this.i18n('~ {{minutes}} {minutes, plural, =1 {minute} other {minutes}}', { minutes }) } + getServerVersionAndCommit () { + return this.serverService.getServerVersionAndCommit() + } + private buildQuotaHelpIndication () { if (this.initialUserVideoQuota === -1) return -- cgit v1.2.3