From 0f2d72fc0a713b2f9d7dde7a0f8b8b0a12f13bbf Mon Sep 17 00:00:00 2001 From: birdhouse Date: Sat, 13 Jul 2019 00:06:58 +0200 Subject: [PATCH] Renaming versionBranch and JSONEditor Enhancement - versionBranch was renamed to watchedVersionBranch (including all variables and strings. even config) - Enhancements for JSON Editor. Detection of advanced was not so good. Now you can see advaced if advanced or expert is selected. expert is the highest and should also make advanced visible. - The levels default, advanced, expert are now also respected in the information tabs. Same logic as for the forms itself. Expert is highest and will also show all advanced settings. --- assets/webconfig/content/dashboard.html | 4 ++-- assets/webconfig/content/update.html | 2 +- assets/webconfig/i18n/de.json | 6 +++--- assets/webconfig/i18n/en.json | 6 +++--- assets/webconfig/js/content_dashboard.js | 2 +- assets/webconfig/js/lib/jsoneditor.js | 9 +++++++-- assets/webconfig/js/ui_utils.js | 6 +++++- config/hyperion.config.json.commented | 2 +- config/hyperion.config.json.default | 2 +- libsrc/hyperion/schema/schema-general.json | 4 ++-- 10 files changed, 26 insertions(+), 17 deletions(-) diff --git a/assets/webconfig/content/dashboard.html b/assets/webconfig/content/dashboard.html index ca873ab7..a83d72ec 100644 --- a/assets/webconfig/content/dashboard.html +++ b/assets/webconfig/content/dashboard.html @@ -38,8 +38,8 @@ unknown - Version Branch: - unknown + Watched version branch: + unknown Latest version: diff --git a/assets/webconfig/content/update.html b/assets/webconfig/content/update.html index 80e9cd46..cfeca4dd 100644 --- a/assets/webconfig/content/update.html +++ b/assets/webconfig/content/update.html @@ -25,7 +25,7 @@ $(document).ready( function(error) { for (var key in window.gitHubVersionList) { - if(window.gitHubVersionList[key].name == null || (window.serverConfig.general.versionBranch == "Stable" && window.gitHubVersionList[key].prerelease == true)) + if(window.gitHubVersionList[key].name == null || (window.serverConfig.general.watchedVersionBranch == "Stable" && window.gitHubVersionList[key].prerelease == true)) { continue; } diff --git a/assets/webconfig/i18n/de.json b/assets/webconfig/i18n/de.json index 94eace38..c7c99a6d 100644 --- a/assets/webconfig/i18n/de.json +++ b/assets/webconfig/i18n/de.json @@ -50,7 +50,7 @@ "dashboard_infobox_label_platform": "Plattform:", "dashboard_infobox_label_instance": "Instanz:", "dashboard_infobox_label_ports": "Ports (flat|proto):", - "dashboard_infobox_label_versionbranch": "Versionszweig:", + "dashboard_infobox_label_watchedversionbranch": "Ausgewählter Versionszweig:", "dashboard_infobox_message_updatewarning": "Eine aktuellere Version von Hyperion ist verfügbar! (V$1)", "dashboard_infobox_message_updatesuccess": "Du nutzt die aktuellste Version von Hyperion.", "dashboard_infobox_label_statush": "Hyperion Status:", @@ -441,8 +441,8 @@ "edt_conf_gen_name_expl": "Der Name wird verwendet, um Hyperion besser zu identifizieren. (Hilfreich bei mehreren Instanzen)", "edt_conf_gen_showOptHelp_title": "Zeige Erklärungen", "edt_conf_gen_showOptHelp_expl": "Zeige alle verfügbaren Options-Erklärungen. Empfohlen für Anfänger", - "edt_conf_gen_versionBranch_title": "Versionszweig", - "edt_conf_gen_versionBranch_expl": "Gibt an, welcher Versionszweig für die Suche von neuen Hyperion Versionen genutzt werden soll.", + "edt_conf_gen_watchedVersionBranch_title": "Ausgewählter Versionszweig", + "edt_conf_gen_watchedVersionBranch_expl": "Gibt an, welcher Versionszweig für die Suche von neuen Hyperion Versionen genutzt werden soll.", "edt_conf_color_heading_title": "Farbkalibrierung", "edt_conf_color_channelAdjustment_header_itemtitle": "Profil", "edt_conf_color_channelAdjustment_header_title": "Anpassung Farbkanäle", diff --git a/assets/webconfig/i18n/en.json b/assets/webconfig/i18n/en.json index 9bc35d80..5876de4b 100644 --- a/assets/webconfig/i18n/en.json +++ b/assets/webconfig/i18n/en.json @@ -50,7 +50,7 @@ "dashboard_infobox_label_platform" : "Platform:", "dashboard_infobox_label_instance" : "Instance:", "dashboard_infobox_label_ports" : "Ports (flat|proto):", - "dashboard_infobox_label_versionbranch" : "Version Branch:", + "dashboard_infobox_label_watchedversionbranch" : "Watched version branch:", "dashboard_infobox_message_updatewarning" : "A newer version of Hyperion is available! ($1)", "dashboard_infobox_message_updatesuccess" : "You run the latest version of Hyperion.", "dashboard_infobox_label_statush" : "Hyperion status:", @@ -441,8 +441,8 @@ "edt_conf_gen_name_expl" : "A user defined name which is used to detect Hyperion. (Helpful with more than one Hyperion instance)", "edt_conf_gen_showOptHelp_title" : "Show explanations", "edt_conf_gen_showOptHelp_expl" : "Show all available explanations in each section. Highly recommended for beginners!", - "edt_conf_gen_versionBranch_title" : "Version Branch", - "edt_conf_gen_versionBranch_expl" : "Selects which version branch should be used for searching new Hyperion versions.", + "edt_conf_gen_watchedVersionBranch_title" : "Watched version branch", + "edt_conf_gen_watchedVersionBranch_expl" : "Selects which version branch should be used for searching new Hyperion versions.", "edt_conf_color_heading_title" : "Color Calibration", "edt_conf_color_channelAdjustment_header_itemtitle" : "Profile", "edt_conf_color_channelAdjustment_header_title" : "Color channel adjustments", diff --git a/assets/webconfig/js/content_dashboard.js b/assets/webconfig/js/content_dashboard.js index daf355a3..1d20526a 100644 --- a/assets/webconfig/js/content_dashboard.js +++ b/assets/webconfig/js/content_dashboard.js @@ -78,7 +78,7 @@ $(document).ready( function() { $('#dash_currv').html(window.currentChannel+' '+window.currentVersion); $('#dash_instance').html(window.serverConfig.general.name); $('#dash_ports').html(window.serverConfig.flatbufServer.port+' | '+window.serverConfig.protoServer.port); - $('#dash_versionbranch').html(window.serverConfig.general.versionBranch); + $('#dash_watchedversionbranch').html(window.serverConfig.general.watchedVersionBranch); getReleases(function(callback){ if(callback) diff --git a/assets/webconfig/js/lib/jsoneditor.js b/assets/webconfig/js/lib/jsoneditor.js index 8fa013d4..8b1c93dd 100755 --- a/assets/webconfig/js/lib/jsoneditor.js +++ b/assets/webconfig/js/lib/jsoneditor.js @@ -1540,8 +1540,13 @@ JSONEditor.AbstractEditor = Class.extend({ var storedAccess = this.access if(this.schema.access){ if(this.schema.access == 'system') - this.container.style.display = "none"; - else if(this.schema.access == 'expert' && storedAccess != 'expert'){ + this.container.style.display = "none"; + else if(this.schema.access == 'advanced' && storedAccess == 'default') + { + this.container.style.display = "none"; + } + else if(this.schema.access == 'expert' && storedAccess != 'expert') + { this.container.style.display = "none"; //this.disable(); } diff --git a/assets/webconfig/js/ui_utils.js b/assets/webconfig/js/ui_utils.js index 70340828..43422b63 100644 --- a/assets/webconfig/js/ui_utils.js +++ b/assets/webconfig/js/ui_utils.js @@ -593,6 +593,8 @@ function createHelpTable(list, phead){ // break one iteration (in the loop), if the schema has the entry hidden=true if ("options" in list[key] && "hidden" in list[key].options && (list[key].options.hidden)) continue; + if ("access" in list[key] && ((list[key].access == "advanced" && storedAccess == "default") || (list[key].access == "expert" && storedAccess != "expert"))) + continue; var text = list[key].title.replace('title', 'expl'); tbody.appendChild(createTableRow([$.i18n(list[key].title), $.i18n(text)], false, false)); @@ -604,6 +606,8 @@ function createHelpTable(list, phead){ // break one iteration (in the loop), if the schema has the entry hidden=true if ("options" in ilist[ikey] && "hidden" in ilist[ikey].options && (ilist[ikey].options.hidden)) continue; + if ("access" in ilist[ikey] && ((ilist[ikey].access == "advanced" && storedAccess == "default") || (ilist[ikey].access == "expert" && storedAccess != "expert"))) + continue; var itext = ilist[ikey].title.replace('title', 'expl'); tbody.appendChild(createTableRow([$.i18n(ilist[ikey].title), $.i18n(itext)], false, false)); } @@ -743,7 +747,7 @@ function getReleases(callback) { window.latestStableVersion = latest; - if(window.serverConfig.general.versionBranch == "Beta" && window.latestStableVersion.tag_name.replace(/\./g, '') <= window.latestBetaVersion.tag_name.replace(/\./g, '')) + if(window.serverConfig.general.watchedVersionBranch == "Beta" && window.latestStableVersion.tag_name.replace(/\./g, '') <= window.latestBetaVersion.tag_name.replace(/\./g, '')) { window.latestVersion = window.latestBetaVersion; } diff --git a/config/hyperion.config.json.commented b/config/hyperion.config.json.commented index 3213951d..1559119a 100644 --- a/config/hyperion.config.json.commented +++ b/config/hyperion.config.json.commented @@ -11,7 +11,7 @@ "general" : { "name" : "MyHyperionConfig", - "versionBranch" : "Stable", + "watchedVersionBranch" : "Stable", "showOptHelp" : true }, /// set log level: silent warn verbose debug diff --git a/config/hyperion.config.json.default b/config/hyperion.config.json.default index 30224989..dc078ec4 100644 --- a/config/hyperion.config.json.default +++ b/config/hyperion.config.json.default @@ -2,7 +2,7 @@ "general" : { "name" : "My Hyperion Config", - "versionBranch" : "Stable", + "watchedVersionBranch" : "Stable", "showOptHelp" : true }, "logger" : diff --git a/libsrc/hyperion/schema/schema-general.json b/libsrc/hyperion/schema/schema-general.json index fff7a320..2713cd22 100644 --- a/libsrc/hyperion/schema/schema-general.json +++ b/libsrc/hyperion/schema/schema-general.json @@ -14,10 +14,10 @@ "required" : true, "propertyOrder" : 1 }, - "versionBranch" : + "watchedVersionBranch" : { "type" : "string", - "title" : "edt_conf_gen_versionBranch_title", + "title" : "edt_conf_gen_watchedVersionBranch_title", "enum" : ["Stable", "Beta"], "required" : true, "access" : "expert",