switch to new API.

This commit is contained in:
Miroslav Šedivý 2021-01-08 20:51:38 +01:00
parent 06a534004c
commit aab2f389eb
2 changed files with 10 additions and 12 deletions

View File

@ -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,
},
},
})
}

View File

@ -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)"
/>
</div>
</div>
@ -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<Blob> }) {
this.api.room.uploadDrop(x, y, files)
}
/////////////////////////////
// Component lifecycle
/////////////////////////////