mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-26 00:43:09 +02:00
88 lines
2 KiB
Vue
88 lines
2 KiB
Vue
<!--
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
-->
|
|
|
|
<template>
|
|
<MkStickyContainer>
|
|
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
|
<MkSpacer :contentMax="700">
|
|
<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="ph-plus ph-bold ph-lg"></i> {{ i18n.ts.add }}</MkButton>
|
|
|
|
<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>
|
|
</div>
|
|
</div>
|
|
</MkSpacer>
|
|
</MkStickyContainer>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { onActivated, computed } from 'vue';
|
|
import MkButton from '@/components/MkButton.vue';
|
|
import { i18n } from '@/i18n.js';
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
|
import { antennasCache } from '@/cache.js';
|
|
import { infoImageUrl } from '@/instance.js';
|
|
|
|
const antennas = computed(() => antennasCache.value.value ?? []);
|
|
|
|
function fetch() {
|
|
antennasCache.fetch();
|
|
}
|
|
|
|
fetch();
|
|
|
|
const headerActions = computed(() => [{
|
|
asFullButton: true,
|
|
icon: 'ph-arrows-counter-clockwise ph-bold ph-lg',
|
|
text: i18n.ts.reload,
|
|
handler: () => {
|
|
antennasCache.delete();
|
|
fetch();
|
|
},
|
|
}]);
|
|
|
|
const headerTabs = computed(() => []);
|
|
|
|
definePageMetadata({
|
|
title: i18n.ts.manageAntennas,
|
|
icon: 'ph-flying-saucer ph-bold ph-lg',
|
|
});
|
|
|
|
onActivated(() => {
|
|
antennasCache.fetch();
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss" module>
|
|
.add {
|
|
margin: 0 auto 16px auto;
|
|
}
|
|
|
|
.antenna {
|
|
display: block;
|
|
padding: 16px;
|
|
border: solid 1px var(--divider);
|
|
border-radius: var(--radius-sm);
|
|
|
|
&:hover {
|
|
border: solid 1px var(--accent);
|
|
text-decoration: none;
|
|
}
|
|
}
|
|
|
|
.name {
|
|
font-weight: bold;
|
|
}
|
|
</style>
|