Merge pull request 'communication from client to nuxt server' (#16) from loginFunctionality into main
Reviewed-on: jo.kuehner/TueIT_App#16 es funktioniert jetzt wie folgt: - vom entsprechenden component wird eine axios Anfrage an den api Server Endpunkt geschickt - parallel greift die passende server middleware ein und diese macht den call ins backend - daraufhin übermittelt die server middleware die Antwort an den api Endpunkt. Dieser schickt dann eine Antwort zurück an den Component, wo dann die Antwort dem client übermittelt wird was ich schon alles gemacht habe: - cors Fehler behoben mit entsprechender Konfig und headern - login (noch nicht initial dorthin geroutet) - signup aber nur hardgecoded mit einem Beispieluser, da ich einen brauchte fürs Login - get all Funktionen für die Tabellen aller Seiten (customer existiert schon aber ist noch nicht in die customer Seite eingebunden) - bin gerade bei CI. hier funktioniert schon ein einziges Item getten, updaten und löschen. Als nächstes mache ich noch die Erstellung eines neuen CI. Du kannst dich daran orientieren.
This commit is contained in:
@ -22,11 +22,11 @@ bun install
|
|||||||
|
|
||||||
## Development Server
|
## Development Server
|
||||||
|
|
||||||
Start the development server on `http://localhost:3000`:
|
Start the development server on `https://localhost:3000`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# npm
|
# npm
|
||||||
npm run dev
|
npm run dev -- --host 0.0.0.0
|
||||||
|
|
||||||
# pnpm
|
# pnpm
|
||||||
pnpm run dev
|
pnpm run dev
|
||||||
|
|||||||
14
axios.config.js
Normal file
14
axios.config.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
//create axios instance
|
||||||
|
const Axios = axios.create({
|
||||||
|
// baseURL: `https://${serversideConfig.url}:${serversideConfig.port}`,
|
||||||
|
headers: {
|
||||||
|
// 'Accept': 'application/json',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
//Authorization: `Bearer`,
|
||||||
|
Accept: "*",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export default Axios;
|
||||||
@ -8,7 +8,7 @@ import {
|
|||||||
deleteIssueVariantById,
|
deleteIssueVariantById,
|
||||||
deleteIssueVariantByIssueSlipId,
|
deleteIssueVariantByIssueSlipId,
|
||||||
insertIssueVariant,
|
insertIssueVariant,
|
||||||
} from "../models/issuesModel.js";
|
} from "../models/issueVariantsModel.js";
|
||||||
|
|
||||||
//get all issue variants
|
//get all issue variants
|
||||||
export const showIssueVariants = (req, res) => {
|
export const showIssueVariants = (req, res) => {
|
||||||
|
|||||||
@ -17,6 +17,7 @@ export const signUp = async (req, res, next) => {
|
|||||||
try {
|
try {
|
||||||
let sql = `SELECT id FROM users WHERE LOWER(username) = LOWER(?)`;
|
let sql = `SELECT id FROM users WHERE LOWER(username) = LOWER(?)`;
|
||||||
const result = await ownConn.execute(sql, [req.body.username])
|
const result = await ownConn.execute(sql, [req.body.username])
|
||||||
|
|
||||||
if (result.length > 0) { //username already exists
|
if (result.length > 0) { //username already exists
|
||||||
return res.status(409).send({
|
return res.status(409).send({
|
||||||
message: 'This username is already in use!'
|
message: 'This username is already in use!'
|
||||||
|
|||||||
@ -15,12 +15,14 @@ import fs from "fs";
|
|||||||
//import routes
|
//import routes
|
||||||
import Router from "./routes/routes.js";
|
import Router from "./routes/routes.js";
|
||||||
|
|
||||||
|
import clientsideConfig from '../clientsideConfig.js';
|
||||||
|
|
||||||
//init express
|
//init express
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
//setup cors
|
//setup cors
|
||||||
const corsOptions = {
|
const corsOptions = {
|
||||||
origin: 'https://localhost:4173',
|
origin: `https://${clientsideConfig.url}:${clientsideConfig.port}`,
|
||||||
headers: 'authorization, content-type',
|
headers: 'authorization, content-type',
|
||||||
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
|
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||||
credentials: true,
|
credentials: true,
|
||||||
@ -37,16 +39,16 @@ app.use(express.json());
|
|||||||
app.use(Router);
|
app.use(Router);
|
||||||
|
|
||||||
//setup https
|
//setup https
|
||||||
var privateKey = fs.readFileSync('../certs/localhost.key');
|
var privateKey = fs.readFileSync('../certs/privkey.pem');
|
||||||
var certificate = fs.readFileSync('../certs/localhost.crt');
|
var certificate = fs.readFileSync('../certs/fullchain.pem');
|
||||||
|
|
||||||
var server = https.createServer({
|
var server = https.createServer({
|
||||||
key: privateKey,
|
key: privateKey,
|
||||||
cert: certificate
|
cert: certificate,
|
||||||
}, app);
|
}, app);
|
||||||
|
|
||||||
// const PORT = process.env.PORT || 5172;
|
// const PORT = process.env.PORT || 4172;
|
||||||
const PORT = process.env.PORT || config.port;
|
const PORT = process.env.PORT || serversideConfig.port;
|
||||||
|
|
||||||
//PORT
|
//PORT
|
||||||
server.listen(PORT, () => {
|
server.listen(PORT, () => {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
|
|||||||
//insert checklist solution todo to databased
|
//insert checklist solution todo to databased
|
||||||
export const insertChecklistSolutionTodo = async (data, result) => {
|
export const insertChecklistSolutionTodo = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO checklistSolutions(solutionID, step, asset, task, comments) VALUES(?, ?, ?, ?, ?)`, [data.solutionID, data.step, data.asset, data.task, data.comments]);
|
const results = await ownConn.query(`INSERT INTO checklistsolutions(solutionID, step, asset, task, comments) VALUES(?, ?, ?, ?, ?)`, [data.solutionID, data.step, data.asset, data.task, data.comments]);
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -16,7 +16,7 @@ export const insertChecklistSolutionTodo = async (data, result) => {
|
|||||||
//get single checklist solution todo by id
|
//get single checklist solution todo by id
|
||||||
export const getChecklistSolutionTodosById = async (id, result) => {
|
export const getChecklistSolutionTodosById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM checklistSolutions WHERE solutionID = ? ORDER BY primaryID ASC`;
|
let sql = `SELECT * FROM checklistsolutions WHERE solutionID = ? ORDER BY primaryID ASC`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -30,7 +30,7 @@ export const getChecklistSolutionTodosById = async (id, result) => {
|
|||||||
//get single checklist solution todo by asset
|
//get single checklist solution todo by asset
|
||||||
export const getChecklistSolutionTodosByAsset = async (id, result) => {
|
export const getChecklistSolutionTodosByAsset = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM checklistSolutions WHERE asset = ? ORDER BY primaryID ASC`;
|
let sql = `SELECT * FROM checklistsolutions WHERE asset = ? ORDER BY primaryID ASC`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ export const getChecklistSolutionTodosByAsset = async (id, result) => {
|
|||||||
export const updateChecklistSolutionTodoById = async (data, result) => {
|
export const updateChecklistSolutionTodoById = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const id = data.primaryID;
|
const id = data.primaryID;
|
||||||
let sql = `UPDATE checklistSolutions SET step = ?, asset = ?, task = ?, comments = ? WHERE primaryID = ?`;
|
let sql = `UPDATE checklistsolutions SET step = ?, asset = ?, task = ?, comments = ? WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.step, data.asset, data.task, data.comments, id])
|
const results = await ownConn.query(sql, [data.step, data.asset, data.task, data.comments, id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ export const updateChecklistSolutionTodoById = async (data, result) => {
|
|||||||
// Delete all checklist solution todos by template ID to Database
|
// Delete all checklist solution todos by template ID to Database
|
||||||
export const deleteAllChecklistSolutionTodosSolutionID = async (id, result) => {
|
export const deleteAllChecklistSolutionTodosSolutionID = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM checklistSolutions WHERE solutionID = ?`;
|
let sql = `DELETE FROM checklistsolutions WHERE solutionID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ export const deleteAllChecklistSolutionTodosSolutionID = async (id, result) => {
|
|||||||
// Delete single checklist solution todo by primary ID to Database
|
// Delete single checklist solution todo by primary ID to Database
|
||||||
export const deleteChecklistSolutionTodo = async (id, result) => {
|
export const deleteChecklistSolutionTodo = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM checklistSolutions WHERE primaryID = ?`;
|
let sql = `DELETE FROM checklistsolutions WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
|
|||||||
//get all master checklists
|
//get all master checklists
|
||||||
export const getConfigItems = async (result) => {
|
export const getConfigItems = async (result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM changeDB ORDER BY assetName ASC`;
|
let sql = `SELECT * FROM changedb ORDER BY assetName ASC`;
|
||||||
const results = await ownConn.query(sql)
|
const results = await ownConn.query(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -17,7 +17,7 @@ export const getConfigItems = async (result) => {
|
|||||||
//get single config item by id
|
//get single config item by id
|
||||||
export const getConfigItemById = async (id, result) => {
|
export const getConfigItemById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM changeDB WHERE primaryID = ?`;
|
let sql = `SELECT * FROM changedb WHERE primaryID = ?`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results[0]);
|
result(null, results[0]);
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ export const getConfigItemById = async (id, result) => {
|
|||||||
//get single config item by name
|
//get single config item by name
|
||||||
export const getConfigItemByName = async (name, result) => {
|
export const getConfigItemByName = async (name, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM changeDB WHERE assetName = ?`;
|
let sql = `SELECT * FROM changedb WHERE assetName = ?`;
|
||||||
const results = await ownConn.query(sql, [name])
|
const results = await ownConn.query(sql, [name])
|
||||||
result(null, results[0]);
|
result(null, results[0]);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ export const getConfigItemByName = async (name, result) => {
|
|||||||
//get config items by customer id
|
//get config items by customer id
|
||||||
export const getConfigItemByCustomerId = async (customerId, result) => {
|
export const getConfigItemByCustomerId = async (customerId, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM changeDB WHERE customerID = ? ORDER BY assetName ASC`;
|
let sql = `SELECT * FROM changedb WHERE customerID = ? ORDER BY assetName ASC`;
|
||||||
const results = await ownConn.query(sql, [customerId])
|
const results = await ownConn.query(sql, [customerId])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -60,8 +60,9 @@ export const getConfigItemByCustomerId = async (customerId, result) => {
|
|||||||
export const updateConfigItemById = async (data, result) => {
|
export const updateConfigItemById = async (data, result) => {
|
||||||
const id = data.primaryID;
|
const id = data.primaryID;
|
||||||
try {
|
try {
|
||||||
let sql = `UPDATE changeDB SET assetName = ?, customerID = ?, customer = ?, location = ?, remoteLocation = ?, type = ?, description = ?, notes = ?, state = ?, lastView = ?, user = ?, hardwareBool = ?, model = ?, serialnumber = ?, CPU = ?, RAM = ?, storageConfiguration = ?, miscellaneous = ?, softwareBool = ?, software = ?, version = ?, networkBool = ?, IPv4 = ?, IPv6 = ?, MAC = ?, subnetmask = ? WHERE primaryID = ?`;
|
let sql = `UPDATE changedb SET assetName = ?, customerID = ?, customer = ?, location = ?, remoteLocation = ?, type = ?, description = ?, notes = ?, state = ?, lastView = ?, user = ?, hardwareBool = ?, model = ?, serialnumber = ?, CPU = ?, RAM = ?, storageConfiguration = ?, miscellaneous = ?, softwareBool = ?, software = ?, version = ?, license = ?, networkBool = ?, IPv4 = ?, IPv6 = ?, MAC = ?, subnetmask = ? WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.assetName, data.customerID, data.customer, data.location, data.remoteLocation, data.type, data.description, data.notes, data.state, data.lastView, data.user, data.hardwareBool, data.model, data.serialnumber, data.CPU, data.RAM, data.storageConfiguration, data.miscellaneous, data.softwareBool, data.software, data.version, data.networkBool, data.IPv4, data.IPv6, data.MAC, data.subnetmask, id]);
|
const results = await ownConn.query(sql, [data.assetName, data.customerID, data.customer, data.location, data.remoteLocation, data.type, data.description, data.notes, data.state, data.lastView, data.user, data.hardwareBool, data.model, data.serialnumber, data.CPU, data.RAM, data.storageConfiguration, data.miscellaneous, data.softwareBool, data.software, data.version, data.license, data.networkBool, data.IPv4, data.IPv6, data.MAC, data.subnetmask, id]);
|
||||||
|
results.insertId = results.insertId.toString();
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -74,7 +75,7 @@ export const updateConfigItemById = async (data, result) => {
|
|||||||
//insert config item to databased
|
//insert config item to databased
|
||||||
export const insertConfigItem = async (data, result) => {
|
export const insertConfigItem = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO changeDB(assetName, customerID, customer, location, remoteLocation, type, description, notes, state, lastView, user, hardwareBool, model, serialnumber, CPU, RAM, storageConfiguration, miscellaneous, softwareBool, software, version, networkBool, IPv4, IPv6, MAC, subnetmask) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [data.assetName, data.customerID, data.customer, data.location, data.remoteLocation, data.type, data.description, data.notes, data.state, data.lastView, data.user, data.hardwareBool, data.model, data.serialnumber, data.CPU, data.RAM, data.storageConfiguration, data.miscellaneous, data.softwareBool, data.software, data.version, data.networkBool, data.IPv4, data.IPv6, data.MAC, data.subnetmask])
|
const results = await ownConn.query(`INSERT INTO changedb(assetName, customerID, customer, location, remoteLocation, type, description, notes, state, lastView, user, hardwareBool, model, serialnumber, CPU, RAM, storageConfiguration, miscellaneous, softwareBool, software, version, license, networkBool, IPv4, IPv6, MAC, subnetmask) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [data.assetName, data.customerID, data.customer, data.location, data.remoteLocation, data.type, data.description, data.notes, data.state, data.lastView, data.user, data.hardwareBool, data.model, data.serialnumber, data.CPU, data.RAM, data.storageConfiguration, data.miscellaneous, data.softwareBool, data.software, data.version, data.license, data.networkBool, data.IPv4, data.IPv6, data.MAC, data.subnetmask])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -87,7 +88,7 @@ export const insertConfigItem = async (data, result) => {
|
|||||||
//get all selected config items by customer
|
//get all selected config items by customer
|
||||||
export const getSelectedConfigItemsByCustomer = async (selected, result) => {
|
export const getSelectedConfigItemsByCustomer = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM changeDB WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
let sql = `SELECT * FROM changedb WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -101,7 +102,7 @@ export const getSelectedConfigItemsByCustomer = async (selected, result) => {
|
|||||||
//get all selected config items by asset name
|
//get all selected config items by asset name
|
||||||
export const getSelectedConfigItemsByAssetName = async (selected, result) => {
|
export const getSelectedConfigItemsByAssetName = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM changeDB WHERE assetName LIKE '%${selected}%' ORDER BY assetName ASC`;
|
let sql = `SELECT * FROM changedb WHERE assetName LIKE '%${selected}%' ORDER BY assetName ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -115,8 +116,9 @@ export const getSelectedConfigItemsByAssetName = async (selected, result) => {
|
|||||||
// Delete config item to Database
|
// Delete config item to Database
|
||||||
export const deleteConfigItemById = async (id, result) => {
|
export const deleteConfigItemById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM changeDB WHERE primaryID = ?`;
|
let sql = `DELETE FROM changedb WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
|
results.insertId = results.insertId.toString();
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
|
|||||||
//get all issue slips
|
//get all issue slips
|
||||||
export const getIssueSlips = async (result) => {
|
export const getIssueSlips = async (result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM issueSlips ORDER BY customer ASC`;
|
let sql = `SELECT * FROM issueslips ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -17,7 +17,7 @@ export const getIssueSlips = async (result) => {
|
|||||||
//get all selected issue slips by ticketnumber
|
//get all selected issue slips by ticketnumber
|
||||||
export const getSelectedIssueSlipsByTicketnumber = async (selected, result) => {
|
export const getSelectedIssueSlipsByTicketnumber = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM issueSlips WHERE ticketNo LIKE '%${selected}%' ORDER BY ticketNo ASC`;
|
let sql = `SELECT * FROM issueslips WHERE ticketNo LIKE '%${selected}%' ORDER BY ticketNo ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ export const getSelectedIssueSlipsByTicketnumber = async (selected, result) => {
|
|||||||
//get all selected issue slips by customer
|
//get all selected issue slips by customer
|
||||||
export const getSelectedIssueSlipsByCustomer = async (selected, result) => {
|
export const getSelectedIssueSlipsByCustomer = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM issueSlips WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
let sql = `SELECT * FROM issueslips WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ export const getSelectedIssueSlipsByCustomer = async (selected, result) => {
|
|||||||
//get all selected issue slips by date of creation
|
//get all selected issue slips by date of creation
|
||||||
export const getSelectedIssueSlipsByDate = async (selected, result) => {
|
export const getSelectedIssueSlipsByDate = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM issueSlips WHERE creationDate LIKE '%${selected}%' ORDER BY creationDate ASC`;
|
let sql = `SELECT * FROM issueslips WHERE creationDate LIKE '%${selected}%' ORDER BY creationDate ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ export const getSelectedIssueSlipsByDate = async (selected, result) => {
|
|||||||
// Delete issue slip to Database
|
// Delete issue slip to Database
|
||||||
export const deleteIssueSlipById = async (id, result) => {
|
export const deleteIssueSlipById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM issueSlips WHERE primaryID = ?`;
|
let sql = `DELETE FROM issueslips WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ export const deleteIssueSlipById = async (id, result) => {
|
|||||||
// Delete issue slip by ticketnumber to Database
|
// Delete issue slip by ticketnumber to Database
|
||||||
export const deleteIssueSlipByTicketNo = async (id, result) => {
|
export const deleteIssueSlipByTicketNo = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM issueSlips WHERE ticketNo = ?`;
|
let sql = `DELETE FROM issueslips WHERE ticketNo = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -87,7 +87,7 @@ export const deleteIssueSlipByTicketNo = async (id, result) => {
|
|||||||
//insert issue slip to database
|
//insert issue slip to database
|
||||||
export const insertIssueSlip = async (data, result) => {
|
export const insertIssueSlip = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO issueSlips(customerID, customer, ticketNo, creationDate, lastView, user, notes, supplierRequest, supplierOffer, clientOffer, clientOrder, supplierOrder, ingress, egress, ingressBill, egressBill) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [data.customerID, data.customer, data.ticketNo, data.creationDate, data.lastView, data.user, data.notes, data.supplierRequest, data.supplierOffer, data.clientOffer, data.clientOrder, data.supplierOrder, data.ingress, data.egress, data.ingressBill, data.egressBill])
|
const results = await ownConn.query(`INSERT INTO issueslips(customerID, customer, ticketNo, creationDate, lastView, user, notes, supplierRequest, supplierOffer, clientOffer, clientOrder, supplierOrder, ingress, egress, ingressBill, egressBill) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [data.customerID, data.customer, data.ticketNo, data.creationDate, data.lastView, data.user, data.notes, data.supplierRequest, data.supplierOffer, data.clientOffer, data.clientOrder, data.supplierOrder, data.ingress, data.egress, data.ingressBill, data.egressBill])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -100,7 +100,7 @@ export const insertIssueSlip = async (data, result) => {
|
|||||||
//get single issue slip by ticketNo
|
//get single issue slip by ticketNo
|
||||||
export const getIssueSlipByTicketNo = async (id, result) => {
|
export const getIssueSlipByTicketNo = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM issueSlips WHERE ticketNo = ?`;
|
let sql = `SELECT * FROM issueslips WHERE ticketNo = ?`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results[0]);
|
result(null, results[0]);
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ export const getIssueSlipByTicketNo = async (id, result) => {
|
|||||||
//get single issue slip by id
|
//get single issue slip by id
|
||||||
export const getIssueSlipById = async (id, result) => {
|
export const getIssueSlipById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM issueSlips WHERE primaryID = ?`;
|
let sql = `SELECT * FROM issueslips WHERE primaryID = ?`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results[0]);
|
result(null, results[0]);
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ export const getIssueSlipById = async (id, result) => {
|
|||||||
export const updateIssueSlipById = async (data, result) => {
|
export const updateIssueSlipById = async (data, result) => {
|
||||||
const id = data.primaryID;
|
const id = data.primaryID;
|
||||||
try {
|
try {
|
||||||
let sql = `UPDATE issueSlips SET customerID = ?, customer = ?, ticketNo = ?, creationDate = ?, lastView = ?, user = ?, notes = ?, supplierRequest = ?, supplierOffer = ?, clientOffer = ?, clientOrder = ?, supplierOrder = ?, ingress = ?, egress = ?, ingressBill = ?, egressBill = ? WHERE primaryID = ?`;
|
let sql = `UPDATE issueslips SET customerID = ?, customer = ?, ticketNo = ?, creationDate = ?, lastView = ?, user = ?, notes = ?, supplierRequest = ?, supplierOffer = ?, clientOffer = ?, clientOrder = ?, supplierOrder = ?, ingress = ?, egress = ?, ingressBill = ?, egressBill = ? WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.customerID, data.customer, data.ticketNo, data.creationDate, data.lastView, data.user, data.notes, data.supplierRequest, data.supplierOffer, data.clientOffer, data.clientOrder, data.supplierOrder, data.ingress, data.egress, data.ingressBill, data.egressBill, id])
|
const results = await ownConn.query(sql, [data.customerID, data.customer, data.ticketNo, data.creationDate, data.lastView, data.user, data.notes, data.supplierRequest, data.supplierOffer, data.clientOffer, data.clientOrder, data.supplierOrder, data.ingress, data.egress, data.ingressBill, data.egressBill, id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
|
|||||||
//get all issue variants
|
//get all issue variants
|
||||||
export const getAllIssueVariants = async (result) => {
|
export const getAllIssueVariants = async (result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM issueVariants ORDER BY primaryID ASC`;
|
let sql = `SELECT * FROM issuevariants ORDER BY primaryID ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -17,7 +17,7 @@ export const getAllIssueVariants = async (result) => {
|
|||||||
//get issue variant
|
//get issue variant
|
||||||
export const getIssueVariantById = async (id, result) => {
|
export const getIssueVariantById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM issueVariants WHERE primaryID = ? ORDER BY primaryID ASC`;
|
let sql = `SELECT * FROM issuevariants WHERE primaryID = ? ORDER BY primaryID ASC`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ export const getIssueVariantById = async (id, result) => {
|
|||||||
//get all selected issue variants by issueID
|
//get all selected issue variants by issueID
|
||||||
export const getSelectedIssueVariantsByIssueId = async (selected, result) => {
|
export const getSelectedIssueVariantsByIssueId = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM issueVariants WHERE issueID LIKE '%${selected}%' ORDER BY issueID ASC`;
|
let sql = `SELECT * FROM issuevariants WHERE issueID LIKE '%${selected}%' ORDER BY issueID ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ export const getSelectedIssueVariantsByIssueId = async (selected, result) => {
|
|||||||
//get all selected issue variants by name
|
//get all selected issue variants by name
|
||||||
export const getSelectedIssueVariantsByName = async (selected, result) => {
|
export const getSelectedIssueVariantsByName = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM issueVariants WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
let sql = `SELECT * FROM issuevariants WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ export const getSelectedIssueVariantsByName = async (selected, result) => {
|
|||||||
export const updateIssueVariantById = async (data, result) => {
|
export const updateIssueVariantById = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const id = data.primaryID;
|
const id = data.primaryID;
|
||||||
let sql = `UPDATE issueVariants SET issueID = ?, name = ? , properties = ?, state = ?, amount = ?, price = ? WHERE primaryID = ?`;
|
let sql = `UPDATE issuevariants SET issueID = ?, name = ? , properties = ?, state = ?, amount = ?, price = ? WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.issueID, data.name, data.properties, data.state, data.amount, data.price, id])
|
const results = await ownConn.query(sql, [data.issueID, data.name, data.properties, data.state, data.amount, data.price, id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -75,7 +75,7 @@ export const updateIssueVariantById = async (data, result) => {
|
|||||||
// Delete issue variant to Database
|
// Delete issue variant to Database
|
||||||
export const deleteIssueVariantById = async (id, result) => {
|
export const deleteIssueVariantById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM issueVariants WHERE primaryID = ?`;
|
let sql = `DELETE FROM issuevariants WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ export const deleteIssueVariantById = async (id, result) => {
|
|||||||
// Delete issue variants by issueID to Database
|
// Delete issue variants by issueID to Database
|
||||||
export const deleteIssueVariantByIssueSlipId = async (id, result) => {
|
export const deleteIssueVariantByIssueSlipId = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM issueVariants WHERE issueID = ?`;
|
let sql = `DELETE FROM issuevariants WHERE issueID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@ export const deleteIssueVariantByIssueSlipId = async (id, result) => {
|
|||||||
//insert issue to databased
|
//insert issue to databased
|
||||||
export const insertIssueVariant = async (data, result) => {
|
export const insertIssueVariant = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO issueVariants(issueID, name, properties, state, amount, price) VALUES(?, ?, ?, ?, ?, ?)`, [data.issueID, data.name, data.properties, data.state, data.amount, data.price])
|
const results = await ownConn.query(`INSERT INTO issuevariants(issueID, name, properties, state, amount, price) VALUES(?, ?, ?, ?, ?, ?)`, [data.issueID, data.name, data.properties, data.state, data.amount, data.price])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
|
|||||||
//get all maintenance visits
|
//get all maintenance visits
|
||||||
export const getMaintenanceVisits = async (result) => {
|
export const getMaintenanceVisits = async (result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM maintenanceVisits ORDER BY name ASC`;
|
let sql = `SELECT * FROM maintenancevisits ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -17,7 +17,7 @@ export const getMaintenanceVisits = async (result) => {
|
|||||||
//get all selected maintenance visits by checklistname
|
//get all selected maintenance visits by checklistname
|
||||||
export const getSelectedMaintenanceVisitsByChecklistname = async (selected, result) => {
|
export const getSelectedMaintenanceVisitsByChecklistname = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM maintenanceVisits WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
let sql = `SELECT * FROM maintenancevisits WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ export const getSelectedMaintenanceVisitsByChecklistname = async (selected, resu
|
|||||||
//get all selected maintenance visits by customer
|
//get all selected maintenance visits by customer
|
||||||
export const getSelectedMaintenanceVisitsByCustomer = async (selected, result) => {
|
export const getSelectedMaintenanceVisitsByCustomer = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM maintenanceVisits WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
let sql = `SELECT * FROM maintenancevisits WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ export const getSelectedMaintenanceVisitsByCustomer = async (selected, result) =
|
|||||||
//get all selected maintenance visits by date
|
//get all selected maintenance visits by date
|
||||||
export const getSelectedMaintenanceVisitsByDate = async (selected, result) => {
|
export const getSelectedMaintenanceVisitsByDate = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM maintenanceVisits WHERE creationDate LIKE '%${selected}%' ORDER BY creationDate ASC`;
|
let sql = `SELECT * FROM maintenancevisits WHERE creationDate LIKE '%${selected}%' ORDER BY creationDate ASC`;
|
||||||
const results = await ownConn.execute(sql);
|
const results = await ownConn.execute(sql);
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ export const getSelectedMaintenanceVisitsByDate = async (selected, result) => {
|
|||||||
//get all selected maintenance visits by state
|
//get all selected maintenance visits by state
|
||||||
export const getSelectedMaintenanceVisitsByState = async (selected, result) => {
|
export const getSelectedMaintenanceVisitsByState = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM maintenanceVisits WHERE state LIKE '%${selected}%' ORDER BY state ASC`;
|
let sql = `SELECT * FROM maintenancevisits WHERE state LIKE '%${selected}%' ORDER BY state ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ export const getSelectedMaintenanceVisitsByState = async (selected, result) => {
|
|||||||
// Delete maintenance visit to Database
|
// Delete maintenance visit to Database
|
||||||
export const deleteMaintenanceVisitById = async (id, result) => {
|
export const deleteMaintenanceVisitById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM maintenanceVisits WHERE primaryID = ?`;
|
let sql = `DELETE FROM maintenancevisits WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -87,7 +87,7 @@ export const deleteMaintenanceVisitById = async (id, result) => {
|
|||||||
//insert maintenance visit to databased
|
//insert maintenance visit to databased
|
||||||
export const insertMaintenanceVisit = async (data, result) => {
|
export const insertMaintenanceVisit = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO maintenanceVisits(name, templateID, maintenanceType, state, creationDate, completionDate, user, customer, customerID, templateNotes, type, timeSpent, notes) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [data.name, data.templateID, data.maintenanceType, data.state, data.creationDate, data.completionDate, data.user, data.customer, data.customerID, data.templateNotes, data.type, data.timeSpent, data.notes])
|
const results = await ownConn.query(`INSERT INTO maintenancevisits(name, templateID, maintenanceType, state, creationDate, completionDate, user, customer, customerID, templateNotes, type, timeSpent, notes) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [data.name, data.templateID, data.maintenanceType, data.state, data.creationDate, data.completionDate, data.user, data.customer, data.customerID, data.templateNotes, data.type, data.timeSpent, data.notes])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -100,7 +100,7 @@ export const insertMaintenanceVisit = async (data, result) => {
|
|||||||
//get single maintenance visit by name
|
//get single maintenance visit by name
|
||||||
export const getMaintenanceVisitByName = async (id, result) => {
|
export const getMaintenanceVisitByName = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM maintenanceVisits WHERE name = ?`;
|
let sql = `SELECT * FROM maintenancevisits WHERE name = ?`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results[0]);
|
result(null, results[0]);
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ export const getMaintenanceVisitByName = async (id, result) => {
|
|||||||
//get single maintenance visit by id
|
//get single maintenance visit by id
|
||||||
export const getMaintenanceVisitById = async (id, result) => {
|
export const getMaintenanceVisitById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM maintenanceVisits WHERE primaryID = ?`;
|
let sql = `SELECT * FROM maintenancevisits WHERE primaryID = ?`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results[0]);
|
result(null, results[0]);
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ export const getMaintenanceVisitById = async (id, result) => {
|
|||||||
export const updateMaintenanceVisitStateById = async (data, result) => {
|
export const updateMaintenanceVisitStateById = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const id = data.primaryID;
|
const id = data.primaryID;
|
||||||
let sql = `UPDATE maintenanceVisits SET state = ? WHERE primaryID = ?`;
|
let sql = `UPDATE maintenancevisits SET state = ? WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.state, id])
|
const results = await ownConn.query(sql, [data.state, id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
|
|||||||
//insert maintenance visit todo to databased
|
//insert maintenance visit todo to databased
|
||||||
export const insertMaintenanceVisitTodo = async (data, result) => {
|
export const insertMaintenanceVisitTodo = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO maintenanceVisitTodos(templateID, step, asset, task, comment, done) VALUES(?, ?, ?, ?, ?, ?)`, [data.templateID, data.step, data.asset, data.task, data.comment, data.done])
|
const results = await ownConn.query(`INSERT INTO maintenancevisittodos(templateID, step, asset, task, comment, done) VALUES(?, ?, ?, ?, ?, ?)`, [data.templateID, data.step, data.asset, data.task, data.comment, data.done])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -16,7 +16,7 @@ export const insertMaintenanceVisitTodo = async (data, result) => {
|
|||||||
//get single maintenance visit todo by id
|
//get single maintenance visit todo by id
|
||||||
export const getMaintenanceVisitTodosById = async (id, result) => {
|
export const getMaintenanceVisitTodosById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM maintenanceVisitTodos WHERE templateID = ? ORDER BY primaryID ASC`;
|
let sql = `SELECT * FROM maintenancevisittodos WHERE templateID = ? ORDER BY primaryID ASC`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -30,7 +30,7 @@ export const getMaintenanceVisitTodosById = async (id, result) => {
|
|||||||
//get single maintenance visit todo by asset
|
//get single maintenance visit todo by asset
|
||||||
export const getMaintenanceVisitTodosByAsset = async (id, result) => {
|
export const getMaintenanceVisitTodosByAsset = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM maintenanceVisitTodos WHERE asset = ? ORDER BY primaryID ASC`;
|
let sql = `SELECT * FROM maintenancevisittodos WHERE asset = ? ORDER BY primaryID ASC`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ export const getMaintenanceVisitTodosByAsset = async (id, result) => {
|
|||||||
export const updateMaintenanceVisitTodoById = async (data, result) => {
|
export const updateMaintenanceVisitTodoById = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const id = data.primaryID;
|
const id = data.primaryID;
|
||||||
let sql = `UPDATE maintenanceVisitTodos SET step = ?, asset = ?, task = ?, comment = ?, done = ? WHERE primaryID = ?`;
|
let sql = `UPDATE maintenancevisittodos SET step = ?, asset = ?, task = ?, comment = ?, done = ? WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.step, data.asset, data.task, data.comment, id])
|
const results = await ownConn.query(sql, [data.step, data.asset, data.task, data.comment, id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ export const updateMaintenanceVisitTodoById = async (data, result) => {
|
|||||||
// Delete maintenance visit todo to Database
|
// Delete maintenance visit todo to Database
|
||||||
export const deleteMaintenanceVisitTodosByPrimaryID = async (id, result) => {
|
export const deleteMaintenanceVisitTodosByPrimaryID = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM maintenanceVisitTodos WHERE primaryID = ?`;
|
let sql = `DELETE FROM maintenancevisittodos WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
|
|||||||
//get single master maintenance visit todo
|
//get single master maintenance visit todo
|
||||||
export const getMasterMaintenanceVisitTodoById = async (id, result) => {
|
export const getMasterMaintenanceVisitTodoById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM masterMaintenanceVisitTodos WHERE templateID = ? ORDER BY rowID ASC`;
|
let sql = `SELECT * FROM mastermaintenancetodos WHERE templateID = ? ORDER BY rowID ASC`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -18,7 +18,7 @@ export const getMasterMaintenanceVisitTodoById = async (id, result) => {
|
|||||||
export const updateMasterMaintenanceVisitTodoById = async (data, result) => {
|
export const updateMasterMaintenanceVisitTodoById = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const id = data.primaryID;
|
const id = data.primaryID;
|
||||||
let sql = `UPDATE masterMaintenanceVisitTodos SET templateID = ?, asset = ? , task = ?, comments = ? WHERE primaryID = ?`;
|
let sql = `UPDATE mastermaintenancetodos SET templateID = ?, asset = ? , task = ?, comments = ? WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.templateID, data.asset, data.task, data.comments, id])
|
const results = await ownConn.query(sql, [data.templateID, data.asset, data.task, data.comments, id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ export const updateMasterMaintenanceVisitTodoById = async (data, result) => {
|
|||||||
// Delete master maintenance visit todo to Database
|
// Delete master maintenance visit todo to Database
|
||||||
export const deleteMasterMaintenanceVisitTodoById = async (id, result) => {
|
export const deleteMasterMaintenanceVisitTodoById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM masterMaintenanceVisitTodos WHERE primaryID = ?`;
|
let sql = `DELETE FROM mastermaintenancetodos WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ export const deleteMasterMaintenanceVisitTodoById = async (id, result) => {
|
|||||||
// Delete master maintenance visit todo by templateID to Database
|
// Delete master maintenance visit todo by templateID to Database
|
||||||
export const deleteMasterMaintenanceVisitTodoByTemplateId = async (id, result) => {
|
export const deleteMasterMaintenanceVisitTodoByTemplateId = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM masterMaintenanceVisitTodos WHERE templateID = ?`;
|
let sql = `DELETE FROM mastermaintenancetodos WHERE templateID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@ export const deleteMasterMaintenanceVisitTodoByTemplateId = async (id, result) =
|
|||||||
// Update all master maintenance visit todos to Database
|
// Update all master maintenance visit todos to Database
|
||||||
export const updateMasterMaintenanceVisitTodos = async (data, result) => {
|
export const updateMasterMaintenanceVisitTodos = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `UPDATE masterMaintenanceVisitTodos SET rowID = ? WHERE primaryID = ?`;
|
let sql = `UPDATE mastermaintenancetodos SET rowID = ? WHERE primaryID = ?`;
|
||||||
data.data.forEach(async i => {
|
data.data.forEach(async i => {
|
||||||
let id = i.primaryID;
|
let id = i.primaryID;
|
||||||
let rowId = i.rowID;
|
let rowId = i.rowID;
|
||||||
@ -79,7 +79,7 @@ export const updateMasterMaintenanceVisitTodos = async (data, result) => {
|
|||||||
//insert master maintenance visit todo to databased
|
//insert master maintenance visit todo to databased
|
||||||
export const insertMasterMaintenanceVisitTodo = async (data, result) => {
|
export const insertMasterMaintenanceVisitTodo = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO masterMaintenanceVisitTodos(templateID, rowID, asset, task, comments) VALUES(?, ?, ?, ?, ?)`, [data.templateID, data.rowID, data.asset, data.task, asset.comments])
|
const results = await ownConn.query(`INSERT INTO mastermaintenancetodos(templateID, rowID, asset, task, comments) VALUES(?, ?, ?, ?, ?)`, [data.templateID, data.rowID, data.asset, data.task, asset.comments])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
|
|||||||
//get all master maintenance visits
|
//get all master maintenance visits
|
||||||
export const getMasterMaintenanceVisits = async (result) => {
|
export const getMasterMaintenanceVisits = async (result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM masterMaintenanceVisits ORDER BY name ASC`;
|
let sql = `SELECT * FROM mastermaintenancevisits ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -17,7 +17,7 @@ export const getMasterMaintenanceVisits = async (result) => {
|
|||||||
//get all selected master maintenance visits by customer
|
//get all selected master maintenance visits by customer
|
||||||
export const getSelectedMasterMaintenanceVisitsByCustomer = async (selected, result) => {
|
export const getSelectedMasterMaintenanceVisitsByCustomer = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM masterMaintenanceVisits WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
let sql = `SELECT * FROM mastermaintenancevisits WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ export const getSelectedMasterMaintenanceVisitsByCustomer = async (selected, res
|
|||||||
//get all selected master maintenance visits by checklistname
|
//get all selected master maintenance visits by checklistname
|
||||||
export const getSelectedMasterMaintenanceVisitsByChecklistname = async (selected, result) => {
|
export const getSelectedMasterMaintenanceVisitsByChecklistname = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM masterMaintenanceVisits WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
let sql = `SELECT * FROM mastermaintenancevisits WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ export const getSelectedMasterMaintenanceVisitsByChecklistname = async (selected
|
|||||||
//get single master maintenance visit
|
//get single master maintenance visit
|
||||||
export const getMasterMaintenanceVisitById = async (id, result) => {
|
export const getMasterMaintenanceVisitById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM masterMaintenanceVisits WHERE checklistID = ?`;
|
let sql = `SELECT * FROM mastermaintenancevisits WHERE checklistID = ?`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results[0]);
|
result(null, results[0]);
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ export const getMasterMaintenanceVisitById = async (id, result) => {
|
|||||||
export const updateMasterMaintenanceVisitById = async (data, result) => {
|
export const updateMasterMaintenanceVisitById = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const id = data.checklistID;
|
const id = data.checklistID;
|
||||||
let sql = `UPDATE masterMaintenanceVisits SET name = ?, customerID = ? , customer = ?, type = ?, lastView = ?, user = ?, notes = ? WHERE checklistID = ?`;
|
let sql = `UPDATE mastermaintenancevisits SET name = ?, customerID = ? , customer = ?, type = ?, lastView = ?, user = ?, notes = ? WHERE checklistID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.name, data.customerID, data.customer, data.type, data.lastView, data.user, data.notes, id])
|
const results = await ownConn.query(sql, [data.name, data.customerID, data.customer, data.type, data.lastView, data.user, data.notes, id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ export const updateMasterMaintenanceVisitById = async (data, result) => {
|
|||||||
//insert master maintenance visit to databased
|
//insert master maintenance visit to databased
|
||||||
export const insertMasterMaintenanceVisit = async (data, result) => {
|
export const insertMasterMaintenanceVisit = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO masterMaintenanceVisits(name, customerID, customer, type, lastView, user, notes) VALUES(?, ?, ?, ?, ?, ?, ?)`, [data.name, data.customerID, data.customer, data.type, data.lastView, data.user, data.notes])
|
const results = await ownConn.query(`INSERT INTO mastermaintenancevisits(name, customerID, customer, type, lastView, user, notes) VALUES(?, ?, ?, ?, ?, ?, ?)`, [data.name, data.customerID, data.customer, data.type, data.lastView, data.user, data.notes])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -87,7 +87,7 @@ export const insertMasterMaintenanceVisit = async (data, result) => {
|
|||||||
// Delete master maintenance visit to Database
|
// Delete master maintenance visit to Database
|
||||||
export const deleteMasterMaintenanceVisitById = async (id, result) => {
|
export const deleteMasterMaintenanceVisitById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM masterMaintenanceVisits WHERE checklistID = ?`;
|
let sql = `DELETE FROM mastermaintenancevisits WHERE checklistID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
|
|||||||
//get single master production order todo
|
//get single master production order todo
|
||||||
export const getMasterProductionOrderTodoById = async (id, result) => {
|
export const getMasterProductionOrderTodoById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM masterOrderTodos WHERE templateID = ? ORDER BY rowID ASC`;
|
let sql = `SELECT * FROM masterordertodos WHERE templateID = ? ORDER BY rowID ASC`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -18,7 +18,7 @@ export const getMasterProductionOrderTodoById = async (id, result) => {
|
|||||||
export const updateMasterProductionOrderTodoById = async (data, result) => {
|
export const updateMasterProductionOrderTodoById = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const id = data.primaryID;
|
const id = data.primaryID;
|
||||||
let sql = `UPDATE masterOrderTodos SET templateID = ?, asset = ? , task = ?, comment = ? WHERE primaryID = ?`;
|
let sql = `UPDATE masterordertodos SET templateID = ?, asset = ? , task = ?, comment = ? WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.templateID, data.asset, data.task, data.comment, id])
|
const results = await ownConn.query(sql, [data.templateID, data.asset, data.task, data.comment, id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ export const updateMasterProductionOrderTodoById = async (data, result) => {
|
|||||||
// Delete master production order todo to Database
|
// Delete master production order todo to Database
|
||||||
export const deleteMasterProductionOrderTodoById = async (id, result) => {
|
export const deleteMasterProductionOrderTodoById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM masterOrderTodos WHERE primaryID = ?`;
|
let sql = `DELETE FROM masterordertodos WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ export const deleteMasterProductionOrderTodoById = async (id, result) => {
|
|||||||
// Delete master production order todo by templateID to Database
|
// Delete master production order todo by templateID to Database
|
||||||
export const deleteMasterProductionOrderTodoByTemplateId = async (id, result) => {
|
export const deleteMasterProductionOrderTodoByTemplateId = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM masterOrderTodos WHERE templateID = ?`;
|
let sql = `DELETE FROM masterordertodos WHERE templateID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@ export const deleteMasterProductionOrderTodoByTemplateId = async (id, result) =>
|
|||||||
// Update all master production order todos to Database
|
// Update all master production order todos to Database
|
||||||
export const updateMasterProductionOrderTodos = async (data, result) => {
|
export const updateMasterProductionOrderTodos = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `UPDATE masterOrderTodos SET rowID = ? WHERE primaryID = ?`;
|
let sql = `UPDATE masterordertodos SET rowID = ? WHERE primaryID = ?`;
|
||||||
data.data.forEach(async i => {
|
data.data.forEach(async i => {
|
||||||
let id = i.primaryID;
|
let id = i.primaryID;
|
||||||
let rowId = i.rowID;
|
let rowId = i.rowID;
|
||||||
@ -79,7 +79,7 @@ export const updateMasterProductionOrderTodos = async (data, result) => {
|
|||||||
//insert master production order todo to databased
|
//insert master production order todo to databased
|
||||||
export const insertMasterProductionOrderTodo = async (data, result) => {
|
export const insertMasterProductionOrderTodo = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO masterOrderTodos(templateID, rowID, asset, task, comment) VALUES(?, ?, ?, ?, ?)`, [data.templateID, data.rowID, data.asset, data.task, data.comment])
|
const results = await ownConn.query(`INSERT INTO masterordertodos(templateID, rowID, asset, task, comment) VALUES(?, ?, ?, ?, ?)`, [data.templateID, data.rowID, data.asset, data.task, data.comment])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
|
|||||||
//get all master production orders
|
//get all master production orders
|
||||||
export const getMasterProductionOrders = async (result) => {
|
export const getMasterProductionOrders = async (result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM masterProductionOrders ORDER BY name ASC`;
|
let sql = `SELECT * FROM masterproductionorders ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -17,7 +17,7 @@ export const getMasterProductionOrders = async (result) => {
|
|||||||
//get all selected master production orders by customer
|
//get all selected master production orders by customer
|
||||||
export const getSelectedMasterProductionOrdersByCustomer = async (selected, result) => {
|
export const getSelectedMasterProductionOrdersByCustomer = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM masterProductionOrders WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
let sql = `SELECT * FROM masterproductionorders WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ export const getSelectedMasterProductionOrdersByCustomer = async (selected, resu
|
|||||||
//get all selected master production orders by checklistname
|
//get all selected master production orders by checklistname
|
||||||
export const getSelectedMasterProductionOrdersByChecklistname = async (selected, result) => {
|
export const getSelectedMasterProductionOrdersByChecklistname = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM masterProductionOrders WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
let sql = `SELECT * FROM masterproductionorders WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ export const getSelectedMasterProductionOrdersByChecklistname = async (selected,
|
|||||||
//get single master production order
|
//get single master production order
|
||||||
export const getMasterProductionOrderById = async (id, result) => {
|
export const getMasterProductionOrderById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM masterProductionOrders WHERE templateID = ?`;
|
let sql = `SELECT * FROM masterproductionorders WHERE templateID = ?`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results[0]);
|
result(null, results[0]);
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ export const getMasterProductionOrderById = async (id, result) => {
|
|||||||
export const updateMasterProductionOrderById = async (data, result) => {
|
export const updateMasterProductionOrderById = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const id = data.templateID;
|
const id = data.templateID;
|
||||||
let sql = `UPDATE masterProductionOrders SET name = ?, customerID = ? , customer = ?, lastView = ?, user = ?, description = ?, notes = ? WHERE templateID = ?`;
|
let sql = `UPDATE masterproductionorders SET name = ?, customerID = ? , customer = ?, lastView = ?, user = ?, description = ?, notes = ? WHERE templateID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.name, data.customerID, data.customer, data.lastView, data.user, data.description, data.notes, id])
|
const results = await ownConn.query(sql, [data.name, data.customerID, data.customer, data.lastView, data.user, data.description, data.notes, id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ export const updateMasterProductionOrderById = async (data, result) => {
|
|||||||
//insert master production order to databased
|
//insert master production order to databased
|
||||||
export const insertMasterProductionOrder = async (data, result) => {
|
export const insertMasterProductionOrder = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO masterProductionOrders(name, customerID, customer, lastView, user, description, notes) VALUES(?, ?, ?, ?, ?, ?, ?)`, [data.name, data.customerID, data.customer, data.lastView, data.user, data.description, data.notes])
|
const results = await ownConn.query(`INSERT INTO masterproductionorders(name, customerID, customer, lastView, user, description, notes) VALUES(?, ?, ?, ?, ?, ?, ?)`, [data.name, data.customerID, data.customer, data.lastView, data.user, data.description, data.notes])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -87,7 +87,7 @@ export const insertMasterProductionOrder = async (data, result) => {
|
|||||||
// Delete master production order to Database
|
// Delete master production order to Database
|
||||||
export const deleteMasterProductionOrderById = async (id, result) => {
|
export const deleteMasterProductionOrderById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM masterProductionOrders WHERE templateID = ?`;
|
let sql = `DELETE FROM masterproductionorders WHERE templateID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
|
|||||||
//get single ordering info issue slip
|
//get single ordering info issue slip
|
||||||
export const getOrderingInfoIssueSlipById = async (id, result) => {
|
export const getOrderingInfoIssueSlipById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM orderingInfoIssueSlips WHERE issueSlipID = ? ORDER BY primaryID ASC`;
|
let sql = `SELECT * FROM orderinginfoissueslips WHERE issueSlipID = ? ORDER BY primaryID ASC`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -18,7 +18,7 @@ export const getOrderingInfoIssueSlipById = async (id, result) => {
|
|||||||
export const updateOrderingInfoIssueSlipById = async (data, result) => {
|
export const updateOrderingInfoIssueSlipById = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const id = data.primaryID;
|
const id = data.primaryID;
|
||||||
let sql = `UPDATE orderingInfoIssueSlips SET issueSlipID = ?, article = ? , amount = ?, price = ?, comment = ? WHERE primaryID = ?`;
|
let sql = `UPDATE orderinginfoissueslips SET issueSlipID = ?, article = ? , amount = ?, price = ?, comment = ? WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.issueSlipID, data.article, data.amount, data.price, data.comment, id])
|
const results = await ownConn.query(sql, [data.issueSlipID, data.article, data.amount, data.price, data.comment, id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ export const updateOrderingInfoIssueSlipById = async (data, result) => {
|
|||||||
// Delete ordering info issue slip to Database
|
// Delete ordering info issue slip to Database
|
||||||
export const deleteOrderingInfoIssueSlipById = async (id, result) => {
|
export const deleteOrderingInfoIssueSlipById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM orderingInfoIssueSlips WHERE primaryID = ?`;
|
let sql = `DELETE FROM orderinginfoissueslips WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ export const deleteOrderingInfoIssueSlipById = async (id, result) => {
|
|||||||
// Delete ordering info issue slip by issueSlipID to Database
|
// Delete ordering info issue slip by issueSlipID to Database
|
||||||
export const deleteOrderingInfoIssueSlipByIssueSlipId = async (id, result) => {
|
export const deleteOrderingInfoIssueSlipByIssueSlipId = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM orderingInfoIssueSlips WHERE issueSlipID = ?`;
|
let sql = `DELETE FROM orderinginfoissueslips WHERE issueSlipID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@ export const deleteOrderingInfoIssueSlipByIssueSlipId = async (id, result) => {
|
|||||||
//insert ordering info issue slip to databased
|
//insert ordering info issue slip to databased
|
||||||
export const insertOrderingInfoIssueSlip = async (data, result) => {
|
export const insertOrderingInfoIssueSlip = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO orderingInfoIssueSlips(issueSlipID, article, amount, price, comment) VALUES(?, ?, ?, ?, ?)`, [data.issueSlipID, data.article, data.amount, data.price, data.comment])
|
const results = await ownConn.query(`INSERT INTO orderinginfoissueslips(issueSlipID, article, amount, price, comment) VALUES(?, ?, ?, ?, ?)`, [data.issueSlipID, data.article, data.amount, data.price, data.comment])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
|
|||||||
//get all production orders
|
//get all production orders
|
||||||
export const getProductionOrders = async (result) => {
|
export const getProductionOrders = async (result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM productionOrders ORDER BY name ASC`;
|
let sql = `SELECT * FROM productionorders ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -17,7 +17,7 @@ export const getProductionOrders = async (result) => {
|
|||||||
//get all selected production orders by ticketnumber
|
//get all selected production orders by ticketnumber
|
||||||
export const getSelectedProductionOrdersByTicketnumber = async (selected, result) => {
|
export const getSelectedProductionOrdersByTicketnumber = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM productionOrders WHERE ticketNumber LIKE '%${selected}%' ORDER BY ticketNumber ASC`;
|
let sql = `SELECT * FROM productionorders WHERE ticketNumber LIKE '%${selected}%' ORDER BY ticketNumber ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ export const getSelectedProductionOrdersByTicketnumber = async (selected, result
|
|||||||
//get all selected production orders by customer
|
//get all selected production orders by customer
|
||||||
export const getSelectedProductionOrdersByCustomer = async (selected, result) => {
|
export const getSelectedProductionOrdersByCustomer = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM productionOrders WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
let sql = `SELECT * FROM productionorders WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ export const getSelectedProductionOrdersByCustomer = async (selected, result) =>
|
|||||||
//get all selected production orders by state
|
//get all selected production orders by state
|
||||||
export const getSelectedProductionOrdersByState = async (selected, result) => {
|
export const getSelectedProductionOrdersByState = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM productionOrders WHERE state LIKE '%${selected}%' ORDER BY state ASC`;
|
let sql = `SELECT * FROM productionorders WHERE state LIKE '%${selected}%' ORDER BY state ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ export const getSelectedProductionOrdersByState = async (selected, result) => {
|
|||||||
//get all selected production orders by checklistname
|
//get all selected production orders by checklistname
|
||||||
export const getSelectedProductionOrdersByChecklistname = async (selected, result) => {
|
export const getSelectedProductionOrdersByChecklistname = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM productionOrders WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
let sql = `SELECT * FROM productionorders WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ export const getSelectedProductionOrdersByChecklistname = async (selected, resul
|
|||||||
//get all selected production orders by date of creation
|
//get all selected production orders by date of creation
|
||||||
export const getSelectedProductionOrdersByDate = async (selected, result) => {
|
export const getSelectedProductionOrdersByDate = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM productionOrders WHERE creationDate LIKE '%${selected}%' ORDER BY creationDate ASC`;
|
let sql = `SELECT * FROM productionorders WHERE creationDate LIKE '%${selected}%' ORDER BY creationDate ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -87,7 +87,7 @@ export const getSelectedProductionOrdersByDate = async (selected, result) => {
|
|||||||
// Delete production order to Database
|
// Delete production order to Database
|
||||||
export const deleteProductionOrderById = async (id, result) => {
|
export const deleteProductionOrderById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM productionOrders WHERE ticketNumber = ?`;
|
let sql = `DELETE FROM productionorders WHERE ticketNumber = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -101,7 +101,7 @@ export const deleteProductionOrderById = async (id, result) => {
|
|||||||
//insert production order to database
|
//insert production order to database
|
||||||
export const insertProductionOrder = async (data, result) => {
|
export const insertProductionOrder = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO productionOrders(name, templateID, customer, customerID, asset, state, creationDate, completionDate, user, templateDescription, templateNotes, timeSpent, notes) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [data.name, data.templateID, data.customer, data.customerID, data.asset, data.state, data.creationDate, data.completionDate, data.user, data.templateDescription, data.templateNotes, data.timeSpent, data.notes])
|
const results = await ownConn.query(`INSERT INTO productionorders(name, templateID, customer, customerID, asset, state, creationDate, completionDate, user, templateDescription, templateNotes, timeSpent, notes) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [data.name, data.templateID, data.customer, data.customerID, data.asset, data.state, data.creationDate, data.completionDate, data.user, data.templateDescription, data.templateNotes, data.timeSpent, data.notes])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -114,7 +114,7 @@ export const insertProductionOrder = async (data, result) => {
|
|||||||
//get single production order by name
|
//get single production order by name
|
||||||
export const getProductionOrderByName = async (id, result) => {
|
export const getProductionOrderByName = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM productionOrders WHERE name = ?`;
|
let sql = `SELECT * FROM productionorders WHERE name = ?`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results[0]);
|
result(null, results[0]);
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ export const getProductionOrderByName = async (id, result) => {
|
|||||||
//get single production order by id
|
//get single production order by id
|
||||||
export const getProductionOrderById = async (id, result) => {
|
export const getProductionOrderById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM productionOrders WHERE ticketNumber = ?`;
|
let sql = `SELECT * FROM productionorders WHERE ticketNumber = ?`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results[0]);
|
result(null, results[0]);
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ export const getProductionOrderById = async (id, result) => {
|
|||||||
export const updateProductionOrderStateById = async (data, result) => {
|
export const updateProductionOrderStateById = async (data, result) => {
|
||||||
const id = data.ticketNumber;
|
const id = data.ticketNumber;
|
||||||
try {
|
try {
|
||||||
let sql = `UPDATE productionOrders SET state = ? WHERE ticketNumber = ?`;
|
let sql = `UPDATE productionorders SET state = ? WHERE ticketNumber = ?`;
|
||||||
const results = await ownConn.query(sql, [data.state, id])
|
const results = await ownConn.query(sql, [data.state, id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ownConn from "../dbConfig.js";
|
|||||||
//insert production order todo to databased
|
//insert production order todo to databased
|
||||||
export const insertProductionOrderTodo = async (data, result) => {
|
export const insertProductionOrderTodo = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO productionOrderTodos(templateID, step, asset, task, comment, done) VALUES(?, ?, ?, ?, ?, ?)`, [data.templateID, data.step, data.asset, data.task, data.comment, data.done]);
|
const results = await ownConn.query(`INSERT INTO productionordertodos(templateID, step, asset, task, comment, done) VALUES(?, ?, ?, ?, ?, ?)`, [data.templateID, data.step, data.asset, data.task, data.comment, data.done]);
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -16,7 +16,7 @@ export const insertProductionOrderTodo = async (data, result) => {
|
|||||||
//get single production order todo by id
|
//get single production order todo by id
|
||||||
export const getProductionOrderTodosById = async (id, result) => {
|
export const getProductionOrderTodosById = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM productionOrderTodos WHERE templateID = ? ORDER BY primaryID ASC`;
|
let sql = `SELECT * FROM productionordertodos WHERE templateID = ? ORDER BY primaryID ASC`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -30,7 +30,7 @@ export const getProductionOrderTodosById = async (id, result) => {
|
|||||||
//get single production order todo by asset
|
//get single production order todo by asset
|
||||||
export const getProductionOrderTodosByAsset = async (id, result) => {
|
export const getProductionOrderTodosByAsset = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM productionOrderTodos WHERE asset = ? ORDER BY primaryID ASC`;
|
let sql = `SELECT * FROM productionordertodos WHERE asset = ? ORDER BY primaryID ASC`;
|
||||||
const results = await ownConn.execute(sql, [id])
|
const results = await ownConn.execute(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ export const getProductionOrderTodosByAsset = async (id, result) => {
|
|||||||
export const updateProductionOrderTodoById = async (data, result) => {
|
export const updateProductionOrderTodoById = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const id = data.primaryID;
|
const id = data.primaryID;
|
||||||
let sql = `UPDATE productionOrderTodos SET step = ?, asset = ?, task = ?, comment = ?, done = ? WHERE primaryID = ?`;
|
let sql = `UPDATE productionordertodos SET step = ?, asset = ?, task = ?, comment = ?, done = ? WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.step, data.asset, data.task, data.comment, data.done, id])
|
const results = await ownConn.query(sql, [data.step, data.asset, data.task, data.comment, data.done, id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ export const updateProductionOrderTodoById = async (data, result) => {
|
|||||||
// Delete production order todos to Database
|
// Delete production order todos to Database
|
||||||
export const deleteProductionOrderTodosChecklistID = async (id, result) => {
|
export const deleteProductionOrderTodosChecklistID = async (id, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM productionOrderTodos WHERE templateID = ?`;
|
let sql = `DELETE FROM productionordertodos WHERE templateID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
86
certs/fullchain.pem
Normal file
86
certs/fullchain.pem
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIEJjCCAw6gAwIBAgISBH1fpnN5tMAmG9rSrKXMtWHmMA0GCSqGSIb3DQEBCwUA
|
||||||
|
MDIxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQswCQYDVQQD
|
||||||
|
EwJSMzAeFw0yNDAyMDcxMTI4MzFaFw0yNDA1MDcxMTI4MzBaMBwxGjAYBgNVBAMT
|
||||||
|
EXR1ZWl0YXBwLnR1ZWl0LmRlMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp/Sf
|
||||||
|
OcRDk6oMEUZnRMyOpMdVWJB6Q0Hs3Ly9QHoEjCwJaPXo5dRLilcb9cgU7omZYoyN
|
||||||
|
Tf6ilHAvxGkr/k/saaOCAhUwggIRMA4GA1UdDwEB/wQEAwIHgDAdBgNVHSUEFjAU
|
||||||
|
BggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQU9GpF
|
||||||
|
/YlVXjNNI8WDy9HBmmx6JMEwHwYDVR0jBBgwFoAUFC6zF7dYVsuuUAlA5h+vnYsU
|
||||||
|
wsYwVQYIKwYBBQUHAQEESTBHMCEGCCsGAQUFBzABhhVodHRwOi8vcjMuby5sZW5j
|
||||||
|
ci5vcmcwIgYIKwYBBQUHMAKGFmh0dHA6Ly9yMy5pLmxlbmNyLm9yZy8wHAYDVR0R
|
||||||
|
BBUwE4IRdHVlaXRhcHAudHVlaXQuZGUwEwYDVR0gBAwwCjAIBgZngQwBAgEwggEG
|
||||||
|
BgorBgEEAdZ5AgQCBIH3BIH0APIAdwA7U3d1Pi25gE6LMFsG/kA7Z9hPw/THvQAN
|
||||||
|
LXJv4frUFwAAAY2DiovMAAAEAwBIMEYCIQDUiw7jGx4k8y49+QeuGNUX6WciOA0s
|
||||||
|
Jipwvi+tjOumGgIhAN2jCoI3iQmpAYN3SvfieUPrAgd2X3RfZa0OzW91XYHWAHcA
|
||||||
|
ouK/1h7eLy8HoNZObTen3GVDsMa1LqLat4r4mm31F9gAAAGNg4qMPQAABAMASDBG
|
||||||
|
AiEAoA4lggVcXpGHlGLqJwVaKdcTsMEM9hsRaPnwtLeRNnMCIQCMUElVlogieFjP
|
||||||
|
hroL/raJrPrakqu9qOm0U3OW8aGPGzANBgkqhkiG9w0BAQsFAAOCAQEAFbGv7Omn
|
||||||
|
OWIW6/9zpasBhxOXNNxz5G1YDKnktgK9qrCius39oexbaxyRCgQj7Y2aVirjHEct
|
||||||
|
pFkpqdT8oRxOwym3UnTe6en/KqSzahuTLxKsWzvt+zYScEAbdv+ShAycojvuCbcN
|
||||||
|
NTzZzVbk5iT2GjPyzB+wBEbEILy1NFzf5sHBTsWOnbClidKpUvYgK6wuEoHb6DPP
|
||||||
|
cfI5OHRU/cOB6rljYZYzz4znhNYuwviBUXEf1qIOfPDxZnM0zrh6eJ4wRXZDdGkn
|
||||||
|
FQdmweAZn/dUpBEjRNuqSF4tGRKRtKZ3PQBNK35yAI4rFROJquhoQXxJK8XrAYyz
|
||||||
|
KJl4MTF4Rk5VMQ==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw
|
||||||
|
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
|
||||||
|
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMjAwOTA0MDAwMDAw
|
||||||
|
WhcNMjUwOTE1MTYwMDAwWjAyMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg
|
||||||
|
RW5jcnlwdDELMAkGA1UEAxMCUjMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
|
||||||
|
AoIBAQC7AhUozPaglNMPEuyNVZLD+ILxmaZ6QoinXSaqtSu5xUyxr45r+XXIo9cP
|
||||||
|
R5QUVTVXjJ6oojkZ9YI8QqlObvU7wy7bjcCwXPNZOOftz2nwWgsbvsCUJCWH+jdx
|
||||||
|
sxPnHKzhm+/b5DtFUkWWqcFTzjTIUu61ru2P3mBw4qVUq7ZtDpelQDRrK9O8Zutm
|
||||||
|
NHz6a4uPVymZ+DAXXbpyb/uBxa3Shlg9F8fnCbvxK/eG3MHacV3URuPMrSXBiLxg
|
||||||
|
Z3Vms/EY96Jc5lP/Ooi2R6X/ExjqmAl3P51T+c8B5fWmcBcUr2Ok/5mzk53cU6cG
|
||||||
|
/kiFHaFpriV1uxPMUgP17VGhi9sVAgMBAAGjggEIMIIBBDAOBgNVHQ8BAf8EBAMC
|
||||||
|
AYYwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMBIGA1UdEwEB/wQIMAYB
|
||||||
|
Af8CAQAwHQYDVR0OBBYEFBQusxe3WFbLrlAJQOYfr52LFMLGMB8GA1UdIwQYMBaA
|
||||||
|
FHm0WeZ7tuXkAXOACIjIGlj26ZtuMDIGCCsGAQUFBwEBBCYwJDAiBggrBgEFBQcw
|
||||||
|
AoYWaHR0cDovL3gxLmkubGVuY3Iub3JnLzAnBgNVHR8EIDAeMBygGqAYhhZodHRw
|
||||||
|
Oi8veDEuYy5sZW5jci5vcmcvMCIGA1UdIAQbMBkwCAYGZ4EMAQIBMA0GCysGAQQB
|
||||||
|
gt8TAQEBMA0GCSqGSIb3DQEBCwUAA4ICAQCFyk5HPqP3hUSFvNVneLKYY611TR6W
|
||||||
|
PTNlclQtgaDqw+34IL9fzLdwALduO/ZelN7kIJ+m74uyA+eitRY8kc607TkC53wl
|
||||||
|
ikfmZW4/RvTZ8M6UK+5UzhK8jCdLuMGYL6KvzXGRSgi3yLgjewQtCPkIVz6D2QQz
|
||||||
|
CkcheAmCJ8MqyJu5zlzyZMjAvnnAT45tRAxekrsu94sQ4egdRCnbWSDtY7kh+BIm
|
||||||
|
lJNXoB1lBMEKIq4QDUOXoRgffuDghje1WrG9ML+Hbisq/yFOGwXD9RiX8F6sw6W4
|
||||||
|
avAuvDszue5L3sz85K+EC4Y/wFVDNvZo4TYXao6Z0f+lQKc0t8DQYzk1OXVu8rp2
|
||||||
|
yJMC6alLbBfODALZvYH7n7do1AZls4I9d1P4jnkDrQoxB3UqQ9hVl3LEKQ73xF1O
|
||||||
|
yK5GhDDX8oVfGKF5u+decIsH4YaTw7mP3GFxJSqv3+0lUFJoi5Lc5da149p90Ids
|
||||||
|
hCExroL1+7mryIkXPeFM5TgO9r0rvZaBFOvV2z0gp35Z0+L4WPlbuEjN/lxPFin+
|
||||||
|
HlUjr8gRsI3qfJOQFy/9rKIJR0Y/8Omwt/8oTWgy1mdeHmmjk7j1nYsvC9JSQ6Zv
|
||||||
|
MldlTTKB3zhThV1+XWYp6rjd5JW1zbVWEkLNxE7GJThEUG3szgBVGP7pSWTUTsqX
|
||||||
|
nLRbwHOoq7hHwg==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIFYDCCBEigAwIBAgIQQAF3ITfU6UK47naqPGQKtzANBgkqhkiG9w0BAQsFADA/
|
||||||
|
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
|
||||||
|
DkRTVCBSb290IENBIFgzMB4XDTIxMDEyMDE5MTQwM1oXDTI0MDkzMDE4MTQwM1ow
|
||||||
|
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
|
||||||
|
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwggIiMA0GCSqGSIb3DQEB
|
||||||
|
AQUAA4ICDwAwggIKAoICAQCt6CRz9BQ385ueK1coHIe+3LffOJCMbjzmV6B493XC
|
||||||
|
ov71am72AE8o295ohmxEk7axY/0UEmu/H9LqMZshftEzPLpI9d1537O4/xLxIZpL
|
||||||
|
wYqGcWlKZmZsj348cL+tKSIG8+TA5oCu4kuPt5l+lAOf00eXfJlII1PoOK5PCm+D
|
||||||
|
LtFJV4yAdLbaL9A4jXsDcCEbdfIwPPqPrt3aY6vrFk/CjhFLfs8L6P+1dy70sntK
|
||||||
|
4EwSJQxwjQMpoOFTJOwT2e4ZvxCzSow/iaNhUd6shweU9GNx7C7ib1uYgeGJXDR5
|
||||||
|
bHbvO5BieebbpJovJsXQEOEO3tkQjhb7t/eo98flAgeYjzYIlefiN5YNNnWe+w5y
|
||||||
|
sR2bvAP5SQXYgd0FtCrWQemsAXaVCg/Y39W9Eh81LygXbNKYwagJZHduRze6zqxZ
|
||||||
|
Xmidf3LWicUGQSk+WT7dJvUkyRGnWqNMQB9GoZm1pzpRboY7nn1ypxIFeFntPlF4
|
||||||
|
FQsDj43QLwWyPntKHEtzBRL8xurgUBN8Q5N0s8p0544fAQjQMNRbcTa0B7rBMDBc
|
||||||
|
SLeCO5imfWCKoqMpgsy6vYMEG6KDA0Gh1gXxG8K28Kh8hjtGqEgqiNx2mna/H2ql
|
||||||
|
PRmP6zjzZN7IKw0KKP/32+IVQtQi0Cdd4Xn+GOdwiK1O5tmLOsbdJ1Fu/7xk9TND
|
||||||
|
TwIDAQABo4IBRjCCAUIwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw
|
||||||
|
SwYIKwYBBQUHAQEEPzA9MDsGCCsGAQUFBzAChi9odHRwOi8vYXBwcy5pZGVudHJ1
|
||||||
|
c3QuY29tL3Jvb3RzL2RzdHJvb3RjYXgzLnA3YzAfBgNVHSMEGDAWgBTEp7Gkeyxx
|
||||||
|
+tvhS5B1/8QVYIWJEDBUBgNVHSAETTBLMAgGBmeBDAECATA/BgsrBgEEAYLfEwEB
|
||||||
|
ATAwMC4GCCsGAQUFBwIBFiJodHRwOi8vY3BzLnJvb3QteDEubGV0c2VuY3J5cHQu
|
||||||
|
b3JnMDwGA1UdHwQ1MDMwMaAvoC2GK2h0dHA6Ly9jcmwuaWRlbnRydXN0LmNvbS9E
|
||||||
|
U1RST09UQ0FYM0NSTC5jcmwwHQYDVR0OBBYEFHm0WeZ7tuXkAXOACIjIGlj26Ztu
|
||||||
|
MA0GCSqGSIb3DQEBCwUAA4IBAQAKcwBslm7/DlLQrt2M51oGrS+o44+/yQoDFVDC
|
||||||
|
5WxCu2+b9LRPwkSICHXM6webFGJueN7sJ7o5XPWioW5WlHAQU7G75K/QosMrAdSW
|
||||||
|
9MUgNTP52GE24HGNtLi1qoJFlcDyqSMo59ahy2cI2qBDLKobkx/J3vWraV0T9VuG
|
||||||
|
WCLKTVXkcGdtwlfFRjlBz4pYg1htmf5X6DYO8A4jqv2Il9DjXA6USbW1FzXSLr9O
|
||||||
|
he8Y4IWS6wY7bCkjCWDcRQJMEhg76fsO3txE+FiYruq9RUWhiF1myv4Q6W+CyBFC
|
||||||
|
Dfvp7OOGAN6dEOM4+qR9sdjoSYKEBpsr6GtPAQw4dy753ec5
|
||||||
|
-----END CERTIFICATE-----
|
||||||
@ -1,24 +0,0 @@
|
|||||||
-----BEGIN CERTIFICATE-----
|
|
||||||
MIIEAzCCAuugAwIBAgIUVwDWxw7XeYOG6Y0uziRnZq2qri8wDQYJKoZIhvcNAQEL
|
|
||||||
BQAwKTELMAkGA1UEBhMCREUxGjAYBgNVBAMMEUxvY2FsaG9zdC1Sb290LUNBMB4X
|
|
||||||
DTIzMTAxNjA5MDMxMFoXDTI2MDgwNTA5MDMxMFowdzELMAkGA1UEBhMCREUxGzAZ
|
|
||||||
BgNVBAgMEkJhZGVuLVd1ZXJ0dGVtYmVyZzESMBAGA1UEBwwJVHVlYmluZ2VuMR0w
|
|
||||||
GwYDVQQKDBRFeGFtcGxlLUNlcnRpZmljYXRlczEYMBYGA1UEAwwPbG9jYWxob3N0
|
|
||||||
LmxvY2FsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm9bmONlkhJ0s
|
|
||||||
ZT+OQR7di5Ypu1BoSIDd53Lwj4V9ws02ThYZUfFfYnuUmQBoGe1SAbvfTZ3dpLjM
|
|
||||||
slBqAxz2gxwTWZt5GteTxtmflvKqmAepybOBqAcFKPwMcjreJyuBxYwInwGfEFgG
|
|
||||||
YyRMH6VmDbC3vdxSz1NHpCkNL5ctfLQ4tkUShJCHPApqRp1F+BSBQVrpUwzIjn33
|
|
||||||
0whHOE346mK1TRI7Qqriyv482BfNCWdG6e8FhbGF6oIEcs7Y0YTcdxxmYHv/CkWI
|
|
||||||
/rtqETRpWOn3YVNGD5hKLchplD2ZaYLvFswij9dSbJUR6j0w5OqgmLO4fyyLZNgN
|
|
||||||
zARg4mQF7wIDAQABo4HUMIHRMB8GA1UdIwQYMBaAFAzjy/XAlhtTipXj30seDdNO
|
|
||||||
97OVMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgTwMHcGA1UdEQRwMG6CCWxvY2FsaG9z
|
|
||||||
dIIRdHVlaXRhcHAudHVlaXQuZGWCDmxvY2FsaG9zdDo1MTcyghZ0dWVpdGFwcC50
|
|
||||||
dWVpdC5kZTo1MTcygg5sb2NhbGhvc3Q6NTE3M4IWdHVlaXRhcHAudHVlaXQuZGU6
|
|
||||||
NTE3MzAdBgNVHQ4EFgQU7JiUZESlRqvV9kqKqR+I+EdpA7QwDQYJKoZIhvcNAQEL
|
|
||||||
BQADggEBACvvYNLtaBoyM7Cy5WuaDaZtxbZvBqzORaNbHUqsGr5YLMlPwAoOj2cC
|
|
||||||
NmeyVX/I8lqZC0vma1UuyXp6v2ykkuAHL+PJrzhJiUb1KDhC8qBtnviaqB4ZNwQ5
|
|
||||||
m84BAiZGCS62q2vpFU4Ux/deDSiP8/P/cnRMCeN3DRtDumGq7/UBODbJuDw3Dt4U
|
|
||||||
CT/cLF2gDm40CkCLFyI6mRSxck3LUvsHV05yf31ikuPQ/M5WIcVHtbQ/qavgDMUT
|
|
||||||
SZmqKTg4NFVJGDhFQV/A0DBqC0qIVkszbrJSCwNTPyVID+jl9ukYoMQ4zjDwrwp5
|
|
||||||
ScOInLpNHHsAJd2b7V9jEptt7gSE1dk=
|
|
||||||
-----END CERTIFICATE-----
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
-----BEGIN PRIVATE KEY-----
|
|
||||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCb1uY42WSEnSxl
|
|
||||||
P45BHt2Llim7UGhIgN3ncvCPhX3CzTZOFhlR8V9ie5SZAGgZ7VIBu99Nnd2kuMyy
|
|
||||||
UGoDHPaDHBNZm3ka15PG2Z+W8qqYB6nJs4GoBwUo/AxyOt4nK4HFjAifAZ8QWAZj
|
|
||||||
JEwfpWYNsLe93FLPU0ekKQ0vly18tDi2RRKEkIc8CmpGnUX4FIFBWulTDMiOfffT
|
|
||||||
CEc4TfjqYrVNEjtCquLK/jzYF80JZ0bp7wWFsYXqggRyztjRhNx3HGZge/8KRYj+
|
|
||||||
u2oRNGlY6fdhU0YPmEotyGmUPZlpgu8WzCKP11JslRHqPTDk6qCYs7h/LItk2A3M
|
|
||||||
BGDiZAXvAgMBAAECggEAOatumfYVBSBW6Ab7gSzHZpsEyX0pgj8yHy8BR9NqJTck
|
|
||||||
1APIjfLpTfwWkwI8A/A3a03XhpUXixgaJBivCoTi0sUGgiAPUngZhzpMnSMjL0yS
|
|
||||||
sAI+RmyGo9KWVoVjZZJrnSvDmvgSIY25m2G4y/M8z28op9mLSY7zkZPhfc2Ptzg0
|
|
||||||
HO+SvyfxjZF7hwbblo41GzXuk0L2xxJN4xVfLti2R1yc+R9bdbEmzmgeECeZaHyQ
|
|
||||||
Y6XacbpafPZpC1bwNTv/0W8BVmXLG1FQo56zSTWOf8yt6gDBA970a++IPWNJzVBs
|
|
||||||
qbVjaDCHAh+sjgeT0+2tUhInVHUrNTgCXxmjWmYf/QKBgQDWOca4y6tEy5r2bl2F
|
|
||||||
OVdYYn44QUjccpV9WQ/UGzMfcrPcBxEWOYsddDkIdhK+ES9pU+dg0xjNVUGLkEKF
|
|
||||||
IuWuUZAtU9048r+xYVTUT1BepTKD9CfZ72dpenfQqUWctT6Pm/fj55NtcowlqXu1
|
|
||||||
IbbVcKv6sXmEj+FG7nb6olVcLQKBgQC6OnYBHFk4phQf1R7Zj+6khRYQTiy3z5Rh
|
|
||||||
3gIzQq8YseHsfiQZRVkVI4YM+y9tlCKuiDyD9AnJAm37j5C9FrFTJmuigu5xNok5
|
|
||||||
zG7Vz08Cm31Vrx/lO/flPDi8CYbjEvWHLu8F64gTiotneMSLy+Jex36A8Ez2dL9N
|
|
||||||
A/w3z3dQCwKBgEHti/vJKk9Evc8DTiK27+uSfDfB17OIS/tEknt7V3NhMHsRba/C
|
|
||||||
S87nurmg5Mm7rjSjDr0cmjBvAXn7Do28nKTWEyHwAlAJXPcw9hNUyW4nNvGnDTCj
|
|
||||||
3dZ3SzJbNcIxgSxfGp334cY4D2tzyk+HLaZoQ3UmczhZs0HKF7GwjcaNAoGBAIej
|
|
||||||
yQtqEHo4TPQakIu6UAE4hid+KQgAg3z87PFVIp+EAJ/2CGj3n7jL1Pljgtn3SYOB
|
|
||||||
60HY37+uq1jM6okvHB0KIN+PKgj/xdd5VUkZ49xsUE+2bC7VDOvEfzZGYh7GUlsS
|
|
||||||
DjproQNKp9rHlbCU4d5Sw4s6e3QO+L8ppe0oiSidAoGBAJCe7594SwX5JUwhdRuC
|
|
||||||
c42pzlqgzeDFCxVafNG5Qi3myPZjum2RbvJVP7Abc+1OqMnRlHrejJZl/eFOxkiD
|
|
||||||
baGMW+GneARmuwUGv8GWK4dsG+JNNtGKRh8D14ZzKokXKjcczh2xdnEbaK+6aQVt
|
|
||||||
HvwvS3sXX44fuJaDd7rTtKkU
|
|
||||||
-----END PRIVATE KEY-----
|
|
||||||
5
certs/privkey.pem
Normal file
5
certs/privkey.pem
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
-----BEGIN PRIVATE KEY-----
|
||||||
|
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgAYAjn8GuqhyMWJyf
|
||||||
|
Bxt8nTpBWm3S06NgzF1sjJqFijmhRANCAASn9J85xEOTqgwRRmdEzI6kx1VYkHpD
|
||||||
|
QezcvL1AegSMLAlo9ejl1EuKVxv1yBTuiZlijI1N/qKUcC/EaSv+T+xp
|
||||||
|
-----END PRIVATE KEY-----
|
||||||
@ -1,6 +1,6 @@
|
|||||||
const clientsideConfig = {
|
const clientsideConfig = {
|
||||||
// url: 'tueitapp.tueit.de',
|
// later for the server
|
||||||
// port: 8000,
|
//url: 'tueitapp.tueit.de',
|
||||||
url: 'localhost',
|
url: 'localhost',
|
||||||
port: 3000,
|
port: 3000,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -32,21 +32,121 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="button" :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="login-button" value="Login">
|
<div v-if="isError" class="form-field-error-msg" id="password-field">
|
||||||
|
<label>
|
||||||
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']"> {{ errorMsg }} </div>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<input type="button" :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="login-button" value="Login"
|
||||||
|
@click="handleLogin">
|
||||||
|
<input type="button" :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="login-button" value="Signup"
|
||||||
|
@click="testFunctionSignup">
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import Axios from '../axios.config.js';
|
||||||
|
import clientsideConfig from '../clientsideConfig.js';
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const router = useRouter();
|
||||||
|
const darkMode = ref(true);
|
||||||
|
const isError = ref(false);
|
||||||
|
const errorMsg = ref('');
|
||||||
|
|
||||||
|
const handleLogin = async () => {
|
||||||
|
isError.value = false;
|
||||||
|
errorMsg.value = '';
|
||||||
|
|
||||||
|
const username = document.getElementById('username-input').value;
|
||||||
|
const password = document.getElementById('password-input').value;
|
||||||
|
|
||||||
|
const requestBody = {
|
||||||
|
username: username,
|
||||||
|
password: password,
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
let res = await Axios.post(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/login`, requestBody);
|
||||||
|
|
||||||
|
// something to do with the res?
|
||||||
|
console.log(res.data)
|
||||||
|
|
||||||
|
// sucessfully logged in
|
||||||
|
router.push('/')
|
||||||
|
} catch (err) {
|
||||||
|
// handle the error
|
||||||
|
console.log(err.response.statusText)
|
||||||
|
isError.value = true;
|
||||||
|
errorMsg.value = err.response.statusText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const testFunctionSignup = async () => {
|
||||||
|
isError.value = false;
|
||||||
|
errorMsg.value = '';
|
||||||
|
|
||||||
|
const username = 'franzzzzzrtg'
|
||||||
|
const password = '112345678'
|
||||||
|
const password_repeat = '112345678'
|
||||||
|
const fullName = 'hallo'
|
||||||
|
const email = 'test.sdj@web.de'
|
||||||
|
const phonenumber = '015736283729'
|
||||||
|
const address = 'Strasse'
|
||||||
|
const city = 'tuebingen'
|
||||||
|
const postcode = '72121'
|
||||||
|
const adminBool = false
|
||||||
|
const technician1Bool = false
|
||||||
|
const technician2Bool = false
|
||||||
|
const technicianMonitoringBool = false
|
||||||
|
const merchantBool = false
|
||||||
|
const internBool = true
|
||||||
|
|
||||||
|
const requestBody = {
|
||||||
|
username: username,
|
||||||
|
password: password,
|
||||||
|
password_repeat: password_repeat,
|
||||||
|
fullName: fullName,
|
||||||
|
email: email,
|
||||||
|
phonenumber: phonenumber,
|
||||||
|
address: address,
|
||||||
|
city: city,
|
||||||
|
postcode: postcode,
|
||||||
|
adminBool: adminBool,
|
||||||
|
technician1Bool: technician1Bool,
|
||||||
|
technician2Bool: technician2Bool,
|
||||||
|
technicianMonitoringBool: technicianMonitoringBool,
|
||||||
|
merchantBool: merchantBool,
|
||||||
|
internBool: internBool,
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
let res = await Axios.post(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/signup`, requestBody);
|
||||||
|
|
||||||
|
// something to do with the res?
|
||||||
|
console.log(res)
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
// handle the error
|
||||||
|
console.log(err.response.statusText)
|
||||||
|
isError.value = true;
|
||||||
|
errorMsg.value = err.response.statusText;
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "LoginForm",
|
name: "LoginForm",
|
||||||
};
|
data() {
|
||||||
|
return {
|
||||||
|
// isError: false,
|
||||||
|
// errorMsg: '',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@ -62,7 +162,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 31.25rem;
|
width: 31.25rem;
|
||||||
height: 31.25rem;
|
height: 33rem;
|
||||||
border-radius: 0.625rem;
|
border-radius: 0.625rem;
|
||||||
padding: 2.5rem 1.875rem;
|
padding: 2.5rem 1.875rem;
|
||||||
gap: 1.875rem;
|
gap: 1.875rem;
|
||||||
@ -138,6 +238,16 @@ export default {
|
|||||||
gap: 0.625rem;
|
gap: 0.625rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-field-error-msg {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 25rem;
|
||||||
|
height: 3rem;
|
||||||
|
gap: 0.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
label {
|
label {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']" id="accounting">Accounting:
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']" id="accounting">Accounting:
|
||||||
<div class="asset-data">
|
<div class="asset-data">
|
||||||
<table class="data-table" id="asset-table-no-client">
|
<table class="data-table" id="asset-table-no-client">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Action', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Action-darkmode' : 'Action-lightmode']">
|
:class="['Action', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Action-darkmode' : 'Action-lightmode']">
|
||||||
@ -93,6 +94,7 @@
|
|||||||
...</td>
|
...</td>
|
||||||
<td :class="['Comments', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['Comments', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -257,4 +259,5 @@ tr#row-2 {
|
|||||||
|
|
||||||
.Comments {
|
.Comments {
|
||||||
width: 40%;
|
width: 40%;
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
||||||
@ -1,31 +1,60 @@
|
|||||||
<template>
|
<template>
|
||||||
<section :class="['information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
<section :class="['information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<h2 :class="['asset-name', darkMode ? 'h2-darkmode' : 'h2-lightmode']">Asset name</h2>
|
<h2 v-if="!editable" :class="['asset-name', darkMode ? 'h2-darkmode' : 'h2-lightmode']">{{ item.assetName }}</h2>
|
||||||
|
<input v-if="editable" v-model="item.assetName" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'asset-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']">
|
||||||
<div class="asset-data">
|
<div class="asset-data">
|
||||||
<div class="client-location">
|
<div class="client-location">
|
||||||
<div class="data-field" id="client">
|
<div class="data-field" id="client">
|
||||||
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Client:</pre>
|
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Client:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']"> {{ item.customer }}</pre>
|
||||||
|
<!-- <input v-if="editable" v-model="item.customer" @change="updateCustomerID()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']"> -->
|
||||||
|
<select v-if="editable" id="customersDropDownChosenCI" v-model="item.customer"
|
||||||
|
@change="updateCustomerID()" :class="[darkMode ? 'select-darkmode' : 'select-lightmode']">
|
||||||
|
<option v-for="cust in customers" :key="cust.primaryID">
|
||||||
|
{{ cust.customername }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="data-field" id="location">
|
<div class="data-field" id="location">
|
||||||
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Location:</pre>
|
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Location:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']"> {{ item.location }}</pre>
|
||||||
|
<input v-if="editable" v-model="item.location" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="id-type">
|
<div class="id-type">
|
||||||
<div class="data-field" id="id">
|
<div class="data-field" id="id">
|
||||||
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">ID:</pre>
|
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">ID:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ item.primaryID }}</pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="data-field" id="type">
|
<div class="data-field" id="type">
|
||||||
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Type:</pre>
|
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Type:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']"> {{ item.type }}</pre>
|
||||||
|
<input v-if="editable" v-model="item.type" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="remoteLocation-state">
|
||||||
<div class="data-field" id="remote-location">
|
<div class="data-field" id="remote-location">
|
||||||
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Remote location:</pre>
|
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Remote location:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ item.remoteLocation }}</pre>
|
||||||
|
<input v-if="editable" v-model="item.remoteLocation" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
|
</div>
|
||||||
|
<div class="data-field" id="state">
|
||||||
|
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">State:</pre>
|
||||||
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ item.state }}</pre>
|
||||||
|
<input v-if="editable" v-model="item.state" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="rectangle-container">
|
<div class="rectangle-container">
|
||||||
@ -36,13 +65,15 @@
|
|||||||
<div class="additional">
|
<div class="additional">
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Description:</h3>
|
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Description:</h3>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']" id="description">...</pre>
|
<input v-model="item.description" :readonly="!editable" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="description">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="additional">
|
<div class="additional">
|
||||||
<div class="notes">
|
<div class="notes">
|
||||||
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Notes:</h3>
|
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Notes:</h3>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']" id="notes">...</pre>
|
<input v-model="item.notes" :readonly="!editable" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="notes">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -51,15 +82,156 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, onMounted, watch } 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 deleteAssetBool = computed(() => store.state.deleteAsset)
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const darkMode = ref(true)
|
||||||
|
const item = ref({});
|
||||||
|
const customer = ref({});
|
||||||
|
const configItems = ref([]);
|
||||||
|
const customers = ref([]);
|
||||||
|
|
||||||
|
// get config item from id
|
||||||
|
const getItemById = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getConfigItem/${chosenAssetId.value}`
|
||||||
|
);
|
||||||
|
item.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//update data
|
||||||
|
const updateConfigItem = async () => {
|
||||||
|
if (item.value.assetName.trim() === "") {
|
||||||
|
alert("Please add a config item name!");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
var counter = 0;
|
||||||
|
// check if config item name already exists
|
||||||
|
configItems.value.forEach(ci => {
|
||||||
|
if (ci.assetName === item.value.assetName) {
|
||||||
|
counter += 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (counter == 2) {
|
||||||
|
alert("This asset name already exists. Please choose an unique asset name or modify respectively delete the old one!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await Axios.put(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/updateConfigItem`,
|
||||||
|
{
|
||||||
|
primaryID: item.value.primaryID,
|
||||||
|
assetName: item.value.assetName,
|
||||||
|
customerID: item.value.customerID,
|
||||||
|
customer: item.value.customer,
|
||||||
|
location: item.value.location,
|
||||||
|
remoteLocation: item.value.remoteLocation,
|
||||||
|
type: item.value.type,
|
||||||
|
description: item.value.description,
|
||||||
|
notes: item.value.notes,
|
||||||
|
state: item.value.state,
|
||||||
|
lastView: item.value.lastView,
|
||||||
|
user: item.value.user,
|
||||||
|
hardwareBool: item.value.hardwareBool,
|
||||||
|
model: item.value.model,
|
||||||
|
serialnumber: item.value.serialnumber,
|
||||||
|
CPU: item.value.CPU,
|
||||||
|
RAM: item.value.RAM,
|
||||||
|
storageConfiguration: item.value.storageConfiguration,
|
||||||
|
miscellaneous: item.value.miscellaneous,
|
||||||
|
softwareBool: item.value.softwareBool,
|
||||||
|
software: item.value.software,
|
||||||
|
version: item.value.version,
|
||||||
|
license: item.value.license,
|
||||||
|
networkBool: item.value.networkBool,
|
||||||
|
IPv4: item.value.IPv4,
|
||||||
|
IPv6: item.value.IPv6,
|
||||||
|
MAC: item.value.MAC,
|
||||||
|
subnetmask: item.value.subnetmask,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
await getItemById();
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//get all customers
|
||||||
|
const getCustomers = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllCustomers`
|
||||||
|
);
|
||||||
|
customers.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const confirmDeleteAsset = async () => {
|
||||||
|
if (deleteAssetBool.value === true) {
|
||||||
|
if (confirm("Do you really want to delete this config item? It cannot be undone!")) {
|
||||||
|
try {
|
||||||
|
await Axios.delete(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/deleteConfigItem/${chosenAssetId.value}`);
|
||||||
|
store.commit('undoDeleteAsset');
|
||||||
|
store.commit('changeToAssetlist');
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
store.commit('undoDeleteAsset');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//get all config items
|
||||||
|
const getConfigItems = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllConfigItems`);
|
||||||
|
configItems.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// update customerid if customer was changed
|
||||||
|
const updateCustomerID = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${item.value.customer}`);
|
||||||
|
customer.value = response.data;
|
||||||
|
item.value.customerID = customer.value.customerID;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
await updateConfigItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(deleteAssetBool, confirmDeleteAsset);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getItemById();
|
||||||
|
getConfigItems();
|
||||||
|
getCustomers();
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "Asset",
|
name: "Asset",
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@ -93,6 +265,16 @@ export default {
|
|||||||
sans-serif;
|
sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.asset-name-input {
|
||||||
|
padding: 1rem 0;
|
||||||
|
margin: 1rem;
|
||||||
|
font-size: initial;
|
||||||
|
letter-spacing: 5%;
|
||||||
|
text-decoration-line: underline;
|
||||||
|
font: italic 400 1rem/187.5% Overpass, -apple-system, Roboto, Helvetica,
|
||||||
|
sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
.h2-darkmode {
|
.h2-darkmode {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
@ -112,6 +294,14 @@ export default {
|
|||||||
border-radius: 0.625rem;
|
border-radius: 0.625rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.h2-input-darkmode {
|
||||||
|
background-color: #212121;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h2-input-lightmode {
|
||||||
|
background-color: #EBEBEB;
|
||||||
|
}
|
||||||
|
|
||||||
.data-field#street-name {
|
.data-field#street-name {
|
||||||
width: 70%;
|
width: 70%;
|
||||||
}
|
}
|
||||||
@ -133,9 +323,13 @@ export default {
|
|||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
.data {
|
.data {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
overflow-x: auto;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
padding: 0 0.625rem;
|
padding: 0 0.625rem;
|
||||||
border-radius: 0.3125rem;
|
border-radius: 0.3125rem;
|
||||||
@ -157,6 +351,9 @@ export default {
|
|||||||
.data#notes,
|
.data#notes,
|
||||||
.data#description {
|
.data#description {
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
|
/* width: 45%; */
|
||||||
|
scrollbar-width: none;
|
||||||
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.asset-data {
|
.asset-data {
|
||||||
@ -203,7 +400,8 @@ export default {
|
|||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.id-type {
|
.id-type,
|
||||||
|
.remoteLocation-state {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -243,4 +441,20 @@ export default {
|
|||||||
.rectangle-lightmode {
|
.rectangle-lightmode {
|
||||||
background-color: #EBEBEB;
|
background-color: #EBEBEB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.select-darkmode {
|
||||||
|
border: none;
|
||||||
|
color: white;
|
||||||
|
background: #212121;
|
||||||
|
padding: 0.4rem;
|
||||||
|
border-radius: 0.3125rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-lightmode {
|
||||||
|
border: none;
|
||||||
|
color: black;
|
||||||
|
background: #EBEBEB;
|
||||||
|
padding: 0.4rem;
|
||||||
|
border-radius: 0.3125rem;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -2,6 +2,7 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Solutions:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Solutions:</div>
|
||||||
<table class="data-table" id="solution-checkklist">
|
<table class="data-table" id="solution-checkklist">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Solution', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Solution-darkmode' : 'Solution-lightmode']">
|
:class="['Solution', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Solution-darkmode' : 'Solution-lightmode']">
|
||||||
@ -14,6 +15,8 @@
|
|||||||
...</td>
|
...</td>
|
||||||
<td :class="['Type', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['Type', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -168,4 +171,5 @@ th {
|
|||||||
|
|
||||||
.label-lightmode {
|
.label-lightmode {
|
||||||
color: #000;
|
color: #000;
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
||||||
@ -2,6 +2,7 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Last viewed:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Last viewed:</div>
|
||||||
<table class="data-table" id="asset-table">
|
<table class="data-table" id="asset-table">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Client', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
:class="['Client', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
||||||
@ -17,29 +18,65 @@
|
|||||||
State</th>
|
State</th>
|
||||||
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
<tr v-for="item in configItemList" :key="item.primaryID"
|
||||||
|
:class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']">
|
||||||
<td
|
<td
|
||||||
:class="['Client', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
:class="['Client', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
||||||
...</td>
|
{{ item.customer }}
|
||||||
|
</td>
|
||||||
<td
|
<td
|
||||||
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
...</td>
|
<!-- <router-link to="/assets" class="button"
|
||||||
|
:class="[darkMode ? 'button-darkmode' : 'button-lightmode']" > {{
|
||||||
|
item.assetName }} </router-link> -->
|
||||||
|
<nuxt-link to="/assets" id="nuxt-link" class="button"
|
||||||
|
:class="[darkMode ? 'button-darkmode' : 'button-lightmode']"
|
||||||
|
@click="goToChosenAsset(item.primaryID)">
|
||||||
|
{{ item.assetName }}
|
||||||
|
</nuxt-link>
|
||||||
|
</td>
|
||||||
<td
|
<td
|
||||||
:class="['Type', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
:class="['Type', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
||||||
...</td>
|
{{ item.type }}</td>
|
||||||
<td
|
<td
|
||||||
:class="['State', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'State-darkmode' : 'State-lightmode']">
|
:class="['State', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'State-darkmode' : 'State-lightmode']">
|
||||||
...</td>
|
{{ item.state }}</td>
|
||||||
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']"> {{ item.user }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
|
import Axios from '../axios.config.js';
|
||||||
|
import clientsideConfig from '../../clientsideConfig.js';
|
||||||
|
import { useStore } from 'vuex';
|
||||||
|
|
||||||
|
// get accesss to the store
|
||||||
|
const store = useStore()
|
||||||
|
const goToChosenAsset = (id) => {
|
||||||
|
store.commit('setChosenAsset', id);
|
||||||
|
store.commit('changeToAsset');
|
||||||
|
};
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const darkMode = ref(true)
|
||||||
|
const configItemList = ref([]);
|
||||||
|
|
||||||
|
//get all config items
|
||||||
|
const getConfigItems = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllConfigItems`);
|
||||||
|
configItemList.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await getConfigItems();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -197,4 +234,10 @@ th {
|
|||||||
|
|
||||||
.label-lightmode {
|
.label-lightmode {
|
||||||
color: #000;
|
color: #000;
|
||||||
}</style>
|
}
|
||||||
|
|
||||||
|
#nuxt-link {
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Assets:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Assets:</div>
|
||||||
<table class="data-table" id="asset-table-no-client">
|
<table class="data-table" id="asset-table-no-client">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
@ -26,6 +27,7 @@
|
|||||||
...</td>
|
...</td>
|
||||||
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -1,20 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<table class="data-table" id="client-table">
|
<table class="data-table" id="client-table">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th :class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">ID
|
<th
|
||||||
|
:class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
|
ID
|
||||||
</th>
|
</th>
|
||||||
<th
|
<th
|
||||||
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
Name</th>
|
Name</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
<td :class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
<td
|
||||||
|
:class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
...</td>
|
...</td>
|
||||||
<td
|
<td
|
||||||
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
...</td>
|
...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -126,5 +131,4 @@ th {
|
|||||||
|
|
||||||
.Name {
|
.Name {
|
||||||
width: 60%;
|
width: 60%;
|
||||||
}
|
}</style>
|
||||||
</style>
|
|
||||||
@ -1,25 +1,37 @@
|
|||||||
<template>
|
<template>
|
||||||
<section :class="['hardware-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
<section v-if="hardwareBoolean" :class="['hardware-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="hardware">Hardware specifications:</div>
|
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="hardware">Hardware specifications:</div>
|
||||||
<div class="asset-data">
|
<div class="asset-data">
|
||||||
<div class="model-CPU">
|
<div class="model-CPU">
|
||||||
<div class="data-field" id="model">
|
<div class="data-field" id="model">
|
||||||
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">Model:</pre>
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">Model:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ item.model }}</pre>
|
||||||
|
<input v-if="editable" v-model="item.model" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
</div>
|
</div>
|
||||||
<div class="data-field" id="CPU">
|
<div class="data-field" id="CPU">
|
||||||
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">CPU:</pre>
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">CPU:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ item.CPU }}</pre>
|
||||||
|
<input v-if="editable" v-model="item.CPU" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="serial-number-RAM">
|
<div class="serial-number-RAM">
|
||||||
<div class="data-field" id="serial-number">
|
<div class="data-field" id="serial-number">
|
||||||
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">Serial number:</pre>
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">Serial number:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ item.serialnumber }}</pre>
|
||||||
|
<input v-if="editable" v-model="item.serialnumber" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
</div>
|
</div>
|
||||||
<div class="data-field" id="RAM">
|
<div class="data-field" id="RAM">
|
||||||
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">RAM:</pre>
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">RAM:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ item.RAM }}</pre>
|
||||||
|
<input v-if="editable" v-model="item.RAM" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -27,14 +39,16 @@
|
|||||||
<div class="additional">
|
<div class="additional">
|
||||||
<div class="storage-configuration">
|
<div class="storage-configuration">
|
||||||
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Storage configuration:</h3>
|
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Storage configuration:</h3>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']"
|
<input v-model="item.storageConfiguration" :readonly="!editable" @change="updateConfigItem()"
|
||||||
id="storage-configuration">...</pre>
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']"
|
||||||
|
id="storage-configuration">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="additional">
|
<div class="additional">
|
||||||
<div class="miscellaneous">
|
<div class="miscellaneous">
|
||||||
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Miscellaneous:</h3>
|
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Miscellaneous:</h3>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']" id="miscellaneous">...</pre>
|
<input v-model="item.miscellaneous" :readonly="!editable" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="miscellaneous">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -43,9 +57,84 @@
|
|||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
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 darkMode = ref(true)
|
||||||
|
const item = ref({});
|
||||||
|
const hardwareBoolean = ref(false)
|
||||||
|
|
||||||
|
// get config item from id
|
||||||
|
const getItemById = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getConfigItem/${chosenAssetId.value}`
|
||||||
|
);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//update data
|
||||||
|
const updateConfigItem = async () => {
|
||||||
|
try {
|
||||||
|
await Axios.put(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/updateConfigItem`,
|
||||||
|
{
|
||||||
|
primaryID: item.value.primaryID,
|
||||||
|
assetName: item.value.assetName,
|
||||||
|
customerID: item.value.customerID,
|
||||||
|
customer: item.value.customer,
|
||||||
|
location: item.value.location,
|
||||||
|
remoteLocation: item.value.remoteLocation,
|
||||||
|
type: item.value.type,
|
||||||
|
description: item.value.description,
|
||||||
|
notes: item.value.notes,
|
||||||
|
state: item.value.state,
|
||||||
|
lastView: item.value.lastView,
|
||||||
|
user: item.value.user,
|
||||||
|
hardwareBool: item.value.hardwareBool,
|
||||||
|
model: item.value.model,
|
||||||
|
serialnumber: item.value.serialnumber,
|
||||||
|
CPU: item.value.CPU,
|
||||||
|
RAM: item.value.RAM,
|
||||||
|
storageConfiguration: item.value.storageConfiguration,
|
||||||
|
miscellaneous: item.value.miscellaneous,
|
||||||
|
softwareBool: item.value.softwareBool,
|
||||||
|
software: item.value.software,
|
||||||
|
version: item.value.version,
|
||||||
|
license: item.value.license,
|
||||||
|
networkBool: item.value.networkBool,
|
||||||
|
IPv4: item.value.IPv4,
|
||||||
|
IPv6: item.value.IPv6,
|
||||||
|
MAC: item.value.MAC,
|
||||||
|
subnetmask: item.value.subnetmask,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
await getItemById();
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getItemById();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -118,6 +207,10 @@ export default {
|
|||||||
font: 400 0.75rem/250% Overpass, sans-serif;
|
font: 400 0.75rem/250% Overpass, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
.data-darkmode {
|
.data-darkmode {
|
||||||
background-color: #212121;
|
background-color: #212121;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Checklist:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Checklist:</div>
|
||||||
<table class="data-table" id="instance-checklist">
|
<table class="data-table" id="instance-checklist">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Step', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Step-darkmode' : 'Step-lightmode']">
|
:class="['Step', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Step-darkmode' : 'Step-lightmode']">
|
||||||
@ -33,6 +34,7 @@
|
|||||||
<td :class="['Done', darkMode ? 'td-darkmode' : 'td-lightmode']"><input type="checkbox"
|
<td :class="['Done', darkMode ? 'td-darkmode' : 'td-lightmode']"><input type="checkbox"
|
||||||
:class="[darkMode ? 'checkbox-darkmode' : 'checkbox-lightmode']" /></td>
|
:class="[darkMode ? 'checkbox-darkmode' : 'checkbox-lightmode']" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -2,11 +2,14 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Last viewed:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Last viewed:</div>
|
||||||
<table class="data-table" id="asset-table">
|
<table class="data-table" id="asset-table">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Client', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
:class="['Client', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
||||||
Client</th>
|
Client</th>
|
||||||
<th :class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">ID
|
<th
|
||||||
|
:class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
|
ID
|
||||||
</th>
|
</th>
|
||||||
<th
|
<th
|
||||||
:class="['TicketNo', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'TicketNo-darkmode' : 'TicketNo-lightmode']">
|
:class="['TicketNo', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'TicketNo-darkmode' : 'TicketNo-lightmode']">
|
||||||
@ -16,29 +19,49 @@
|
|||||||
Creation Date</th>
|
Creation Date</th>
|
||||||
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
<tr v-for="issueSlip in issueSlips" :key="issueSlip.primaryID"
|
||||||
|
:class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
<td
|
<td
|
||||||
:class="['Client', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
:class="['Client', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
||||||
...</td>
|
{{ issueSlip.customer }}</td>
|
||||||
<td :class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
<td
|
||||||
...</td>
|
:class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
|
{{ issueSlip.primaryID }}</td>
|
||||||
<td
|
<td
|
||||||
:class="['TicketNo', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'TicketNo-darkmode' : 'TicketNo-lightmode']">
|
:class="['TicketNo', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'TicketNo-darkmode' : 'TicketNo-lightmode']">
|
||||||
...</td>
|
{{ issueSlip.ticketNo }}</td>
|
||||||
<td
|
<td
|
||||||
:class="['CreationDate', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'CreationDate-darkmode' : 'CreationDate-lightmode']">
|
:class="['CreationDate', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'CreationDate-darkmode' : 'CreationDate-lightmode']">
|
||||||
...</td>
|
{{ issueSlip.creationDate }}</td>
|
||||||
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']"> {{ issueSlip.user }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
|
import Axios from '../axios.config.js';
|
||||||
|
import clientsideConfig from '../../clientsideConfig.js';
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const darkMode = ref(true)
|
||||||
|
const issueSlips = ref([]);
|
||||||
|
|
||||||
|
//get all issueSlips
|
||||||
|
const getIssueSlips = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllIssueSlips`);
|
||||||
|
issueSlips.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getIssueSlips();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -47,8 +70,6 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.data {
|
.data {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -2,8 +2,11 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Issue slip:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Issue slip:</div>
|
||||||
<table class="data-table" id="asset-table">
|
<table class="data-table" id="asset-table">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th :class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">ID
|
<th
|
||||||
|
:class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
|
ID
|
||||||
</th>
|
</th>
|
||||||
<th
|
<th
|
||||||
:class="['TicketNo', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'TicketNo-darkmode' : 'TicketNo-lightmode']">
|
:class="['TicketNo', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'TicketNo-darkmode' : 'TicketNo-lightmode']">
|
||||||
@ -14,7 +17,8 @@
|
|||||||
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
<td :class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
<td
|
||||||
|
:class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
...</td>
|
...</td>
|
||||||
<td
|
<td
|
||||||
:class="['TicketNo', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'TicketNo-darkmode' : 'TicketNo-lightmode']">
|
:class="['TicketNo', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'TicketNo-darkmode' : 'TicketNo-lightmode']">
|
||||||
@ -24,6 +28,7 @@
|
|||||||
...</td>
|
...</td>
|
||||||
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Issues:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Issues:</div>
|
||||||
<table class="data-table" id="asset-table">
|
<table class="data-table" id="asset-table">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
@ -14,27 +15,46 @@
|
|||||||
State</th>
|
State</th>
|
||||||
<th :class="['Amount', darkMode ? 'th-darkmode' : 'th-lightmode']">Amount</th>
|
<th :class="['Amount', darkMode ? 'th-darkmode' : 'th-lightmode']">Amount</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
<tr v-for="issue in issues" :key="issue.primaryID"
|
||||||
|
:class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
<td
|
<td
|
||||||
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
...</td>
|
{{ issue.name }}</td>
|
||||||
<td
|
<td
|
||||||
:class="['Type', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
:class="['Type', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
||||||
...</td>
|
{{ issue.type }}</td>
|
||||||
<td
|
<td
|
||||||
:class="['State', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'State-darkmode' : 'State-lightmode']">
|
:class="['State', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'State-darkmode' : 'State-lightmode']">
|
||||||
...</td>
|
{{ issue.state }}</td>
|
||||||
<td :class="['Amount', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['Amount', darkMode ? 'td-darkmode' : 'td-lightmode']">{{ issue.amount }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
|
import Axios from '../axios.config.js';
|
||||||
|
import clientsideConfig from '../../clientsideConfig.js';
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const darkMode = ref(true)
|
||||||
|
const issues = ref([]);
|
||||||
|
|
||||||
|
//get all issue
|
||||||
|
const getIssues = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllIssues`);
|
||||||
|
issues.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getIssues();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -181,4 +201,5 @@ th {
|
|||||||
|
|
||||||
.label-lightmode {
|
.label-lightmode {
|
||||||
color: #000;
|
color: #000;
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
||||||
@ -2,6 +2,7 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Variants:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Variants:</div>
|
||||||
<table class="data-table" id="issue-variants-table">
|
<table class="data-table" id="issue-variants-table">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
@ -32,6 +33,7 @@
|
|||||||
...</td>
|
...</td>
|
||||||
<td :class="['Price', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['Price', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -198,4 +200,5 @@ th {
|
|||||||
|
|
||||||
.label-lightmode {
|
.label-lightmode {
|
||||||
color: #000;
|
color: #000;
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
||||||
@ -2,8 +2,10 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Instances:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Instances:</div>
|
||||||
<table class="data-table" name="maintenance-visits-instance-table">
|
<table class="data-table" name="maintenance-visits-instance-table">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th :class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
<th
|
||||||
|
:class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
ID</th>
|
ID</th>
|
||||||
<th
|
<th
|
||||||
:class="['MaintenanceType', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'MaintenanceType-darkmode' : 'MaintenanceType-lightmode']">
|
:class="['MaintenanceType', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'MaintenanceType-darkmode' : 'MaintenanceType-lightmode']">
|
||||||
@ -20,7 +22,8 @@
|
|||||||
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
<td :class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
<td
|
||||||
|
:class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
...</td>
|
...</td>
|
||||||
<td
|
<td
|
||||||
:class="['MaintenanceType', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'MaintenanceType-darkmode' : 'MaintenanceType-lightmode']">
|
:class="['MaintenanceType', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'MaintenanceType-darkmode' : 'MaintenanceType-lightmode']">
|
||||||
@ -36,6 +39,7 @@
|
|||||||
...</td>
|
...</td>
|
||||||
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Last viewed:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Last viewed:</div>
|
||||||
<table class="data-table" name="maintenance-visits-template-table">
|
<table class="data-table" name="maintenance-visits-template-table">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Client', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
:class="['Client', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
||||||
@ -9,36 +10,58 @@
|
|||||||
<th
|
<th
|
||||||
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
Name</th>
|
Name</th>
|
||||||
<th :class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">ID
|
<th
|
||||||
|
:class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
|
ID
|
||||||
</th>
|
</th>
|
||||||
<th
|
<th
|
||||||
:class="['Type', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
:class="['Type', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
||||||
Type</th>
|
Type</th>
|
||||||
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
<tr v-for="template in maintenanceVisitTemplates" :key="template.checklistID"
|
||||||
|
:class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
<td
|
<td
|
||||||
:class="['Client', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
:class="['Client', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
||||||
...</td>
|
{{ template.customer }}</td>
|
||||||
<td
|
<td
|
||||||
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
...</td>
|
{{ template.name }}</td>
|
||||||
<td :class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
<td
|
||||||
...</td>
|
:class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
|
{{ template.checklistID }}</td>
|
||||||
<td
|
<td
|
||||||
:class="['Type', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
:class="['Type', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
||||||
...</td>
|
{{ template.type }}</td>
|
||||||
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']"> {{ template.user }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
|
import Axios from '../axios.config.js';
|
||||||
|
import clientsideConfig from '../../clientsideConfig.js';
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const darkMode = ref(true)
|
||||||
|
const maintenanceVisitTemplates = ref([]);
|
||||||
|
|
||||||
|
//get all maintenance visit templates
|
||||||
|
const getMaintenanceVisitTemplates = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllMaintenanceVisitTemplates`);
|
||||||
|
maintenanceVisitTemplates.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getMaintenanceVisitTemplates();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -197,5 +220,4 @@ th {
|
|||||||
|
|
||||||
.label-lightmode {
|
.label-lightmode {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}</style>
|
||||||
</style>
|
|
||||||
@ -2,11 +2,14 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Templates:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Templates:</div>
|
||||||
<table class="data-table" id="maintenance-visits-templat-table-no-client">
|
<table class="data-table" id="maintenance-visits-templat-table-no-client">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
Name</th>
|
Name</th>
|
||||||
<th :class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">ID
|
<th
|
||||||
|
:class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
|
ID
|
||||||
</th>
|
</th>
|
||||||
<th
|
<th
|
||||||
:class="['Type', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
:class="['Type', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
||||||
@ -17,13 +20,15 @@
|
|||||||
<td
|
<td
|
||||||
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
...</td>
|
...</td>
|
||||||
<td :class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
<td
|
||||||
|
:class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
...</td>
|
...</td>
|
||||||
<td
|
<td
|
||||||
:class="['Type', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
:class="['Type', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
||||||
...</td>
|
...</td>
|
||||||
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -179,5 +184,4 @@ th {
|
|||||||
|
|
||||||
.label-lightmode {
|
.label-lightmode {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}</style>
|
||||||
</style>
|
|
||||||
@ -1,25 +1,37 @@
|
|||||||
<template>
|
<template>
|
||||||
<section :class="['network-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
<section v-if="networkBoolean" :class="['network-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="network">Network specifications:</div>
|
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="network">Network specifications:</div>
|
||||||
<div class="asset-data">
|
<div class="asset-data">
|
||||||
<div class="IPv4-MAC">
|
<div class="IPv4-MAC">
|
||||||
<div class="data-field" id="IPv4">
|
<div class="data-field" id="IPv4">
|
||||||
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">IPv4:</pre>
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">IPv4:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ inputIPv4 }}</pre>
|
||||||
|
<input v-if="editable" v-model="inputIPv4" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
</div>
|
</div>
|
||||||
<div class="data-field" id="MAC">
|
<div class="data-field" id="MAC">
|
||||||
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">MAC:</pre>
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">MAC:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ item.MAC }}</pre>
|
||||||
|
<input v-if="editable" v-model="item.MAC" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="IPv6-subnetmask">
|
<div class="IPv6-subnetmask">
|
||||||
<div class="data-field" id="IPv6">
|
<div class="data-field" id="IPv6">
|
||||||
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">IPv6:</pre>
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">IPv6:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ inputIPv6 }}</pre>
|
||||||
|
<input v-if="editable" v-model="inputIPv6" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
</div>
|
</div>
|
||||||
<div class="data-field" id="subnetmask">
|
<div class="data-field" id="subnetmask">
|
||||||
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">Subnetmask:</pre>
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">Subnetmask:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ item.subnetmask }}</pre>
|
||||||
|
<input v-if="editable" v-model="item.subnetmask" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -28,9 +40,173 @@
|
|||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
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 darkMode = ref(true)
|
||||||
|
const item = ref({});
|
||||||
|
const networkBoolean = ref(false);
|
||||||
|
const inputIPv4 = ref('');
|
||||||
|
const inputIPv6 = ref('');
|
||||||
|
|
||||||
|
// get config item from id
|
||||||
|
const getItemById = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getConfigItem/${chosenAssetId.value}`
|
||||||
|
);
|
||||||
|
item.value = response.data;
|
||||||
|
if ((item.value.networkBool == 1) && (item.value.IPv4 === (null | "")) && (item.value.IPv6 === (null | "")) && (item.value.subnetmask === (null | "")) && (item.value.MAC === (null | ""))) {
|
||||||
|
item.value.networkBool = 0;
|
||||||
|
networkBoolean.value = false;
|
||||||
|
};
|
||||||
|
if (item.value.networkBool == 1) {
|
||||||
|
networkBoolean.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (item.value.IPv4 == null) {
|
||||||
|
inputIPv4.value = "";
|
||||||
|
} else {
|
||||||
|
inputIPv4.value = item.value.IPv4;
|
||||||
|
}
|
||||||
|
if (item.value.IPv6 == null) {
|
||||||
|
inputIPv6.value = "";
|
||||||
|
} else {
|
||||||
|
inputIPv6.value = item.value.IPv6;
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// helper function to validate an IPv4 address
|
||||||
|
const validateIPv4address = (ipaddress) => {
|
||||||
|
const ipv4format = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
|
||||||
|
if (ipv4format.test(ipaddress) || ipaddress === "") {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// helper function to validate an IPv4 address
|
||||||
|
const validateIPv6address = (ipaddress) => {
|
||||||
|
const ipv6format = /(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/gi;
|
||||||
|
if (ipv6format.test(ipaddress) || ipaddress === "") {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//update data
|
||||||
|
const updateConfigItem = async () => {
|
||||||
|
if (validateIPv4address(inputIPv4.value)) {
|
||||||
|
item.value.IPv4 = inputIPv4.value;
|
||||||
|
try {
|
||||||
|
await Axios.put(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/updateConfigItem`,
|
||||||
|
{
|
||||||
|
primaryID: item.value.primaryID,
|
||||||
|
assetName: item.value.assetName,
|
||||||
|
customerID: item.value.customerID,
|
||||||
|
customer: item.value.customer,
|
||||||
|
location: item.value.location,
|
||||||
|
remoteLocation: item.value.remoteLocation,
|
||||||
|
type: item.value.type,
|
||||||
|
description: item.value.description,
|
||||||
|
notes: item.value.notes,
|
||||||
|
state: item.value.state,
|
||||||
|
lastView: item.value.lastView,
|
||||||
|
user: item.value.user,
|
||||||
|
hardwareBool: item.value.hardwareBool,
|
||||||
|
model: item.value.model,
|
||||||
|
serialnumber: item.value.serialnumber,
|
||||||
|
CPU: item.value.CPU,
|
||||||
|
RAM: item.value.RAM,
|
||||||
|
storageConfiguration: item.value.storageConfiguration,
|
||||||
|
miscellaneous: item.value.miscellaneous,
|
||||||
|
softwareBool: item.value.softwareBool,
|
||||||
|
software: item.value.software,
|
||||||
|
version: item.value.version,
|
||||||
|
license: item.value.license,
|
||||||
|
networkBool: item.value.networkBool,
|
||||||
|
IPv4: item.value.IPv4,
|
||||||
|
IPv6: item.value.IPv6,
|
||||||
|
MAC: item.value.MAC,
|
||||||
|
subnetmask: item.value.subnetmask,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (item.value.IPv4 == null) {
|
||||||
|
inputIPv4.value = "";
|
||||||
|
} else {
|
||||||
|
inputIPv4.value = item.value.IPv4;
|
||||||
|
}
|
||||||
|
alert("You have entered an invalid IPv4 address, please choose a valid one!");
|
||||||
|
}
|
||||||
|
if (validateIPv6address(inputIPv6.value)) {
|
||||||
|
item.value.IPv6 = inputIPv6.value;
|
||||||
|
try {
|
||||||
|
await Axios.put(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/updateConfigItem`,
|
||||||
|
{
|
||||||
|
primaryID: item.value.primaryID,
|
||||||
|
assetName: item.value.assetName,
|
||||||
|
customerID: item.value.customerID,
|
||||||
|
customer: item.value.customer,
|
||||||
|
location: item.value.location,
|
||||||
|
remoteLocation: item.value.remoteLocation,
|
||||||
|
type: item.value.type,
|
||||||
|
description: item.value.description,
|
||||||
|
notes: item.value.notes,
|
||||||
|
state: item.value.state,
|
||||||
|
lastView: item.value.lastView,
|
||||||
|
user: item.value.user,
|
||||||
|
hardwareBool: item.value.hardwareBool,
|
||||||
|
model: item.value.model,
|
||||||
|
serialnumber: item.value.serialnumber,
|
||||||
|
CPU: item.value.CPU,
|
||||||
|
RAM: item.value.RAM,
|
||||||
|
storageConfiguration: item.value.storageConfiguration,
|
||||||
|
miscellaneous: item.value.miscellaneous,
|
||||||
|
softwareBool: item.value.softwareBool,
|
||||||
|
software: item.value.software,
|
||||||
|
version: item.value.version,
|
||||||
|
license: item.value.license,
|
||||||
|
networkBool: item.value.networkBool,
|
||||||
|
IPv4: item.value.IPv4,
|
||||||
|
IPv6: item.value.IPv6,
|
||||||
|
MAC: item.value.MAC,
|
||||||
|
subnetmask: item.value.subnetmask,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (item.value.IPv6 == null) {
|
||||||
|
inputIPv6.value = "";
|
||||||
|
} else {
|
||||||
|
inputIPv6.value = item.value.IPv6;
|
||||||
|
}
|
||||||
|
alert("You have entered an invalid IPv6 address, please choose a valid one!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getItemById();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -129,4 +305,8 @@ export default {
|
|||||||
padding: 0 0;
|
padding: 0 0;
|
||||||
border-radius: 0.3125rem;
|
border-radius: 0.3125rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -3,6 +3,7 @@
|
|||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']" id="ordering">Ordering information:
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']" id="ordering">Ordering information:
|
||||||
<div class="asset-data">
|
<div class="asset-data">
|
||||||
<table class="data-table" id="asset-table-no-client">
|
<table class="data-table" id="asset-table-no-client">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Article', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Article-darkmode' : 'Article-lightmode']">
|
:class="['Article', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Article-darkmode' : 'Article-lightmode']">
|
||||||
@ -27,6 +28,7 @@
|
|||||||
...</td>
|
...</td>
|
||||||
<td :class="['Comments', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['Comments', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -2,8 +2,10 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Instances:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Instances:</div>
|
||||||
<table class="data-table" name="production-orders-instance-table">
|
<table class="data-table" name="production-orders-instance-table">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th :class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
<th
|
||||||
|
:class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
ID</th>
|
ID</th>
|
||||||
<th
|
<th
|
||||||
:class="['TicketNo', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'TicketNo-darkmode' : 'TicketNo-lightmode']">
|
:class="['TicketNo', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'TicketNo-darkmode' : 'TicketNo-lightmode']">
|
||||||
@ -23,7 +25,8 @@
|
|||||||
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
<td :class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
<td
|
||||||
|
:class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
...</td>
|
...</td>
|
||||||
<td
|
<td
|
||||||
:class="['TicketNo', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'TicketNo-darkmode' : 'TicketNo-lightmode']">
|
:class="['TicketNo', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'TicketNo-darkmode' : 'TicketNo-lightmode']">
|
||||||
@ -42,6 +45,7 @@
|
|||||||
...</td>
|
...</td>
|
||||||
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Last viewed:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Last viewed:</div>
|
||||||
<table class="data-table" name="production-orders-template-table">
|
<table class="data-table" name="production-orders-template-table">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Client', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
:class="['Client', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
||||||
@ -9,30 +10,52 @@
|
|||||||
<th
|
<th
|
||||||
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
Name</th>
|
Name</th>
|
||||||
<th :class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">ID
|
<th
|
||||||
|
:class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
|
ID
|
||||||
</th>
|
</th>
|
||||||
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
<tr v-for="template in productionOrderTemplates" :key="template.templateID"
|
||||||
|
:class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
<td
|
<td
|
||||||
:class="['Client', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
:class="['Client', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
||||||
...</td>
|
{{ template.customer }}</td>
|
||||||
<td
|
<td
|
||||||
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
...</td>
|
{{ template.name }}</td>
|
||||||
<td :class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
<td
|
||||||
...</td>
|
:class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
{{ template.templateID }}</td>
|
||||||
|
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']"> {{ template.user }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
|
import Axios from '../axios.config.js';
|
||||||
|
import clientsideConfig from '../../clientsideConfig.js';
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const darkMode = ref(true)
|
||||||
|
const productionOrderTemplates = ref([]);
|
||||||
|
|
||||||
|
//get all productionOrder templates
|
||||||
|
const getProductionOrderTemplates = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllProductionOrderTemplates`);
|
||||||
|
productionOrderTemplates.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getProductionOrderTemplates();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -178,5 +201,4 @@ th {
|
|||||||
|
|
||||||
.label-lightmode {
|
.label-lightmode {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}</style>
|
||||||
</style>
|
|
||||||
@ -2,11 +2,14 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Templates:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Templates:</div>
|
||||||
<table class="data-table" id="production-orders-template-table-no-client">
|
<table class="data-table" id="production-orders-template-table-no-client">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
Name</th>
|
Name</th>
|
||||||
<th :class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">ID
|
<th
|
||||||
|
:class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
|
ID
|
||||||
</th>
|
</th>
|
||||||
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -14,10 +17,12 @@
|
|||||||
<td
|
<td
|
||||||
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
...</td>
|
...</td>
|
||||||
<td :class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
<td
|
||||||
|
:class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
...</td>
|
...</td>
|
||||||
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -160,5 +165,4 @@ th {
|
|||||||
|
|
||||||
.label-lightmode {
|
.label-lightmode {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}</style>
|
||||||
</style>
|
|
||||||
@ -3,6 +3,7 @@
|
|||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']" id="software">Software specifications:
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']" id="software">Software specifications:
|
||||||
<div class="asset-data">
|
<div class="asset-data">
|
||||||
<table class="data-table" id="asset-table-no-client">
|
<table class="data-table" id="asset-table-no-client">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Software', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Software-darkmode' : 'Software-lightmode']">
|
:class="['Software', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Software-darkmode' : 'Software-lightmode']">
|
||||||
@ -12,15 +13,32 @@
|
|||||||
Version</th>
|
Version</th>
|
||||||
<th :class="['License', darkMode ? 'th-darkmode' : 'th-lightmode']">License</th>
|
<th :class="['License', darkMode ? 'th-darkmode' : 'th-lightmode']">License</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
<tr v-if="editable" :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
<td
|
<td
|
||||||
:class="['Software', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Software-darkmode' : 'Software-lightmode']">
|
:class="['Software', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Software-darkmode' : 'Software-lightmode']">
|
||||||
...</td>
|
<input type="text" v-model="item.software" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
|
</td>
|
||||||
<td
|
<td
|
||||||
:class="['Version', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Version-darkmode' : 'Version-lightmode']">
|
:class="['Version', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Version-darkmode' : 'Version-lightmode']">
|
||||||
...</td>
|
<input type="text" v-model="item.version" @change="updateConfigItem()"
|
||||||
<td :class="['License', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
|
</td>
|
||||||
|
<td :class="['License', darkMode ? 'td-darkmode' : 'td-lightmode']">
|
||||||
|
<input type="text" v-model="item.license" @change="updateConfigItem()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr v-if="!editable" :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
|
<td
|
||||||
|
:class="['Software', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Software-darkmode' : 'Software-lightmode']">
|
||||||
|
{{ item.software }}</td>
|
||||||
|
<td
|
||||||
|
:class="['Version', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Version-darkmode' : 'Version-lightmode']">
|
||||||
|
{{ item.version }}</td>
|
||||||
|
<td :class="['License', darkMode ? 'td-darkmode' : 'td-lightmode']">{{ item.license }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -28,9 +46,84 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
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 darkMode = ref(true)
|
||||||
|
const item = ref({});
|
||||||
|
const softwareBoolean = ref(false)
|
||||||
|
|
||||||
|
// get config item from id
|
||||||
|
const getItemById = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getConfigItem/${chosenAssetId.value}`
|
||||||
|
);
|
||||||
|
item.value = response.data;
|
||||||
|
if ((item.value.softwareBool == 1) && (item.value.version.trim() === "") && (item.value.software.trim() === "")) {
|
||||||
|
item.value.softwareBool = 0;
|
||||||
|
softwareBoolean.value = false;
|
||||||
|
};
|
||||||
|
if (item.value.softwareBool == 1) {
|
||||||
|
softwareBoolean.value = true;
|
||||||
|
};
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//update data
|
||||||
|
const updateConfigItem = async () => {
|
||||||
|
try {
|
||||||
|
await Axios.put(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/updateConfigItem`,
|
||||||
|
{
|
||||||
|
primaryID: item.value.primaryID,
|
||||||
|
assetName: item.value.assetName,
|
||||||
|
customerID: item.value.customerID,
|
||||||
|
customer: item.value.customer,
|
||||||
|
location: item.value.location,
|
||||||
|
remoteLocation: item.value.remoteLocation,
|
||||||
|
type: item.value.type,
|
||||||
|
description: item.value.description,
|
||||||
|
notes: item.value.notes,
|
||||||
|
state: item.value.state,
|
||||||
|
lastView: item.value.lastView,
|
||||||
|
user: item.value.user,
|
||||||
|
hardwareBool: item.value.hardwareBool,
|
||||||
|
model: item.value.model,
|
||||||
|
serialnumber: item.value.serialnumber,
|
||||||
|
CPU: item.value.CPU,
|
||||||
|
RAM: item.value.RAM,
|
||||||
|
storageConfiguration: item.value.storageConfiguration,
|
||||||
|
miscellaneous: item.value.miscellaneous,
|
||||||
|
softwareBool: item.value.softwareBool,
|
||||||
|
software: item.value.software,
|
||||||
|
version: item.value.version,
|
||||||
|
license: item.value.license,
|
||||||
|
networkBool: item.value.networkBool,
|
||||||
|
IPv4: item.value.IPv4,
|
||||||
|
IPv6: item.value.IPv6,
|
||||||
|
MAC: item.value.MAC,
|
||||||
|
subnetmask: item.value.subnetmask,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
await getItemById();
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getItemById();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -172,4 +265,30 @@ th {
|
|||||||
|
|
||||||
.License {
|
.License {
|
||||||
width: 25%;
|
width: 25%;
|
||||||
}</style>
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-darkmode {
|
||||||
|
background-color: #212121;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-lightmode {
|
||||||
|
background-color: #EBEBEB;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -2,6 +2,7 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Checklist:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Checklist:</div>
|
||||||
<table class="data-table" id="solution-checkklist">
|
<table class="data-table" id="solution-checkklist">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Step', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Step-darkmode' : 'Step-lightmode']">
|
:class="['Step', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Step-darkmode' : 'Step-lightmode']">
|
||||||
@ -26,6 +27,7 @@
|
|||||||
...</td>
|
...</td>
|
||||||
<td :class="['Comments', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['Comments', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -180,4 +182,5 @@ th {
|
|||||||
|
|
||||||
.label-lightmode {
|
.label-lightmode {
|
||||||
color: #000;
|
color: #000;
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
||||||
@ -2,6 +2,7 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Last viewed:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Last viewed:</div>
|
||||||
<table class="data-table" id="solution-table">
|
<table class="data-table" id="solution-table">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Client', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
:class="['Client', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
||||||
@ -17,30 +18,49 @@
|
|||||||
Type</th>
|
Type</th>
|
||||||
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
<th :class="['User', darkMode ? 'th-darkmode' : 'th-lightmode']">User</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
<tr v-for="sol in solutions" :key="sol.primaryID"
|
||||||
|
:class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
<td
|
<td
|
||||||
:class="['Client', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
:class="['Client', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Client-darkmode' : 'Client-lightmode']">
|
||||||
...</td>
|
{{ sol.customer }}</td>
|
||||||
<td
|
<td
|
||||||
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
...</td>
|
{{ sol.solutionName }}</td>
|
||||||
<td
|
<td
|
||||||
:class="['Asset', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Asset-darkmode' : 'Asset-lightmode']">
|
:class="['Asset', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Asset-darkmode' : 'Asset-lightmode']">
|
||||||
...</td>
|
{{ sol.assetName }}</td>
|
||||||
<td
|
<td
|
||||||
:class="['Type', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
:class="['Type', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Type-darkmode' : 'Type-lightmode']">
|
||||||
...</td>
|
{{ sol.type }}</td>
|
||||||
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']"> {{ sol.user }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
|
import Axios from '../axios.config.js';
|
||||||
|
import clientsideConfig from '../../clientsideConfig.js';
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const darkMode = ref(true)
|
||||||
|
const solutions = ref([]);
|
||||||
|
|
||||||
|
//get all solutions
|
||||||
|
const getSolutions = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllSolutions`);
|
||||||
|
solutions.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getSolutions();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Solutions:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Solutions:</div>
|
||||||
<table class="data-table" id="solution-table">
|
<table class="data-table" id="solution-table">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
@ -26,6 +27,7 @@
|
|||||||
...</td>
|
...</td>
|
||||||
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['User', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -180,4 +182,5 @@ th {
|
|||||||
|
|
||||||
.label-lightmode {
|
.label-lightmode {
|
||||||
color: #000;
|
color: #000;
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
||||||
@ -2,6 +2,7 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Checklist:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Checklist:</div>
|
||||||
<table class="data-table" id="template-checkklist">
|
<table class="data-table" id="template-checkklist">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['Step', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Step-darkmode' : 'Step-lightmode']">
|
:class="['Step', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Step-darkmode' : 'Step-lightmode']">
|
||||||
@ -26,6 +27,7 @@
|
|||||||
...</td>
|
...</td>
|
||||||
<td :class="['Comments', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
<td :class="['Comments', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -180,4 +182,5 @@ th {
|
|||||||
|
|
||||||
.label-lightmode {
|
.label-lightmode {
|
||||||
color: #000;
|
color: #000;
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
||||||
@ -2,6 +2,7 @@
|
|||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Rights:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Rights:</div>
|
||||||
<table class="data-table" id="user-rights-list">
|
<table class="data-table" id="user-rights-list">
|
||||||
|
<tbody>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
<th
|
<th
|
||||||
:class="['User', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'User-darkmode' : 'User-lightmode']">
|
:class="['User', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'User-darkmode' : 'User-lightmode']">
|
||||||
@ -36,6 +37,7 @@
|
|||||||
<td :class="['View', darkMode ? 'td-darkmode' : 'td-lightmode']"><input type="checkbox"
|
<td :class="['View', darkMode ? 'td-darkmode' : 'td-lightmode']"><input type="checkbox"
|
||||||
:class="[darkMode ? 'checkbox-darkmode' : 'checkbox-lightmode']" /></td>
|
:class="[darkMode ? 'checkbox-darkmode' : 'checkbox-lightmode']" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
971
documentation/.$Datenbankmodell.drawio.bkp
Normal file
971
documentation/.$Datenbankmodell.drawio.bkp
Normal file
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
<mxfile host="Electron" modified="2024-02-01T15:29:10.628Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="R4sGFqNy6FSLZX5LoMO_" version="22.0.3" type="device" pages="2">
|
<mxfile host="Electron" modified="2024-02-14T10:28:35.536Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="_zOGEdVgp7g5JHBy-mYE" version="22.0.3" type="device" pages="2">
|
||||||
<diagram name="Seite-1" id="VLuSDTVFFHJCdRpH-1WC">
|
<diagram name="Seite-1" id="VLuSDTVFFHJCdRpH-1WC">
|
||||||
<mxGraphModel dx="246" dy="2876" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
<mxGraphModel dx="393" dy="2849" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||||
<root>
|
<root>
|
||||||
<mxCell id="0" />
|
<mxCell id="0" />
|
||||||
<mxCell id="1" parent="0" />
|
<mxCell id="1" parent="0" />
|
||||||
@ -62,7 +62,7 @@
|
|||||||
<mxGeometry y="240" width="140" height="30" as="geometry" />
|
<mxGeometry y="240" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-29" value="changeDB" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#00CC00;" parent="1" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-29" value="changeDB" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#00CC00;" parent="1" vertex="1">
|
||||||
<mxGeometry x="75" y="-560" width="140" height="840" as="geometry" />
|
<mxGeometry x="75" y="-560" width="140" height="870" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-67" value="primaryID*" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-67" value="primaryID*" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="30" width="140" height="30" as="geometry" />
|
<mxGeometry y="30" width="140" height="30" as="geometry" />
|
||||||
@ -130,21 +130,24 @@
|
|||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-63" value="version" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-63" value="version" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="660" width="140" height="30" as="geometry" />
|
<mxGeometry y="660" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="qbUp6gtjYndA0fy5zK6_-1" value="networkBool" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="-qW6OXXOOqjT1X6LnSAE-1" value="license" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="690" width="140" height="30" as="geometry" />
|
<mxGeometry y="690" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-53" value="IPv4" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="qbUp6gtjYndA0fy5zK6_-1" value="networkBool" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="720" width="140" height="30" as="geometry" />
|
<mxGeometry y="720" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-56" value="IPv6" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-53" value="IPv4" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="750" width="140" height="30" as="geometry" />
|
<mxGeometry y="750" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-54" value="MAC" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-56" value="IPv6" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="780" width="140" height="30" as="geometry" />
|
<mxGeometry y="780" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-55" value="subnetmask" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-54" value="MAC" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="810" width="140" height="30" as="geometry" />
|
<mxGeometry y="810" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-55" value="subnetmask" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
|
<mxGeometry y="840" width="140" height="30" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-33" value="productionOrders" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#009900;" parent="1" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-33" value="productionOrders" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#009900;" parent="1" vertex="1">
|
||||||
<mxGeometry x="920" y="-85" width="140" height="450" as="geometry" />
|
<mxGeometry x="920" y="-85" width="140" height="450" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
|
|||||||
@ -1,90 +1,114 @@
|
|||||||
<template>
|
<template>
|
||||||
<aside :class="[ 'actionbar', darkMode ? 'actionbar-darkmode' : 'actionbar-lightmode', isExpanded ? 'is-expanded' : 'is-not-expanded']">
|
<aside
|
||||||
<div :class="['icon', darkMode ? 'indicator-darkmode' : 'indicator-lightmode' ]" id="indicator-icon" @click="toggleActionbar">
|
:class="['actionbar', darkMode ? 'actionbar-darkmode' : 'actionbar-lightmode', isExpanded ? 'is-expanded' : 'is-not-expanded']">
|
||||||
<img :class="[ darkMode ? 'img-darkmode' : 'img-lightmode' ]" loading="lazy" src="../icons/actionbar-icons/Indicator-Icon-Opened.svg"/>
|
<div :class="['icon', darkMode ? 'indicator-darkmode' : 'indicator-lightmode']" id="indicator-icon"
|
||||||
|
@click="toggleActionbar">
|
||||||
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||||
|
src="../icons/actionbar-icons/Indicator-Icon-Opened.svg" />
|
||||||
</div>
|
</div>
|
||||||
<nav class="actions" >
|
<nav class="actions">
|
||||||
<button :class="[ darkMode ? 'button-darkmode' : 'button-lightmode' ]" id="search" >
|
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="search">
|
||||||
<div class="icon" id="search-icon">
|
<div class="icon" id="search-icon">
|
||||||
<img :class="[ darkMode ? 'img-darkmode' : 'img-lightmode' ]" loading="lazy" src="../icons/actionbar-icons/Search-Icon.svg"/>
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||||
|
src="../icons/actionbar-icons/Search-Icon.svg" />
|
||||||
</div>
|
</div>
|
||||||
<Transition name="fade">
|
<Transition name="fade">
|
||||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode' ]">Search</pre>
|
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Search</pre>
|
||||||
</Transition>
|
</Transition>
|
||||||
</button>
|
</button>
|
||||||
<button :class="[ darkMode ? 'button-darkmode' : 'button-lightmode' ]" id="filter" >
|
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="filter">
|
||||||
<div class="icon" id="filter-icon">
|
<div class="icon" id="filter-icon">
|
||||||
<img :class="[ darkMode ? 'img-darkmode' : 'img-lightmode' ]" loading="lazy" src="../icons/actionbar-icons/Filter-Icon.svg"/>
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||||
|
src="../icons/actionbar-icons/Filter-Icon.svg" />
|
||||||
</div>
|
</div>
|
||||||
<Transition name="fade">
|
<Transition name="fade">
|
||||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode' ]">Filter</pre>
|
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Filter</pre>
|
||||||
</Transition>
|
</Transition>
|
||||||
</button>
|
</button>
|
||||||
<button :class="[ darkMode ? 'button-darkmode' : 'button-lightmode' ]" id="instances" >
|
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="instances">
|
||||||
<div class="icon" id="instances-icon">
|
<div class="icon" id="instances-icon">
|
||||||
<img :class="[ darkMode ? 'img-darkmode' : 'img-lightmode' ]" loading="lazy" src="../icons/actionbar-icons/Instances-Icon.svg"/>
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||||
|
src="../icons/actionbar-icons/Instances-Icon.svg" />
|
||||||
</div>
|
</div>
|
||||||
<Transition name="fade" >
|
<Transition name="fade">
|
||||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode' ]">Instances</pre>
|
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Instances</pre>
|
||||||
</Transition>
|
</Transition>
|
||||||
</button>
|
</button>
|
||||||
<button :class="[ darkMode ? 'button-darkmode' : 'button-lightmode' ]" id="attachments" >
|
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="attachments">
|
||||||
<div class="icon" id="attachments-icon">
|
<div class="icon" id="attachments-icon">
|
||||||
<img :class="[ darkMode ? 'img-darkmode' : 'img-lightmode' ]" loading="lazy" src="../icons/actionbar-icons/Attachments-Icon.svg"/>
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||||
|
src="../icons/actionbar-icons/Attachments-Icon.svg" />
|
||||||
</div>
|
</div>
|
||||||
<Transition name="fade" >
|
<Transition name="fade">
|
||||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode' ]">Attachments</pre>
|
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Attachments</pre>
|
||||||
</Transition>
|
</Transition>
|
||||||
</button>
|
</button>
|
||||||
<button :class="[ darkMode ? 'button-darkmode' : 'button-lightmode' ]" id="sell" >
|
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="sell">
|
||||||
<div class="icon" id="sell-icon">
|
<div class="icon" id="sell-icon">
|
||||||
<img :class="[ darkMode ? 'img-darkmode' : 'img-lightmode' ]" loading="lazy" src="../icons/actionbar-icons/Sell-Icon.svg"/>
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||||
|
src="../icons/actionbar-icons/Sell-Icon.svg" />
|
||||||
</div>
|
</div>
|
||||||
<Transition name="fade" >
|
<Transition name="fade">
|
||||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode' ]">Sell</pre>
|
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Sell</pre>
|
||||||
</Transition>
|
</Transition>
|
||||||
</button>
|
</button>
|
||||||
<button :class="[ darkMode ? 'button-darkmode' : 'button-lightmode' ]" id="archive" >
|
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="archive">
|
||||||
<div class="icon" id="archive-icon">
|
<div class="icon" id="archive-icon">
|
||||||
<img :class="[ darkMode ? 'img-darkmode' : 'img-lightmode' ]" loading="lazy" src="../icons/actionbar-icons/Archive-Icon.svg"/>
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||||
|
src="../icons/actionbar-icons/Archive-Icon.svg" />
|
||||||
</div>
|
</div>
|
||||||
<Transition name="fade" >
|
<Transition name="fade">
|
||||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode' ]">Archive</pre>
|
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Archive</pre>
|
||||||
</Transition>
|
</Transition>
|
||||||
</button>
|
</button>
|
||||||
<button :class="[ darkMode ? 'button-darkmode' : 'button-lightmode' ]" id="new" >
|
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="new">
|
||||||
<div class="icon" id="new-icon">
|
<div class="icon" id="new-icon">
|
||||||
<img :class="[ darkMode ? 'img-darkmode' : 'img-lightmode' ]" loading="lazy" src="../icons/actionbar-icons/Add-New-Icon.svg"/>
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||||
|
src="../icons/actionbar-icons/Add-New-Icon.svg" />
|
||||||
</div>
|
</div>
|
||||||
<Transition name="fade" >
|
<Transition name="fade">
|
||||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode' ]">New</pre>
|
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">New</pre>
|
||||||
</Transition>
|
</Transition>
|
||||||
</button>
|
</button>
|
||||||
<button :class="[ darkMode ? 'button-darkmode' : 'button-lightmode' ]" id="edit" >
|
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="edit" @click="toggleEditable">
|
||||||
<div class="icon" id="edit-icon">
|
<div class="icon" id="edit-icon">
|
||||||
<img :class="[ darkMode ? 'img-darkmode' : 'img-lightmode' ]" loading="lazy" src="../icons/actionbar-icons/Edit-Icon.svg"/>
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||||
|
src="../icons/actionbar-icons/Edit-Icon.svg" />
|
||||||
</div>
|
</div>
|
||||||
<Transition name="fade" >
|
<Transition name="fade">
|
||||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode' ]">Edit</pre>
|
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Edit</pre>
|
||||||
</Transition>
|
</Transition>
|
||||||
</button>
|
</button>
|
||||||
<button :class="[ darkMode ? 'button-darkmode' : 'button-lightmode' ]" id="delete" >
|
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="delete" @click="deleteAsset">
|
||||||
<div class="icon" id="delete-icon">
|
<div class="icon" id="delete-icon">
|
||||||
<img :class="[ darkMode ? 'img-darkmode' : 'img-lightmode' ]" loading="lazy" src="../icons/actionbar-icons/Delete-Icon.svg"/>
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||||
|
src="../icons/actionbar-icons/Delete-Icon.svg" />
|
||||||
</div>
|
</div>
|
||||||
<Transition name="fade" >
|
<Transition name="fade">
|
||||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode' ]">Delete</pre>
|
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Delete</pre>
|
||||||
</Transition>
|
</Transition>
|
||||||
</button>
|
</button>
|
||||||
</nav>
|
</nav>
|
||||||
</aside>
|
</aside>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { useStore } from 'vuex';
|
||||||
|
|
||||||
|
// get accesss to the store
|
||||||
|
const store = useStore()
|
||||||
|
const toggleEditable = () => {
|
||||||
|
store.commit('toggleEditableAsset');
|
||||||
|
};
|
||||||
|
const deleteAsset = () => {
|
||||||
|
store.commit('doDeleteAsset');
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Actionbar",
|
name: "Actionbar",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -94,24 +118,22 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleActionbar() {
|
toggleActionbar() {
|
||||||
console.log('Actionbar toggled');
|
|
||||||
this.isExpanded = !this.isExpanded;
|
this.isExpanded = !this.isExpanded;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
* {
|
||||||
* {
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
aside.actionbar {
|
aside.actionbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
@ -127,26 +149,30 @@
|
|||||||
gap: 1.25rem;
|
gap: 1.25rem;
|
||||||
transition: all 10s ease-in-out 0s;
|
transition: all 10s ease-in-out 0s;
|
||||||
overflow: clip;
|
overflow: clip;
|
||||||
}
|
}
|
||||||
.actionbar-darkmode {
|
|
||||||
|
.actionbar-darkmode {
|
||||||
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
||||||
background-color: #2C2C2C;
|
background-color: #2C2C2C;
|
||||||
}
|
}
|
||||||
.actionbar-lightmode {
|
|
||||||
|
.actionbar-lightmode {
|
||||||
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
}
|
}
|
||||||
aside.is-expanded {
|
|
||||||
|
aside.is-expanded {
|
||||||
animation: expand 0.5s linear both;
|
animation: expand 0.5s linear both;
|
||||||
}
|
}
|
||||||
aside.is-not-expanded {
|
|
||||||
|
aside.is-not-expanded {
|
||||||
animation: contract 0.5s linear both;
|
animation: contract 0.5s linear both;
|
||||||
width: stretch;
|
width: stretch;
|
||||||
inline-size: stretch;
|
inline-size: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.actions {
|
.actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
@ -154,10 +180,10 @@
|
|||||||
padding: 1.25rem 0;
|
padding: 1.25rem 0;
|
||||||
gap: 1.25rem;
|
gap: 1.25rem;
|
||||||
overflow: clip;
|
overflow: clip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
button {
|
button {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
@ -169,26 +195,33 @@
|
|||||||
transition: 0.2s ease-in-out;
|
transition: 0.2s ease-in-out;
|
||||||
overflow: clip;
|
overflow: clip;
|
||||||
gap: 0.125rem
|
gap: 0.125rem
|
||||||
}
|
}
|
||||||
.button-darkmode {
|
|
||||||
|
.button-darkmode {
|
||||||
background-color: #2C2C2C;
|
background-color: #2C2C2C;
|
||||||
}
|
}
|
||||||
.button-lightmode {
|
|
||||||
|
.button-lightmode {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
}
|
}
|
||||||
.button-darkmode:hover, .indicator-darkmode:hover {
|
|
||||||
|
.button-darkmode:hover,
|
||||||
|
.indicator-darkmode:hover {
|
||||||
background-color: #444444;
|
background-color: #444444;
|
||||||
}
|
}
|
||||||
.button-lightmode:hover, .indicator-lightmode:hover {
|
|
||||||
|
.button-lightmode:hover,
|
||||||
|
.indicator-lightmode:hover {
|
||||||
background-color: #ACACAC;
|
background-color: #ACACAC;
|
||||||
}
|
}
|
||||||
.is-not-expanded > button {
|
|
||||||
|
.is-not-expanded>button {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
/*width: 0.875rem;*/
|
/*width: 0.875rem;*/
|
||||||
@ -197,37 +230,42 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 0 0.5rem;
|
padding: 0 0.5rem;
|
||||||
transition: padding 0.5s linear
|
transition: padding 0.5s linear
|
||||||
}
|
}
|
||||||
#indicator-icon {
|
|
||||||
|
#indicator-icon {
|
||||||
width: 1.875rem;
|
width: 1.875rem;
|
||||||
height: 1.875rem;
|
height: 1.875rem;
|
||||||
border-radius: 0.3125rem;
|
border-radius: 0.3125rem;
|
||||||
transition: 0.2s ease-in-out;
|
transition: 0.2s ease-in-out;
|
||||||
}
|
}
|
||||||
.is-not-expanded .icon {
|
|
||||||
|
.is-not-expanded .icon {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
padding: 0 0.375rem;
|
padding: 0 0.375rem;
|
||||||
}
|
}
|
||||||
.is-not-expanded #indicator-icon {
|
|
||||||
transform: rotate(180deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
.is-not-expanded #indicator-icon {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
width: 0.875rem;
|
width: 0.875rem;
|
||||||
height: 0.875rem;
|
height: 0.875rem;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
object-position: center;
|
object-position: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
#indicator-icon > img {
|
|
||||||
|
#indicator-icon>img {
|
||||||
height: 1.25rem;
|
height: 1.25rem;
|
||||||
}
|
}
|
||||||
.img-darkmode {
|
|
||||||
|
.img-darkmode {
|
||||||
filter: invert(100%);
|
filter: invert(100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.label {
|
.label {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
padding: 0rem 0.3125rem 0rem 0rem;
|
padding: 0rem 0.3125rem 0rem 0rem;
|
||||||
@ -235,77 +273,88 @@
|
|||||||
align-self: center;
|
align-self: center;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
font: 400 0.875rem/1.25rem Overpass, sans-serif;
|
font: 400 0.875rem/1.25rem Overpass, sans-serif;
|
||||||
}
|
}
|
||||||
.label-darkmode {
|
|
||||||
|
.label-darkmode {
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
.label-lightmode {
|
|
||||||
|
.label-lightmode {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.fade-enter-from, .fade-leave-to {
|
.fade-enter-from,
|
||||||
|
.fade-leave-to {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
.fade-enter-to, .fade-leave-from {
|
|
||||||
|
.fade-enter-to,
|
||||||
|
.fade-leave-from {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
max-width: 0;
|
max-width: 0;
|
||||||
}
|
}
|
||||||
.fade-enter-active {
|
|
||||||
|
.fade-enter-active {
|
||||||
transition: all 0.75s;
|
transition: all 0.75s;
|
||||||
overflow: clip;
|
overflow: clip;
|
||||||
animation: fade-in 0.5s linear forwards;
|
animation: fade-in 0.5s linear forwards;
|
||||||
}
|
}
|
||||||
.fade-leave-active {
|
|
||||||
|
.fade-leave-active {
|
||||||
transition: all 0.75s;
|
transition: all 0.75s;
|
||||||
animation: fade-out 0.5s linear forwards;
|
animation: fade-out 0.5s linear forwards;
|
||||||
}
|
}
|
||||||
.fade-move {
|
|
||||||
|
.fade-move {
|
||||||
transition: transform 5s
|
transition: transform 5s
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes expand {
|
@keyframes expand {
|
||||||
from {
|
from {
|
||||||
max-inline-size: 3.25rem;
|
max-inline-size: 3.25rem;
|
||||||
max-width: 3.25rem;
|
max-width: 3.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
max-inline-size: 9.0625rem;
|
max-inline-size: 9.0625rem;
|
||||||
max-width: 9.0625rem;
|
max-width: 9.0625rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@keyframes contract {
|
|
||||||
|
@keyframes contract {
|
||||||
from {
|
from {
|
||||||
max-inline-size: 9.0625rem;
|
max-inline-size: 9.0625rem;
|
||||||
max-width: 9.0625rem;
|
max-width: 9.0625rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
max-inline-size: 3.25rem;
|
max-inline-size: 3.25rem;
|
||||||
max-width: 3.25rem;
|
max-width: 3.25rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes fade-in {
|
@keyframes fade-in {
|
||||||
from {
|
from {
|
||||||
max-width: 0;
|
max-width: 0;
|
||||||
max-inline-size: 0;
|
max-inline-size: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
max-width: 7.5rem;
|
max-width: 7.5rem;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@keyframes fade-out {
|
|
||||||
|
@keyframes fade-out {
|
||||||
from {
|
from {
|
||||||
max-width: 7.5rem;
|
max-width: 7.5rem;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
max-width: 0;
|
max-width: 0;
|
||||||
max-inline-size: 0;
|
max-inline-size: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@ -13,8 +13,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="menus">
|
<div class="menus">
|
||||||
<nav id="home-menu" :class="[darkMode ? 'menu-darkmode' : 'menu-lightmode']">
|
<nav id="home-menu" :class="[darkMode ? 'menu-darkmode' : 'menu-lightmode']">
|
||||||
<router-link to="/home" class="button" :class="[darkMode ? 'button-darkmode' : 'button-lightmode']"
|
<router-link to="/home" class="button"
|
||||||
id="home-button">
|
:class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="home-button">
|
||||||
<div class="icon" id="home-icon">
|
<div class="icon" id="home-icon">
|
||||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||||
src="../icons/navbar-icons/Home-Icon.svg" />
|
src="../icons/navbar-icons/Home-Icon.svg" />
|
||||||
@ -31,14 +31,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<span v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Checklists</span>
|
<span v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Checklists</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link to="/assets" class="button" :class="[darkMode ? 'button-darkmode' : 'button-lightmode']"
|
<nuxt-link to="/assets" class="button" :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" @click="defaultAssetPage()"
|
||||||
id="assets-button">
|
id="assets-button">
|
||||||
<div class="icon" id="assets-icon">
|
<div class="icon" id="assets-icon">
|
||||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy"
|
||||||
src="../icons/navbar-icons/Assets-Icon.svg" />
|
src="../icons/navbar-icons/Assets-Icon.svg" />
|
||||||
</div>
|
</div>
|
||||||
<span v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Config Items</span>
|
<span v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Config Items</span>
|
||||||
</router-link>
|
</nuxt-link>
|
||||||
<router-link to="/solutions" class="button" :class="[darkMode ? 'button-darkmode' : 'button-lightmode']"
|
<router-link to="/solutions" class="button" :class="[darkMode ? 'button-darkmode' : 'button-lightmode']"
|
||||||
id="solutions-button">
|
id="solutions-button">
|
||||||
<div class="icon" id="solutions-icon">
|
<div class="icon" id="solutions-icon">
|
||||||
@ -72,14 +72,21 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import { useStore } from 'vuex';
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const darkMode = ref(true)
|
||||||
const isExpanded = ref(true)
|
const isExpanded = ref(true)
|
||||||
|
|
||||||
|
// get accesss to the store
|
||||||
|
const store = useStore()
|
||||||
|
const defaultAssetPage = () => {
|
||||||
|
store.commit('resetAssetStore');
|
||||||
|
store.commit('changeToAssetlist');
|
||||||
|
};
|
||||||
|
|
||||||
const ToggleSidebar = () => {
|
const ToggleSidebar = () => {
|
||||||
isExpanded.value = !isExpanded.value;
|
isExpanded.value = !isExpanded.value;
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -1,4 +1,19 @@
|
|||||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
devtools: { enabled: true }
|
devtools: { enabled: true },
|
||||||
|
devServer: {
|
||||||
|
https: {
|
||||||
|
key: './certs/privkey.pem',
|
||||||
|
cert: './certs/fullchain.pem'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
vite: {
|
||||||
|
server: {
|
||||||
|
cors: {
|
||||||
|
origin: true,
|
||||||
|
optionsSuccessStatus: 204,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
6204
package-lock.json
generated
6204
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -17,6 +17,15 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vueform/toggle": "^2.1.4",
|
"@vueform/toggle": "^2.1.4",
|
||||||
"leading-trim": "^1.0.2"
|
"axios": "^1.6.7",
|
||||||
|
"bcryptjs": "^2.4.3",
|
||||||
|
"cors": "^2.8.5",
|
||||||
|
"express": "^4.18.2",
|
||||||
|
"jsonwebtoken": "^9.0.2",
|
||||||
|
"leading-trim": "^1.0.2",
|
||||||
|
"mariadb": "^3.2.3",
|
||||||
|
"uuid": "^9.0.1",
|
||||||
|
"vite": "^5.1.0",
|
||||||
|
"vuex": "^4.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,15 +4,15 @@
|
|||||||
<h1 :class="[darkMode ? 'h1-darkmode' : 'h1-lightmode']" id="page-name">Assets</h1>
|
<h1 :class="[darkMode ? 'h1-darkmode' : 'h1-lightmode']" id="page-name">Assets</h1>
|
||||||
</div>
|
</div>
|
||||||
<div id="content-body">
|
<div id="content-body">
|
||||||
<ClientSearch v-if="onAssetlist || onCustomerAssetlist"/>
|
<ClientSearch v-if="onAssetlist || onCustomerAssetlist" />
|
||||||
<AssetTable v-if="onAssetlist"/>
|
<AssetTable v-if="onAssetlist" />
|
||||||
<AssetTableNoClient v-if="onCustomerAssetlist"/>
|
<AssetTableNoClient v-if="onCustomerAssetlist" />
|
||||||
<Asset v-if="onAsset"/>
|
<Asset v-if="onAsset" />
|
||||||
<HardwareSpecifications v-if="onAsset"/>
|
<HardwareSpecifications v-if="onAsset" />
|
||||||
<SoftwareSpecifications v-if="onAsset"/>
|
<SoftwareSpecifications v-if="onAsset" />
|
||||||
<NetworkSpecifications v-if="onAsset"/>
|
<NetworkSpecifications v-if="onAsset" />
|
||||||
<AssetSearch v-if="onSolutionlistAsset"/>
|
<AssetSearch v-if="onSolutionlistAsset" />
|
||||||
<AssetSolutionList v-if="onSolutionlistAsset"/>
|
<AssetSolutionList v-if="onSolutionlistAsset" />
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
@ -30,18 +30,20 @@ import SoftwareSpecifications from "../components/server/SoftwareSpecifications.
|
|||||||
import NetworkSpecifications from "../components/server/NetworkSpecifications.vue";
|
import NetworkSpecifications from "../components/server/NetworkSpecifications.vue";
|
||||||
import AssetSearch from "../components/AssetSearch.vue";
|
import AssetSearch from "../components/AssetSearch.vue";
|
||||||
import AssetSolutionList from "../components/server/AssetSolutionList.vue";
|
import AssetSolutionList from "../components/server/AssetSolutionList.vue";
|
||||||
|
import { useStore } from 'vuex';
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
|
const store = useStore();
|
||||||
|
const onAssetlist = computed(() => store.state.onAssetlist);
|
||||||
|
const onCustomerAssetlist = computed(() => store.state.onCustomerAssetlist);
|
||||||
|
const onAsset = computed(() => store.state.onAsset);
|
||||||
|
const onSolutionlistAsset = computed(() => store.state.onSolutionlistAsset);
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: 'default'
|
layout: 'default'
|
||||||
})
|
})
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const darkMode = ref(true)
|
||||||
|
|
||||||
// to render the right components
|
|
||||||
const onAssetlist = ref(true)
|
|
||||||
const onCustomerAssetlist = ref(false)
|
|
||||||
const onAsset = ref(false)
|
|
||||||
const onSolutionlistAsset = ref(false)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -50,7 +52,6 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|||||||
62
plugins/vuex.js
Normal file
62
plugins/vuex.js
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
import { createStore } from "vuex";
|
||||||
|
|
||||||
|
const store = createStore({
|
||||||
|
state() {
|
||||||
|
return {
|
||||||
|
assetEditable: false,
|
||||||
|
deleteAsset: false,
|
||||||
|
onAssetlist: true,
|
||||||
|
onCustomerAssetlist: false,
|
||||||
|
onAsset: false,
|
||||||
|
onSolutionlistAsset: false,
|
||||||
|
chosenAssetId: -1
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mutations: {
|
||||||
|
toggleEditableAsset(state) {
|
||||||
|
state.assetEditable = !state.assetEditable
|
||||||
|
},
|
||||||
|
changeToAssetlist(state) {
|
||||||
|
state.onAssetlist = true
|
||||||
|
state.onCustomerAssetlist = false
|
||||||
|
state.onAsset = false
|
||||||
|
state.onSolutionlistAsset = false
|
||||||
|
},
|
||||||
|
changeToCustomerAssetlist(state) {
|
||||||
|
state.onAssetlist = false
|
||||||
|
state.onCustomerAssetlist = true
|
||||||
|
state.onAsset = false
|
||||||
|
state.onSolutionlistAsset = false
|
||||||
|
},
|
||||||
|
changeToAsset(state) {
|
||||||
|
state.onAssetlist = false
|
||||||
|
state.onCustomerAssetlist = false
|
||||||
|
state.onAsset = true
|
||||||
|
state.onSolutionlistAsset = false
|
||||||
|
},
|
||||||
|
changeToSolutionlistAsset(state) {
|
||||||
|
state.onAssetlist = false
|
||||||
|
state.onCustomerAssetlist = false
|
||||||
|
state.onAsset = false
|
||||||
|
state.onSolutionlistAsset = true
|
||||||
|
},
|
||||||
|
setChosenAsset(state, id) {
|
||||||
|
state.chosenAssetId = id
|
||||||
|
},
|
||||||
|
resetAssetStore(state) {
|
||||||
|
state.chosenAssetId = -1
|
||||||
|
state.assetEditable = false
|
||||||
|
},
|
||||||
|
doDeleteAsset(state) {
|
||||||
|
state.deleteAsset = true
|
||||||
|
},
|
||||||
|
undoDeleteAsset(state) {
|
||||||
|
state.deleteAsset = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default defineNuxtPlugin((nuxtApp) => {
|
||||||
|
nuxtApp.vueApp.use(store);
|
||||||
|
// Install the store instance as a plugin
|
||||||
|
});
|
||||||
65
router/index.js
Normal file
65
router/index.js
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
// import { createRouter, createWebHistory } from 'vue-router';
|
||||||
|
// import HomePage from '../pages/home.vue';
|
||||||
|
// import ClientsPage from '../pages/clients.vue';
|
||||||
|
// import LoginPage from '../pages/login.vue';
|
||||||
|
// import AssetPage from '../pages/assets.vue';
|
||||||
|
// import SolutionPage from '../pages/solutions.vue';
|
||||||
|
// import IssueSlipPage from '../pages/issueSlips.vue';
|
||||||
|
// import IssuesPages from '../pages/issues.vue';
|
||||||
|
// import MaintenanceVisitsPage from '../pages/maintenanceVisits.vue';
|
||||||
|
// import ProductionOrdersPage from '../pages/productionOrders.vue';
|
||||||
|
// import SettingsPage from '../pages/settings.vue';
|
||||||
|
|
||||||
|
// const router = createRouter({
|
||||||
|
// mode: 'history',
|
||||||
|
// history: createWebHistory(),
|
||||||
|
// routes: [
|
||||||
|
// {
|
||||||
|
// name: "Asset",
|
||||||
|
// path: "/asset/:id",
|
||||||
|
// component: async () => await import('../pages/assets.vue'),
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: '/login',
|
||||||
|
// component: LoginPage
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: '/home',
|
||||||
|
// component: HomePage
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: '/productionOrders',
|
||||||
|
// component: ProductionOrdersPage
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: '/maintenanceVisits',
|
||||||
|
// component: MaintenanceVisitsPage
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: '/assets',
|
||||||
|
// component: AssetPage
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: '/solutions',
|
||||||
|
// component: AssetPage
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: '/issueSlips',
|
||||||
|
// component: IssueSlipPage
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: '/issues',
|
||||||
|
// component: IssuesPages
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: '/clients',
|
||||||
|
// component: ClientsPage
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: '/settings',
|
||||||
|
// component: SettingsPage
|
||||||
|
// },
|
||||||
|
// ]
|
||||||
|
// })
|
||||||
|
|
||||||
|
// export default router
|
||||||
@ -1,59 +0,0 @@
|
|||||||
import { createRouter, createWebHistory } from 'vue-router';
|
|
||||||
import HomePage from '../pages/home.vue';
|
|
||||||
import ClientsPage from '../pages/clients.vue';
|
|
||||||
import LoginPage from '../pages/login.vue';
|
|
||||||
import AssetPage from '../pages/assets.vue';
|
|
||||||
import SolutionPage from '../pages/solutions.vue';
|
|
||||||
import IssueSlipPage from '../pages/issueSlips.vue';
|
|
||||||
import IssuesPages from '../pages/issues.vue';
|
|
||||||
import MaintenanceVisitsPage from '../pages/maintenanceVisits.vue';
|
|
||||||
import ProductionOrdersPage from '../pages/productionOrders.vue';
|
|
||||||
import SettingsPage from '../pages/settings.vue';
|
|
||||||
|
|
||||||
const router = createRouter({
|
|
||||||
history: createWebHistory(),
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/login',
|
|
||||||
component: LoginPage
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/home',
|
|
||||||
component: HomePage
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/productionOrders',
|
|
||||||
component: ProductionOrdersPage
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/maintenanceVisits',
|
|
||||||
component: MaintenanceVisitsPage
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/assets',
|
|
||||||
component: AssetPage
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/solutions',
|
|
||||||
component: SolutionPage
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/issueSlips',
|
|
||||||
component: IssueSlipPage
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/issues',
|
|
||||||
component: IssuesPages
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/clients',
|
|
||||||
component: ClientsPage
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/settings',
|
|
||||||
component: SettingsPage
|
|
||||||
},
|
|
||||||
]
|
|
||||||
})
|
|
||||||
|
|
||||||
export default router
|
|
||||||
22
server/api/deleteConfigItem/[id].ts
Normal file
22
server/api/deleteConfigItem/[id].ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { errorMsg } from "../../middleware/configItems";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[1]> = {
|
||||||
|
'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
|
||||||
|
'Access-Control-Allow-Headers': 'authorization, content-type',
|
||||||
|
'Access-Control-Allow-Methods': 'OPTIONS,GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return
|
||||||
|
})
|
||||||
22
server/api/getAllConfigItems.ts
Normal file
22
server/api/getAllConfigItems.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { configItems, errorMsg } from "../middleware/configItems";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[1]> = {
|
||||||
|
'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
|
||||||
|
'Access-Control-Allow-Headers': 'authorization, content-type',
|
||||||
|
'Access-Control-Allow-Methods': 'OPTIONS,GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return configItems
|
||||||
|
})
|
||||||
22
server/api/getAllCustomers.ts
Normal file
22
server/api/getAllCustomers.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { customers, errorMsg } from "../middleware/customers";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[1]> = {
|
||||||
|
'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
|
||||||
|
'Access-Control-Allow-Headers': 'authorization, content-type',
|
||||||
|
'Access-Control-Allow-Methods': 'GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return customers
|
||||||
|
})
|
||||||
22
server/api/getAllIssueSlips.ts
Normal file
22
server/api/getAllIssueSlips.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { issueSlips, errorMsg } from "../middleware/issueSlips";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[1]> = {
|
||||||
|
'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
|
||||||
|
'Access-Control-Allow-Headers': 'authorization, content-type',
|
||||||
|
'Access-Control-Allow-Methods': 'GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return issueSlips
|
||||||
|
})
|
||||||
22
server/api/getAllIssues.ts
Normal file
22
server/api/getAllIssues.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { issues, errorMsg } from "../middleware/issues";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[1]> = {
|
||||||
|
'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
|
||||||
|
'Access-Control-Allow-Headers': 'authorization, content-type',
|
||||||
|
'Access-Control-Allow-Methods': 'GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return issues
|
||||||
|
})
|
||||||
22
server/api/getAllMaintenanceVisitTemplates.ts
Normal file
22
server/api/getAllMaintenanceVisitTemplates.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { maintenanceVisitTemplates, errorMsg } from "../middleware/maintenanceVisitTemplates";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[1]> = {
|
||||||
|
'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
|
||||||
|
'Access-Control-Allow-Headers': 'authorization, content-type',
|
||||||
|
'Access-Control-Allow-Methods': 'GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return maintenanceVisitTemplates
|
||||||
|
})
|
||||||
22
server/api/getAllProductionOrderTemplates.ts
Normal file
22
server/api/getAllProductionOrderTemplates.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { productionOrderTemplates, errorMsg } from "../middleware/productionOrderTemplates";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[1]> = {
|
||||||
|
'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
|
||||||
|
'Access-Control-Allow-Headers': 'authorization, content-type',
|
||||||
|
'Access-Control-Allow-Methods': 'GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return productionOrderTemplates
|
||||||
|
})
|
||||||
22
server/api/getAllSolutions.ts
Normal file
22
server/api/getAllSolutions.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { solutions, errorMsg } from "../middleware/solutions";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[1]> = {
|
||||||
|
'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
|
||||||
|
'Access-Control-Allow-Headers': 'authorization, content-type',
|
||||||
|
'Access-Control-Allow-Methods': 'GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return solutions
|
||||||
|
})
|
||||||
22
server/api/getConfigItem/[id].ts
Normal file
22
server/api/getConfigItem/[id].ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { configItem, errorMsg } from "../../middleware/configItems";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[1]> = {
|
||||||
|
'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
|
||||||
|
'Access-Control-Allow-Headers': 'authorization, content-type',
|
||||||
|
'Access-Control-Allow-Methods': 'OPTIONS,GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return configItem
|
||||||
|
})
|
||||||
22
server/api/getCustomerByName/[id].ts
Normal file
22
server/api/getCustomerByName/[id].ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { customerObject, errorMsg } from "../../middleware/customers";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[1]> = {
|
||||||
|
'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
|
||||||
|
'Access-Control-Allow-Headers': 'authorization, content-type',
|
||||||
|
'Access-Control-Allow-Methods': 'OPTIONS,GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return customerObject
|
||||||
|
})
|
||||||
15
server/api/login.ts
Normal file
15
server/api/login.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { loginSuccessful, errorMsg } from "../middleware/login";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
if (!loginSuccessful) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return 'Successfully logged in.'
|
||||||
|
})
|
||||||
14
server/api/signup.ts
Normal file
14
server/api/signup.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { errorMsg } from "../middleware/signUp.js";
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 202)
|
||||||
|
return 'Successfully signed up.'
|
||||||
|
})
|
||||||
13
server/api/updateConfigItem.ts
Normal file
13
server/api/updateConfigItem.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { errorMsg } from "../middleware/configItems";
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
})
|
||||||
144
server/middleware/configItems.ts
Normal file
144
server/middleware/configItems.ts
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
import axios, { AxiosError } from 'axios';
|
||||||
|
import serversideConfig from '../../serversideConfig';
|
||||||
|
import https from 'https';
|
||||||
|
|
||||||
|
let configItems = [];
|
||||||
|
let configItem = {};
|
||||||
|
let errorMsg = '';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const agent = new https.Agent({
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const axiosInstance = axios.create({
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Accept: "*",
|
||||||
|
},
|
||||||
|
httpsAgent: agent
|
||||||
|
});
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/getAllConfigItems")) {
|
||||||
|
// get all config items object from backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/configItems`);
|
||||||
|
configItems = res.data;
|
||||||
|
} catch (err) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const axiosError = err as AxiosError;
|
||||||
|
|
||||||
|
if (axiosError.response) {
|
||||||
|
// Axios error
|
||||||
|
console.error(axiosError.response.data.message);
|
||||||
|
errorMsg = axiosError.response.data.message;
|
||||||
|
} else if (axiosError.request) {
|
||||||
|
console.log(err)
|
||||||
|
// If error was caused by the request
|
||||||
|
console.error(axiosError.request);
|
||||||
|
} else {
|
||||||
|
// Other errors
|
||||||
|
console.error('Error', axiosError.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No AxiosError
|
||||||
|
console.error('Error', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/getConfigItem")) {
|
||||||
|
// get all config items object from backend
|
||||||
|
let itemId = null;
|
||||||
|
const path = event._path;
|
||||||
|
const pathSegments = path.split('/');
|
||||||
|
itemId = pathSegments[pathSegments.length - 1];
|
||||||
|
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/configItem/${itemId}`);
|
||||||
|
configItem = res.data;
|
||||||
|
} catch (err) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const axiosError = err as AxiosError;
|
||||||
|
|
||||||
|
if (axiosError.response) {
|
||||||
|
// Axios error
|
||||||
|
console.error(axiosError.response.data.message);
|
||||||
|
errorMsg = axiosError.response.data.message;
|
||||||
|
} else if (axiosError.request) {
|
||||||
|
// If error was caused by the request
|
||||||
|
console.error(axiosError.request);
|
||||||
|
} else {
|
||||||
|
// Other errors
|
||||||
|
console.error('Error', axiosError.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No AxiosError
|
||||||
|
console.error('Error', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/updateConfigItem")) {
|
||||||
|
const body = await readBody(event)
|
||||||
|
// update the config item in the backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.put(`https://${serversideConfig.url}:${serversideConfig.port}/configItem`, body);
|
||||||
|
} catch (err) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const axiosError = err as AxiosError;
|
||||||
|
|
||||||
|
if (axiosError.response) {
|
||||||
|
// Axios error
|
||||||
|
console.error(axiosError.response.data.message);
|
||||||
|
errorMsg = axiosError.response.data.message;
|
||||||
|
} else if (axiosError.request) {
|
||||||
|
console.log(err)
|
||||||
|
// If error was caused by the request
|
||||||
|
console.error(axiosError.request);
|
||||||
|
} else {
|
||||||
|
// Other errors
|
||||||
|
console.error('Error', axiosError.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No AxiosError
|
||||||
|
console.error('Error', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/deleteConfigItem")) {
|
||||||
|
let itemId = null;
|
||||||
|
const path = event._path;
|
||||||
|
const pathSegments = path.split('/');
|
||||||
|
itemId = pathSegments[pathSegments.length - 1];
|
||||||
|
|
||||||
|
// delete the config item in the backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.delete(`https://${serversideConfig.url}:${serversideConfig.port}/configItems/${itemId}`);
|
||||||
|
} catch (err) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const axiosError = err as AxiosError;
|
||||||
|
|
||||||
|
if (axiosError.response) {
|
||||||
|
// Axios error
|
||||||
|
console.error(axiosError.response.data.message);
|
||||||
|
errorMsg = axiosError.response.data.message;
|
||||||
|
} else if (axiosError.request) {
|
||||||
|
console.log(err)
|
||||||
|
// If error was caused by the request
|
||||||
|
console.error(axiosError.request);
|
||||||
|
} else {
|
||||||
|
// Other errors
|
||||||
|
console.error('Error', axiosError.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No AxiosError
|
||||||
|
console.error('Error', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export { configItems, configItem, errorMsg };
|
||||||
8
server/middleware/cors.ts
Normal file
8
server/middleware/cors.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
export default defineEventHandler((event) => {
|
||||||
|
|
||||||
|
if (event.method === 'OPTIONS') {
|
||||||
|
event.node.res.statusCode = 204;
|
||||||
|
event.node.res.statusMessage = "No Content";
|
||||||
|
return 'OK'
|
||||||
|
}
|
||||||
|
})
|
||||||
84
server/middleware/customers.ts
Normal file
84
server/middleware/customers.ts
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
import axios, { AxiosError } from 'axios';
|
||||||
|
import serversideConfig from '../../serversideConfig';
|
||||||
|
import https from 'https';
|
||||||
|
|
||||||
|
let customers = [];
|
||||||
|
let customerObject = [];
|
||||||
|
let errorMsg = '';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const agent = new https.Agent({
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const axiosInstance = axios.create({
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Accept: "*",
|
||||||
|
},
|
||||||
|
httpsAgent: agent
|
||||||
|
});
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/getAllCustomers")) {
|
||||||
|
// get all customers object from backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/customers`);
|
||||||
|
customers = res.data;
|
||||||
|
} catch (err) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const axiosError = err as AxiosError;
|
||||||
|
|
||||||
|
if (axiosError.response) {
|
||||||
|
// Axios error
|
||||||
|
console.error(axiosError.response.data.message);
|
||||||
|
errorMsg = axiosError.response.data.message;
|
||||||
|
} else if (axiosError.request) {
|
||||||
|
console.log(err)
|
||||||
|
// If error was caused by the request
|
||||||
|
console.error(axiosError.request);
|
||||||
|
} else {
|
||||||
|
// Other errors
|
||||||
|
console.error('Error', axiosError.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No AxiosError
|
||||||
|
console.error('Error', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/getCustomerByName")) {
|
||||||
|
// get customer object from backend
|
||||||
|
let itemId = null;
|
||||||
|
const path = event._path;
|
||||||
|
const pathSegments = path.split('/');
|
||||||
|
itemId = pathSegments[pathSegments.length - 1];
|
||||||
|
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/customerName/${itemId}`);
|
||||||
|
customerObject = res.data;
|
||||||
|
} catch (err) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const axiosError = err as AxiosError;
|
||||||
|
|
||||||
|
if (axiosError.response) {
|
||||||
|
// Axios error
|
||||||
|
console.error(axiosError.response.data.message);
|
||||||
|
errorMsg = axiosError.response.data.message;
|
||||||
|
} else if (axiosError.request) {
|
||||||
|
// If error was caused by the request
|
||||||
|
console.error(axiosError.request);
|
||||||
|
} else {
|
||||||
|
// Other errors
|
||||||
|
console.error('Error', axiosError.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No AxiosError
|
||||||
|
console.error('Error', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export { customers, customerObject, errorMsg };
|
||||||
51
server/middleware/issueSlips.ts
Normal file
51
server/middleware/issueSlips.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import axios, { AxiosError } from 'axios';
|
||||||
|
import serversideConfig from '../../serversideConfig';
|
||||||
|
import https from 'https';
|
||||||
|
|
||||||
|
let issueSlips = [];
|
||||||
|
let errorMsg = '';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/getAllIssueSlips")) {
|
||||||
|
|
||||||
|
const agent = new https.Agent({
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const axiosInstance = axios.create({
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Accept: "*",
|
||||||
|
},
|
||||||
|
httpsAgent: agent
|
||||||
|
});
|
||||||
|
|
||||||
|
// get all issue slips object from backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/issueSlips`);
|
||||||
|
issueSlips = res.data;
|
||||||
|
} catch (err) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const axiosError = err as AxiosError;
|
||||||
|
|
||||||
|
if (axiosError.response) {
|
||||||
|
// Axios error
|
||||||
|
console.error(axiosError.response.data.message);
|
||||||
|
errorMsg = axiosError.response.data.message;
|
||||||
|
} else if (axiosError.request) {
|
||||||
|
// If error was caused by the request
|
||||||
|
console.error(axiosError.request);
|
||||||
|
} else {
|
||||||
|
// Other errors
|
||||||
|
console.error('Error', axiosError.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No AxiosError
|
||||||
|
console.error('Error', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export { issueSlips, errorMsg };
|
||||||
51
server/middleware/issues.ts
Normal file
51
server/middleware/issues.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import axios, { AxiosError } from 'axios';
|
||||||
|
import serversideConfig from '../../serversideConfig';
|
||||||
|
import https from 'https';
|
||||||
|
|
||||||
|
let issues = [];
|
||||||
|
let errorMsg = '';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/getAllIssues")) {
|
||||||
|
|
||||||
|
const agent = new https.Agent({
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const axiosInstance = axios.create({
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Accept: "*",
|
||||||
|
},
|
||||||
|
httpsAgent: agent
|
||||||
|
});
|
||||||
|
|
||||||
|
// get all issues object from backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/issues`);
|
||||||
|
issues = res.data;
|
||||||
|
} catch (err) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const axiosError = err as AxiosError;
|
||||||
|
|
||||||
|
if (axiosError.response) {
|
||||||
|
// Axios error
|
||||||
|
console.error(axiosError.response.data.message);
|
||||||
|
errorMsg = axiosError.response.data.message;
|
||||||
|
} else if (axiosError.request) {
|
||||||
|
// If error was caused by the request
|
||||||
|
console.error(axiosError.request);
|
||||||
|
} else {
|
||||||
|
// Other errors
|
||||||
|
console.error('Error', axiosError.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No AxiosError
|
||||||
|
console.error('Error', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export { issues, errorMsg };
|
||||||
56
server/middleware/login.ts
Normal file
56
server/middleware/login.ts
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
import axios, { AxiosError } from 'axios';
|
||||||
|
import serversideConfig from '../../serversideConfig';
|
||||||
|
import https from 'https';
|
||||||
|
|
||||||
|
let loginSuccessful = false;
|
||||||
|
let errorMsg = '';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
loginSuccessful = false;
|
||||||
|
const agent = new https.Agent({
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const axiosInstance = axios.create({
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Accept: "*",
|
||||||
|
},
|
||||||
|
httpsAgent: agent
|
||||||
|
});
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/login")) {
|
||||||
|
|
||||||
|
const body = await readBody(event)
|
||||||
|
|
||||||
|
// get user object from backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.post(`https://${serversideConfig.url}:${serversideConfig.port}/login`, {
|
||||||
|
username: body.username,
|
||||||
|
password: body.password,
|
||||||
|
});
|
||||||
|
loginSuccessful = true;
|
||||||
|
} catch (err) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const axiosError = err as AxiosError;
|
||||||
|
|
||||||
|
if (axiosError.response) {
|
||||||
|
// Axios error
|
||||||
|
console.error(axiosError.response.data.message);
|
||||||
|
errorMsg = axiosError.response.data.message;
|
||||||
|
} else if (axiosError.request) {
|
||||||
|
// If error was caused by the request
|
||||||
|
console.error(axiosError.request);
|
||||||
|
} else {
|
||||||
|
// Other errors
|
||||||
|
console.error('Error', axiosError.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No AxiosError
|
||||||
|
console.error('Error', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export { loginSuccessful, errorMsg };
|
||||||
51
server/middleware/maintenanceVisitTemplates.ts
Normal file
51
server/middleware/maintenanceVisitTemplates.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import axios, { AxiosError } from 'axios';
|
||||||
|
import serversideConfig from '../../serversideConfig';
|
||||||
|
import https from 'https';
|
||||||
|
|
||||||
|
let maintenanceVisitTemplates = [];
|
||||||
|
let errorMsg = '';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/getAllMaintenanceVisitTemplates")) {
|
||||||
|
|
||||||
|
const agent = new https.Agent({
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const axiosInstance = axios.create({
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Accept: "*",
|
||||||
|
},
|
||||||
|
httpsAgent: agent
|
||||||
|
});
|
||||||
|
|
||||||
|
// get all maintenance visit templates object from backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/masterMaintenanceVisits`);
|
||||||
|
maintenanceVisitTemplates = res.data;
|
||||||
|
} catch (err) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const axiosError = err as AxiosError;
|
||||||
|
|
||||||
|
if (axiosError.response) {
|
||||||
|
// Axios error
|
||||||
|
console.error(axiosError.response.data.message);
|
||||||
|
errorMsg = axiosError.response.data.message;
|
||||||
|
} else if (axiosError.request) {
|
||||||
|
// If error was caused by the request
|
||||||
|
console.error(axiosError.request);
|
||||||
|
} else {
|
||||||
|
// Other errors
|
||||||
|
console.error('Error', axiosError.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No AxiosError
|
||||||
|
console.error('Error', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export { maintenanceVisitTemplates, errorMsg };
|
||||||
51
server/middleware/productionOrderTemplates.ts
Normal file
51
server/middleware/productionOrderTemplates.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import axios, { AxiosError } from 'axios';
|
||||||
|
import serversideConfig from '../../serversideConfig';
|
||||||
|
import https from 'https';
|
||||||
|
|
||||||
|
let productionOrderTemplates = [];
|
||||||
|
let errorMsg = '';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/getAllProductionOrderTemplates")) {
|
||||||
|
|
||||||
|
const agent = new https.Agent({
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const axiosInstance = axios.create({
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Accept: "*",
|
||||||
|
},
|
||||||
|
httpsAgent: agent
|
||||||
|
});
|
||||||
|
|
||||||
|
// get all production order templates object from backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/masterProductionOrders`);
|
||||||
|
productionOrderTemplates = res.data;
|
||||||
|
} catch (err) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const axiosError = err as AxiosError;
|
||||||
|
|
||||||
|
if (axiosError.response) {
|
||||||
|
// Axios error
|
||||||
|
console.error(axiosError.response.data.message);
|
||||||
|
errorMsg = axiosError.response.data.message;
|
||||||
|
} else if (axiosError.request) {
|
||||||
|
// If error was caused by the request
|
||||||
|
console.error(axiosError.request);
|
||||||
|
} else {
|
||||||
|
// Other errors
|
||||||
|
console.error('Error', axiosError.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No AxiosError
|
||||||
|
console.error('Error', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export { productionOrderTemplates, errorMsg };
|
||||||
50
server/middleware/signUp.ts
Normal file
50
server/middleware/signUp.ts
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
import axios, { AxiosError } from 'axios';
|
||||||
|
import serversideConfig from '../../serversideConfig';
|
||||||
|
import https from 'https';
|
||||||
|
|
||||||
|
let errorMsg = '';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
const agent = new https.Agent({
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const axiosInstance = axios.create({
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Accept: "*",
|
||||||
|
},
|
||||||
|
httpsAgent: agent
|
||||||
|
});
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/signup")) {
|
||||||
|
const body = await readBody(event)
|
||||||
|
|
||||||
|
// do the post request in the backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.post(`https://${serversideConfig.url}:${serversideConfig.port}/signup`, body);
|
||||||
|
} catch (err) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const axiosError = err as AxiosError;
|
||||||
|
|
||||||
|
if (axiosError.response) {
|
||||||
|
// Axios error
|
||||||
|
console.error(axiosError.response.data.message);
|
||||||
|
errorMsg = axiosError.response.data.message;
|
||||||
|
} else if (axiosError.request) {
|
||||||
|
console.log(err)
|
||||||
|
// If error was caused by the request
|
||||||
|
console.error(axiosError.request);
|
||||||
|
} else {
|
||||||
|
// Other errors
|
||||||
|
console.error('Error', axiosError.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No AxiosError
|
||||||
|
console.error('Error', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export { errorMsg };
|
||||||
51
server/middleware/solutions.ts
Normal file
51
server/middleware/solutions.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import axios, { AxiosError } from 'axios';
|
||||||
|
import serversideConfig from '../../serversideConfig';
|
||||||
|
import https from 'https';
|
||||||
|
|
||||||
|
let solutions = [];
|
||||||
|
let errorMsg = '';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/getAllSolutions")) {
|
||||||
|
|
||||||
|
const agent = new https.Agent({
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const axiosInstance = axios.create({
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Accept: "*",
|
||||||
|
},
|
||||||
|
httpsAgent: agent
|
||||||
|
});
|
||||||
|
|
||||||
|
// get all solutions object from backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/solutions`);
|
||||||
|
solutions = res.data;
|
||||||
|
} catch (err) {
|
||||||
|
if (axios.isAxiosError(err)) {
|
||||||
|
const axiosError = err as AxiosError;
|
||||||
|
|
||||||
|
if (axiosError.response) {
|
||||||
|
// Axios error
|
||||||
|
console.error(axiosError.response.data.message);
|
||||||
|
errorMsg = axiosError.response.data.message;
|
||||||
|
} else if (axiosError.request) {
|
||||||
|
// If error was caused by the request
|
||||||
|
console.error(axiosError.request);
|
||||||
|
} else {
|
||||||
|
// Other errors
|
||||||
|
console.error('Error', axiosError.message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No AxiosError
|
||||||
|
console.error('Error', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export { solutions, errorMsg };
|
||||||
@ -2,7 +2,7 @@ const serversideConfig = {
|
|||||||
// url: 'tueitapp.tueit.de',
|
// url: 'tueitapp.tueit.de',
|
||||||
// port: 8000,
|
// port: 8000,
|
||||||
url: 'localhost',
|
url: 'localhost',
|
||||||
port: 3000,
|
port: 4172,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default serversideConfig;
|
export default serversideConfig;
|
||||||
Reference in New Issue
Block a user