mirror of
https://github.com/OutlineFoundation/outline-server.git
synced 2026-08-27 03:42:01 +00:00
make methods async
This commit is contained in:
parent
a7bec09ffa
commit
3bee7cdd02
1 changed files with 22 additions and 23 deletions
|
|
@ -874,18 +874,18 @@ export class App {
|
|||
};
|
||||
}
|
||||
|
||||
private addAccessKey() {
|
||||
this.selectedServer.addAccessKey()
|
||||
.then(async (serverAccessKey: server.AccessKey) => {
|
||||
const uiAccessKey = this.convertToUiAccessKey(serverAccessKey);
|
||||
(await this.appRoot.getServerView(this.appRoot.selectedServerId))
|
||||
.addAccessKey(uiAccessKey);
|
||||
this.appRoot.showNotification(this.appRoot.localize('notification-key-added'));
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(`Failed to add access key: ${error}`);
|
||||
this.appRoot.showError(this.appRoot.localize('error-key-add'));
|
||||
});
|
||||
private async addAccessKey() {
|
||||
const server = this.selectedServer;
|
||||
try {
|
||||
const serverAccessKey = await server.addAccessKey();
|
||||
const uiAccessKey = this.convertToUiAccessKey(serverAccessKey);
|
||||
const serverView = await this.appRoot.getServerView(server.getId());
|
||||
serverView.addAccessKey(uiAccessKey);
|
||||
this.appRoot.showNotification(this.appRoot.localize('notification-key-added'));
|
||||
} catch (error) {
|
||||
console.error(`Failed to add access key: ${error}`);
|
||||
this.appRoot.showError(this.appRoot.localize('error-key-add'));
|
||||
}
|
||||
}
|
||||
|
||||
private renameAccessKey(accessKeyId: string, newName: string, entry: polymer.Base) {
|
||||
|
|
@ -1061,17 +1061,16 @@ export class App {
|
|||
}
|
||||
}
|
||||
|
||||
private removeAccessKey(accessKeyId: string) {
|
||||
this.selectedServer.removeAccessKey(accessKeyId)
|
||||
.then(async () => {
|
||||
(await this.appRoot.getServerView(this.appRoot.selectedServerId))
|
||||
.removeAccessKey(accessKeyId);
|
||||
this.appRoot.showNotification(this.appRoot.localize('notification-key-removed'));
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(`Failed to remove access key: ${error}`);
|
||||
this.appRoot.showError(this.appRoot.localize('error-key-remove'));
|
||||
});
|
||||
private async removeAccessKey(accessKeyId: string) {
|
||||
const server = this.selectedServer;
|
||||
try {
|
||||
await server.removeAccessKey(accessKeyId);
|
||||
(await this.appRoot.getServerView(server.getId())).removeAccessKey(accessKeyId);
|
||||
this.appRoot.showNotification(this.appRoot.localize('notification-key-removed'));
|
||||
} catch (error) {
|
||||
console.error(`Failed to remove access key: ${error}`);
|
||||
this.appRoot.showError(this.appRoot.localize('error-key-remove'));
|
||||
}
|
||||
}
|
||||
|
||||
private deleteServer(serverId: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue