mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
ui: completes welcome ack trigger
This commit is contained in:
committed by
Aiden McClelland
parent
778d22ab2b
commit
939ad844e8
@@ -17,6 +17,7 @@ export interface ApiServer {
|
||||
}
|
||||
ssh: SSHFingerprint[]
|
||||
serverId: string
|
||||
welcomeAck: boolean
|
||||
}
|
||||
|
||||
/** APPS **/
|
||||
|
||||
@@ -29,6 +29,7 @@ export abstract class ApiService {
|
||||
abstract getNotifications (page: number, perPage: number): Promise<S9Notification[]>
|
||||
abstract deleteNotification (id: string): Promise<Unit>
|
||||
abstract updateAgent (thing: any): Promise<Unit>
|
||||
abstract acknowledgeOSWelcome (): Promise<Unit>
|
||||
abstract getAvailableApps (): Promise<AppAvailablePreview[]>
|
||||
abstract getAvailableApp (appId: string): Promise<AppAvailableFull>
|
||||
abstract getAvailableAppVersionSpecificInfo (appId: string, versionSpec: string): Promise<AppAvailableVersionSpecificInfo>
|
||||
|
||||
@@ -37,6 +37,10 @@ export class LiveApiService extends ApiService {
|
||||
return this.authRequest<ReqRes.GetServerRes>({ method: Method.GET, url: '/', readTimeout: timeout })
|
||||
}
|
||||
|
||||
async acknowledgeOSWelcome (): Promise<Unit> {
|
||||
return this.authRequest<Unit>({ method: Method.POST, url: '/welcome' })
|
||||
}
|
||||
|
||||
async getVersionLatest (): Promise<ReqRes.GetVersionLatestRes> {
|
||||
return this.authRequest<ReqRes.GetVersionLatestRes>({ method: Method.GET, url: '/versionLatest' }, { version: '' })
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import { mockApiAppAvailableFull, mockApiAppAvailableVersionInfo, mockApiAppInst
|
||||
//@TODO consider moving to test folders.
|
||||
@Injectable()
|
||||
export class MockApiService extends ApiService {
|
||||
welcomeAck = false
|
||||
constructor (
|
||||
private readonly appModel: AppModel,
|
||||
private readonly serverModel: ServerModel,
|
||||
@@ -32,7 +33,8 @@ export class MockApiService extends ApiService {
|
||||
}
|
||||
|
||||
async getServer (): Promise<ApiServer> {
|
||||
return mockGetServer()
|
||||
const res = await mockGetServer()
|
||||
return { ...res, welcomeAck: this.welcomeAck }
|
||||
}
|
||||
|
||||
async ejectExternalDisk (): Promise<Unit> {
|
||||
@@ -115,6 +117,12 @@ export class MockApiService extends ApiService {
|
||||
return mockUninstallApp()
|
||||
}
|
||||
|
||||
async acknowledgeOSWelcome () {
|
||||
await pauseFor(2000)
|
||||
this.welcomeAck = true
|
||||
return { }
|
||||
}
|
||||
|
||||
async startApp (appId: string): Promise<EmptyResponse> {
|
||||
console.log('start app mock')
|
||||
await mockStartApp()
|
||||
@@ -396,6 +404,7 @@ const mockApiServer: () => ReqRes.GetServerRes = () => ({
|
||||
versionInstalled: '0.2.8',
|
||||
status: ServerStatus.RUNNING,
|
||||
alternativeRegistryUrl: 'beta-registry.start9labs.com',
|
||||
welcomeAck: true,
|
||||
specs: {
|
||||
'Tor Address': 'nfsnjkcnaskjnlkasnfahj7dh23fdnieqwjdnhjewbfijendiueqwbd.onion',
|
||||
'CPU': 'Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz',
|
||||
|
||||
Reference in New Issue
Block a user