60 lines
1.8 KiB
HTML
60 lines
1.8 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />
|
|
|
|
<title> App Status </title>
|
|
|
|
<!-- bootstrap -->
|
|
<link href="3rdparty/css/bootstrap.min.css" rel="stylesheet" media="screen">
|
|
<link href="3rdparty/css/bootstrap-theme.min.css" rel="stylesheet" media="screen">
|
|
|
|
<!-- application stylesheets -->
|
|
<link href="css/index.css" rel="stylesheet" media="screen">
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="span12 text-center">
|
|
<h2><span id="appstatus"> Getting application status ... </span></h2>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
var subdomain = window.location.host.substr(0, window.location.host.indexOf('.'));
|
|
var BOX = window.location.host.substr(subdomain.length + 1);
|
|
|
|
function refresh() {
|
|
var ajax = new XMLHttpRequest();
|
|
|
|
var statusDiv = document.getElementById('appstatus');
|
|
|
|
ajax.onreadystatechange = function() {
|
|
if (ajax.readyState == 4) {
|
|
if (ajax.status == 200) {
|
|
var response = JSON.parse(ajax.responseText);
|
|
statusDiv.innerHTML = response.installationState;
|
|
if (response.runState === 'running') {
|
|
window.location.reload();
|
|
}
|
|
} else {
|
|
statusDiv.innerHTML = 'Error getting status';
|
|
}
|
|
setTimeout(refresh, 1000);
|
|
}
|
|
};
|
|
|
|
ajax.open('GET', 'https://admin.' + BOX + '/api/v1/subdomains/' + subdomain, true);
|
|
ajax.send();
|
|
}
|
|
|
|
refresh();
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|