mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-21 02:01:19 +00:00
Option to check for updates added
This commit is contained in:
parent
15b9748120
commit
57294f49a7
@ -282,6 +282,7 @@ import { ChangeHostnameDialogComponent } from './components/project-map/change-h
|
||||
import { ApplianceInfoDialogComponent } from './components/project-map/new-template-dialog/appliance-info-dialog/appliance-info-dialog.component';
|
||||
import { InformationDialogComponent } from './components/dialogs/information-dialog.component';
|
||||
import { TemplateNameDialogComponent } from './components/project-map/new-template-dialog/template-name-dialog/template-name-dialog.component';
|
||||
import { UpdatesService } from './services/updates.service';
|
||||
|
||||
|
||||
@NgModule({
|
||||
@ -565,7 +566,8 @@ import { TemplateNameDialogComponent } from './components/project-map/new-templa
|
||||
ServerResolve,
|
||||
ConsoleGuard,
|
||||
Title,
|
||||
ApplianceService
|
||||
ApplianceService,
|
||||
UpdatesService
|
||||
],
|
||||
entryComponents: [
|
||||
AddServerDialogComponent,
|
||||
|
@ -54,6 +54,18 @@
|
||||
</div>
|
||||
|
||||
</mat-expansion-panel>
|
||||
|
||||
<mat-expansion-panel [expanded]="false">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title> Updates </mat-panel-title>
|
||||
<mat-panel-description> Check for updates </mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
|
||||
<div class="theme-panel">
|
||||
<button mat-raised-button (click)="checkForUpdates()" class="fullWidth">Check for updates</button>
|
||||
</div>
|
||||
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
</div>
|
||||
|
||||
|
@ -3,3 +3,7 @@
|
||||
display: flex;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.fullWidth {
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import { ToasterService } from '../../services/toaster.service';
|
||||
import { ConsoleService } from '../../services/settings/console.service';
|
||||
import { ThemeService } from '../../services/theme.service';
|
||||
import { MapSettingsService } from '../../services/mapsettings.service';
|
||||
import { UpdatesService } from '../../services/updates.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
@ -20,7 +21,8 @@ export class SettingsComponent implements OnInit {
|
||||
private toaster: ToasterService,
|
||||
private consoleService: ConsoleService,
|
||||
private themeService: ThemeService,
|
||||
public mapSettingsService: MapSettingsService
|
||||
public mapSettingsService: MapSettingsService,
|
||||
public updatesService: UpdatesService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@ -38,4 +40,8 @@ export class SettingsComponent implements OnInit {
|
||||
setDarkMode(value: boolean) {
|
||||
this.themeService.setDarkMode(value);
|
||||
}
|
||||
|
||||
checkForUpdates() {
|
||||
window.open("https://gns3.com/software");
|
||||
}
|
||||
}
|
||||
|
11
src/app/services/updates.service.ts
Normal file
11
src/app/services/updates.service.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
|
||||
@Injectable()
|
||||
export class UpdatesService {
|
||||
constructor(private httpClient: HttpClient) {}
|
||||
|
||||
getLatestVersion() {
|
||||
return this.httpClient.get('http://update.gns3.net/');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user