diff --git a/ui/src/app/pages/server-routes/security-routes/ssh-keys/ssh-keys.page.ts b/ui/src/app/pages/server-routes/security-routes/ssh-keys/ssh-keys.page.ts index 9f1a6508e..54e9f77d1 100644 --- a/ui/src/app/pages/server-routes/security-routes/ssh-keys/ssh-keys.page.ts +++ b/ui/src/app/pages/server-routes/security-routes/ssh-keys/ssh-keys.page.ts @@ -62,7 +62,7 @@ export class SSHKeysPage { await loader.present() try { - const key = await this.embassyApi.addSshKey({ pubkey }) + const key = await this.embassyApi.addSshKey({ key: pubkey }) this.sshKeys = { ...this.sshKeys, ...key } } catch (e) { this.errToast.present(e) diff --git a/ui/src/app/services/api/api.types.ts b/ui/src/app/services/api/api.types.ts index 28ef5722f..ecc2541c8 100644 --- a/ui/src/app/services/api/api.types.ts +++ b/ui/src/app/services/api/api.types.ts @@ -24,7 +24,7 @@ export module RR { // server - export type SetShareStatsReq = WithExpire<{ value: boolean }> // server.config.share-stats + export type SetShareStatsReq = WithExpire<{ value: boolean }> // server.config.share_stats export type SetShareStatsRes = WithRevision export type GetServerLogsReq = { cursor?: string, before_flag?: boolean, limit?: number } @@ -110,7 +110,7 @@ export module RR { export type GetSSHKeysReq = { } // ssh.list export type GetSSHKeysRes = SSHKeys - export type AddSSHKeyReq = { pubkey: string } // ssh.add + export type AddSSHKeyReq = { key: string } // ssh.add export type AddSSHKeyRes = SSHKeys export type DeleteSSHKeyReq = { hash: string } // ssh.delete diff --git a/ui/src/app/services/api/embassy-live-api.service.ts b/ui/src/app/services/api/embassy-live-api.service.ts index f618e5d36..70d6af513 100644 --- a/ui/src/app/services/api/embassy-live-api.service.ts +++ b/ui/src/app/services/api/embassy-live-api.service.ts @@ -54,7 +54,7 @@ export class LiveApiService extends ApiService { // server async setShareStatsRaw (params: RR.SetShareStatsReq): Promise { - return this.http.rpcRequest( { method: 'server.config.share-stats', params }) + return this.http.rpcRequest( { method: 'server.config.share_stats', params }) } async getServerLogs (params: RR.GetServerLogsReq): Promise { diff --git a/ui/src/app/services/config.service.ts b/ui/src/app/services/config.service.ts index 8c3f5727b..94b64c6b0 100644 --- a/ui/src/app/services/config.service.ts +++ b/ui/src/app/services/config.service.ts @@ -35,7 +35,7 @@ export class ConfigService { mocks = mocks skipStartupAlerts = mocks.enabled && mocks.skipStartupAlerts - isConsulate = window['platform'] === 'ios' + supportsWebSockets = 'WebSocket' in window || 'MozWebSocket' in window isTor (): boolean { return (mocks.enabled && mocks.maskAs === 'tor') || this.origin.endsWith('.onion') @@ -46,11 +46,11 @@ export class ConfigService { } usePoll (): boolean { - return this.isConsulate || (mocks.enabled && mocks.connection === 'poll') + return this.supportsWebSockets || (mocks.enabled && mocks.connection === 'poll') } isLaunchable (state: PackageState, status: PackageMainStatus, interfaces: { [id: string]: InterfaceDef }): boolean { - if (this.isConsulate || state !== PackageState.Installed) { + if (this.supportsWebSockets || state !== PackageState.Installed) { return false } diff --git a/ui/src/app/services/patch-db/patch-db.factory.ts b/ui/src/app/services/patch-db/patch-db.factory.ts index 7a4f40574..7088dfe82 100644 --- a/ui/src/app/services/patch-db/patch-db.factory.ts +++ b/ui/src/app/services/patch-db/patch-db.factory.ts @@ -11,7 +11,7 @@ export function PatchDbServiceFactory ( embassyApi: ApiService, ): PatchDbService { - const { mocks, patchDb: { poll }, isConsulate } = config + const { mocks, patchDb: { poll }, supportsWebSockets } = config let source: Source @@ -22,7 +22,7 @@ export function PatchDbServiceFactory ( source = new WebsocketSource(`ws://localhost:${config.mocks.wsPort}/db`) } } else { - if (isConsulate) { + if (supportsWebSockets) { source = new PollSource({ ...poll }, embassyApi) } else { const protocol = window.location.protocol === 'http:' ? 'ws' : 'wss'