Wiki-Quellcode von Servermeldungen (SaaS)
Version 2.1 von fweise am 24.06.2024
Zeige letzte Bearbeiter
author | version | line-number | content |
---|---|---|---|
1 | = Erreichbarkeit und Wartung der Services = | ||
2 | |||
3 | Hier finden unsere SaaS-Kunden und Benutzer eine dynamische Anzeige der Uptime der Services und die geplanten Wartungsintervalle. | ||
4 | |||
5 | {{html}} | ||
6 | <style> | ||
7 | .status-up { | ||
8 | color: rgb(3, 133, 3); /* Green text color for "UP" status */ | ||
9 | } | ||
10 | .status-down { | ||
11 | color: rgb(187, 9, 9); /* Red text color for "DOWN" status */ | ||
12 | } | ||
13 | .status-maintenance { | ||
14 | color: gold; /* Gold text color for "Under Maintenance" status */ | ||
15 | } | ||
16 | |||
17 | </style> | ||
18 | <!-- Servers Status --> | ||
19 | <div> | ||
20 | <h2>Überblick Status</h2> | ||
21 | |||
22 | <h3>Primärsysteme</h3> | ||
23 | <ul class="productive-systems-list ikiss-unordered-list"></ul> | ||
24 | |||
25 | <h3>Sekundärsysteme</h3> | ||
26 | <ul class="customer-systems-list ikiss-unordered-list"></ul> | ||
27 | </div> | ||
28 | <!-- System Update --> | ||
29 | <div> | ||
30 | <h2>System-Updates</h2> | ||
31 | <p> | ||
32 | Updates des Antragsmanagement 4.0 werden grundsätzlich Montags zwischen 02:00 Uhr und 03:00 Uhr eingespielt. | ||
33 | </p> | ||
34 | <h3>Nächster Updatetermin</h3> | ||
35 | <div> | ||
36 | <ul> | ||
37 | <li><strong><span id="plannedUpdate"></span></strong></li> | ||
38 | </ul> | ||
39 | </div> | ||
40 | </div> | ||
41 | <!-- System Maintenance --> | ||
42 | <div> | ||
43 | <h2>System-Wartung</h2> | ||
44 | <p> | ||
45 | Wartungen an unserem System finden regelmäßig am letzten Donnerstag eines Monats zwischen 22:00 Uhr und 24:00 Uhr statt. | ||
46 | </p> | ||
47 | <h3>Nächster Wartungstermin</h3> | ||
48 | <div> | ||
49 | <ul> | ||
50 | <li><strong><span id="plannedMaintenance"></span></strong></li> | ||
51 | </ul> | ||
52 | </div> | ||
53 | </div> | ||
54 | |||
55 | <script type="text/javascript"> | ||
56 | // Function to fetch data from api-status.php and update the HTML | ||
57 | function fetchData() { | ||
58 | fetch('api-status.php') | ||
59 | .then(response => response.json()) | ||
60 | .then(data => { | ||
61 | const productiveSystemsList = document.querySelector('.productive-systems-list'); | ||
62 | const customerSystemsList = document.querySelector('.customer-systems-list'); | ||
63 | |||
64 | data.hostStatus.forEach(host => { | ||
65 | const listItem = document.createElement('li'); | ||
66 | listItem.innerHTML = `<span class="host-name">${host.host}:</span> <span class="status-${getStatusColor(host.status)}"><strong>${getStatusText(host.status)}</strong></span>`; | ||
67 | |||
68 | if (host.host === "pdf.form-solutions.net" || host.host === "onlinedienste.form-solutions.de") { | ||
69 | productiveSystemsList.appendChild(listItem); | ||
70 | } else { | ||
71 | customerSystemsList.appendChild(listItem); | ||
72 | } | ||
73 | }); | ||
74 | |||
75 | // Update Next Planned Update Date | ||
76 | const plannedUpdate = document.getElementById('plannedUpdate'); | ||
77 | plannedUpdate.textContent = data.plannedUpdate; | ||
78 | // Update Next Planned Maintenance Date | ||
79 | const plannedMaintenance = document.getElementById('plannedMaintenance'); | ||
80 | plannedMaintenance.textContent = data.plannedMaintenance; | ||
81 | }) | ||
82 | .catch(error => { | ||
83 | console.error('Error fetching data:', error); | ||
84 | }); | ||
85 | } | ||
86 | |||
87 | // Function to get the appropriate status color class | ||
88 | function getStatusText(status) { | ||
89 | switch (status) { | ||
90 | case 'Up': | ||
91 | return 'Verfügbar'; | ||
92 | case 'Down': | ||
93 | return 'Beeinträchtigung'; | ||
94 | case 'Under Maintenance': | ||
95 | return 'Wartung'; | ||
96 | default: | ||
97 | return ''; | ||
98 | } | ||
99 | } | ||
100 | |||
101 | // Function to get the appropriate status color class | ||
102 | function getStatusColor(status) { | ||
103 | switch (status) { | ||
104 | case 'Up': | ||
105 | return 'up'; | ||
106 | case 'Down': | ||
107 | return 'down'; | ||
108 | case 'Under Maintenance': | ||
109 | return 'maintenance'; | ||
110 | default: | ||
111 | return ''; | ||
112 | } | ||
113 | } | ||
114 | |||
115 | // Call fetchData when the page loads | ||
116 | window.addEventListener('load', fetchData); | ||
117 | </script> | ||
118 | {{/html}} | ||
119 | |||
120 | |||
121 |