diff --git a/app/files/locations/Location0/Location0_cover.png b/app/files/locations/Location0/Location0_cover.png new file mode 100644 index 0000000..81cd2ac Binary files /dev/null and b/app/files/locations/Location0/Location0_cover.png differ diff --git a/app/files/locations/Location10/Location10_cover.png b/app/files/locations/Location10/Location10_cover.png index bf50b0e..81cd2ac 100644 Binary files a/app/files/locations/Location10/Location10_cover.png and b/app/files/locations/Location10/Location10_cover.png differ diff --git a/app/log/goInventorize.log b/app/log/goInventorize.log index 4f7a7f6..aa80d52 100644 --- a/app/log/goInventorize.log +++ b/app/log/goInventorize.log @@ -165,3 +165,138 @@ {"level":"info","time":"2022-04-08T22:50:26-04:00","message":"Configuration loaded successfully..."} {"level":"debug","time":"2022-04-08T22:50:26-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} {"level":"info","time":"2022-04-08T22:50:26-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T17:12:44-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T17:12:44-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T17:12:44-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T17:12:44-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T17:12:44-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T17:12:44-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T17:14:28-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T17:14:28-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T17:14:28-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T21:21:48-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T21:21:48-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T21:21:48-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T21:21:49-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T21:21:49-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T21:21:49-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T21:22:27-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T21:22:27-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T21:22:27-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T21:26:20-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T21:26:20-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T21:26:20-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T21:27:06-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T21:27:06-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T21:27:06-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T21:28:54-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"27100", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"} +{"logtype":"webserver", "pid":"27100", "requestid":"", "status":"404", "method":"GET", "path":"/photos/locations/Location4/Kitchen/Kitchen_cover.png"} +{"level":"info","time":"2022-04-09T21:29:20-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T21:29:20-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T21:29:20-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"debug","time":"2022-04-09T21:29:25-04:00","message":"Returning Locations: []"} +{"logtype":"webserver", "pid":"26572", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"} +{"logtype":"webserver", "pid":"26572", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"} +{"level":"debug","time":"2022-04-09T21:31:16-04:00","message":"Returning Locations: []"} +{"logtype":"webserver", "pid":"26572", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"} +{"level":"debug","time":"2022-04-09T21:31:51-04:00","message":"Returning Locations: []"} +{"logtype":"webserver", "pid":"26572", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"} +{"level":"debug","time":"2022-04-09T21:35:18-04:00","message":"Returning Locations: []"} +{"logtype":"webserver", "pid":"26572", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"} +{"level":"info","time":"2022-04-09T21:35:33-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"26572", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"} +{"level":"debug","time":"2022-04-09T21:35:35-04:00","message":"Returning Locations: []"} +{"logtype":"webserver", "pid":"26572", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"} +{"level":"info","time":"2022-04-09T21:35:39-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"26572", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"} +{"level":"debug","time":"2022-04-09T21:35:40-04:00","message":"Returning Locations: []"} +{"logtype":"webserver", "pid":"26572", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"} +{"level":"debug","time":"2022-04-09T21:35:51-04:00","message":"Returning Locations: []"} +{"logtype":"webserver", "pid":"26572", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"} +{"level":"debug","time":"2022-04-09T21:35:53-04:00","message":"Returning Locations: []"} +{"logtype":"webserver", "pid":"26572", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"} +{"level":"info","time":"2022-04-09T21:42:08-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T21:42:08-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T21:42:08-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T21:42:16-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T21:42:16-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T21:42:16-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T21:52:51-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T21:52:51-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T21:52:51-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T21:52:56-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T21:52:56-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T21:52:56-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T21:54:17-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T21:54:17-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T21:54:17-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T21:54:17-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T21:54:17-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T21:54:17-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T21:56:14-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T21:56:14-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T21:56:14-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T22:03:09-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T22:03:09-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T22:03:09-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T22:04:01-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T22:04:01-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T22:04:01-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T22:04:06-04:00","message":"Adding new location to database: %!(EXTRA main.Location={0 Location10 This is my test description10 Notes for my location!10 2400 120N 120N 125000 Location10_cover.png [] [] []})"} +{"level":"debug","time":"2022-04-09T22:04:06-04:00","message":"Adding new location: {0 Location10 This is my test description10 Notes for my location!10 2400 120N 120N 125000 Location10_cover.png [] [] []}"} +{"logtype":"webserver", "pid":"24776", "requestid":"", "status":"200", "method":"POST", "path":"/api/locations/new"} +{"logtype":"webserver", "pid":"24776", "requestid":"", "status":"404", "method":"GET", "path":"/api/overview"} +{"level":"error","time":"2022-04-09T22:04:51-04:00","message":"Failed to get last added location: provided target must be a pointer to slice "} +{"logtype":"webserver", "pid":"24776", "requestid":"", "status":"500", "method":"GET", "path":"/api/overview/all"} +{"level":"info","time":"2022-04-09T22:05:20-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T22:05:20-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T22:05:20-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T22:07:38-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T22:07:38-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T22:07:38-04:00","message":"Database and Config loaded, starting webserver..."} +{"logtype":"webserver", "pid":"30140", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"} +{"level":"info","time":"2022-04-09T22:09:43-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T22:09:43-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T22:09:43-04:00","message":"Database and Config loaded, starting webserver..."} +{"logtype":"webserver", "pid":"23428", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"} +{"level":"info","time":"2022-04-09T22:12:03-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T22:12:03-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T22:12:03-04:00","message":"Database and Config loaded, starting webserver..."} +{"logtype":"webserver", "pid":"31068", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"} +{"level":"info","time":"2022-04-09T22:12:47-04:00","message":"Adding new location to database: %!(EXTRA main.Location={0 Location0 This is my test description0 Notes for my location!0 2500 120N 120N 125000 Location0_cover.png [] [] []})"} +{"level":"debug","time":"2022-04-09T22:12:48-04:00","message":"Adding new location: {0 Location0 This is my test description0 Notes for my location!0 2500 120N 120N 125000 Location0_cover.png [] [] []}"} +{"logtype":"webserver", "pid":"31068", "requestid":"", "status":"200", "method":"POST", "path":"/api/locations/new"} +{"logtype":"webserver", "pid":"31068", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"} +{"logtype":"webserver", "pid":"31068", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"} +{"logtype":"webserver", "pid":"31068", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"} +{"level":"debug","time":"2022-04-09T22:13:43-04:00","message":"Returning Locations: [{ID:1 Name:Location10 Description:This is my test description10 Notes:Notes for my location!10 Address: SquareFeet:2400 Latitude:120N Longitude:120N DatePurchased: PurchasePrice:125000 CurrentValue: CoverPhoto:Location10_cover.png Photos:[] Files:[] Rooms:[]} {ID:2 Name:Location0 Description:This is my test description0 Notes:Notes for my location!0 Address: SquareFeet:2500 Latitude:120N Longitude:120N DatePurchased: PurchasePrice:125000 CurrentValue: CoverPhoto:Location0_cover.png Photos:[] Files:[] Rooms:[]}]"} +{"logtype":"webserver", "pid":"31068", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"} +{"level":"info","time":"2022-04-09T22:14:04-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T22:14:04-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T22:14:04-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T22:17:33-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T22:17:33-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T22:17:33-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T22:24:48-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T22:24:48-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T22:24:48-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"error","time":"2022-04-09T22:24:52-04:00","message":"Failed to get all cabinets by ID: unknown tag "} +{"logtype":"webserver", "pid":"22260", "requestid":"", "status":"500", "method":"GET", "path":"/api/overview/all"} +{"level":"info","time":"2022-04-09T22:25:33-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T22:25:33-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T22:25:33-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"error","time":"2022-04-09T22:25:38-04:00","message":"Failed to get all cabinets by ID: unknown tag "} +{"logtype":"webserver", "pid":"31072", "requestid":"", "status":"500", "method":"GET", "path":"/api/overview/all"} +{"level":"info","time":"2022-04-09T22:25:58-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T22:25:58-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T22:25:58-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-04-09T22:26:05-04:00","message":"Adding new location to database: %!(EXTRA main.Location={0 Location0 This is my test description0 Notes for my location!0 2500 120N 120N 125000 Location0_cover.png [] [] []})"} +{"level":"debug","time":"2022-04-09T22:26:05-04:00","message":"Adding new location: {0 Location0 This is my test description0 Notes for my location!0 2500 120N 120N 125000 Location0_cover.png [] [] []}"} +{"logtype":"webserver", "pid":"9860", "requestid":"", "status":"200", "method":"POST", "path":"/api/locations/new"} +{"level":"error","time":"2022-04-09T22:26:09-04:00","message":"Failed to get all cabinets by ID: unknown tag "} +{"logtype":"webserver", "pid":"9860", "requestid":"", "status":"500", "method":"GET", "path":"/api/overview/all"} +{"level":"info","time":"2022-04-09T22:26:38-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-04-09T22:26:38-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-04-09T22:26:38-04:00","message":"Database and Config loaded, starting webserver..."} +{"logtype":"webserver", "pid":"12712", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"} diff --git a/database_structs.go b/database_structs.go index 8504fc9..4b4dede 100644 --- a/database_structs.go +++ b/database_structs.go @@ -38,7 +38,7 @@ type Room struct { // Cabinet is a containerized area in a room type Cabinet struct { - ID int `storm:"id, increment"` + ID int `storm:"id,increment,index"` RoomID int // Room ID that the cabinet is assigned to RoomName string // Room name cabinet belongs to CoverPhoto string // A "Cover photo" for this item @@ -49,7 +49,7 @@ type Cabinet struct { // Item is contained inside a room or cabinet type Item struct { - ID int `storm:"id, increment"` + ID int `storm:"id,increment,index"` LocType string // Can be Room or Cabinet to show where it is stored RoomID int // Room ID that item is assigned to (can also be in a cabinet) RoomName string // Room name that item is assigned to @@ -66,3 +66,15 @@ type Item struct { DatePurchased string Files []string //filepath to any files relevant to this item } + +// DatabaseOverview provides some details about the database +type DatabaseOverview struct { + NumLocations int + LastAddedLocation *Location + NumRooms int + LastAddedRoom *Room + NumCabinets int + LastAddedCabinet *Cabinet + NumItems int + LastAddedItem *Item +} diff --git a/frontend/src/components/SideBar.js b/frontend/src/components/SideBar.js index 5028f9f..cabeaff 100644 --- a/frontend/src/components/SideBar.js +++ b/frontend/src/components/SideBar.js @@ -67,7 +67,7 @@ const useStyles = createStyles((theme) => ({ initiallyOpened: true, links: [ { label: 'View Rooms', link: '/rooms' }, - { label: 'Previous releases', link: '/' }, + { label: 'Add New Room', link: '/rooms/new' }, { label: 'Releases schedule', link: '/' }, ], }, diff --git a/frontend/src/components/pages/Locations.js b/frontend/src/components/pages/Locations.js index 02b1735..35c6204 100644 --- a/frontend/src/components/pages/Locations.js +++ b/frontend/src/components/pages/Locations.js @@ -3,7 +3,7 @@ import { useAtom } from 'jotai' import { serverConfigAtom } from '../../state/main'; import { HiPlus } from 'react-icons/hi' import { Loader, Center, SimpleGrid, Title, Group, Button } from '@mantine/core' - +import { useNavigate } from "react-router-dom"; import { useNotifications } from '@mantine/notifications'; @@ -17,6 +17,8 @@ function LocationsPage() { const [locations, setLocations] = useState([]) const [serverConfig] = useAtom(serverConfigAtom) + let navigate = useNavigate(); + const notifications = useNotifications(); @@ -51,7 +53,7 @@ function LocationsPage() { <>