mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
Use onstorage event - don't poll. Increase screenshot frequency to one second.
This commit is contained in:
@@ -132,6 +132,9 @@ GuacamoleHistory = new (function() {
|
||||
*/
|
||||
this.onchange = null;
|
||||
|
||||
// Reload when modified
|
||||
window.addEventListener("storage", guac_history.reload);
|
||||
|
||||
// Initial load
|
||||
guac_history.reload();
|
||||
|
||||
|
@@ -418,9 +418,8 @@ GuacamoleUI.attach = function(guac) {
|
||||
if (GuacamoleUI.sessionState.getProperty("clipboard"))
|
||||
guac.setClipboard(GuacamoleUI.sessionState.getProperty("clipboard"));
|
||||
|
||||
// Regularly update screenshot if storage available
|
||||
if (localStorage)
|
||||
window.setInterval(updateThumbnail, 5000);
|
||||
// Regularly update screenshot
|
||||
window.setInterval(updateThumbnail, 1000);
|
||||
|
||||
break;
|
||||
|
||||
|
@@ -323,12 +323,6 @@ GuacamoleRootUI.reset = function() {
|
||||
GuacamoleRootUI.views.login.style.display = "none";
|
||||
GuacamoleRootUI.views.connections.style.display = "";
|
||||
|
||||
// Reload history every 5 seconds
|
||||
window.setInterval(GuacamoleHistory.reload, 5000);
|
||||
|
||||
// Reload history when focus gained
|
||||
window.onfocus = GuacamoleHistory.reload;
|
||||
|
||||
};
|
||||
|
||||
GuacamoleHistory.onchange = function(id, old_entry, new_entry) {
|
||||
|
@@ -98,12 +98,9 @@ function GuacamoleSessionState() {
|
||||
*/
|
||||
this.onchange = null;
|
||||
|
||||
// Reload properties every second
|
||||
window.setInterval(guac_state.reload, 1000);
|
||||
// Reload when modified
|
||||
window.addEventListener("storage", guac_state.reload);
|
||||
|
||||
// Reload properties when focus is gained
|
||||
window.addEventListener("focus", guac_state.reload);
|
||||
|
||||
// Initial load
|
||||
guac_state.reload();
|
||||
|
||||
|
Reference in New Issue
Block a user