mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 19:08:20 +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">
|
<script setup lang="ts">
|
||||||
|
|
||||||
import { editTypes } from "../../../../definitions";
|
import { editTypes } from "../../../../definitions";
|
||||||
|
import getPlugins from '../../../../plugins';
|
||||||
|
const p = getPlugins();
|
||||||
|
|
||||||
const props = $defineProps<{subsystem: string, entity: string, id: string}>();
|
const props = $defineProps<{subsystem: string, entity: string, id: string}>();
|
||||||
const { subsystem, entity, id } = $(props);
|
const { subsystem, entity, id } = $(props);
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { editTypes } from "../../../../definitions";
|
import { editTypes } from "../../../../definitions";
|
||||||
import { apiCall } from "../../../../api";
|
import { apiCall } from "../../../../api";
|
||||||
import { useToast } from 'vue-toast-notification';
|
import getPlugins from '../../../../plugins';
|
||||||
|
const p = getPlugins();
|
||||||
const $toast = useToast();
|
|
||||||
|
|
||||||
const props = $defineProps<{subsystem: string, entity: string}>();
|
const props = $defineProps<{subsystem: string, entity: string}>();
|
||||||
const { subsystem, entity } = $(props);
|
const { subsystem, entity } = $(props);
|
||||||
|
@ -14,8 +13,8 @@ async function create(value: any) {
|
||||||
console.debug("value", value);
|
console.debug("value", value);
|
||||||
let res = await apiCall(editTypes[subsystem].name +".Create"+ editTypes[subsystem][entity].name, value);
|
let res = await apiCall(editTypes[subsystem].name +".Create"+ editTypes[subsystem][entity].name, value);
|
||||||
if (res.Error === null) {
|
if (res.Error === null) {
|
||||||
$toast.success("Created " + editTypes[subsystem][entity].name);
|
p.toast.success("Created " + editTypes[subsystem][entity].name);
|
||||||
$router.go(-1)
|
p.router.go(-1);
|
||||||
} else {
|
} else {
|
||||||
console.debug("error", res);
|
console.debug("error", res);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue