2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2023-05-19 13:52:15 +02:00
|
|
|
<template>
|
|
|
|
<MkStickyContainer>
|
2022-06-20 10:38:49 +02:00
|
|
|
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
2023-05-19 13:52:15 +02:00
|
|
|
<MkSpacer :contentMax="700">
|
2023-07-10 08:55:10 +02: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>
|
|
|
|
|
|
|
|
<MkButton :link="true" to="/my/antennas/create" primary :class="$style.add"><i class="ti ti-plus"></i> {{ i18n.ts.add }}</MkButton>
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2023-07-10 08:55:10 +02: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 13:52:15 +02:00
|
|
|
</div>
|
2021-12-02 12:09:12 +01:00
|
|
|
</div>
|
2023-05-19 13:52:15 +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-12-07 06:42:09 +01:00
|
|
|
import { onActivated, computed } from 'vue';
|
2022-09-06 11:21:49 +02:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2023-09-19 09:37:43 +02:00
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
2023-12-24 08:16:58 +01:00
|
|
|
import { antennasCache } from '@/cache.js';
|
2023-09-19 09:37:43 +02:00
|
|
|
import { infoImageUrl } from '@/instance.js';
|
2022-05-17 18:30:35 +02:00
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const antennas = computed(() => antennasCache.value.value ?? []);
|
2023-07-10 08:55:10 +02:00
|
|
|
|
|
|
|
function fetch() {
|
2023-09-11 07:55:18 +02:00
|
|
|
antennasCache.fetch();
|
2023-07-10 08:55:10 +02:00
|
|
|
}
|
2022-05-17 18:30:35 +02:00
|
|
|
|
2023-07-10 08:55:10 +02:00
|
|
|
fetch();
|
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const headerActions = computed(() => [{
|
2023-07-10 08:55:10 +02:00
|
|
|
asFullButton: true,
|
|
|
|
icon: 'ti ti-refresh',
|
|
|
|
text: i18n.ts.reload,
|
|
|
|
handler: () => {
|
|
|
|
antennasCache.delete();
|
|
|
|
fetch();
|
|
|
|
},
|
|
|
|
}]);
|
2022-06-20 10:38:49 +02:00
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const headerTabs = computed(() => []);
|
2022-06-20 10:38:49 +02:00
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.manageAntennas,
|
2022-12-19 11:01:30 +01:00
|
|
|
icon: 'ti ti-antenna',
|
2022-06-10 07:36:55 +02:00
|
|
|
});
|
2021-08-07 10:55:16 +02:00
|
|
|
|
2023-07-10 08:55:10 +02:00
|
|
|
onActivated(() => {
|
2023-09-11 07:55:18 +02:00
|
|
|
antennasCache.fetch();
|
2023-07-10 08:55:10 +02:00
|
|
|
});
|
|
|
|
</script>
|
2021-08-07 10:55:16 +02:00
|
|
|
|
2023-07-10 08:55:10 +02:00
|
|
|
<style lang="scss" module>
|
|
|
|
.add {
|
|
|
|
margin: 0 auto 16px auto;
|
|
|
|
}
|
2021-08-07 10:55:16 +02:00
|
|
|
|
2023-07-10 08:55:10 +02:00
|
|
|
.antenna {
|
|
|
|
display: block;
|
|
|
|
padding: 16px;
|
|
|
|
border: solid 1px var(--divider);
|
|
|
|
border-radius: 6px;
|
2021-08-07 10:55:16 +02:00
|
|
|
|
2023-07-10 08:55:10 +02:00
|
|
|
&:hover {
|
|
|
|
border: solid 1px var(--accent);
|
|
|
|
text-decoration: none;
|
2021-08-07 10:55:16 +02:00
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
}
|
2023-07-10 08:55:10 +02:00
|
|
|
|
|
|
|
.name {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
</style>
|