2022-11-04 00:05:22 +01:00
|
|
|
<template>
|
2023-04-08 02:01:42 +02:00
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header
|
|
|
|
><MkPageHeader
|
|
|
|
:actions="headerActions"
|
|
|
|
:tabs="headerTabs"
|
|
|
|
:display-back-button="true"
|
|
|
|
/></template>
|
|
|
|
<MkSpacer :content-max="700">
|
|
|
|
<div class="ieepwinx">
|
|
|
|
|
|
|
|
<div class="">
|
|
|
|
<MkPagination
|
|
|
|
ref="list"
|
|
|
|
:pagination="pagination"
|
|
|
|
>
|
2023-05-29 15:11:42 +02:00
|
|
|
<template #empty>
|
|
|
|
<MkInfo
|
|
|
|
:icon="'flying-saucer'"
|
|
|
|
:card="true"
|
2023-04-08 02:01:42 +02:00
|
|
|
>
|
2023-05-29 15:11:42 +02:00
|
|
|
<p>{{ i18n.ts.antennasDesc }}</p>
|
|
|
|
<MkButton
|
|
|
|
:link="true"
|
|
|
|
to="/my/antennas/create"
|
|
|
|
primary
|
|
|
|
class="add"
|
|
|
|
><i class="ph-plus ph-bold ph-lg"></i>
|
|
|
|
{{ i18n.ts.add }}</MkButton
|
|
|
|
>
|
|
|
|
</MkInfo>
|
|
|
|
</template>
|
|
|
|
<template #default="{ items }">
|
|
|
|
<MkButton
|
|
|
|
:link="true"
|
|
|
|
to="/my/antennas/create"
|
|
|
|
primary
|
|
|
|
class="add"
|
|
|
|
><i class="ph-plus ph-bold ph-lg"></i>
|
|
|
|
{{ i18n.ts.add }}</MkButton
|
2023-04-08 02:01:42 +02:00
|
|
|
>
|
2023-05-29 15:11:42 +02:00
|
|
|
<div v-for="antenna in items" :key="antenna.id">
|
|
|
|
<MkA
|
|
|
|
class="uopelskx"
|
|
|
|
:link="true"
|
|
|
|
:to="`/timeline/antenna/${antenna.id}`"
|
|
|
|
>
|
|
|
|
<i class="ph-flying-saucer ph-bold ph-lg"></i
|
|
|
|
><i
|
|
|
|
:class="`${
|
|
|
|
antenna.hasUnreadNote
|
|
|
|
? 'ph-circle ph-fill'
|
|
|
|
: 'ph-check'
|
|
|
|
} ph-xs notify-icon`"
|
|
|
|
></i>
|
|
|
|
</MkA>
|
|
|
|
<MkA
|
|
|
|
class="ljoevbzj"
|
|
|
|
:to="`/my/antennas/${antenna.id}`"
|
|
|
|
>
|
|
|
|
<div class="name">{{ antenna.name }}</div>
|
|
|
|
</MkA>
|
|
|
|
</div>
|
|
|
|
</template>
|
2023-04-08 02:01:42 +02:00
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2022-11-04 00:05:22 +01:00
|
|
|
</div>
|
2023-04-08 02:01:42 +02:00
|
|
|
</MkSpacer>
|
|
|
|
</MkStickyContainer>
|
2020-01-29 20:37:25 +01:00
|
|
|
</template>
|
|
|
|
|
2022-05-17 18:30:35 +02:00
|
|
|
<script lang="ts" setup>
|
2023-04-08 02:01:42 +02:00
|
|
|
import { onActivated, onDeactivated, ref } from "vue";
|
|
|
|
import MkPagination from "@/components/MkPagination.vue";
|
|
|
|
import MkButton from "@/components/MkButton.vue";
|
2023-05-29 15:11:42 +02:00
|
|
|
import MkInfo from "@/components/MkInfo.vue";
|
2023-04-08 02:01:42 +02:00
|
|
|
import { i18n } from "@/i18n";
|
|
|
|
import { definePageMetadata } from "@/scripts/page-metadata";
|
2022-05-17 18:30:35 +02:00
|
|
|
|
|
|
|
const pagination = {
|
2023-04-08 02:01:42 +02:00
|
|
|
endpoint: "antennas/list" as const,
|
2022-12-29 11:00:30 +01:00
|
|
|
limit: 250,
|
2022-05-17 18:30:35 +02:00
|
|
|
};
|
|
|
|
|
2022-06-20 10:38:49 +02:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
const list = ref<typeof MkPagination | null>(null);
|
2022-12-29 11:00:30 +01:00
|
|
|
|
|
|
|
let isCached: boolean = false;
|
|
|
|
let refreshTimer: number | null = null;
|
|
|
|
|
|
|
|
const refresh = () => {
|
|
|
|
if (isCached) {
|
|
|
|
list.value?.refresh();
|
|
|
|
}
|
|
|
|
|
|
|
|
isCached = true;
|
2023-04-08 02:01:42 +02:00
|
|
|
refreshTimer = setTimeout(refresh, 15000);
|
2022-12-29 11:00:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
onActivated(() => {
|
|
|
|
refresh();
|
|
|
|
});
|
|
|
|
|
|
|
|
onDeactivated(() => {
|
|
|
|
if (refreshTimer) {
|
|
|
|
clearTimeout(refreshTimer);
|
|
|
|
refreshTimer = null;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-06-20 10:38:49 +02:00
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.manageAntennas,
|
2023-04-08 02:01:42 +02:00
|
|
|
icon: "ph-flying-saucer ph-bold ph-lg",
|
2022-06-10 07:36:55 +02:00
|
|
|
});
|
2020-01-29 20:37:25 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.ieepwinx {
|
2022-12-29 11:00:30 +01:00
|
|
|
.uopelskx {
|
|
|
|
float: left;
|
|
|
|
min-width: 25px;
|
|
|
|
padding: 13px;
|
|
|
|
margin-right: 10px;
|
|
|
|
border: solid 1px var(--divider);
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
border: solid 1px var(--accent);
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-07 10:55:16 +02:00
|
|
|
.ljoevbzj {
|
|
|
|
display: block;
|
|
|
|
padding: 16px;
|
|
|
|
margin-bottom: 8px;
|
|
|
|
border: solid 1px var(--divider);
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
border: solid 1px var(--accent);
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .name {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
}
|
2022-12-29 11:00:30 +01:00
|
|
|
|
|
|
|
.notify-icon {
|
2023-04-08 02:01:42 +02:00
|
|
|
position: relative;
|
|
|
|
top: -1em;
|
|
|
|
left: -0.5em;
|
2022-12-29 11:00:30 +01:00
|
|
|
|
2023-03-11 22:52:11 +01:00
|
|
|
&.ph-circle ph-fill {
|
2022-12-29 11:00:30 +01:00
|
|
|
color: var(--indicator);
|
|
|
|
animation: blink 1s infinite;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.ph-check {
|
|
|
|
color: var(--muted);
|
|
|
|
}
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
}
|
|
|
|
</style>
|