mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
switch to new API.
This commit is contained in:
parent
06a534004c
commit
aab2f389eb
@ -6,8 +6,11 @@ export class NekoApi {
|
|||||||
public connect(url: string, id: string, secret: string) {
|
public connect(url: string, id: string, secret: string) {
|
||||||
this.api_configuration = new Api.Configuration({
|
this.api_configuration = new Api.Configuration({
|
||||||
basePath: url,
|
basePath: url,
|
||||||
headers: {
|
baseOptions: {
|
||||||
Authorization: 'Basic ' + btoa(id + ':' + secret),
|
auth: {
|
||||||
|
username: id,
|
||||||
|
password: secret,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
:implicitControl="state.control.implicit_hosting && state.members[state.member_id].profile.can_host"
|
:implicitControl="state.control.implicit_hosting && state.members[state.member_id].profile.can_host"
|
||||||
@implicit-control-request="websocket.send('control/request')"
|
@implicit-control-request="websocket.send('control/request')"
|
||||||
@implicit-control-release="websocket.send('control/release')"
|
@implicit-control-release="websocket.send('control/release')"
|
||||||
@drop-files="api.room.uploadDrop($event)"
|
@drop-files="uploadDrop($event)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -227,15 +227,6 @@
|
|||||||
this.websocket.send('screen/set', { width, height, rate })
|
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 {
|
public get room(): RoomApi {
|
||||||
return this.api.room
|
return this.api.room
|
||||||
}
|
}
|
||||||
@ -244,6 +235,10 @@
|
|||||||
return this.api.members
|
return this.api.members
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uploadDrop({ x, y, files }: { x: number; y: number; files: Array<Blob> }) {
|
||||||
|
this.api.room.uploadDrop(x, y, files)
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
// Component lifecycle
|
// Component lifecycle
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user