From aab2f389eb3f35bfe6670d047658e586a20963ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Fri, 8 Jan 2021 20:51:38 +0100 Subject: [PATCH] switch to new API. --- src/component/internal/api.ts | 7 +++++-- src/component/main.vue | 15 +++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/component/internal/api.ts b/src/component/internal/api.ts index 2d5f0991..434ab6a2 100644 --- a/src/component/internal/api.ts +++ b/src/component/internal/api.ts @@ -6,8 +6,11 @@ export class NekoApi { public connect(url: string, id: string, secret: string) { this.api_configuration = new Api.Configuration({ basePath: url, - headers: { - Authorization: 'Basic ' + btoa(id + ':' + secret), + baseOptions: { + auth: { + username: id, + password: secret, + }, }, }) } diff --git a/src/component/main.vue b/src/component/main.vue index 88132bdd..8654db16 100644 --- a/src/component/main.vue +++ b/src/component/main.vue @@ -12,7 +12,7 @@ :implicitControl="state.control.implicit_hosting && state.members[state.member_id].profile.can_host" @implicit-control-request="websocket.send('control/request')" @implicit-control-release="websocket.send('control/release')" - @drop-files="api.room.uploadDrop($event)" + @drop-files="uploadDrop($event)" /> @@ -227,15 +227,6 @@ this.websocket.send('screen/set', { width, height, rate }) } - public async initBrowser() { - const tabs = await this.api.browser.tabsGetAll() - - Vue.set(this.state, 'browser', { - connected: true, - tabs, - }) - } - public get room(): RoomApi { return this.api.room } @@ -244,6 +235,10 @@ return this.api.members } + uploadDrop({ x, y, files }: { x: number; y: number; files: Array }) { + this.api.room.uploadDrop(x, y, files) + } + ///////////////////////////// // Component lifecycle /////////////////////////////