Use post() to go to create snapshot
parent
a6b3b18a6e
commit
23b94987e7
|
@ -1133,10 +1133,26 @@ function initPage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function takeSnapshot() {
|
function takeSnapshot() {
|
||||||
monitor_ids = Array.from(monitorIndex.keys()).map((id)=>{
|
monitor_ids = [];
|
||||||
return 'monitor_ids[]='+id;
|
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});
|
window.addEventListener("resize", redrawScreen, {passive: true});
|
||||||
|
|
Loading…
Reference in New Issue