* generate model from openAPI schema * implement replica status #231 * Sync "Pause service blocking schedule" #234 * Sync "Safe Search Provider" #200
76 lines
3.0 KiB
HTML
76 lines
3.0 KiB
HTML
<html lang="en">
|
|
<head>
|
|
<title>AdGuardHome sync</title>
|
|
<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js">
|
|
</script>
|
|
{{- if .DarkMode }}
|
|
<link rel="stylesheet" href="https://bootswatch.com/5/darkly/bootstrap.min.css"
|
|
crossorigin="anonymous">
|
|
{{- else }}
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet"
|
|
integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We"
|
|
crossOrigin="anonymous">
|
|
{{- end }}
|
|
<script type="text/javascript">
|
|
$(document).ready(function () {
|
|
$("#showLogs").click(function () {
|
|
$.get("api/v1/logs", {}, function (data) {
|
|
$('#logs').html(data);
|
|
}
|
|
);
|
|
$.get("api/v1/status", {}, function (status) {
|
|
$('#origin').removeClass(function (index, className) {
|
|
return (className.match(/(^|\s)btn-\S+/g) || []).join(' ');
|
|
}).addClass("btn-" + status.origin.status);
|
|
status.replicas.forEach(function (replica, i) {
|
|
$('#replica_' + i).removeClass(function (index, className) {
|
|
return (className.match(/(^|\s)btn-\S+/g) || []).join(' ');
|
|
}).addClass("btn-" + replica.status);
|
|
});
|
|
}
|
|
);
|
|
});
|
|
$("#sync").click(function () {
|
|
$.post("api/v1/sync", {}, function (data) {
|
|
});
|
|
$("#showLogs").click();
|
|
});
|
|
$("#showLogs").click();
|
|
});
|
|
</script>
|
|
<link rel="shortcut icon" href="favicon.ico">
|
|
</head>
|
|
<body>
|
|
<div class="container-fluid px-4">
|
|
<div class="row">
|
|
<p class="h1">
|
|
AdGuardHome sync
|
|
<p class="h6">{{ .Version }} ({{ .Build }})</p>
|
|
</p>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col">
|
|
<div class="btn-group" role="group">
|
|
<input class="btn btn-success" type="button" id="sync" value="Synchronize"/>
|
|
<input class="btn btn-secondary" type="button" id="showLogs" value="Update Logs"/>
|
|
</div>
|
|
</div>
|
|
<div class="col col-md-auto">
|
|
<div class="float-right">
|
|
<input class="btn btn-{{ .SyncStatus.Origin.Status }}" type="button" id="origin"
|
|
value="Origin {{ .SyncStatus.Origin.Host }}"/>
|
|
{{ range $i, $r := .SyncStatus.Replicas }}
|
|
<input class="btn btn-{{ $r.Status }}" type="button" id="replica_{{ $i }}" value="Replica {{ $r.Host }}"
|
|
{{ if $r.Error }} title="{{ $r.Error }}" {{ end }}/>
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row mt-3">
|
|
<div class="col-12">
|
|
<pre class="p-3 border"><code id="logs"></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |