Skip to content

Commit

Permalink
add loader
Browse files Browse the repository at this point in the history
  • Loading branch information
vol4tim committed Dec 24, 2024
1 parent 46edc3e commit bda2195
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/components/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:canHistory="historyready"
@history="historyhandler"
:measuretype="measuretype"
:isLoad="isLoad"
>

<button
Expand Down Expand Up @@ -36,7 +37,7 @@ import { getTypeProvider } from "../utils/utils";
export default {
emits: ["city", "clickMarker", "close"],
props: ["measuretype", "historyready", "historyhandler"],
props: ["measuretype", "historyready", "historyhandler", "isLoad"],
components: { Footer },
data() {
return {
Expand Down
10 changes: 3 additions & 7 deletions src/components/footer/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@
</div>
<button class="popovercontrol" :class="bookmarks && bookmarks.length > 0 ? 'active' : null" popovertarget="bookmarks"><font-awesome-icon icon="fa-solid fa-bookmark" /></button>

<input
type="date"
v-model="start"
:max="maxDate"
:disabled="currentProvider == 'realtime'"
/>
<input type="date" v-model="start" :max="maxDate" :disabled="currentProvider == 'realtime'" />

<Measures :current="measuretype.toLowerCase()" />
<div v-if="isLoad">{{ $t("isLoad") }}</div>
</div>

<div class="flexline">
Expand Down Expand Up @@ -58,7 +54,7 @@ import Bookmarks from "../../components/Bookmarks.vue";
export default {
emits: ["history"],
props: ["currentProvider", "canHistory", "measuretype"],
props: ["currentProvider", "canHistory", "measuretype", "isLoad"],
components: { HistoryImport, Measures, Bookmarks },
data() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/sensor/SensorPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</section>

<section>
<div v-if="isLoad">Load...</div>
<div v-if="isLoad">{{ $t("isLoad") }}</div>
<Chart v-else :point="point" :log="log" />
</section>

Expand Down
2 changes: 2 additions & 0 deletions src/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export default {
},
showlocation: "Show my location",
locationloading: "Trying to get your location",
isLoad: "Load...",
},
ru: {
header: {
Expand Down Expand Up @@ -434,5 +435,6 @@ export default {
},
showlocation: "Показать моё местоположение",
locationloading: "Пытаемся получить вашу геопозицию",
isLoad: "Загрузка ...",
},
};
4 changes: 4 additions & 0 deletions src/views/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
:measuretype="type"
:historyready="canHistory"
:historyhandler="handlerHistory"
:isLoad="isLoad"
@clickMarker="handlerClick"
/>

Expand Down Expand Up @@ -90,6 +91,7 @@ export default {
},
start: null,
end: null,
isLoad: false,
};
},
computed: {
Expand Down Expand Up @@ -119,6 +121,7 @@ export default {
},
methods: {
async handlerHistory({ start, end }) {
this.isLoad = true;
this.start = start;
this.end = end;
this.status = "history";
Expand All @@ -144,6 +147,7 @@ export default {
for (const message in messages) {
this.handlerNewPoint(messages[message]);
}
this.isLoad = false;
},
async handlerNewPoint(point) {
if (!point.model || !markers.isReadyLayers()) {
Expand Down

0 comments on commit bda2195

Please sign in to comment.