diff --git a/app/log/goInventorize.log b/app/log/goInventorize.log index f891d7f..7447b3d 100644 --- a/app/log/goInventorize.log +++ b/app/log/goInventorize.log @@ -174,3 +174,162 @@ {"level":"debug","time":"2022-03-27T22:47:19-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location!} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location!}]"} {"logtype":"webserver", "pid":"32756", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ {"logtype":"webserver", "pid":"32756", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"level":"info","time":"2022-03-28T21:29:49-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-03-28T21:29:49-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-03-28T21:29:49-04:00","message":"Database and Config loaded, starting webserver..."} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/config​"}​ +{"level":"debug","time":"2022-03-28T21:39:28-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location!} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location!}]"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"304", "method":"GET", "path":"/photos/locations/Location1/Kitchen/Kitchen_cover.png​"}​ +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"level":"debug","time":"2022-03-28T21:49:46-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location!} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location!}]"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"level":"info","time":"2022-03-28T21:56:28-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms​"}​ +{"level":"debug","time":"2022-03-28T21:56:30-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location!} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location!}]"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"level":"info","time":"2022-03-28T21:56:32-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms​"}​ +{"level":"info","time":"2022-03-28T21:57:37-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms​"}​ +{"level":"debug","time":"2022-03-28T21:57:39-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location!} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location!}]"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"level":"info","time":"2022-03-28T21:57:57-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms​"}​ +{"level":"debug","time":"2022-03-28T21:58:37-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location!} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location!}]"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"level":"debug","time":"2022-03-28T21:58:51-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location!} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location!}]"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"debug","time":"2022-03-28T22:00:03-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location!} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location!}]"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"level":"info","time":"2022-03-28T22:00:07-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms​"}​ +{"level":"debug","time":"2022-03-28T22:00:09-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location!} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location!}]"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"debug","time":"2022-03-28T22:01:05-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location!} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location!}]"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"debug","time":"2022-03-28T22:01:11-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location!} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location!}]"} +{"logtype":"webserver", "pid":"9768", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"info","time":"2022-03-28T22:02:35-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-03-28T22:02:35-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-03-28T22:02:35-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-03-28T22:03:23-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-03-28T22:03:23-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-03-28T22:03:23-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-03-28T22:04:03-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-03-28T22:04:03-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-03-28T22:04:03-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-03-28T22:05:23-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-03-28T22:05:23-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-03-28T22:05:23-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"debug","time":"2022-03-28T22:07:01-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location! Address:} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"16312", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"debug","time":"2022-03-28T22:07:15-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location! Address:} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"16312", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"debug","time":"2022-03-28T22:07:18-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location! Address:} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"16312", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"debug","time":"2022-03-28T22:07:53-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location! Address:} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"16312", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"logtype":"webserver", "pid":"16312", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"level":"info","time":"2022-03-28T22:08:26-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"16312", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms​"}​ +{"level":"debug","time":"2022-03-28T22:08:30-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location! Address:} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"16312", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"logtype":"webserver", "pid":"16312", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"logtype":"webserver", "pid":"16312", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/3​"}​ +{"level":"debug","time":"2022-03-28T22:11:27-04:00","message":"Returning Locations: [{ID:3 Name:Location1 Description: CoverPhoto:Location1_cover.png Photos:[Location1_0.png Location1_1.png] Rooms:[] Notes:Notes for my location! Address:} {ID:4 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"16312", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"info","time":"2022-03-28T22:17:33-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-03-28T22:17:33-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-03-28T22:17:33-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-03-28T22:18:47-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-03-28T22:18:47-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-03-28T22:18:47-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"debug","time":"2022-03-28T22:18:53-04:00","message":"Returning Locations: []"} +{"logtype":"webserver", "pid":"28488", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"info","time":"2022-03-28T22:19:02-04:00","message":"Adding new location to database: %!(EXTRA main.Location={0 Location4 Location4_cover.png [Location4_0.png Location4_1.png] [] Notes for my location! })"} +{"level":"debug","time":"2022-03-28T22:19:02-04:00","message":"Adding new location: {0 Location4 Location4_cover.png [Location4_0.png Location4_1.png] [] Notes for my location! }"} +{"logtype":"webserver", "pid":"28488", "requestid":"", "status":"200", "method":"POST", "path":"/api/locations/new​"}​ +{"level":"debug","time":"2022-03-28T22:19:11-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"28488", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"error","time":"2022-03-28T22:19:17-04:00","message":"Unable to fetch all rooms at location: not found"} +{"level":"error","error":"not found","time":"2022-03-28T22:19:17-04:00","message":"Unable to fetch location by id: 3 with error: not found"} +{"logtype":"webserver", "pid":"28488", "requestid":"", "status":"500", "method":"POST", "path":"/api/rooms/3/new​"}​ +{"level":"info","time":"2022-03-28T22:19:22-04:00","message":"Adding new room to location: {%!s(int=0) Kitchen Location4/Kitchen/Kitchen_cover.png [Location4/Kitchen/Kitchen_0.png] Notes For My Room! [] [] %!s(int=1) Location4}"} +{"level":"debug","time":"2022-03-28T22:19:22-04:00","message":"Adding new Room: {0 Kitchen Location4/Kitchen/Kitchen_cover.png [Location4/Kitchen/Kitchen_0.png] Notes For My Room! [] [] 1 Location4}"} +{"logtype":"webserver", "pid":"28488", "requestid":"", "status":"200", "method":"POST", "path":"/api/rooms/1/new​"}​ +{"level":"debug","time":"2022-03-28T22:19:28-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[{ID:0 Name:Kitchen Description: CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Notes:Notes For My Room! Cabinets:[] Items:[] LocationID:1 LocationName:Location4}] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"28488", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"info","time":"2022-03-28T22:19:46-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-03-28T22:19:46-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-03-28T22:19:46-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"debug","time":"2022-03-28T22:21:28-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[{ID:0 Name:Kitchen Description: CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Notes:Notes For My Room! Cabinets:[] Items:[] LocationID:1 LocationName:Location4}] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"debug","time":"2022-03-28T22:21:49-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[{ID:0 Name:Kitchen Description: CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Notes:Notes For My Room! Cabinets:[] Items:[] LocationID:1 LocationName:Location4}] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/config​"}​ +{"level":"debug","time":"2022-03-28T22:24:42-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[{ID:0 Name:Kitchen Description: CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Notes:Notes For My Room! Cabinets:[] Items:[] LocationID:1 LocationName:Location4}] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"debug","time":"2022-03-28T22:25:08-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[{ID:0 Name:Kitchen Description: CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Notes:Notes For My Room! Cabinets:[] Items:[] LocationID:1 LocationName:Location4}] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"error","time":"2022-03-28T22:25:37-04:00","message":"Unable to fetch all rooms at location: not found"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"500", "method":"GET", "path":"/api/rooms/3​"}​ +{"level":"info","time":"2022-03-28T22:25:42-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms​"}​ +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/photos/locations/Location4/Kitchen/Kitchen_cover.png​"}​ +{"level":"debug","time":"2022-03-28T22:26:29-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[{ID:0 Name:Kitchen Description: CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Notes:Notes For My Room! Cabinets:[] Items:[] LocationID:1 LocationName:Location4}] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"info","time":"2022-03-28T22:26:30-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms​"}​ +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"304", "method":"GET", "path":"/photos/locations/Location4/Kitchen/Kitchen_cover.png​"}​ +{"level":"debug","time":"2022-03-28T22:29:27-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[{ID:0 Name:Kitchen Description: CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Notes:Notes For My Room! Cabinets:[] Items:[] LocationID:1 LocationName:Location4}] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"info","time":"2022-03-28T22:29:27-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms​"}​ +{"level":"debug","time":"2022-03-28T22:29:29-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[{ID:0 Name:Kitchen Description: CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Notes:Notes For My Room! Cabinets:[] Items:[] LocationID:1 LocationName:Location4}] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"info","time":"2022-03-28T22:29:29-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms​"}​ +{"level":"debug","time":"2022-03-28T22:29:32-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[{ID:0 Name:Kitchen Description: CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Notes:Notes For My Room! Cabinets:[] Items:[] LocationID:1 LocationName:Location4}] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"info","time":"2022-03-28T22:29:32-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms​"}​ +{"level":"debug","time":"2022-03-28T22:29:55-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[{ID:0 Name:Kitchen Description: CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Notes:Notes For My Room! Cabinets:[] Items:[] LocationID:1 LocationName:Location4}] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"debug","time":"2022-03-28T22:30:26-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[{ID:0 Name:Kitchen Description: CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Notes:Notes For My Room! Cabinets:[] Items:[] LocationID:1 LocationName:Location4}] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/1​"}​ +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"304", "method":"GET", "path":"/photos/locations/Location4/Kitchen/Kitchen_cover.png​"}​ +{"level":"info","time":"2022-03-28T22:30:47-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms​"}​ +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/1​"}​ +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/config​"}​ +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/1​"}​ +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/config​"}​ +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/1​"}​ +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/1​"}​ +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/1​"}​ +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms/1​"}​ +{"level":"debug","time":"2022-03-28T22:40:36-04:00","message":"Returning Locations: [{ID:1 Name:Location4 Description: CoverPhoto:Location4_cover.png Photos:[Location4_0.png Location4_1.png] Rooms:[{ID:0 Name:Kitchen Description: CoverPhoto:Location4/Kitchen/Kitchen_cover.png Photos:[Location4/Kitchen/Kitchen_0.png] Notes:Notes For My Room! Cabinets:[] Items:[] LocationID:1 LocationName:Location4}] Notes:Notes for my location! Address:}]"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations​"}​ +{"level":"info","time":"2022-03-28T22:40:37-04:00","message":"Getting all Rooms"} +{"logtype":"webserver", "pid":"24780", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms​"}​ +{"level":"info","time":"2022-03-28T22:41:32-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-03-28T22:41:32-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-03-28T22:41:32-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-03-28T22:42:41-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-03-28T22:42:41-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-03-28T22:42:41-04:00","message":"Database and Config loaded, starting webserver..."} +{"level":"info","time":"2022-03-28T22:43:31-04:00","message":"Configuration loaded successfully..."} +{"level":"debug","time":"2022-03-28T22:43:31-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationPhotoDir:./app/photos/locations/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"} +{"level":"info","time":"2022-03-28T22:43:31-04:00","message":"Database and Config loaded, starting webserver..."} diff --git a/app/photos/locations/Location4/Kitchen/Kitchen_0.png b/app/photos/locations/Location4/Kitchen/Kitchen_0.png new file mode 100644 index 0000000..5a3863b Binary files /dev/null and b/app/photos/locations/Location4/Kitchen/Kitchen_0.png differ diff --git a/app/photos/locations/Location4/Kitchen/Kitchen_cover.png b/app/photos/locations/Location4/Kitchen/Kitchen_cover.png new file mode 100644 index 0000000..273ae2e Binary files /dev/null and b/app/photos/locations/Location4/Kitchen/Kitchen_cover.png differ diff --git a/database.go b/database.go index 3ea62a7..2ffb506 100644 --- a/database.go +++ b/database.go @@ -8,25 +8,34 @@ import ( // Location is a top level component that starts the containerization process type Location struct { - ID int `storm:"id,increment,index"` - Name string `storm:"unique"` - Description string - CoverPhoto string // A "cover photo" for the location - Photos []string // A list of additional photos for the location - Rooms []Room - Notes string + ID int `storm:"id,increment,index"` + Name string `storm:"unique"` + Description string + CoverPhoto string // A "cover photo" for the location + Photos []string // A list of additional photos for the location + Rooms []Room + Notes string + Address string + SquareFeet int + Latitude string + Longitude string + DatePurchased string + PurchasePrice string + CurrentValue string } // Room is a containerized area at a location type Room struct { - ID int `storm:"id,increment,index"` - Name string `storm:"unique"` - Description string - CoverPhoto string // A "cover photo" for the room - Photos []string // A list of additional photos for the room - Notes string - Cabinets []Cabinet - Items []Item + ID int `storm:"id,increment,index"` + Name string `storm:"unique"` + Description string + CoverPhoto string // A "cover photo" for the room + Photos []string // A list of additional photos for the room + Notes string + Cabinets []Cabinet + Items []Item + SquareFeet int + LocationID int //Which location room is assigned to LocationName string // Location name room belongs to diff --git a/frontend/package-lock.json b/frontend/package-lock.json index b895f4d..b263db8 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -2030,11 +2030,11 @@ } }, "@mantine/core": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@mantine/core/-/core-4.0.9.tgz", - "integrity": "sha512-x7qEnot6dUqstby8G3Hn06zH39sAzC610qEUUThsw1a/UFJvHjr+UONcfDkBGX3XzcgsgOLn/HnOksUHE349fg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@mantine/core/-/core-4.1.0.tgz", + "integrity": "sha512-uEHGssKveDgGHhbBrgVqp8o12m0oQGLBKH3D8bkrca1GB905ZHuj8CG+i/ojBhqdalfUwqcYGRpwwALtD+XfJg==", "requires": { - "@mantine/styles": "4.0.9", + "@mantine/styles": "4.1.0", "@popperjs/core": "^2.9.3", "@radix-ui/react-scroll-area": "^0.1.1", "clsx": "^1.1.1", @@ -2043,9 +2043,9 @@ } }, "@mantine/dates": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@mantine/dates/-/dates-4.0.9.tgz", - "integrity": "sha512-Dd+wsg6pVsdgeCNNqExhh9p+K651rh1/bAlClsdlPPOoOZzEDMM2U8cN2c4ZVJVbmAeF0spcF4dFLz9G3DX3yA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@mantine/dates/-/dates-4.1.0.tgz", + "integrity": "sha512-kdKQ9PRGbYe1YhRlqWVUVGG7IKHjdIWMX3XhSFbWWLkfUxqSG4dhwNeAZIcbHXDZhFT9xIifFlBlDiN7JIOmtA==", "requires": { "@popperjs/core": "^2.9.3", "clsx": "^1.1.1", @@ -2053,31 +2053,31 @@ } }, "@mantine/dropzone": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@mantine/dropzone/-/dropzone-4.0.9.tgz", - "integrity": "sha512-E9ULojgCUJ5tV4CoMKA7XNa6Qj67VWyXSAwaXWhDeOfMDQy8feYPIbC7lcHlbSo5nBm9IhzjXp5JMLDwRbxAPA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@mantine/dropzone/-/dropzone-4.1.0.tgz", + "integrity": "sha512-ixu9VGg/dX5DO/BhyoSYH+9nwAmBTElBml7efClawMlvYaifhoOnNiEWykESwjGaGa6/tww0qxzd/ddsI9jEVQ==", "requires": { "react-dropzone": "^11.4.2" } }, "@mantine/hooks": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-4.0.9.tgz", - "integrity": "sha512-b+IrevT05/nAM2H0iKWC9BP0gr/U8kF3U8Ge+EnvSFeSOWp/exm/Wy5toorQ83nQbmfCjkSAL5WDb6Jx0gI/Fg==" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-4.1.0.tgz", + "integrity": "sha512-bvVvHDDfYqdIxl7n+lBBwSIkcqInv6kK+fxvEfFBOUEzN6KbpJaPdaYXP788x64uFbA7AODQjdtOhk3tMyQA8Q==" }, "@mantine/notifications": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@mantine/notifications/-/notifications-4.0.9.tgz", - "integrity": "sha512-pMM+Pb1p+OdfHl16XvT8jKer8AR/2puVpfO2AUXZ7iJWxycfYkq5vgGW9kY1lowp/B+iS1Cqc7fqwNLPo4HCnA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@mantine/notifications/-/notifications-4.1.0.tgz", + "integrity": "sha512-2pdRiK4UVDSHeCcHLSY7GFyXXn4t9HkoVqypXPwybWDBeT6tSOry+5l/+/HKhOpSPktxWykr+4OACUhtBYn5dg==", "requires": { "clsx": "^1.1.1", "react-transition-group": "^4.4.2" } }, "@mantine/styles": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@mantine/styles/-/styles-4.0.9.tgz", - "integrity": "sha512-pZIJ4lAl0RDbIYosJEJpEv2iYutlIDMlgoCOac32jB3GkY1iPu2mZjVTp5/aySLI1e/2hb0Pb+kHM58nnG82wA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@mantine/styles/-/styles-4.1.0.tgz", + "integrity": "sha512-mWFNSE5DqE/5C9TDYIkQVbTef8QyWnW8a8MADHl6S52K0iGU8nqw4jnyozB+6y9JEIxdl+sp0o16L2JnAsq7bA==", "requires": { "@emotion/cache": "^11.7.1", "@emotion/react": "^11.7.1", diff --git a/frontend/package.json b/frontend/package.json index 868563d..ab3fbca 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -3,11 +3,11 @@ "version": "0.1.0", "private": true, "dependencies": { - "@mantine/core": "^4.0.9", - "@mantine/dates": "^4.0.9", - "@mantine/dropzone": "^4.0.9", - "@mantine/hooks": "^4.0.9", - "@mantine/notifications": "^4.0.9", + "@mantine/core": "^4.1.0", + "@mantine/dates": "^4.1.0", + "@mantine/dropzone": "^4.1.0", + "@mantine/hooks": "^4.1.0", + "@mantine/notifications": "^4.1.0", "@testing-library/jest-dom": "^5.16.3", "@testing-library/react": "^12.1.4", "@testing-library/user-event": "^13.5.0", diff --git a/frontend/src/components/SideBar.js b/frontend/src/components/SideBar.js index bdca266..de82c66 100644 --- a/frontend/src/components/SideBar.js +++ b/frontend/src/components/SideBar.js @@ -1,6 +1,6 @@ import React, {useState } from 'react'; import { useAtom } from 'jotai'; -import { activePageAtom } from '../state/main'; +import { activePageAtom, roomFilterAtom } from '../state/main'; import { Navbar, Text, Group, ThemeIcon, Button, UnstyledButton } from '@mantine/core'; import { Link } from 'react-router-dom'; import { createStyles } from '@mantine/styles'; @@ -39,6 +39,14 @@ const useStyles = createStyles((theme) => ({ function SideBar(props) { const { classes } = useStyles(); const [activePage, setActivePage] = useAtom(activePageAtom) + const [roomFilter, setRoomFilter] = useAtom(roomFilterAtom) + + const changeView = (newView) => { + if (newView === "rooms") { + setRoomFilter({}) + } + setActivePage(newView) + } return ( @@ -61,7 +69,7 @@ function SideBar(props) { */} - setActivePage("rooms")} > + changeView("rooms")} > Rooms diff --git a/frontend/src/components/pages/Locations.js b/frontend/src/components/pages/Locations.js index fd7bed9..5bf1431 100644 --- a/frontend/src/components/pages/Locations.js +++ b/frontend/src/components/pages/Locations.js @@ -1,7 +1,7 @@ import React, {useState, useEffect, useContext, createContext} from 'react'; import { useAtom } from 'jotai' import { activePageAtom, roomFilterAtom, serverConfigAtom } from '../../state/main'; -import { Text, Loader, Center, Card, Image, Badge, Button, SimpleGrid, Group } from '@mantine/core' +import { Text, Loader, Center, Card, Image, Badge, Button, SimpleGrid, Group, Title } from '@mantine/core' import { useNavigate } from "react-router-dom"; import { useNotifications } from '@mantine/notifications'; @@ -46,10 +46,9 @@ function LocationsPage(props) { }, []) - const navigateToRooms = (locationID) => { - console.log("Passedlocid: ", locationID) + const navigateToRooms = (locationID, locationName) => { setActivePage("rooms") - setRoomsFilter({"locationID": locationID}) + setRoomsFilter({"filterType": "location", "locationID": locationID, "commonName": "location", "metadata": locationName}) navigate("/rooms") } @@ -57,20 +56,25 @@ function LocationsPage(props) { return ( <>
{ isLoading && }
-
Locations
+
Locations
{ locations.map((location, idx) => - navigateToRooms(location.ID)} shadow="sm" padding="md"> + {location.CoverPhoto ? : No Photo} {location.Name} - {/* - On Sale - */} + + { location.Rooms !== null && location.Rooms.length !== 0 && location.Rooms.length > 1 ? {location.Rooms.length} Rooms : {location.Rooms.length} Room} + {location.Description} + + + + + )} diff --git a/frontend/src/components/pages/RoomsPage.js b/frontend/src/components/pages/RoomsPage.js index fa78f53..abc5f9a 100644 --- a/frontend/src/components/pages/RoomsPage.js +++ b/frontend/src/components/pages/RoomsPage.js @@ -1,7 +1,7 @@ import React, {useState, useEffect, useContext, createContext} from 'react'; import { useAtom } from 'jotai' import { roomFilterAtom, serverConfigAtom } from '../../state/main'; -import { Text, Loader, Center, Card, Image, Badge, Button, SimpleGrid, Group } from '@mantine/core' +import { Text, Loader, Center, Card, Image, Badge, Button, SimpleGrid, Group, Title, ActionIcon } from '@mantine/core' import { useLocation } from "react-router-dom"; import { useNotifications } from '@mantine/notifications'; @@ -47,20 +47,32 @@ function RoomsPage(props) { fetchSettings(); - }, []) + }, [roomFilter]) // Check if filter changes for this page and refresh results useEffect(() => { console.log("CURRENT ROOM FILTER: ", roomFilter) - }, [roomFilter, setFilter]) + }, [roomFilter, setRoomFilter]) + + const removeFilterButton = ( + + X + + ); return ( <>
{ isLoading && }
-
Rooms
+
Rooms
+ { Object.keys(roomFilter).length !== 0 && + {setRoomFilter({})}}> + Filter by {roomFilter.commonName}: {roomFilter.metadata} + + + } { rooms.map((room, idx) => {}} shadow="sm" padding="md"> @@ -69,11 +81,23 @@ function RoomsPage(props) { {room.Name} - - {room.LocationName} - + + + {room.LocationName} + + + {room.Cabinets === null ? 0 : room.Cabinets.length} Cabinets + + + {room.Cabinets === null ? 0 : room.Cabinets.length} Items + + {room.Description} + + + + )} diff --git a/handlers.go b/handlers.go index 455c2ea..0beb817 100644 --- a/handlers.go +++ b/handlers.go @@ -231,6 +231,18 @@ func (s *Server) AddNewRoomHandler(c *fiber.Ctx) error { if err != nil { return err } + // Update our location in the db to add the new room as attached to the ID + loc, err = s.GetLocation(newRoom.LocationID) + if err != nil { + return err + } + roomList := loc.Rooms + roomList = append(roomList, newRoom) + + err = s.Database.UpdateField(&Location{ID: newRoom.LocationID}, "Rooms", roomList) + if err != nil { + return err + } s.Log.Debug().Msgf("Adding new Room: %v", newRoom) return c.Status(fiber.StatusOK).SendString(fmt.Sprintf("New Room Created! %s", newRoom.Name)) }