Загрузку завез
This commit is contained in:
parent
7ef5621d84
commit
f316d7ac8b
@ -11,12 +11,51 @@
|
||||
<link rel="stylesheet" href="{% static 'js/ol/ol-ext/ol-layer-theme.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
<link rel="stylesheet" href="{% static 'lte/plugins/vis/vis.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/main_page.css' %}?ver={% settings_value 'APP_VER' %}">
|
||||
<style>
|
||||
.loading {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
border: 5px solid rgba(81, 81, 81, 0.2);
|
||||
border-top: 5px solid rgba(0, 123, 255, 0.8);
|
||||
z-index: 1999;
|
||||
}
|
||||
|
||||
.loader-wrapper {
|
||||
position: absolute;
|
||||
background-color: rgba(135, 135, 135, 0.5);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1998;
|
||||
}
|
||||
|
||||
@keyframes rotate {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.loading {
|
||||
animation: rotate 1s linear infinite;
|
||||
}
|
||||
</style>
|
||||
{% endblock header_link %}
|
||||
|
||||
{% block content %}
|
||||
<section class="content text-sm p-1">
|
||||
{% csrf_token %}
|
||||
<div class="map-container">
|
||||
|
||||
<div class="loader-wrapper d-none">
|
||||
<div class="loading"></div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between bg-white p-2 flex-wrap rounded-top wrap-low-gap">
|
||||
<div class="d-flex gap-1">
|
||||
<button type="button" id="toStart" class="btn btn-return">
|
||||
@ -118,7 +157,11 @@
|
||||
<script>
|
||||
let globalTimeQuery = ""
|
||||
let prevTimeQuery = undefined
|
||||
let loading = false
|
||||
|
||||
document.addEventListener("DOMContentLoaded", async () => {
|
||||
const loaderWrapper = document.querySelector(".loader-wrapper")
|
||||
|
||||
// Инициализация карты
|
||||
const mapCore = new MapCore('map', {
|
||||
center: ['{{lon}}', '{{lat}}'],
|
||||
@ -211,8 +254,12 @@
|
||||
})
|
||||
|
||||
async function updateMarkers() {
|
||||
if ( globalTimeQuery !== "" &&prevTimeQuery === globalTimeQuery) return
|
||||
|
||||
if (globalTimeQuery !== "" && prevTimeQuery === globalTimeQuery) return
|
||||
if (globalTimeQuery !== "") {
|
||||
loading = true
|
||||
console.log(loaderWrapper)
|
||||
loaderWrapper.classList.toggle("d-none")
|
||||
}
|
||||
const gtoData = await fetch('/gto/update_object/' + globalTimeQuery).then(r => r.json());
|
||||
const currentGtoIds = new Set(gtoData.map(item => item.id));
|
||||
const staleGtoMarkers = Object.values(gtoManager.markers).filter(
|
||||
@ -276,6 +323,11 @@
|
||||
});
|
||||
|
||||
prevTimeQuery = globalTimeQuery
|
||||
if (loading) {
|
||||
loading = false
|
||||
loaderWrapper.classList.toggle("d-none")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let isUpdating
|
||||
|
||||
@ -42,7 +42,7 @@ INSTALLED_APPS = [
|
||||
"""Информация о приложении """
|
||||
SITE_TITLE = "Многофункциональная система безопасности ОГР"
|
||||
SITE_TITLE_S = "МФСБ ОГР"
|
||||
APP_VER = "1.0.17.3"
|
||||
APP_VER = "1.0.17.4"
|
||||
APP_VEK = "2023 - 2025гг"
|
||||
APP_COPPIRIGHT = "Многофункциональная система безопасности ОГР"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user