WebUi: New Internet API logic, correct switch to last instance after refresh, current instance notification (#608)

* Added new restricted ip api checkbox, initial instance localStorage support

* Added instance notification, added correct instance switch after page refresh (to last current instance)

* Optimize intention in wizard.js

* ":" from i18n json to code

* Changes for Responsive about site
This commit is contained in:
b1rdhous3 2019-08-21 17:46:49 +02:00 committed by brindosch
parent 1093278d16
commit 18d6345968
10 changed files with 854 additions and 813 deletions

View File

@ -60,7 +60,7 @@
else else
{ {
response.text().then(function(text) { response.text().then(function(text) {
$("#3rdpartylicenses").text(text); $("#3rdpartylicenses").html('<code>'+text+'</code>');
}); });
} }
}) })

View File

@ -76,6 +76,7 @@
"dashboard_alert_message_confsave_success" : "Deine Hyperion Konfiguration wurde erfolgreich gespeichert. Deine Änderungen sind somit übernommen.", "dashboard_alert_message_confsave_success" : "Deine Hyperion Konfiguration wurde erfolgreich gespeichert. Deine Änderungen sind somit übernommen.",
"dashboard_message_global_setting_t": "Instanzunabhängige Einstellung", "dashboard_message_global_setting_t": "Instanzunabhängige Einstellung",
"dashboard_message_global_setting": "Die Einstellungen auf dieser Seite sind instanzunabhängig. Änderungen werden global übernommen.", "dashboard_message_global_setting": "Die Einstellungen auf dieser Seite sind instanzunabhängig. Änderungen werden global übernommen.",
"dashboard_active_instance": "Ausgewählte Instanz",
"main_menu_dashboard_token": "Dashboard", "main_menu_dashboard_token": "Dashboard",
"main_menu_configuration_token": "Konfiguration", "main_menu_configuration_token": "Konfiguration",
"main_menu_general_conf_token": "Allgemein", "main_menu_general_conf_token": "Allgemein",
@ -611,6 +612,8 @@
"edt_conf_net_apiAuth_expl":"Zwinge alle Anwendungen welche die Hyperion API nutzen sich zu authentifizieren. Aktivieren für höhere Sicherheit, da nun jede neue Anwendung einmalig von dir bestätigt werden muss.", "edt_conf_net_apiAuth_expl":"Zwinge alle Anwendungen welche die Hyperion API nutzen sich zu authentifizieren. Aktivieren für höhere Sicherheit, da nun jede neue Anwendung einmalig von dir bestätigt werden muss.",
"edt_conf_net_localApiAuth_title" : "Lokale API Authentifizierung", "edt_conf_net_localApiAuth_title" : "Lokale API Authentifizierung",
"edt_conf_net_localApiAuth_expl" : "Wenn aktiviert, müssen Verbindungen aus dem Heimnetzwerk mit einem Token authentifiziert werden.", "edt_conf_net_localApiAuth_expl" : "Wenn aktiviert, müssen Verbindungen aus dem Heimnetzwerk mit einem Token authentifiziert werden.",
"edt_conf_net_restirctedInternetAccessAPI_title" : "Auf IP's beschränken",
"edt_conf_net_restirctedInternetAccessAPI_expl": "Den Zugriff auf die API durch das Internet auf bestimmte IP's beschränken",
"edt_conf_js_heading_title": "JSON Server", "edt_conf_js_heading_title": "JSON Server",
"edt_conf_fbs_heading_title": "Flatbuffers Server", "edt_conf_fbs_heading_title": "Flatbuffers Server",
"edt_conf_fbs_timeout_title": "Zeitüberschreitung", "edt_conf_fbs_timeout_title": "Zeitüberschreitung",

View File

@ -75,6 +75,7 @@
"dashboard_alert_message_confsave_success" : "Your Hyperion configuration has been saved successfully. Your changes are now active.", "dashboard_alert_message_confsave_success" : "Your Hyperion configuration has been saved successfully. Your changes are now active.",
"dashboard_message_global_setting_t": "Instance independent setting", "dashboard_message_global_setting_t": "Instance independent setting",
"dashboard_message_global_setting": "The settings on this page are not depending on a specific instance. Changes will be stored globally for all instances.", "dashboard_message_global_setting": "The settings on this page are not depending on a specific instance. Changes will be stored globally for all instances.",
"dashboard_active_instance": "Selected instance",
"main_menu_dashboard_token" : "Dashboard", "main_menu_dashboard_token" : "Dashboard",
"main_menu_configuration_token" : "Configuration", "main_menu_configuration_token" : "Configuration",
"main_menu_general_conf_token" : "General", "main_menu_general_conf_token" : "General",
@ -610,6 +611,8 @@
"edt_conf_net_apiAuth_expl":"Enforce all applications that use the Hyperion API to authenticate themself against Hyperion (Exception see \"Local API Authentication\"). Higher security, as you control the access and revoke it at any time.", "edt_conf_net_apiAuth_expl":"Enforce all applications that use the Hyperion API to authenticate themself against Hyperion (Exception see \"Local API Authentication\"). Higher security, as you control the access and revoke it at any time.",
"edt_conf_net_localApiAuth_title" : "Local API Authentication", "edt_conf_net_localApiAuth_title" : "Local API Authentication",
"edt_conf_net_localApiAuth_expl" : "When enabled, connections from your home network needs to authenticate themself against Hyperion too.", "edt_conf_net_localApiAuth_expl" : "When enabled, connections from your home network needs to authenticate themself against Hyperion too.",
"edt_conf_net_restirctedInternetAccessAPI_title" : "Restrict to IP's",
"edt_conf_net_restirctedInternetAccessAPI_expl": "You can restrict the access to the API through the internet to certain IP's.",
"edt_conf_js_heading_title" : "JSON Server", "edt_conf_js_heading_title" : "JSON Server",
"edt_conf_fbs_heading_title" : "Flatbuffers Server", "edt_conf_fbs_heading_title" : "Flatbuffers Server",
"edt_conf_fbs_timeout_title" : "Timeout", "edt_conf_fbs_timeout_title" : "Timeout",

View File

@ -211,6 +211,11 @@
<!-- Page Content --> <!-- Page Content -->
<div id="page-wrapper" style="padding-top:10px; overflow: hidden;"> <div id="page-wrapper" style="padding-top:10px; overflow: hidden;">
<div id="dashboard_active_instance" style="display:none;padding:0 10px;margin:0">
<div class="bs-callout bs-callout-success">
<h4 id="dashboard_active_instance_friendly_name"></h4>
</div>
</div>
<div id="hyperion_config_write_success_notify" style="display:none;padding:0 10px;margin:0"> <div id="hyperion_config_write_success_notify" style="display:none;padding:0 10px;margin:0">
<div class="bs-callout bs-callout-success"> <div class="bs-callout bs-callout-success">
<h4 data-i18n="dashboard_alert_message_confsave_success_t"></h4> <h4 data-i18n="dashboard_alert_message_confsave_success_t"></h4>

View File

@ -81,4 +81,3 @@ $(document).ready( function() {
removeOverlay(); removeOverlay();
}); });

View File

@ -95,6 +95,10 @@ function loadContent(event, forceRefresh)
{ {
var tag; var tag;
var lastSelectedInstance = getStorage('lastSelectedInstance', false);
if(lastSelectedInstance && (lastSelectedInstance != window.currentHyperionInstance))
instanceSwitch(lastSelectedInstance);
if(typeof event != "undefined") if(typeof event != "undefined")
{ {
tag = event.currentTarget.hash; tag = event.currentTarget.hash;
@ -154,10 +158,7 @@ function updateHyperionInstanceListing()
$('#hyperioninstance_'+data[key].instance).off().on("click",function(e){ $('#hyperioninstance_'+data[key].instance).off().on("click",function(e){
var inst = e.currentTarget.id.split("_")[1] var inst = e.currentTarget.id.split("_")[1]
requestInstanceSwitch(inst) instanceSwitch(inst)
window.currentHyperionInstance = inst;
window.currentHyperionInstanceName = getInstanceNameByIndex(inst);
updateHyperionInstanceListing()
}); });
} }
} }
@ -171,13 +172,26 @@ function updateUiOnInstance(inst)
$("#hyperion_global_setting_notify").fadeIn("fast"); $("#hyperion_global_setting_notify").fadeIn("fast");
else else
$("#hyperion_global_setting_notify").attr("style", "display:none"); $("#hyperion_global_setting_notify").attr("style", "display:none");
$("#dashboard_active_instance_friendly_name").html($.i18n('dashboard_active_instance') + ': ' + window.serverInfo.instance[inst].friendly_name);
$("#dashboard_active_instance").removeAttr("style");
} }
else else
{ {
$("#hyperion_global_setting_notify").fadeOut("fast"); $("#hyperion_global_setting_notify").fadeOut("fast");
$("#dashboard_active_instance").attr("style", "display:none");
} }
} }
function instanceSwitch(inst)
{
requestInstanceSwitch(inst)
window.currentHyperionInstance = inst;
window.currentHyperionInstanceName = getInstanceNameByIndex(inst);
setStorage('lastSelectedInstance', inst, false)
updateHyperionInstanceListing()
}
function loadContentTo(containerId, fileName) function loadContentTo(containerId, fileName)
{ {
$(containerId).load("/content/"+fileName+".html"); $(containerId).load("/content/"+fileName+".html");

File diff suppressed because it is too large Load Diff

View File

@ -309,6 +309,7 @@
"network" : "network" :
{ {
"internetAccessAPI" : false, "internetAccessAPI" : false,
"restirctedInternetAccessAPI" : false,
"ipWhitelist" : [], "ipWhitelist" : [],
"apiAuth" : true, "apiAuth" : true,
"localApiAuth" : false "localApiAuth" : false

View File

@ -178,6 +178,7 @@
"network" : "network" :
{ {
"internetAccessAPI" : false, "internetAccessAPI" : false,
"restirctedInternetAccessAPI" : false,
"ipWhitelist" : [], "ipWhitelist" : [],
"apiAuth" : true, "apiAuth" : true,
"localApiAuth" : false "localApiAuth" : false

View File

@ -25,6 +25,19 @@
}, },
"propertyOrder" : 2 "propertyOrder" : 2
}, },
"restirctedInternetAccessAPI" :
{
"type" : "boolean",
"title" : "edt_conf_net_restirctedInternetAccessAPI_title",
"required" : true,
"default" : false,
"options": {
"dependencies": {
"internetAccessAPI": true
}
},
"propertyOrder" : 3
},
"ipWhitelist" : "ipWhitelist" :
{ {
"type" : "array", "type" : "array",
@ -36,10 +49,10 @@
}, },
"options": { "options": {
"dependencies": { "dependencies": {
"internetAccessAPI": false "restirctedInternetAccessAPI": true
} }
}, },
"propertyOrder" : 3 "propertyOrder" : 4
}, },
"localApiAuth" : "localApiAuth" :
{ {
@ -52,7 +65,7 @@
"apiAuth": true "apiAuth": true
} }
}, },
"propertyOrder" : 4 "propertyOrder" : 5
} }
}, },
"additionalProperties" : false "additionalProperties" : false