basic functionality pot implemented

This commit is contained in:
2024-02-27 10:31:03 +01:00
parent 3a79ed12fa
commit c327355c8a
30 changed files with 1113 additions and 189 deletions

View File

@ -1,5 +1,5 @@
<template>
<section v-if="networkBoolean && !addAssetBool"
<section v-if="networkBoolean && !addBool"
:class="['network-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="network">Network specifications:</div>
<div class="asset-data">
@ -37,7 +37,7 @@
</div>
</div>
</section>
<section v-if="addAssetBool" :class="['network-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
<section v-if="addBool" :class="['network-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="network">Network specifications:</div>
<div class="asset-data">
<div class="IPv4-MAC">
@ -66,7 +66,7 @@
</div>
</div>
</section>
<section v-if="addAssetBool" id="saveNewItem">
<section v-if="addBool" id="saveNewItem">
<button :class="[darkMode ? 'saveNewItem-darkmode' : 'saveNewItem-lightmode']" @click="addItem()">Safe</button>
</section>
</template>
@ -80,9 +80,9 @@ import { useStore } from 'vuex';
import { computed } from 'vue';
const store = useStore();
const editable = computed(() => store.state.assetEditable);
const editable = computed(() => store.state.editable);
const chosenAssetId = computed(() => store.state.chosenAssetId);
const addAssetBool = computed(() => store.state.newAsset);
const addBool = computed(() => store.state.new);
const newAssetName = computed(() => store.state.newAssetName);
const newCustomerID = computed(() => store.state.newCustomerID);
const newCustomer = computed(() => store.state.newCustomer);
@ -120,7 +120,7 @@ const configItems = ref([]);
// get config item from id
const getItemById = async () => {
if (!addAssetBool.value) {
if (!addBool.value) {
try {
const response = await Axios.get(
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getConfigItem/${chosenAssetId.value}`
@ -332,7 +332,7 @@ const addItem = async () => {
MAC: newMAC.value,
subnetmask: newSubnetmask.value,
});
store.commit('resetAssetStore');
store.commit('resetStore');
store.commit('changeToAssetlist');
} catch (err) {
console.log(err.response.statusText);