2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2021-08-07 10:55:16 +02:00
|
|
|
<template>
|
|
|
|
<div class="">
|
|
|
|
<XAntenna v-if="antenna" :antenna="antenna" @updated="onAntennaUpdated"/>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-05-25 09:37:15 +02:00
|
|
|
<script lang="ts" setup>
|
2023-12-07 06:42:09 +01:00
|
|
|
import { ref } from 'vue';
|
2023-12-26 06:19:35 +01:00
|
|
|
import * as Misskey from 'misskey-js';
|
2021-08-07 10:55:16 +02:00
|
|
|
import XAntenna from './editor.vue';
|
2024-01-04 10:32:46 +01:00
|
|
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
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';
|
2024-01-08 06:44:43 +01:00
|
|
|
import { useRouter } from '@/global/router/supplier.js';
|
2021-08-07 10:55:16 +02:00
|
|
|
|
2022-06-20 10:38:49 +02:00
|
|
|
const router = useRouter();
|
2022-05-25 09:37:15 +02:00
|
|
|
|
2023-12-26 06:19:35 +01:00
|
|
|
const antenna = ref<Misskey.entities.Antenna | null>(null);
|
2022-05-25 09:37:15 +02:00
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
antennaId: string
|
|
|
|
}>();
|
|
|
|
|
|
|
|
function onAntennaUpdated() {
|
2023-07-10 08:55:10 +02:00
|
|
|
antennasCache.delete();
|
2022-06-20 10:38:49 +02:00
|
|
|
router.push('/my/antennas');
|
2022-05-25 09:37:15 +02:00
|
|
|
}
|
|
|
|
|
2024-01-04 10:32:46 +01:00
|
|
|
misskeyApi('antennas/show', { antennaId: props.antennaId }).then((antennaResponse) => {
|
2023-12-07 06:42:09 +01:00
|
|
|
antenna.value = antennaResponse;
|
2022-05-25 09:37:15 +02:00
|
|
|
});
|
|
|
|
|
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',
|
2021-08-07 10:55:16 +02:00
|
|
|
});
|
|
|
|
</script>
|