fixed backend imports

This commit is contained in:
2024-02-16 19:00:30 +01:00
parent 5ca56d36cf
commit 5242d4a3af
26 changed files with 195 additions and 279 deletions

View File

@ -53,18 +53,14 @@
<div class="additional">
<div class="description">
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Description:</h3>
<input v-if="!editable" v-model="item.description"
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="description">
<input v-if="editable" v-model="item.description"
<input v-model="item.description" :readonly="!editable"
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="description">
</div>
</div>
<div class="additional">
<div class="notes">
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Notes:</h3>
<input v-if="!editable" v-model="item.notes"
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="notes">
<input v-if="editable" v-model="item.notes"
<input v-model="item.notes" :readonly="!editable"
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="notes">
</div>
</div>
@ -77,6 +73,12 @@
import { ref, onMounted } from 'vue';
import Axios from '../axios.config.js';
import clientsideConfig from '../../clientsideConfig.js';
import { useStore } from 'vuex';
import { computed } from 'vue';
const store = useStore();
const editable = computed(() => store.state.assetEditable);
const chosenAssetId = computed(() => store.state.chosenAssetId);
const darkMode = ref(true)
// const editable = ref(false)
@ -84,10 +86,9 @@ const item = ref({});
// get config item from id
const getItemById = async () => {
console.log(this.chosenAssetId)
try {
const response = await Axios.get(
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getConfigItem/${chosenAssetId}`
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getConfigItem/${chosenAssetId.value}`
);
item.value = response.data;
} catch (err) {
@ -154,7 +155,6 @@ const updateConfigItem = async () => {
onMounted(() => {
getItemById();
// console.log(editable.value)
});
</script>
@ -162,14 +162,6 @@ onMounted(() => {
<script>
export default {
name: "Asset",
computed: {
editable() {
return this.$store.state.assetEditable
},
chosenAssetId() {
return this.$store.state.chosenAssetId
}
},
}
</script>