Add config options to remove fields from Connect dialog
This commit is contained in:
parent
5f2798e78c
commit
ad3669d8bc
3 changed files with 16 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue