hippofish/packages/frontend/src/pages/my-antennas/edit.vue

37 lines
795 B
Vue
Raw Normal View History

2021-08-07 10:55:16 +02:00
<template>
<div class="">
<XAntenna v-if="antenna" :antenna="antenna" @updated="onAntennaUpdated"/>
</div>
</template>
<script lang="ts" setup>
2021-08-07 10:55:16 +02:00
import XAntenna from './editor.vue';
2021-11-11 18:02:25 +01:00
import * as os from '@/os';
import { i18n } from '@/i18n';
import { useRouter } from '@/router';
import { definePageMetadata } from '@/scripts/page-metadata';
import { antennasCache } from '@/cache';
2021-08-07 10:55:16 +02:00
const router = useRouter();
let antenna: any = $ref(null);
const props = defineProps<{
antennaId: string
}>();
function onAntennaUpdated() {
antennasCache.delete();
router.push('/my/antennas');
}
os.api('antennas/show', { antennaId: props.antennaId }).then((antennaResponse) => {
antenna = antennaResponse;
});
definePageMetadata({
title: i18n.ts.manageAntennas,
icon: 'ti ti-antenna',
2021-08-07 10:55:16 +02:00
});
</script>