add filter to url (#5535)

This commit is contained in:
Simon Smith 2023-11-12 18:14:01 +00:00 committed by GitHub
parent c05cbeae88
commit d80a74b915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 3 deletions

View File

@ -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;
}

View File

@ -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);