improve config and mock infra

This commit is contained in:
Matt Hill
2021-06-15 10:16:51 -06:00
committed by Aiden McClelland
parent 53a16775fe
commit decc17fce5
8 changed files with 73 additions and 37 deletions

View File

@@ -36,15 +36,40 @@ export class MockApiService extends ApiService {
// db
async getRevisions (since: number): Promise<RR.GetRevisionsRes> {
return this.http.rpcRequest({ method: 'db.revisions', params: { since } })
await pauseFor(2000)
return {
...Mock.DbDump,
id: this.nextSequence(),
}
// return this.http.rpcRequest({ method: 'db.revisions', params: { since } })
}
async getDump (): Promise<RR.GetDumpRes> {
return this.http.rpcRequest({ method: 'db.dump' })
await pauseFor(2000)
return {
...Mock.DbDump,
id: this.nextSequence(),
}
// return this.http.rpcRequest({ method: 'db.dump' })
}
async setDbValueRaw (params: RR.SetDBValueReq): Promise<RR.SetDBValueRes> {
return this.http.rpcRequest({ method: 'db.put.ui', params })
await pauseFor(2000)
return {
response: null,
revision: {
id: this.nextSequence(),
patch: [
{
op: PatchOp.REPLACE,
path: params.pointer,
value: params.value,
},
],
expireId: null,
},
}
// return this.http.rpcRequest({ method: 'db.put.ui', params })
}
// auth

View File

@@ -58,8 +58,7 @@ const serverConfig: ConfigSpec = {
name: 'Device Name',
description: 'A unique label for this device.',
nullable: false,
// @TODO determine regex
// pattern: '',
pattern: '^.{1,40}$',
patternDescription: 'Must be less than 40 characters',
masked: false,
copyable: false,
@@ -67,7 +66,7 @@ const serverConfig: ConfigSpec = {
autoCheckUpdates: {
type: 'boolean',
name: 'Auto Check for Updates',
description: 'On launch, EmabssyOS will automatically check for updates of itself and your installed services. Updating still requires user approval and action. No updates will ever be performed automatically.',
description: 'On launch, EmbassyOS will automatically check for updates of itself and your installed services. Updating still requires user approval and action. No updates will ever be performed automatically.',
default: true,
},
ssh: {