auto check for update on init

This commit is contained in:
Matt Hill
2021-01-15 16:35:39 -07:00
committed by Aiden McClelland
parent 792a5cc429
commit 0c7eae7333
6 changed files with 109 additions and 23 deletions

View File

@@ -18,6 +18,7 @@ export interface ApiServer {
ssh: SSHFingerprint[]
serverId: string
welcomeAck: boolean
autoCheckUpdates: boolean
}
/** APPS **/

View File

@@ -28,7 +28,7 @@ export abstract class ApiService {
abstract getServerMetrics (): Promise<ReqRes.GetServerMetricsRes>
abstract getNotifications (page: number, perPage: number): Promise<S9Notification[]>
abstract deleteNotification (id: string): Promise<Unit>
abstract updateAgent (thing: any): Promise<Unit>
abstract updateAgent (version: any): Promise<Unit>
abstract acknowledgeOSWelcome (version: string): Promise<Unit>
abstract getAvailableApps (): Promise<AppAvailablePreview[]>
abstract getAvailableApp (appId: string): Promise<AppAvailableFull>

View File

@@ -12,6 +12,7 @@ import { mockApiAppAvailableFull, mockApiAppAvailableVersionInfo, mockApiAppInst
@Injectable()
export class MockApiService extends ApiService {
welcomeAck = false
constructor (
private readonly appModel: AppModel,
private readonly serverModel: ServerModel,
@@ -34,7 +35,10 @@ export class MockApiService extends ApiService {
async getServer (): Promise<ApiServer> {
const res = await mockGetServer()
return { ...res, welcomeAck: this.welcomeAck }
return {
...res,
welcomeAck: this.welcomeAck,
}
}
async ejectExternalDisk (): Promise<Unit> {
@@ -402,9 +406,11 @@ const mockApiServer: () => ReqRes.GetServerRes = () => ({
serverId: 'start9-mockxyzab',
name: 'Embassy:12345678',
versionInstalled: '0.2.8',
versionLatest: '0.2.9',
status: ServerStatus.RUNNING,
alternativeRegistryUrl: 'beta-registry.start9labs.com',
welcomeAck: true,
autoCheckUpdates: true,
specs: {
'Tor Address': 'nfsnjkcnaskjnlkasnfahj7dh23fdnieqwjdnhjewbfijendiueqwbd.onion',
'CPU': 'Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz',