diff --git a/domain-server/resources/web/css/style.css b/domain-server/resources/web/css/style.css index 1aab383a7d..fa0c440076 100644 --- a/domain-server/resources/web/css/style.css +++ b/domain-server/resources/web/css/style.css @@ -53,7 +53,12 @@ span.port { } .locked { - color: blue; + color: #428bca; +} + +.locked-table { + cursor: not-allowed; + background-color: #eee; } .advanced-setting { diff --git a/domain-server/resources/web/js/settings.js b/domain-server/resources/web/js/settings.js index c2223a8f55..21a4d99977 100644 --- a/domain-server/resources/web/js/settings.js +++ b/domain-server/resources/web/js/settings.js @@ -41,6 +41,7 @@ var viewHelpers = { common_attrs = " class='" + (setting.type !== 'checkbox' ? 'form-control' : '') + " " + Settings.TRIGGER_CHANGE_CLASS + "' data-short-name='" + setting.name + "' name='" + setting_name + "' " + + "id='" + setting_name + "'" if (setting.type === 'checkbox') { if (setting.label) { @@ -51,8 +52,6 @@ var viewHelpers = { form_group += "" form_group += " " + setting.help + ""; form_group += "" - } else if (setting.type === 'table') { - form_group += makeTable(setting, setting_name, setting_value); } else { input_type = _.has(setting, 'type') ? setting.type : "text" @@ -60,29 +59,33 @@ var viewHelpers = { form_group += ""; } - if (setting.type === 'select') { - form_group += "" - - form_group += "" + if (input_type === 'table') { + form_group += makeTable(setting, setting_name, setting_value, isLocked) } else { + if (input_type === 'select') { + form_group += "" + + form_group += "" + } else { + + if (input_type == 'integer') { + input_type = "text" + } + + form_group += "" } - - form_group += "" - } - form_group += "" + setting.help + "" + form_group += "" + setting.help + "" + } } form_group += "" @@ -201,7 +204,10 @@ function reloadSettings() { title: 'This setting is in the master config file and cannot be changed' }) - appendDomainSelectionModal() + if (!_.has(data["locked"], "metaverse") && !_.has(data["locked"]["metaverse"], "id")) { + // append the domain selection modal, as long as it's not locked + appendDomainSelectionModal() + } }); } @@ -252,16 +258,15 @@ $('body').on('click', '.save-button', function(e){ return false; }); -function makeTable(setting, setting_name, setting_value) { +function makeTable(setting, setting_name, setting_value, isLocked) { var isArray = !_.has(setting, 'key') if (!isArray && setting.can_order) { setting.can_order = false; } - var html = (setting.label) ? "" : "" - html += "" + setting.help + "" - html += "
" + col.label + " | " // Data }) - if (setting.can_order) { - html += ""; - } + if (!isLocked) { + if (setting.can_order) { + html += " | "; + } html += " | " + } // populate rows in the table from existing values var row_num = 1 @@ -317,20 +324,25 @@ function makeTable(setting, setting_name, setting_value) { html += "" }) - if (setting.can_order) { - html += " | " - } + if (!isLocked) { + if (setting.can_order) { + html += " | " + } html += " | " + } + html += "" row_num++ }) // populate inputs in the table for new values - html += makeTableInputs(setting) + if (!isLocked) { + html += makeTableInputs(setting) + } html += " |