rudeshark.net/packages/client/src/pages/my-antennas/edit.vue

48 lines
925 B
Vue
Raw Normal View History

2021-08-07 10:55:16 +02:00
<template>
2023-04-08 02:01:42 +02:00
<div class="">
<XAntenna
v-if="antenna"
:antenna="antenna"
@updated="onAntennaUpdated"
/>
</div>
2021-08-07 10:55:16 +02:00
</template>
<script lang="ts" setup>
2023-04-08 02:01:42 +02:00
import { inject, watch } from "vue";
import XAntenna from "./editor.vue";
import * as os from "@/os";
import { i18n } from "@/i18n";
import { useRouter } from "@/router";
import { definePageMetadata } from "@/scripts/page-metadata";
2021-08-07 10:55:16 +02:00
const router = useRouter();
let antenna: any = $ref(null);
const props = defineProps<{
2023-04-08 02:01:42 +02:00
antennaId: string;
}>();
function onAntennaUpdated() {
2023-04-08 02:01:42 +02:00
router.push("/my/antennas");
}
2023-04-08 02:01:42 +02:00
os.api("antennas/show", { antennaId: props.antennaId }).then(
(antennaResponse) => {
antenna = antennaResponse;
}
);
const headerActions = $computed(() => []);
const headerTabs = $computed(() => []);
definePageMetadata({
title: i18n.ts.manageAntennas,
2023-04-08 02:01:42 +02:00
icon: "ph-flying-saucer ph-bold ph-lg",
2021-08-07 10:55:16 +02:00
});
</script>
2023-04-08 02:01:42 +02:00
<style lang="scss" scoped></style>