#93960 Show sycned machines

This commit is contained in:
Sandeep Somavarapu
2020-05-20 12:00:55 +02:00
parent 025dc8a948
commit 175fddc4ee
10 changed files with 364 additions and 43 deletions

View File

@@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService';
import { Disposable } from 'vs/base/common/lifecycle';
import { IChannel } from 'vs/base/parts/ipc/common/ipc';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { IUserDataSyncMachinesService, IUserDataSyncMachine } from 'vs/platform/userDataSync/common/userDataSyncMachines';
class UserDataSyncMachinesService extends Disposable implements IUserDataSyncMachinesService {
_serviceBrand: undefined;
private readonly channel: IChannel;
constructor(
@ISharedProcessService sharedProcessService: ISharedProcessService
) {
super();
this.channel = sharedProcessService.getChannel('userDataSyncMachines');
}
getMachines(): Promise<IUserDataSyncMachine[]> {
return this.channel.call<IUserDataSyncMachine[]>('getMachines');
}
updateName(name: string): Promise<void> {
return this.channel.call('updateName', [name]);
}
unset(): Promise<void> {
return this.channel.call('unset');
}
disable(id: string): Promise<void> {
return this.channel.call('disable', [id]);
}
}
registerSingleton(IUserDataSyncMachinesService, UserDataSyncMachinesService);