mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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:
@@ -81,4 +81,3 @@ $(document).ready( function() {
|
||||
|
||||
removeOverlay();
|
||||
});
|
||||
|
||||
|
@@ -95,6 +95,10 @@ function loadContent(event, forceRefresh)
|
||||
{
|
||||
var tag;
|
||||
|
||||
var lastSelectedInstance = getStorage('lastSelectedInstance', false);
|
||||
if(lastSelectedInstance && (lastSelectedInstance != window.currentHyperionInstance))
|
||||
instanceSwitch(lastSelectedInstance);
|
||||
|
||||
if(typeof event != "undefined")
|
||||
{
|
||||
tag = event.currentTarget.hash;
|
||||
@@ -154,10 +158,7 @@ function updateHyperionInstanceListing()
|
||||
|
||||
$('#hyperioninstance_'+data[key].instance).off().on("click",function(e){
|
||||
var inst = e.currentTarget.id.split("_")[1]
|
||||
requestInstanceSwitch(inst)
|
||||
window.currentHyperionInstance = inst;
|
||||
window.currentHyperionInstanceName = getInstanceNameByIndex(inst);
|
||||
updateHyperionInstanceListing()
|
||||
instanceSwitch(inst)
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -171,13 +172,26 @@ function updateUiOnInstance(inst)
|
||||
$("#hyperion_global_setting_notify").fadeIn("fast");
|
||||
else
|
||||
$("#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
|
||||
{
|
||||
$("#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)
|
||||
{
|
||||
$(containerId).load("/content/"+fileName+".html");
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user