chg: [instance:settings] UI improvements
parent
22faffb170
commit
cf793b6742
|
@ -216,31 +216,30 @@ class SettingsProviderTable extends AppTable
|
||||||
'Narud' => 'Narud',
|
'Narud' => 'Narud',
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
'name' => 'Antagonist',
|
'severity' => 'warning',
|
||||||
'type' => 'select'
|
'type' => 'select'
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'floating-setting' => [
|
'floating-setting' => [
|
||||||
'description' => 'floaringSetting',
|
'description' => 'floaringSetting',
|
||||||
'errorMessage' => 'floaringSetting',
|
// 'default' => 'A default value',
|
||||||
'default' => 'A default value',
|
|
||||||
'name' => 'Uncategorized Setting',
|
'name' => 'Uncategorized Setting',
|
||||||
'test' => 'testEmptyBecomesDefault',
|
// 'severity' => 'critical',
|
||||||
'type' => 'string'
|
'severity' => 'warning',
|
||||||
|
// 'severity' => 'info',
|
||||||
|
'type' => 'integer'
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'Network' => [
|
'Network' => [
|
||||||
'Proxy' => [
|
'Proxy' => [
|
||||||
'proxy.host' => [
|
'proxy.host' => [
|
||||||
'description' => __('The hostname of an HTTP proxy for outgoing sync requests. Leave empty to not use a proxy.'),
|
'description' => __('The hostname of an HTTP proxy for outgoing sync requests. Leave empty to not use a proxy.'),
|
||||||
'default' => '',
|
|
||||||
'name' => __('Host'),
|
'name' => __('Host'),
|
||||||
'test' => 'testHostname',
|
'test' => 'testHostname',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
],
|
],
|
||||||
'proxy.port' => [
|
'proxy.port' => [
|
||||||
'description' => __('The TCP port for the HTTP proxy.'),
|
'description' => __('The TCP port for the HTTP proxy.'),
|
||||||
'default' => '',
|
|
||||||
'name' => __('Port'),
|
'name' => __('Port'),
|
||||||
'test' => 'testForRangeXY',
|
'test' => 'testForRangeXY',
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
|
|
|
@ -474,6 +474,8 @@ function isLeaf($setting)
|
||||||
let oldValue = settingsFlattened[$input.data('setting-name')].value
|
let oldValue = settingsFlattened[$input.data('setting-name')].value
|
||||||
if ($input.is('select')) {
|
if ($input.is('select')) {
|
||||||
oldValue = oldValue !== undefined ? oldValue : -1
|
oldValue = oldValue !== undefined ? oldValue : -1
|
||||||
|
} else {
|
||||||
|
oldValue = oldValue !== undefined ? oldValue : ''
|
||||||
}
|
}
|
||||||
$input.val(oldValue)
|
$input.val(oldValue)
|
||||||
handleSettingValueChange($input)
|
handleSettingValueChange($input)
|
||||||
|
@ -503,7 +505,7 @@ function isLeaf($setting)
|
||||||
function handleSettingValueChange($input) {
|
function handleSettingValueChange($input) {
|
||||||
const oldValue = settingsFlattened[$input.data('setting-name')].value
|
const oldValue = settingsFlattened[$input.data('setting-name')].value
|
||||||
const newValue = ($input.attr('type') == 'checkbox' ? $input.is(':checked') : $input.val())
|
const newValue = ($input.attr('type') == 'checkbox' ? $input.is(':checked') : $input.val())
|
||||||
if (newValue == oldValue) {
|
if (newValue == oldValue || (newValue == '' && oldValue == undefined)) {
|
||||||
restoreWarnings($input)
|
restoreWarnings($input)
|
||||||
} else {
|
} else {
|
||||||
removeWarnings($input)
|
removeWarnings($input)
|
||||||
|
@ -664,4 +666,8 @@ function isLeaf($setting)
|
||||||
.custom-select ~ div > a.btn-reset-setting {
|
.custom-select ~ div > a.btn-reset-setting {
|
||||||
left: -2.5em;
|
left: -2.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-control ~ div > a.btn-reset-setting {
|
||||||
|
left: -3em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue