Einfache Statusseite. (Noch nicht ausliefern, Infos kommen noch)
This commit is contained in:
@@ -1,9 +1,97 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" >
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title></title>
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>BeWo – Serverstatus</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
padding: 2rem;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.ok {
|
||||
color: green;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.err {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
td, th {
|
||||
border: 1px solid #ccc;
|
||||
padding: 8px 12px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
th {
|
||||
background: #eee;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>BeWo Serverstatus</h1>
|
||||
<p>Tenant: <span id="tenant">–</span></p>
|
||||
<p>Serverzeit: <span id="time">–</span></p>
|
||||
<p>Version: <span id="version">–</span></p>
|
||||
<p>Datenbank: <span id="db">–</span></p>
|
||||
|
||||
<h2>Services</h2>
|
||||
<table>
|
||||
<thead><tr><th>Service</th><th>Status</th><th>Meldung</th></tr></thead>
|
||||
<tbody id="services"></tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
function getTenant() {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
return params.get('Tenant') || '';
|
||||
}
|
||||
|
||||
async function load() {
|
||||
const tenant = getTenant();
|
||||
const url = tenant
|
||||
? `StatusService.svc/Status?Tenant=${encodeURIComponent(tenant)}`
|
||||
: 'StatusService.svc/Status';
|
||||
|
||||
const res = await fetch(url);
|
||||
const data = await res.json();
|
||||
|
||||
document.getElementById('tenant').textContent = data.Tenant || '–';
|
||||
document.getElementById('time').textContent = data.ServerTime;
|
||||
document.getElementById('version').textContent = data.Version;
|
||||
|
||||
const db = document.getElementById('db');
|
||||
db.textContent = data.DatabaseOk ? '✔ OK' : '✘ Fehler';
|
||||
db.className = data.DatabaseOk ? 'ok' : 'err';
|
||||
|
||||
const tbody = document.getElementById('services');
|
||||
tbody.innerHTML = '';
|
||||
for (const svc of data.Services) {
|
||||
const cls = svc.IsOk ? 'ok' : 'err';
|
||||
tbody.innerHTML += `
|
||||
<tr>
|
||||
<td>${svc.Name}</td>
|
||||
<td class="${cls}">${svc.IsOk ? '✔ OK' : '✘ Fehler'}</td>
|
||||
<td>${svc.Message}</td>
|
||||
</tr>`;
|
||||
}
|
||||
}
|
||||
|
||||
load();
|
||||
setInterval(load, 30000); // alle 30 Sek. aktualisieren</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
Reference in New Issue
Block a user