mirror of
https://github.com/lemeow125/Borrowing-TrackerFrontend.git
synced 2024-11-17 06:19:27 +08:00
Adjust CRUD actions according to backend changes
This commit is contained in:
parent
a14b09f2a0
commit
fd1eb8ac3b
6 changed files with 16 additions and 148 deletions
|
@ -1,14 +0,0 @@
|
||||||
# .woodpecker.yml
|
|
||||||
steps:
|
|
||||||
- name: build & copy
|
|
||||||
image: node:18-alpine
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache openssh-client
|
|
||||||
- mkdir -p /root/.ssh/
|
|
||||||
- echo "$SSH_KEY" | tr -d '\r' > /root/.ssh/id_rsa
|
|
||||||
- chmod 600 /root/.ssh/id_rsa
|
|
||||||
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
|
|
||||||
- npm install
|
|
||||||
- npm run build
|
|
||||||
- scp -r dist/* root@10.0.10.4:/mnt/sda1/files/projects/equipment_tracker_frontend
|
|
||||||
secrets: [SSH_KEY]
|
|
|
@ -17,7 +17,7 @@ import {
|
||||||
EquipmentInstanceLogListType,
|
EquipmentInstanceLogListType,
|
||||||
} from "../Types/Types";
|
} from "../Types/Types";
|
||||||
|
|
||||||
const debug = false;
|
const debug = true;
|
||||||
let backendURL;
|
let backendURL;
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
|
|
|
@ -86,39 +86,13 @@ export default function AddSKUModal() {
|
||||||
<div style={styles.flex_row}>
|
<div style={styles.flex_row}>
|
||||||
<div style={styles.flex_column}>
|
<div style={styles.flex_column}>
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
value="PC"
|
value="Glassware"
|
||||||
control={<Radio />}
|
control={<Radio />}
|
||||||
label="Workstation"
|
label="Glassware"
|
||||||
style={styles.text_dark}
|
style={styles.text_dark}
|
||||||
/>
|
/>
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
value="NETWORKING"
|
value="Miscellaneous"
|
||||||
control={<Radio />}
|
|
||||||
label="Networking"
|
|
||||||
style={styles.text_dark}
|
|
||||||
/>
|
|
||||||
<FormControlLabel
|
|
||||||
value="CCTV"
|
|
||||||
control={<Radio />}
|
|
||||||
label="CCTV"
|
|
||||||
style={styles.text_dark}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div style={styles.flex_column}>
|
|
||||||
<FormControlLabel
|
|
||||||
value="FURNITURE"
|
|
||||||
control={<Radio />}
|
|
||||||
label="Furniture"
|
|
||||||
style={styles.text_dark}
|
|
||||||
/>
|
|
||||||
<FormControlLabel
|
|
||||||
value="PERIPHERALS"
|
|
||||||
control={<Radio />}
|
|
||||||
label="Peripherals"
|
|
||||||
style={styles.text_dark}
|
|
||||||
/>
|
|
||||||
<FormControlLabel
|
|
||||||
value="MISC"
|
|
||||||
control={<Radio />}
|
control={<Radio />}
|
||||||
label="Miscellaneous"
|
label="Miscellaneous"
|
||||||
style={styles.text_dark}
|
style={styles.text_dark}
|
||||||
|
|
|
@ -197,8 +197,7 @@ export default function EditItemInstanceModal(props: {
|
||||||
Associated SKU:
|
Associated SKU:
|
||||||
</p>
|
</p>
|
||||||
<p style={{ ...styles.text_dark, ...styles.text_M }}>
|
<p style={{ ...styles.text_dark, ...styles.text_M }}>
|
||||||
{equipment.data?.equipment_name}
|
{equipment.data?.equipment}
|
||||||
{" (SKU #" + equipment.data?.equipment + ")"}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -221,39 +221,13 @@ export default function EditSKUModal(props: {
|
||||||
<div style={styles.flex_row}>
|
<div style={styles.flex_row}>
|
||||||
<div style={styles.flex_column}>
|
<div style={styles.flex_column}>
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
value="PC"
|
value="Glassware"
|
||||||
control={<Radio />}
|
control={<Radio />}
|
||||||
label="Workstation"
|
label="Glassware"
|
||||||
style={styles.text_dark}
|
style={styles.text_dark}
|
||||||
/>
|
/>
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
value="NETWORKING"
|
value="Miscellaneous"
|
||||||
control={<Radio />}
|
|
||||||
label="Networking"
|
|
||||||
style={styles.text_dark}
|
|
||||||
/>
|
|
||||||
<FormControlLabel
|
|
||||||
value="CCTV"
|
|
||||||
control={<Radio />}
|
|
||||||
label="CCTV"
|
|
||||||
style={styles.text_dark}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div style={styles.flex_column}>
|
|
||||||
<FormControlLabel
|
|
||||||
value="FURNITURE"
|
|
||||||
control={<Radio />}
|
|
||||||
label="Furniture"
|
|
||||||
style={styles.text_dark}
|
|
||||||
/>
|
|
||||||
<FormControlLabel
|
|
||||||
value="PERIPHERALS"
|
|
||||||
control={<Radio />}
|
|
||||||
label="Peripherals"
|
|
||||||
style={styles.text_dark}
|
|
||||||
/>
|
|
||||||
<FormControlLabel
|
|
||||||
value="MISC"
|
|
||||||
control={<Radio />}
|
control={<Radio />}
|
||||||
label="Miscellaneous"
|
label="Miscellaneous"
|
||||||
style={styles.text_dark}
|
style={styles.text_dark}
|
||||||
|
|
|
@ -3,10 +3,6 @@ import styles from "../../styles";
|
||||||
import { useQueries } from "@tanstack/react-query";
|
import { useQueries } from "@tanstack/react-query";
|
||||||
import { EquipmentsAPI, EquipmentInstancesAPI } from "../../Components/API/API";
|
import { EquipmentsAPI, EquipmentInstancesAPI } from "../../Components/API/API";
|
||||||
import { Button, CircularProgress } from "@mui/material";
|
import { Button, CircularProgress } from "@mui/material";
|
||||||
import ComputerIcon from "@mui/icons-material/Computer";
|
|
||||||
import RouterIcon from "@mui/icons-material/Router";
|
|
||||||
import CameraOutdoorIcon from "@mui/icons-material/CameraOutdoor";
|
|
||||||
import ChairIcon from "@mui/icons-material/Chair";
|
|
||||||
import FormatListBulletedIcon from "@mui/icons-material/FormatListBulleted";
|
import FormatListBulletedIcon from "@mui/icons-material/FormatListBulleted";
|
||||||
import AddToQueueIcon from "@mui/icons-material/AddToQueue";
|
import AddToQueueIcon from "@mui/icons-material/AddToQueue";
|
||||||
import NoteAddIcon from "@mui/icons-material/NoteAdd";
|
import NoteAddIcon from "@mui/icons-material/NoteAdd";
|
||||||
|
@ -18,6 +14,8 @@ import { useState } from "react";
|
||||||
import AddSKUModal from "../../Components/AddSKUModal/AddSKUModal";
|
import AddSKUModal from "../../Components/AddSKUModal/AddSKUModal";
|
||||||
import Popup from "reactjs-popup";
|
import Popup from "reactjs-popup";
|
||||||
import AddItemModal from "../../Components/AddItemModal/AddItemModal";
|
import AddItemModal from "../../Components/AddItemModal/AddItemModal";
|
||||||
|
import ScienceIcon from "@mui/icons-material/Science";
|
||||||
|
import ColorizeIcon from "@mui/icons-material/Colorize";
|
||||||
export default function Dashboard() {
|
export default function Dashboard() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
@ -388,7 +386,7 @@ export default function Dashboard() {
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ComputerIcon
|
<ScienceIcon
|
||||||
style={{
|
style={{
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
|
@ -397,7 +395,7 @@ export default function Dashboard() {
|
||||||
marginRight: "1rem",
|
marginRight: "1rem",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate("/view/equipment_instances/filter/PC");
|
navigate("/view/equipment_instances/filter/Glassware");
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<p
|
<p
|
||||||
|
@ -406,7 +404,7 @@ export default function Dashboard() {
|
||||||
...styles.text_M,
|
...styles.text_M,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Workstations
|
Glassware
|
||||||
</p>
|
</p>
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
@ -419,7 +417,7 @@ export default function Dashboard() {
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<RouterIcon
|
<ColorizeIcon
|
||||||
style={{
|
style={{
|
||||||
height: 64,
|
height: 64,
|
||||||
width: 64,
|
width: 64,
|
||||||
|
@ -428,7 +426,7 @@ export default function Dashboard() {
|
||||||
marginRight: "1rem",
|
marginRight: "1rem",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate("/view/equipment_instances/filter/NETWORKING");
|
navigate("/view/equipment_instances/filter/Miscellaneous");
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<p
|
<p
|
||||||
|
@ -437,70 +435,7 @@ export default function Dashboard() {
|
||||||
...styles.text_M,
|
...styles.text_M,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Networking
|
Miscellaneous
|
||||||
</p>
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style={{
|
|
||||||
...styles.flex_column,
|
|
||||||
...{
|
|
||||||
alignSelf: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
flexWrap: "wrap",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
|
||||||
navigate("/view/equipment_instances/filter/CCTV");
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<CameraOutdoorIcon
|
|
||||||
style={{
|
|
||||||
height: 64,
|
|
||||||
width: 64,
|
|
||||||
fill: colors.font_dark,
|
|
||||||
marginLeft: "1rem",
|
|
||||||
marginRight: "1rem",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<p
|
|
||||||
style={{
|
|
||||||
...styles.text_dark,
|
|
||||||
...styles.text_M,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
CCTVs
|
|
||||||
</p>
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
style={{
|
|
||||||
...styles.flex_column,
|
|
||||||
...{
|
|
||||||
alignSelf: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
flexWrap: "wrap",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ChairIcon
|
|
||||||
style={{
|
|
||||||
height: 64,
|
|
||||||
width: 64,
|
|
||||||
fill: colors.font_dark,
|
|
||||||
marginLeft: "1rem",
|
|
||||||
marginRight: "1rem",
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
|
||||||
navigate("/view/equipment_instances/filter/FURNITURE");
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<p
|
|
||||||
style={{
|
|
||||||
...styles.text_dark,
|
|
||||||
...styles.text_M,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Furniture
|
|
||||||
</p>
|
</p>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue