Files
gott/wwwroot/js/title.js
T
Meleki 5d090e160b feat: Windows-Kompatibilität
- WorkspaceHelper: Zentrale Hilfsmethoden (IsWindows, TempDir, IsSubPathOf,
  GetRelativePath, ShellExecutable, ShellArguments)
- ToolService: execute nutzt cmd.exe auf Windows, GetRelativePath mit
  Forward-Slashes, IsSubPathOf für case-insensitive Pfadprüfung
- SessionEndpoint: /tmp → Path.GetTempPath(), bash → cmd.exe,
  Fire-and-forget via .bat statt systemd-run auf Windows
- ChatService: /tmp → WorkspaceHelper.TempDir
- MemoryService: IsSubPathOf + GetRelativePath
- WorkspaceEndpoint: HandleBrowse zeigt Laufwerke auf Windows,
  IsSubPathOf statt StartsWith
- InfoEndpoint: gott.exe auf Windows, isWindows-Flag in API-Response
- Frontend: File-Explorer mit Laufwerks-Navigation auf Windows
2026-03-09 11:35:04 +01:00

21 lines
771 B
JavaScript

let buildTime = 0;
let serverIsWindows = false;
fetch('/api/info').then(r => r.json()).then(data => {
buildTime = data.buildTime || 0;
serverIsWindows = !!data.isWindows;
updateTitle();
setInterval(updateTitle, 1000);
});
function updateTitle() {
if (!buildTime) { document.title = '// gott'; return; }
const s = Math.floor(Date.now() / 1000) - buildTime;
let ago;
if (s < 60) ago = `${s} Sekunde${s !== 1 ? 'n' : ''}`;
else if (s < 3600) { const m = Math.floor(s / 60); ago = `${m} Minute${m !== 1 ? 'n' : ''}`; }
else if (s < 86400) { const h = Math.floor(s / 3600); ago = `${h} Stunde${h !== 1 ? 'n' : ''}`; }
else { const d = Math.floor(s / 86400); ago = `${d} Tag${d !== 1 ? 'en' : ''}`; }
document.title = `// gott :: Build vor ${ago}`;
}