dorfylegends/backend/templates/loading.html

30 lines
753 B
HTML
Raw Permalink Normal View History

2022-04-26 22:00:09 +03:00
{{template "layout.html" .}}
{{define "title"}}Loading{{end}}
{{define "content"}}
<h1>Loading...</h1>
<p id="msg">{{ .Msg }}</p>
<div class="progress">
<div id="progress" class="progress-bar" role="progressbar" style="width: {{ .Progress }}%" aria-valuenow="25" aria-valuemin="0"
aria-valuemax="100">
</div>
</div>
<script>
setInterval(() => {
$.ajax({
2022-05-09 18:20:31 +03:00
url: "./load/progress",
2022-04-26 22:00:09 +03:00
context: document.body,
success: function (data) {
$("#msg").text(data.msg);
$("#progress").css("width", data.progress + "%");
if (data.done) {
location.reload();
}
}
})
}, 300);
</script>
{{- end }}