Додан моніторінг застосунку
Додани веб компоненти карточок територій та повідомлень
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
let map_card;
|
||||
let map_card, Territory_reconnecting;
|
||||
|
||||
const Territory_card = {
|
||||
// Глобальні змінні стану
|
||||
@@ -131,12 +131,12 @@ const Territory_card = {
|
||||
data: apt
|
||||
};
|
||||
|
||||
if (Cloud.socket?.readyState === WebSocket.OPEN) {
|
||||
if (navigator.onLine && Cloud.socket?.readyState === WebSocket.OPEN) {
|
||||
Cloud.socket.send(JSON.stringify(message));
|
||||
} else {
|
||||
if (confirm("З'єднання розірвано! Перепідключитись?")) {
|
||||
Territory_card.getEntrances({ update: true });
|
||||
Cloud.start();
|
||||
Territory_card.getEntrances({ update: true });
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -178,11 +178,10 @@ const Territory_card = {
|
||||
data: apt
|
||||
};
|
||||
|
||||
if (Cloud.socket?.readyState === WebSocket.OPEN) {
|
||||
if (navigator.onLine && Cloud.socket?.readyState === WebSocket.OPEN) {
|
||||
Cloud.socket.send(JSON.stringify(message));
|
||||
} else {
|
||||
if (confirm("З'єднання розірвано! Перепідключитись?")) {
|
||||
Territory_card.getEntrances({ update: true });
|
||||
Territory_card.cloud.start();
|
||||
}
|
||||
}
|
||||
@@ -230,9 +229,9 @@ const Territory_card = {
|
||||
const details = document.createElement('details');
|
||||
if (show === "open") details.setAttribute('open', '');
|
||||
details.innerHTML = `
|
||||
<summary><p>${title}</p>${icon}</summary>
|
||||
<div id="apartments_${id}" class="apartments_list"></div>
|
||||
`;
|
||||
<summary><p>${title}</p>${icon}</summary>
|
||||
<div id="apartments_${id}" class="apartments_list"></div>
|
||||
`;
|
||||
fragment.appendChild(details);
|
||||
|
||||
this.getApartment({ id, number: entrance_number, update: false });
|
||||
@@ -487,6 +486,10 @@ const Territory_card = {
|
||||
},
|
||||
},
|
||||
|
||||
async reload(){
|
||||
Territory_card.getEntrances({ update: true });
|
||||
},
|
||||
|
||||
// Сортування
|
||||
sort(mode, load) {
|
||||
const idx = Math.max(1, Math.min(4, Number(mode) || 1));
|
||||
|
||||
Reference in New Issue
Block a user