summaryrefslogtreecommitdiffstats
path: root/server/lib/external-backends/backends/idoit-backend.js
diff options
context:
space:
mode:
authorJannik Schönartz2018-07-26 15:09:54 +0200
committerJannik Schönartz2018-07-26 15:09:54 +0200
commitdfbc9e183af3fbd28dc72f386b97f8df7b3de7c1 (patch)
tree95b50a0dec8f5a15bd3f6e124c6b14133590597a /server/lib/external-backends/backends/idoit-backend.js
parent[server/ipxe-loader] Fixed the script for booting a pxe-linux. (diff)
downloadbas-dfbc9e183af3fbd28dc72f386b97f8df7b3de7c1.tar.gz
bas-dfbc9e183af3fbd28dc72f386b97f8df7b3de7c1.tar.xz
bas-dfbc9e183af3fbd28dc72f386b97f8df7b3de7c1.zip
[server/backends] Added iDoII Backend. Implemented a checkConnection method for each individual backend. Switches in backends can now have recursive elements. They are only shown if the switch is set to true.
Diffstat (limited to 'server/lib/external-backends/backends/idoit-backend.js')
-rw-r--r--server/lib/external-backends/backends/idoit-backend.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/server/lib/external-backends/backends/idoit-backend.js b/server/lib/external-backends/backends/idoit-backend.js
new file mode 100644
index 0000000..2520b07
--- /dev/null
+++ b/server/lib/external-backends/backends/idoit-backend.js
@@ -0,0 +1,27 @@
+var ExternalBackends = require('../external-backends.js')
+
+class IdoitBackend extends ExternalBackends {
+ getCredentials () {
+ // I do it only needs the API-key.
+ return [
+ { type: 'text', id: 1, name: 'API url', icon: 'link' },
+ { type: 'password', id: 2, name: 'API token', icon: 'vpn_key', show: false },
+ { type: 'switch',
+ id: 3,
+ name: 'Login',
+ icon: 'lock_open',
+ elements: [
+ { type: 'text', id: 4, name: 'username', icon: 'person_outline' },
+ { type: 'password', id: 5, name: 'password', icon: 'lock', show: false }
+ ]
+ }
+ ]
+ }
+
+ async checkConnection () {
+ // Make a simple login and check if the connection works.
+ return { success: false, msg: 'TODO: IMPLEMENT' }
+ }
+}
+
+module.exports = IdoitBackend