2023-07-27 08:31:52 +03:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2021-08-07 11:55:16 +03:00
|
|
|
<template>
|
|
|
|
<div class="">
|
|
|
|
<XAntenna v-if="antenna" :antenna="antenna" @updated="onAntennaUpdated"/>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-05-25 10:37:15 +03:00
|
|
|
<script lang="ts" setup>
|
2023-12-07 07:42:09 +02:00
|
|
|
import { ref } from 'vue';
|
2023-12-26 07:19:35 +02:00
|
|
|
import * as Misskey from 'misskey-js';
|
2021-08-07 11:55:16 +03:00
|
|
|
import XAntenna from './editor.vue';
|
2023-09-19 10:37:43 +03:00
|
|
|
import * as os from '@/os.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { useRouter } from '@/router.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
2023-12-24 09:16:58 +02:00
|
|
|
import { antennasCache } from '@/cache.js';
|
2021-08-07 11:55:16 +03:00
|
|
|
|
2022-06-20 11:38:49 +03:00
|
|
|
const router = useRouter();
|
2022-05-25 10:37:15 +03:00
|
|
|
|
2023-12-26 07:19:35 +02:00
|
|
|
const antenna = ref<Misskey.entities.Antenna | null>(null);
|
2022-05-25 10:37:15 +03:00
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
antennaId: string
|
|
|
|
}>();
|
|
|
|
|
|
|
|
function onAntennaUpdated() {
|
2023-07-10 09:55:10 +03:00
|
|
|
antennasCache.delete();
|
2022-06-20 11:38:49 +03:00
|
|
|
router.push('/my/antennas');
|
2022-05-25 10:37:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
os.api('antennas/show', { antennaId: props.antennaId }).then((antennaResponse) => {
|
2023-12-07 07:42:09 +02:00
|
|
|
antenna.value = antennaResponse;
|
2022-05-25 10:37:15 +03:00
|
|
|
});
|
|
|
|
|
2022-06-20 11:38:49 +03:00
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.manageAntennas,
|
2022-12-19 12:01:30 +02:00
|
|
|
icon: 'ti ti-antenna',
|
2021-08-07 11:55:16 +03:00
|
|
|
});
|
|
|
|
</script>
|