|
|
@ -93,6 +93,7 @@ function togglemenu() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function about(c) { |
|
|
|
function about(c) { |
|
|
|
|
|
|
|
$("#imagetools").hide(); |
|
|
|
$.ajax({url: "about.php", success: function(res) { |
|
|
|
$.ajax({url: "about.php", success: function(res) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
var a = JSON.parse(res); |
|
|
|
var a = JSON.parse(res); |
|
|
@ -110,7 +111,58 @@ function about(c) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var zoomlevel = 0; |
|
|
|
|
|
|
|
function zoom(incr = 0) { |
|
|
|
|
|
|
|
zoomlevel = (zoomlevel+incr)%2; |
|
|
|
|
|
|
|
switch (zoomlevel) { |
|
|
|
|
|
|
|
case 0: { |
|
|
|
|
|
|
|
$("#main svg").css("width", "auto"); |
|
|
|
|
|
|
|
$("#main svg").css("height", "auto"); |
|
|
|
|
|
|
|
$("#main svg").css("max-width", "100%"); |
|
|
|
|
|
|
|
$("#main svg").css("max-height", "100%"); |
|
|
|
|
|
|
|
} break; |
|
|
|
|
|
|
|
case 1: { |
|
|
|
|
|
|
|
$("#main svg").css("width", "100%"); |
|
|
|
|
|
|
|
$("#main svg").css("height", "auto"); |
|
|
|
|
|
|
|
$("#main svg").css("max-width", "100%"); |
|
|
|
|
|
|
|
$("#main svg").css("max-height", "none"); |
|
|
|
|
|
|
|
} break; |
|
|
|
|
|
|
|
case 2: { |
|
|
|
|
|
|
|
$("#main.svg").css("width", "auto"); |
|
|
|
|
|
|
|
$("#main.svg").css("height", "100%"); |
|
|
|
|
|
|
|
$("#main.svg").css("max-width", "none"); |
|
|
|
|
|
|
|
$("#main.svg").css("max-height", "100%"); |
|
|
|
|
|
|
|
} break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var viz = null; |
|
|
|
|
|
|
|
var rankdir = "LR"; |
|
|
|
|
|
|
|
function rotateviz() { |
|
|
|
|
|
|
|
if (!viz) return; |
|
|
|
|
|
|
|
if (rankdir == "LR") |
|
|
|
|
|
|
|
rankdir = "TB"; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
rankdir = "LR"; |
|
|
|
|
|
|
|
showviz(viz); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function showviz(vizpath) { |
|
|
|
|
|
|
|
$("#imagetools").show(); |
|
|
|
|
|
|
|
viz = vizpath; |
|
|
|
|
|
|
|
res = "digraph {\n"+" rankdir="+rankdir+";\n"+viz+"\n}"; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
zoomlevel = 0; |
|
|
|
|
|
|
|
status(Viz(res)); |
|
|
|
|
|
|
|
} catch(e) { |
|
|
|
|
|
|
|
(res = res.split("\n")).forEach(function(v, i, a) { |
|
|
|
|
|
|
|
a[i] = ("000"+(i+1)).slice(-3)+": "+v; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
status("<h2>Exception Caught:</h2><p>"+e+"<p><pre>"+res.join("\n")+"</pre>"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function details(c) { |
|
|
|
function details(c) { |
|
|
|
|
|
|
|
$("#imagetools").hide(); |
|
|
|
$.ajax({url: "details.php?container="+c, success: function(res) { |
|
|
|
$.ajax({url: "details.php?container="+c, success: function(res) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
status(res); |
|
|
|
status(res); |
|
|
@ -124,6 +176,7 @@ function details(c) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function action(container, action) { |
|
|
|
function action(container, action) { |
|
|
|
|
|
|
|
$("#imagetools").hide(); |
|
|
|
$.ajax({url: "action.php?container="+container+"&action="+action, success: function(res) { |
|
|
|
$.ajax({url: "action.php?container="+container+"&action="+action, success: function(res) { |
|
|
|
success(res); |
|
|
|
success(res); |
|
|
|
manage(); |
|
|
|
manage(); |
|
|
@ -134,6 +187,7 @@ function action(container, action) { |
|
|
|
|
|
|
|
|
|
|
|
/** Manage Docker Services */ |
|
|
|
/** Manage Docker Services */ |
|
|
|
function manage() { |
|
|
|
function manage() { |
|
|
|
|
|
|
|
$("#imagetools").hide(); |
|
|
|
$.ajax({url: "manage.php", success: function(res) { |
|
|
|
$.ajax({url: "manage.php", success: function(res) { |
|
|
|
status(res); |
|
|
|
status(res); |
|
|
|
}}).fail(function() { |
|
|
|
}}).fail(function() { |
|
|
@ -143,9 +197,10 @@ function manage() { |
|
|
|
|
|
|
|
|
|
|
|
/** Show an Overview of all Docker Services */ |
|
|
|
/** Show an Overview of all Docker Services */ |
|
|
|
function overview() { |
|
|
|
function overview() { |
|
|
|
|
|
|
|
$("#imagetools").hide(); |
|
|
|
$.ajax({url: "overview.php", success: function(res) { |
|
|
|
$.ajax({url: "overview.php", success: function(res) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
status(Viz(res)); |
|
|
|
showviz(res); |
|
|
|
} catch(e) { |
|
|
|
} catch(e) { |
|
|
|
(res = res.split("\n")).forEach(function(v, i, a) { |
|
|
|
(res = res.split("\n")).forEach(function(v, i, a) { |
|
|
|
a[i] = ("000"+(i+1)).slice(-3)+": "+v; |
|
|
|
a[i] = ("000"+(i+1)).slice(-3)+": "+v; |
|
|
@ -159,10 +214,10 @@ function overview() { |
|
|
|
|
|
|
|
|
|
|
|
/** Show an Overview of all Docker Images */ |
|
|
|
/** Show an Overview of all Docker Images */ |
|
|
|
function imgs() { |
|
|
|
function imgs() { |
|
|
|
|
|
|
|
$("#imagetools").hide(); |
|
|
|
$.ajax({url: "images.php", success: function(res) { |
|
|
|
$.ajax({url: "images.php", success: function(res) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
status(Viz(res)); |
|
|
|
showviz(res); |
|
|
|
//status(res);
|
|
|
|
|
|
|
|
} catch(e) { |
|
|
|
} catch(e) { |
|
|
|
(res = res.split("\n")).forEach(function(v, i, a) { |
|
|
|
(res = res.split("\n")).forEach(function(v, i, a) { |
|
|
|
a[i] = ("000"+(i+1)).slice(-3)+": "+v; |
|
|
|
a[i] = ("000"+(i+1)).slice(-3)+": "+v; |
|
|
@ -177,6 +232,7 @@ function imgs() { |
|
|
|
/// Initial Function: Startup
|
|
|
|
/// Initial Function: Startup
|
|
|
|
/** Decide whether to login or to create a new user */ |
|
|
|
/** Decide whether to login or to create a new user */ |
|
|
|
function start() { |
|
|
|
function start() { |
|
|
|
|
|
|
|
$("#imagetools").hide(); |
|
|
|
$("#menu").hide(); |
|
|
|
$("#menu").hide(); |
|
|
|
$("#username").html(window.location.hostname) |
|
|
|
$("#username").html(window.location.hostname) |
|
|
|
try { |
|
|
|
try { |
|
|
|