Add config options to remove fields from Connect dialog

This commit is contained in:
Jonas Herzig 2018-10-08 19:21:48 +02:00
parent 5f2798e78c
commit ad3669d8bc
3 changed files with 16 additions and 7 deletions

View file

@ -3,6 +3,14 @@
// configuration options. Use the [config.local.js] file instead!
window.mumbleWebConfig = {
// Which fields to show on the Connect to Server dialog
'connectDialog': {
'address': true,
'port': true,
'token': true,
'username': true,
'password': true
},
// Default values (can be changed by passing a query parameter of the same name)
'defaults': {
// Connect Dialog

View file

@ -31,23 +31,23 @@
</div>
<form data-bind="submit: connect">
<table>
<tr>
<tr data-bind="if: $root.config.connectDialog.address">
<td>Address</td>
<td><input id="address" type="text" data-bind="value: address" required></td>
</tr>
<tr>
<tr data-bind="if: $root.config.connectDialog.port">
<td>Port</td>
<td><input id="port" type="text" data-bind="value: port" required></td>
</tr>
<tr>
<tr data-bind="if: $root.config.connectDialog.token">
<td>Token</td>
<td><input id="token" type="text" data-bind="value: token"></td>
</tr>
<tr>
<tr data-bind="if: $root.config.connectDialog.username">
<td>Username</td>
<td><input id="username" type="text" data-bind="value: username" required></td>
</tr>
<tr>
<tr data-bind="if: $root.config.connectDialog.password">
<td>Password</td>
<td><input id="password" type="password" data-bind="value: password"></td>
</tr>

View file

@ -260,7 +260,8 @@ class Settings {
}
class GlobalBindings {
constructor () {
constructor (config) {
this.config = config
this.settings = new Settings()
this.connector = new WorkerBasedMumbleConnector()
this.client = null
@ -860,7 +861,7 @@ class GlobalBindings {
}
}
}
var ui = new GlobalBindings()
var ui = new GlobalBindings(window.mumbleWebConfig)
// Used only for debugging
window.mumbleUi = ui