239 lines
7.3 KiB
Vue
239 lines
7.3 KiB
Vue
<template>
|
|
<section :class="['hardware-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
|
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="hardware">Hardware specifications:</div>
|
|
<div class="asset-data">
|
|
<div class="model-CPU">
|
|
<div class="data-field" id="model">
|
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">Model:</pre>
|
|
<pre v-if="!editable"
|
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ item.model }}</pre>
|
|
<input v-if="editable" v-model="item.model"
|
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
|
</div>
|
|
<div class="data-field" id="CPU">
|
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">CPU:</pre>
|
|
<pre v-if="!editable"
|
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ item.CPU }}</pre>
|
|
<input v-if="editable" v-model="item.CPU"
|
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
|
</div>
|
|
</div>
|
|
<div class="serial-number-RAM">
|
|
<div class="data-field" id="serial-number">
|
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">Serial number:</pre>
|
|
<pre v-if="!editable"
|
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ item.serialnumber }}</pre>
|
|
<input v-if="editable" v-model="item.serialnumber"
|
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
|
</div>
|
|
<div class="data-field" id="RAM">
|
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">RAM:</pre>
|
|
<pre v-if="!editable"
|
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ item.RAM }}</pre>
|
|
<input v-if="editable" v-model="item.RAM"
|
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="asset-data">
|
|
<div class="additional">
|
|
<div class="storage-configuration">
|
|
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Storage configuration:</h3>
|
|
<input v-if="!editable" v-model="item.storageConfiguration"
|
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']"
|
|
id="storage-configuration">
|
|
<input v-if="editable" v-model="item.storageConfiguration"
|
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']"
|
|
id="storage-configuration">
|
|
</div>
|
|
</div>
|
|
<div class="additional">
|
|
<div class="miscellaneous">
|
|
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Miscellaneous:</h3>
|
|
<input v-if="!editable" v-model="item.miscellaneous"
|
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="miscellaneous">
|
|
<input v-if="editable" v-model="item.miscellaneous"
|
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="miscellaneous">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
import { ref, onMounted } from 'vue';
|
|
import Axios from '../axios.config.js';
|
|
import clientsideConfig from '../../clientsideConfig.js';
|
|
|
|
const darkMode = ref(true)
|
|
const item = ref({});
|
|
const hardwareBoolean = ref(false)
|
|
|
|
// get config item from id
|
|
const getItemById = async () => {
|
|
// later itemIndex from route params
|
|
let itemIndex = 9;
|
|
try {
|
|
const response = await Axios.get(
|
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getConfigItem/${itemIndex}`
|
|
);
|
|
item.value = response.data;
|
|
if ((item.value.hardwareBool == 1) && (item.value.model === (null | "")) && (item.value.serialnumber.trim() === "") && (item.value.CPU.trim() === "") && (item.value.RAM.trim() === "") && (item.value.storageConfiguration.trim() === "") && (item.value.miscellaneous.trim() === "")) {
|
|
item.value.hardwareBool = 0;
|
|
hardwareBoolean.value = false;
|
|
};
|
|
if (item.value.hardwareBool == 1) {
|
|
hardwareBoolean.value = true;
|
|
};
|
|
} catch (err) {
|
|
console.log(err.response.statusText);
|
|
}
|
|
}
|
|
|
|
onMounted(() => {
|
|
getItemById();
|
|
});
|
|
</script>
|
|
|
|
<script>
|
|
export default {
|
|
name: "HardwareSpecifications",
|
|
computed: {
|
|
editable() {
|
|
return this.$store.state.assetEditable
|
|
}
|
|
},
|
|
};
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
.hardware-information {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
justify-content: center;
|
|
width: 100%;
|
|
padding: 1.25rem 1.875rem;
|
|
border-radius: 0.625rem;
|
|
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
|
}
|
|
|
|
.section-darkmode {
|
|
background-color: #2c2c2c;
|
|
}
|
|
|
|
.section-lightmode {
|
|
background-color: #fff;
|
|
}
|
|
|
|
|
|
.data-field {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
width: 100%;
|
|
padding: 0 1.875rem;
|
|
gap: 1.25rem;
|
|
border-radius: 0.625rem;
|
|
}
|
|
|
|
.label {
|
|
letter-spacing: 5%;
|
|
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
|
}
|
|
|
|
.div-darkmode,
|
|
.h3-darkmode {
|
|
color: #fff;
|
|
}
|
|
|
|
.div-lightmode,
|
|
.h3-lightmode {
|
|
color: #000;
|
|
}
|
|
|
|
.label#hardware {
|
|
padding-top: 1rem;
|
|
padding-bottom: 1rem;
|
|
}
|
|
|
|
.data {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: flex-start;
|
|
padding: 0 0.625rem;
|
|
border-radius: 0.3125rem;
|
|
box-shadow: 0.0625rem 0.0625rem 0.25rem 0rem rgba(0, 0, 0, 0.25) inset;
|
|
letter-spacing: 5%;
|
|
font: 400 0.75rem/250% Overpass, sans-serif;
|
|
}
|
|
|
|
.input {
|
|
border: none;
|
|
}
|
|
|
|
.data-darkmode {
|
|
background-color: #212121;
|
|
color: #fff;
|
|
}
|
|
|
|
.data-lightmode {
|
|
background-color: #EBEBEB;
|
|
color: #000;
|
|
}
|
|
|
|
.data#miscellaneous,
|
|
.data#storage-configuration {
|
|
align-self: stretch;
|
|
}
|
|
|
|
.asset-data {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
align-self: stretch;
|
|
}
|
|
|
|
.model-CPU,
|
|
.serial-number-RAM {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
justify-content: center;
|
|
line-height: normal;
|
|
width: 50%;
|
|
padding: 0 0;
|
|
border-radius: 0.3125rem;
|
|
}
|
|
|
|
.additional {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
justify-content: center;
|
|
line-height: normal;
|
|
width: 50%;
|
|
padding: 0rem 0.625rem;
|
|
border-radius: 0.3125rem;
|
|
}
|
|
|
|
.area-title {
|
|
letter-spacing: 5%;
|
|
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
|
}
|
|
|
|
|
|
.storage-configuration,
|
|
.miscellaneous {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
justify-content: center;
|
|
align-self: stretch;
|
|
padding: 0.625rem 1.875rem 0.625rem 1.25rem;
|
|
}
|
|
</style> |