]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add peertube version in features table
authorChocobozzz <me@florianbigard.com>
Fri, 13 Dec 2019 09:19:41 +0000 (10:19 +0100)
committerChocobozzz <me@florianbigard.com>
Fri, 13 Dec 2019 09:19:41 +0000 (10:19 +0100)
client/src/app/+about/about-instance/about-instance.component.html
client/src/app/app.component.html
client/src/app/app.component.ts
client/src/app/core/server/server.service.ts
client/src/app/shared/instance/instance-features-table.component.html
client/src/app/shared/instance/instance-features-table.component.ts

index 8ed248b60b6e3201774e3db22b28821e44f6a540..f5b481158dd993faf787ad666a1fe5cc17233eda 100644 (file)
@@ -2,7 +2,7 @@
   <div class="col-md-12 col-xl-6">
 
     <div class="about-instance-title">
-      <div i18n class="title">About {{ instanceName }} instance</div>
+      <div i18n class="title">About {{ instanceName }}</div>
 
       <div i18n *ngIf="isContactFormEnabled" (click)="openContactModal()" role="button" class="contact-admin">Contact administrator</div>
     </div>
index 81b4351c5e2555bb01ede56150ff216f372f5aa7..057a4e19eef52dfc03d92376cecd976466965fd0 100644 (file)
@@ -29,7 +29,7 @@
       </div>
 
       <footer class="row">
-        <a href="https://joinpeertube.org" title="PeerTube website" target="_blank" rel="noopener noreferrer">PeerTube v{{ serverVersion }}{{ serverCommit }}</a>&nbsp;-&nbsp;
+        <a href="https://joinpeertube.org" title="PeerTube website" target="_blank" rel="noopener noreferrer">PeerTube v{{ getServerVersionAndCommit() }}</a>&nbsp;-&nbsp;
         <a href="https://github.com/Chocobozzz/PeerTube/blob/develop/LICENSE" title="PeerTube license" target="_blank" rel="noopener noreferrer">CopyLeft 2015-2019</a>
       </footer>
     </div>
index f1658ca1bf3ec5f449066d3c40c9126e79b9a952..351620c59da1ab216ac5e8e9b7fa29544b89bf67 100644 (file)
@@ -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
index cf9c411a4fe7ead08f3544256f67d4e0cccc8247..fdcc51cc5b28832a7266ea2de4f922788eebb4b2 100644 (file)
@@ -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)
   }
index d1cb8fcbe55a4ec30b39930231ff800234a79691..f880a886ffe3e13d37bf851217309d908dd71a71 100644 (file)
@@ -1,6 +1,12 @@
 <div class="feature-table">
 
   <table class="table" *ngIf="config">
+    <tr>
+      <td i18n class="label">PeerTube version</td>
+
+      <td class="value">{{ getServerVersionAndCommit() }}</td>
+    </tr>
+
     <tr>
       <td i18n class="label">
         <div>Default NSFW/sensitive videos policy</div>
index 46df4d0b29d1228f8b846a2ab06bbe8f21fb80e4..1661f1efeba0ca7a61e49941e4c21b1cc6844075 100644 (file)
@@ -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