Use post() to go to create snapshot

pull/3646/head
Isaac Connor 2022-11-30 19:29:50 -05:00
parent a6b3b18a6e
commit 23b94987e7
1 changed files with 19 additions and 3 deletions

View File

@ -1133,10 +1133,26 @@ function initPage() {
}
function takeSnapshot() {
monitor_ids = Array.from(monitorIndex.keys()).map((id)=>{
return 'monitor_ids[]='+id;
monitor_ids = [];
for (const key in monitorIndex) {
monitor_ids[monitor_ids.length] = key;
}
post('?view=snapshot', {action: 'create', 'monitor_ids[]': monitor_ids});
/*
* Alternate implementation using the API
server = new Server(Servers[serverId]);
$j.ajax({
method: 'POST',
url: server.UrlToApi()+'/snapshots.json' + (auth_relay ? '?' + auth_relay : ''),
data: { 'monitor_ids[]': monitorIndex.keys()},
success: function(response) {
console.log(response);
}
});
window.location = '?view=snapshot&action=create&'+monitor_ids.join('&');
//console.log(monitor_ids);
//window.location = '?view=snapshot&action=create&'+monitor_ids.join('&');
*/
}
window.addEventListener("resize", redrawScreen, {passive: true});