Änderungen von Dokument Servermeldungen (SaaS)

Zuletzt geändert von MACH ProForms GmbH am 22.07.2024

Von Version 9.1
bearbeitet von MACH ProForms GmbH
am 16.07.2024
Änderungskommentar: Es gibt keinen Kommentar für diese Version
Auf Version 11.1
bearbeitet von MACH ProForms GmbH
am 16.07.2024
Änderungskommentar: Es gibt keinen Kommentar für diese Version

Zusammenfassung

Details

Seiteneigenschaften
Inhalt
... ... @@ -8,28 +8,28 @@
8 8  )))
9 9  
10 10  {{html}}
11 - <style>
12 - .status-up {
13 - color: rgb(3, 133, 3); /* Green text color for "UP" status */
14 - }
15 - .status-down {
16 - color: rgb(187, 9, 9); /* Red text color for "DOWN" status */
17 - }
18 - .status-maintenance {
19 - color: gold; /* Gold text color for "Under Maintenance" status */
20 - }
21 -
22 - </style>
11 +<style>
12 + .status-up {
13 + color: rgb(3, 133, 3); /* Green text color for "UP" status */
14 + }
15 + .status-down {
16 + color: rgb(187, 9, 9); /* Red text color for "DOWN" status */
17 + }
18 + .status-maintenance {
19 + color: gold; /* Gold text color for "Under Maintenance" status */
20 + }
21 +</style>
23 23  <!-- Servers Status -->
24 24  <div>
25 25   <h2>&Uuml;berblick Status</h2>
26 26  
27 - <h3>Prim&auml;rsysteme</h3>
28 - <ul class="productive-systems-list ikiss-unordered-list"></ul>
26 + <h3>Prim&auml;rsysteme</h3>
27 + <ul class="productive-systems-list ikiss-unordered-list"></ul>
29 29  
30 - <h3>Sekund&auml;rsysteme</h3>
31 - <ul class="customer-systems-list ikiss-unordered-list"></ul>
29 + <h3>Sekund&auml;rsysteme</h3>
30 + <ul class="customer-systems-list ikiss-unordered-list"></ul>
32 32  </div>
32 +
33 33  <!-- System Update -->
34 34  <div>
35 35   <h2>System-Updates</h2>
... ... @@ -43,6 +43,7 @@
43 43   </ul>
44 44   </div>
45 45  </div>
46 +
46 46  <!-- System Maintenance -->
47 47  <div>
48 48   <h2>System-Wartung</h2>
... ... @@ -51,9 +51,9 @@
51 51   </p>
52 52   <h3>Nächster Wartungstermin</h3>
53 53   <div>
54 - <ul>
55 - <li><strong><span id="plannedMaintenance"></span></strong></li>
56 - </ul>
55 + <ul>
56 + <li><strong><span id="plannedMaintenance"></span></strong></li>
57 + </ul>
57 57   </div>
58 58  </div>
59 59  
... ... @@ -60,13 +60,22 @@
60 60  <script type="text/javascript">
61 61   function fetchData() {
62 62   fetch('https://mpf-serversstatus.azurewebsites.net/api/http_serversstatus_trigger')
63 - .then(response => response.json())
64 + .then(response => {
65 + if (!response.ok) {
66 + throw new Error('Network response was not ok ' + response.statusText);
67 + }
68 + return response.json();
69 + })
64 64   .then(data => {
71 + console.log('Data fetched successfully:', data); // Log the fetched data
72 +
65 65   const productiveSystemsList = document.querySelector('.productive-systems-list');
66 66   const customerSystemsList = document.querySelector('.customer-systems-list');
75 +
67 67   data.hostStatus.forEach(host => {
68 68   const listItem = document.createElement('li');
69 69   listItem.innerHTML = `<span class="host-name">${host.host}:</span> <span class="status-${getStatusColor(host.status)}"><strong>${getStatusText(host.status)}</strong></span>`;
79 +
70 70   if (host.host === "pdf.form-solutions.net" || host.host === "onlinedienste.form-solutions.de") {
71 71   productiveSystemsList.appendChild(listItem);
72 72   } else {
... ... @@ -73,23 +73,25 @@
73 73   customerSystemsList.appendChild(listItem);
74 74   }
75 75   });
86 +
76 76   const plannedUpdate = document.getElementById('plannedUpdate');
77 77   plannedUpdate.textContent = data.plannedUpdate;
89 +
78 78   const plannedMaintenance = document.getElementById('plannedMaintenance');
79 79   plannedMaintenance.textContent = data.plannedMaintenance;
80 80   })
81 81   .catch(error => {
82 - console.error('Error fetching data:', error);
94 + console.error('Error fetching data:', error); // Improved error logging
83 83   });
84 84   }
85 85  
86 - // Function to get the appropriate status color class
98 + // Function to get the appropriate status text
87 87   function getStatusText(status) {
88 88   switch (status) {
89 89   case 'Up':
90 90   return 'Verfügbar';
91 91   case 'Down':
92 - return 'Beeintr&auml;chtigung';
104 + return 'Beeinträchtigung';
93 93   case 'Under Maintenance':
94 94   return 'Wartung';
95 95   default: