diff --git a/main.go b/main.go
index 05e00a1..a6dd4d2 100644
--- a/main.go
+++ b/main.go
@@ -17,6 +17,7 @@ import (
"strconv"
"strings"
"sync"
+ "syscall"
"time"
"github.com/shirou/gopsutil/v3/cpu"
@@ -710,13 +711,24 @@ var page = template.Must(template.New("index").Parse(`
+
Host
+
+
+
+
+
+
+
+
Aktionen
+
+
+
+
+
+
OS
@@ -885,6 +897,29 @@ document.addEventListener('DOMContentLoaded', ()=>{
renderApps(filtered);
});
}
+
+ const btnGp = document.getElementById('btnGpupdate');
+ const resGp = document.getElementById('gpupdateResult');
+ if (btnGp && resGp) {
+ btnGp.addEventListener('click', async ()=>{
+ resGp.textContent = 'gpupdate /force wird gestartet …';
+ try {
+ const r = await fetch('/api/gpupdate', { method: 'POST' });
+ if (!r.ok) {
+ resGp.textContent = 'Fehler: HTTP ' + r.status + ' ' + r.statusText;
+ return;
+ }
+ const j = await r.json();
+ if (j.ok) {
+ resGp.textContent = 'gpupdate /force ausgeführt (ExitCode ' + (j.exit_code ?? 0) + ').';
+ } else {
+ resGp.textContent = 'Fehler bei gpupdate (ExitCode ' + (j.exit_code ?? -1) + '): ' + (j.error || '');
+ }
+ } catch (e) {
+ resGp.textContent = 'Request-Fehler: ' + e;
+ }
+ });
+ }
});