diff --git a/src/app/models/server.ts b/src/app/models/server.ts index cf8649f3..271991a5 100644 --- a/src/app/models/server.ts +++ b/src/app/models/server.ts @@ -1,5 +1,5 @@ export type ServerAuthorization = 'basic' | 'none'; -export type ServerLocation = 'local' | 'remote'; +export type ServerLocation = 'local' | 'remote' | 'bundled'; export type ServerStatus = 'stopped' | 'starting' | 'running'; export class Server { @@ -13,6 +13,5 @@ export class Server { authorization: ServerAuthorization; login: string; password: string; - is_local: boolean; status: ServerStatus; } diff --git a/src/app/services/server.service.spec.ts b/src/app/services/server.service.spec.ts index d463bae6..a1f0c437 100644 --- a/src/app/services/server.service.spec.ts +++ b/src/app/services/server.service.spec.ts @@ -151,8 +151,7 @@ describe('ServerService', () => { expectedServer.name = 'local'; expectedServer.host = 'hostname'; expectedServer.port = 9999; - expectedServer.location = 'remote'; - expectedServer.is_local = true; + expectedServer.location = 'bundled'; service.getLocalServer('hostname', 9999).then(() => { expect(service.create).toHaveBeenCalledWith(expectedServer); @@ -165,7 +164,7 @@ describe('ServerService', () => { server.name = 'local'; server.host = 'hostname'; server.port = 9999; - server.is_local = true; + server.location = 'bundled'; spyOn(db, 'getAll').and.returnValue(Promise.resolve([server])); spyOn(service, 'update').and.returnValue(Promise.resolve(new Server())); diff --git a/src/app/services/server.service.ts b/src/app/services/server.service.ts index 0689a419..8f9ff324 100644 --- a/src/app/services/server.service.ts +++ b/src/app/services/server.service.ts @@ -58,7 +58,7 @@ export class ServerService { public getLocalServer(host: string, port: number) { const promise = new Promise((resolve, reject) => { this.findAll().then((servers: Server[]) => { - const local = servers.find(server => server.is_local); + const local = servers.find(server => server.location === 'bundled'); if (local) { local.host = host; local.port = port; @@ -70,8 +70,7 @@ export class ServerService { server.name = 'local'; server.host = host; server.port = port; - server.location = 'remote'; - server.is_local = true; + server.location = 'bundled'; this.create(server).then(created => { resolve(created); }, reject);