Add peertube version in features table

This commit is contained in:
Chocobozzz 2019-12-13 10:19:41 +01:00
parent ee83ad12ca
commit dbdf2d51c6
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
6 changed files with 26 additions and 11 deletions

View 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>

View 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>

View 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

View 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)
}

View 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>

View 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