mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Allow editor-validation for enum-lists
This commit is contained in:
parent
561fabeba6
commit
184cfb1e72
@ -831,6 +831,8 @@ $(document).ready(function () {
|
|||||||
canSave = true;
|
canSave = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!conf_editor.validate().length) {
|
||||||
|
|
||||||
if (canIdentify) {
|
if (canIdentify) {
|
||||||
$("#btn_test_controller").removeClass('hidden');
|
$("#btn_test_controller").removeClass('hidden');
|
||||||
$('#btn_test_controller').attr('disabled', false);
|
$('#btn_test_controller').attr('disabled', false);
|
||||||
@ -852,7 +854,7 @@ $(document).ready(function () {
|
|||||||
else {
|
else {
|
||||||
$('#btn_submit_controller').attr('disabled', true);
|
$('#btn_submit_controller').attr('disabled', true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
window.readOnlyMode ? $('#btn_cl_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
window.readOnlyMode ? $('#btn_cl_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||||
window.readOnlyMode ? $('#btn_ma_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
window.readOnlyMode ? $('#btn_ma_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||||
window.readOnlyMode ? $('#leds_custom_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
window.readOnlyMode ? $('#leds_custom_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||||
|
@ -1839,7 +1839,7 @@ JSONEditor.AbstractEditor = Class.extend({
|
|||||||
this.parent = null;
|
this.parent = null;
|
||||||
},
|
},
|
||||||
getDefault: function() {
|
getDefault: function() {
|
||||||
if(this.schema["default"]) return this.schema["default"];
|
if(this.schema["default"]) return $.i18n(this.schema["default"]);
|
||||||
if(this.schema["enum"]) return this.schema["enum"][0];
|
if(this.schema["enum"]) return this.schema["enum"][0];
|
||||||
|
|
||||||
var type = this.schema.type || this.schema.oneOf;
|
var type = this.schema.type || this.schema.oneOf;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"available_devices": {
|
"available_devices": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_conf_grabber_discovered_title",
|
"title": "edt_conf_grabber_discovered_title",
|
||||||
"default": "NONE",
|
"default": "edt_conf_grabber_discovery_inprogress",
|
||||||
"options": {
|
"options": {
|
||||||
"infoText": "edt_conf_grabber_discovered_title_info"
|
"infoText": "edt_conf_grabber_discovered_title_info"
|
||||||
},
|
},
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"available_devices": {
|
"available_devices": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_conf_grabber_discovered_title",
|
"title": "edt_conf_grabber_discovered_title",
|
||||||
"default": "NONE",
|
"default": "edt_conf_grabber_discovery_inprogress",
|
||||||
"options": {
|
"options": {
|
||||||
"infoText": "edt_conf_grabber_discovered_title_info"
|
"infoText": "edt_conf_grabber_discovered_title_info"
|
||||||
},
|
},
|
||||||
|
@ -5,9 +5,8 @@
|
|||||||
"hostList": {
|
"hostList": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_dev_spec_devices_discovered_title",
|
"title": "edt_dev_spec_devices_discovered_title",
|
||||||
"enum": [ "NONE" ],
|
"default": "edt_dev_spec_devices_discovery_inprogress",
|
||||||
"options": {
|
"options": {
|
||||||
"enum_titles": [ "edt_dev_spec_devices_discovery_inprogress" ],
|
|
||||||
"infoText": "edt_dev_spec_devices_discovered_title_info"
|
"infoText": "edt_dev_spec_devices_discovered_title_info"
|
||||||
},
|
},
|
||||||
"required": true,
|
"required": true,
|
||||||
|
@ -5,9 +5,8 @@
|
|||||||
"hostList": {
|
"hostList": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_dev_spec_devices_discovered_title",
|
"title": "edt_dev_spec_devices_discovered_title",
|
||||||
"enum": [ "NONE" ],
|
"default": "edt_dev_spec_devices_discovery_inprogress",
|
||||||
"options": {
|
"options": {
|
||||||
"enum_titles": [ "edt_dev_spec_devices_discovery_inprogress" ],
|
|
||||||
"infoText": "edt_dev_spec_devices_discovered_title_info"
|
"infoText": "edt_dev_spec_devices_discovered_title_info"
|
||||||
},
|
},
|
||||||
"required": true,
|
"required": true,
|
||||||
|
@ -6,9 +6,8 @@
|
|||||||
"hostList": {
|
"hostList": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_dev_spec_devices_discovered_title",
|
"title": "edt_dev_spec_devices_discovered_title",
|
||||||
"enum": [ "NONE" ],
|
"default": "edt_dev_spec_devices_discovery_inprogress",
|
||||||
"options": {
|
"options": {
|
||||||
"enum_titles": [ "edt_dev_spec_devices_discovery_inprogress" ],
|
|
||||||
"infoText": "edt_dev_spec_devices_discovered_title_info"
|
"infoText": "edt_dev_spec_devices_discovered_title_info"
|
||||||
},
|
},
|
||||||
"required": true,
|
"required": true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user