mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-10 18:38:22 +00:00
use plugin helper
This commit is contained in:
parent
480f2c85b7
commit
c39c3d6606
2 changed files with 7 additions and 6 deletions
|
@ -1,6 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
|
||||
import { editTypes } from "../../../../definitions";
|
||||
import getPlugins from '../../../../plugins';
|
||||
const p = getPlugins();
|
||||
|
||||
const props = $defineProps<{subsystem: string, entity: string, id: string}>();
|
||||
const { subsystem, entity, id } = $(props);
|
||||
|
@ -8,7 +10,7 @@ const { subsystem, entity, id } = $(props);
|
|||
let data = $ref({} as {});
|
||||
|
||||
async function update() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import { editTypes } from "../../../../definitions";
|
||||
import { apiCall } from "../../../../api";
|
||||
import { useToast } from 'vue-toast-notification';
|
||||
|
||||
const $toast = useToast();
|
||||
import getPlugins from '../../../../plugins';
|
||||
const p = getPlugins();
|
||||
|
||||
const props = $defineProps<{subsystem: string, entity: string}>();
|
||||
const { subsystem, entity } = $(props);
|
||||
|
@ -14,8 +13,8 @@ async function create(value: any) {
|
|||
console.debug("value", value);
|
||||
let res = await apiCall(editTypes[subsystem].name +".Create"+ editTypes[subsystem][entity].name, value);
|
||||
if (res.Error === null) {
|
||||
$toast.success("Created " + editTypes[subsystem][entity].name);
|
||||
$router.go(-1)
|
||||
p.toast.success("Created " + editTypes[subsystem][entity].name);
|
||||
p.router.go(-1);
|
||||
} else {
|
||||
console.debug("error", res);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue