neko mirror
Go to file
Miroslav Šedivý dc2ef37e17
Add mobile keyboard API (#21)
* fix page for mobile - minor changes.

* fix textarea overlay to hide caret and avodi zooming on mobiles.

* fix typo.

* show keyboard btn if is touch device.

* lint fix.

* add to API.

* mobile keybaord fix andorid blur.

* add mobile keybaord toggle.

* fix overlay.

* mobile keybaord, skip if not a touch device.
2023-01-27 19:21:42 +01:00
.github/workflows github action fix registry-url. 2022-07-18 23:17:37 +02:00
.vscode bump openapi generator version. 2021-02-26 22:54:43 +01:00
dev logger: color only if enabled in env. 2022-09-16 10:50:57 +02:00
src Add mobile keyboard API (#21) 2023-01-27 19:21:42 +01:00
.babelrc inital commit. 2020-11-05 11:56:26 +01:00
.editorconfig inital commit. 2020-11-05 11:56:26 +01:00
.eslintrc Add NoVnc keyboard (#13) 2022-10-04 20:28:07 +02:00
.gitattributes bump openapi generator version. 2021-02-26 22:54:43 +01:00
.gitignore add plugins. 2022-07-17 00:52:29 +02:00
.prettierrc inital commit. 2020-11-05 11:56:26 +01:00
Dockerfile node 16 major upgrade. 2022-05-14 19:25:22 +02:00
LICENSE add LICENSE. 2022-07-18 22:08:36 +02:00
package-lock.json version 1.6.15 2023-01-20 23:09:39 +01:00
package.json version 1.6.15 2023-01-20 23:09:39 +01:00
README.md Add mobile keyboard API (#21) 2023-01-27 19:21:42 +01:00
tsconfig.json inital commit. 2020-11-05 11:56:26 +01:00
vue.config.js fix relative paths for page. 2023-01-13 19:36:51 +01:00

neko-client

Connect to demodesk/neko backend with self contained vue component.

For community edition neko with GUI and plug & play deployment visit m1k1o/neko.

Installation

Code is published to public GitHub npm repository.

# npm command
npm i @demodesk/neko
# yarn command
yarn add @demodesk/neko

Registry setup

# npm command
echo @demodesk:registry=https://npm.pkg.github.com >> .npmrc
# yarn command
echo \"@demodesk:registry\" \"https://npm.pkg.github.com\" >> .yarnrc

Build

You can set keyboard provider at build time, either novnc or the default guacamole.

# by default uses guacamole keyboard
npm run build
# uses novnc keyboard
KEYBOARD=novnc npm run build

Example

API consists of accessing Vue reactive state, calling various methods and subscribing to events. Simple usage:

<!-- import vue -->
<script src="https://unpkg.com/vue"></script>

<!-- import neko -->
<script src="./neko.umd.js"></script>
<link rel="stylesheet" href="./neko.css">

<div id="app">
  <neko ref="neko" server="http://127.0.0.1:3000/api" autologin autoplay />
</div>

<script>
new Vue({
  components: { neko },
  mounted() {
    // access state
    // this.$refs.neko.state.session_id
  
    // call methods
    // this.$refs.neko.setUrl('http://127.0.0.1:3000/api')
    // this.$refs.neko.login('username', 'password')
    // this.$refs.neko.logout()
  
    // subscribe to events
    // this.$refs.neko.events.on('room.control.host', (id) => { })
  },
}).$mount('#app')
</script>