mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-20 03:30:55 +03:00
About dialog now informs user when update is available or when they are up to date based on the github release api
This commit is contained in:
@@ -14,7 +14,11 @@
|
||||
<a [href]="projectLink" target="_blank">
|
||||
<img style="width: 32px; margin-bottom: 10px;" src="assets/images/GitHub-64px.png">
|
||||
</a>
|
||||
<p><ng-container i18n="Version label">Installed version:</ng-container> {{version}} - <a [href]="latestUpdateLink" target="_blank"><ng-container i18n="View latest update">View latest update</ng-container></a></p>
|
||||
<p>
|
||||
<ng-container i18n="Version label">Installed version:</ng-container> {{current_version_tag}} - <span style="display: inline-block" *ngIf="checking_for_updates"><mat-spinner class="version-spinner" [diameter]="22"></mat-spinner> <ng-container i18n="Checking for updates text">Checking for updates...</ng-container></span>
|
||||
<mat-icon *ngIf="!checking_for_updates" class="version-checked-icon">done</mat-icon> <a *ngIf="!checking_for_updates && latestGithubRelease['tag_name'] !== current_version_tag" [href]="latestUpdateLink" target="_blank"><ng-container i18n="View latest update">Update available</ng-container> - {{latestGithubRelease['tag_name']}}</a>
|
||||
<span *ngIf="!checking_for_updates && latestGithubRelease['tag_name'] === current_version_tag">You are up to date.</span>
|
||||
</p>
|
||||
</div>
|
||||
</mat-dialog-content>
|
||||
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
i {
|
||||
margin-right: 1px;
|
||||
}
|
||||
|
||||
.version-spinner {
|
||||
top: 4px;
|
||||
margin-right: 5px;
|
||||
margin-left: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.version-checked-icon {
|
||||
top: 4px;
|
||||
margin-left: 2px;
|
||||
position: relative;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { PostsService } from 'app/posts.services';
|
||||
|
||||
@Component({
|
||||
selector: 'app-about-dialog',
|
||||
@@ -10,12 +11,23 @@ export class AboutDialogComponent implements OnInit {
|
||||
projectLink = 'https://github.com/Tzahi12345/YoutubeDL-Material';
|
||||
issuesLink = 'https://github.com/Tzahi12345/YoutubeDL-Material/issues';
|
||||
latestUpdateLink = 'https://github.com/Tzahi12345/YoutubeDL-Material/releases/latest'
|
||||
latestGithubRelease = null;
|
||||
checking_for_updates = true;
|
||||
|
||||
version = 'v3.5';
|
||||
current_version_tag = 'v3.5';
|
||||
|
||||
constructor() { }
|
||||
constructor(private postsService: PostsService) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.getLatestGithubRelease()
|
||||
}
|
||||
|
||||
getLatestGithubRelease() {
|
||||
this.postsService.getLatestGithubRelease().subscribe(res => {
|
||||
this.checking_for_updates = false;
|
||||
this.latestGithubRelease = res;
|
||||
console.log(this.latestGithubRelease)
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user