diff --git a/public/scripts/common-0.0.1.js b/public/scripts/common-0.0.1.js index 8adba78c..56770a46 100644 --- a/public/scripts/common-0.0.1.js +++ b/public/scripts/common-0.0.1.js @@ -125,7 +125,7 @@ function parseUriArgs(decodeUrl) { name = arg.substring(0, i); r[name] = arg.substring(i + 1); if (decodeUrl) { r[name] = decodeURIComponent(arg.substring(i + 1)); } - if (!isSafeString(r[name])) { delete r[name]; } else { var x = parseInt(r[name]); if (x == r[name]) { r[name] = x; } } + if (!isSafeString2(r[name])) { delete r[name]; } else { var x = parseInt(r[name]); if (x == r[name]) { r[name] = x; } } } return r; } diff --git a/views/default.handlebars b/views/default.handlebars index fccf07ba..f7c2553b 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -1644,7 +1644,10 @@ QV('DeskESC', browserfullscreen); if ((xtermfit != null) && (xxcurrentView == 12)) { xtermfit.fit(); } } - setTimeout(function() { mainUpdate(512); }, 200); + setTimeout(function() { + if (urlargs.filter) { Q('SearchInput').value = urlargs.filter; Q('KvmSearchInput').value = urlargs.filter; } + mainUpdate(512); + }, 200); // Connect to the mesh server meshserver = MeshServerCreateControl(domainUrl); @@ -5019,7 +5022,25 @@ } function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; } function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["Disconnected", "Connecting...", "Setup...", '', ''][state]); } catch (ex) {} } - function onDeviceSearchChanged(e) { if (e != null) { if (e.target.id == 'SearchInput') { Q('KvmSearchInput').value = Q('SearchInput').value; } else { Q('SearchInput').value = Q('KvmSearchInput').value; } } mainUpdate(5); } + function onDeviceSearchChanged(e) { + var url = new URL(window.location.href); + if (e != null) { + if (e.target.id == 'SearchInput') { + Q('KvmSearchInput').value = Q('SearchInput').value; + } else { + Q('SearchInput').value = Q('KvmSearchInput').value; + } + url.searchParams.set('filter', e.target.value); + if(urlargs.filter){ urlargs.filter = e.target.value; } + }else{ + url.searchParams.delete('filter'); + if(urlargs.filter){ delete urlargs.filter; } + } + if (((features & 0x10000000) == 0) && (xxcurrentView > 0)) { + try { window.history.replaceState({}, document.title, decodeURIComponent(url.toString())); } catch(e) { } + } + mainUpdate(5); + } function showMultiDesktopSettings() { QV('td7amtkvm', false);