Files
pgadmin4/runtime/src/html/view_log.html

50 lines
1.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>pgAdmin 4 Log</title>
<link rel="stylesheet" href="../css/pgadmin-desktop.css"/>
<style>
body, html {
font-size: 14px;
background-color: #ebeef3;
}
@media screen and (forced-colors: active) {
body {
forced-color-adjust: none !important;
}
}
</style>
</head>
<body>
<div class="card shadow-sm">
<div class="card-body">
<label id="server_log_label">Server Log: </label>
<textarea id="server_log" style="min-width: 750px; min-height: 300px;resize: none;" readonly></textarea>
</div>
<div class="p-2 d-flex fixed-bottom shadow bg-white">
<div class="mr-auto" id="status-text"></div>
<div class="ml-auto">
<button id="btnReload" class="btn btn-primary">Reload</button>
</div>
</div>
</div>
<script>
window.onload = async function() {
document.getElementById('status-text').innerHTML = '';
document.getElementById('server_log_label').innerHTML = 'Server Log: ' + '(' + await window.electronUI.getServerLogFile() + ')';
document.getElementById('server_log').innerHTML = await window.electronUI.readServerLog();
document.getElementById('btnReload').addEventListener('click', function() {
document.getElementById('server_log').innerHTML = 'Loading logs...';
setTimeout(async function() {
document.getElementById('server_log').innerHTML = await window.electronUI.readServerLog();
}, 500);
document.getElementById('status-text').innerHTML = 'Logs reloaded successfully';
});
}
</script>
</body>
</html>