Added progress bar to file downloads

Added two new API calls, to update the server to a particular version and to get the updater status

You can now update through the UI, and a status dialog displays after
This commit is contained in:
Isaac Grynsztein
2020-04-02 21:53:08 -04:00
parent 458e4b45f8
commit c36867d368
17 changed files with 345 additions and 40 deletions

View File

@@ -6,6 +6,7 @@ import { MatSnackBar } from '@angular/material/snack-bar';
import {DomSanitizer} from '@angular/platform-browser';
import { MatDialog } from '@angular/material/dialog';
import { ArgModifierDialogComponent } from 'app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component';
import { CURRENT_VERSION } from 'app/consts';
@Component({
selector: 'app-settings',
@@ -24,6 +25,9 @@ export class SettingsComponent implements OnInit {
_settingsSame = true;
latestGithubRelease = null;
CURRENT_VERSION = CURRENT_VERSION
get settingsAreTheSame() {
this._settingsSame = this.settingsSame()
return this._settingsSame;
@@ -40,6 +44,8 @@ export class SettingsComponent implements OnInit {
this.getConfig();
this.generated_bookmarklet_code = this.sanitizer.bypassSecurityTrustUrl(this.generateBookmarkletCode());
this.getLatestGithubRelease();
}
getConfig() {
@@ -129,6 +135,12 @@ export class SettingsComponent implements OnInit {
});
}
getLatestGithubRelease() {
this.postsService.getLatestGithubRelease().subscribe(res => {
this.latestGithubRelease = res;
});
}
// snackbar helper
public openSnackBar(message: string, action: string = '') {
this.snackBar.open(message, action, {