2023-07-27 08:31:52 +03:00
|
|
|
<!--
|
2024-02-13 17:59:27 +02:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 08:31:52 +03:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2023-05-19 14:52:15 +03:00
|
|
|
<template>
|
|
|
|
<MkStickyContainer>
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
2023-05-19 14:52:15 +03:00
|
|
|
<MkSpacer :contentMax="700">
|
2023-07-10 09:55:10 +03:00
|
|
|
<div>
|
|
|
|
<div v-if="antennas.length === 0" class="empty">
|
|
|
|
<div class="_fullinfo">
|
|
|
|
<img :src="infoImageUrl" class="_ghost"/>
|
|
|
|
<div>{{ i18n.ts.nothing }}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-09-30 22:53:52 +03:00
|
|
|
<MkButton :link="true" to="/my/antennas/create" primary :class="$style.add"><i class="ph-plus ph-bold ph-lg"></i> {{ i18n.ts.add }}</MkButton>
|
2020-01-29 21:37:25 +02:00
|
|
|
|
2023-07-10 09:55:10 +03:00
|
|
|
<div v-if="antennas.length > 0" class="_gaps">
|
|
|
|
<MkA v-for="antenna in antennas" :key="antenna.id" :class="$style.antenna" :to="`/my/antennas/${antenna.id}`">
|
|
|
|
<div class="name">{{ antenna.name }}</div>
|
|
|
|
</MkA>
|
2023-05-19 14:52:15 +03:00
|
|
|
</div>
|
2021-12-02 13:09:12 +02:00
|
|
|
</div>
|
2023-05-19 14:52:15 +03:00
|
|
|
</MkSpacer>
|
|
|
|
</MkStickyContainer>
|
2020-01-29 21:37:25 +02:00
|
|
|
</template>
|
|
|
|
|
2022-05-17 19:30:35 +03:00
|
|
|
<script lang="ts" setup>
|
2023-12-07 07:42:09 +02:00
|
|
|
import { onActivated, computed } from 'vue';
|
2022-09-06 12:21:49 +03:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2023-09-19 10:37:43 +03:00
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
2023-12-24 09:16:58 +02:00
|
|
|
import { antennasCache } from '@/cache.js';
|
2023-09-19 10:37:43 +03:00
|
|
|
import { infoImageUrl } from '@/instance.js';
|
2022-05-17 19:30:35 +03:00
|
|
|
|
2023-12-07 07:42:09 +02:00
|
|
|
const antennas = computed(() => antennasCache.value.value ?? []);
|
2023-07-10 09:55:10 +03:00
|
|
|
|
|
|
|
function fetch() {
|
2023-09-11 08:55:18 +03:00
|
|
|
antennasCache.fetch();
|
2023-07-10 09:55:10 +03:00
|
|
|
}
|
2022-05-17 19:30:35 +03:00
|
|
|
|
2023-07-10 09:55:10 +03:00
|
|
|
fetch();
|
|
|
|
|
2023-12-07 07:42:09 +02:00
|
|
|
const headerActions = computed(() => [{
|
2023-07-10 09:55:10 +03:00
|
|
|
asFullButton: true,
|
2023-11-04 00:20:53 +02:00
|
|
|
icon: 'ph-arrows-counter-clockwise ph-bold ph-lg',
|
2023-07-10 09:55:10 +03:00
|
|
|
text: i18n.ts.reload,
|
|
|
|
handler: () => {
|
|
|
|
antennasCache.delete();
|
|
|
|
fetch();
|
|
|
|
},
|
|
|
|
}]);
|
2022-06-20 11:38:49 +03:00
|
|
|
|
2023-12-07 07:42:09 +02:00
|
|
|
const headerTabs = computed(() => []);
|
2022-06-20 11:38:49 +03:00
|
|
|
|
2024-02-16 09:17:09 +02:00
|
|
|
definePageMetadata(() => ({
|
2022-06-20 11:38:49 +03:00
|
|
|
title: i18n.ts.manageAntennas,
|
2023-11-04 00:20:53 +02:00
|
|
|
icon: 'ph-flying-saucer ph-bold ph-lg',
|
2024-02-16 09:17:09 +02:00
|
|
|
}));
|
2021-08-07 11:55:16 +03:00
|
|
|
|
2023-07-10 09:55:10 +03:00
|
|
|
onActivated(() => {
|
2023-09-11 08:55:18 +03:00
|
|
|
antennasCache.fetch();
|
2023-07-10 09:55:10 +03:00
|
|
|
});
|
|
|
|
</script>
|
2021-08-07 11:55:16 +03:00
|
|
|
|
2023-07-10 09:55:10 +03:00
|
|
|
<style lang="scss" module>
|
|
|
|
.add {
|
|
|
|
margin: 0 auto 16px auto;
|
|
|
|
}
|
2021-08-07 11:55:16 +03:00
|
|
|
|
2023-07-10 09:55:10 +03:00
|
|
|
.antenna {
|
|
|
|
display: block;
|
|
|
|
padding: 16px;
|
|
|
|
border: solid 1px var(--divider);
|
2023-10-31 20:44:34 +02:00
|
|
|
border-radius: var(--radius-sm);
|
2021-08-07 11:55:16 +03:00
|
|
|
|
2023-07-10 09:55:10 +03:00
|
|
|
&:hover {
|
|
|
|
border: solid 1px var(--accent);
|
|
|
|
text-decoration: none;
|
2021-08-07 11:55:16 +03:00
|
|
|
}
|
2020-01-29 21:37:25 +02:00
|
|
|
}
|
2023-07-10 09:55:10 +03:00
|
|
|
|
|
|
|
.name {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
2020-01-29 21:37:25 +02:00
|
|
|
</style>
|