working on location form, dropzone and previews
This commit is contained in:
@@ -234,3 +234,185 @@
|
|||||||
{"logtype":"webserver", "pid":"3324", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
{"logtype":"webserver", "pid":"3324", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
{"level":"debug","time":"2022-04-11T22:40:10-04:00","message":"Returning Locations: [{ID:1 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:[]}]"}
|
{"level":"debug","time":"2022-04-11T22:40:10-04:00","message":"Returning Locations: [{ID:1 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":"3324", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
{"logtype":"webserver", "pid":"3324", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"info","time":"2022-07-31T15:10:32-04:00","message":"Configuration loaded successfully..."}
|
||||||
|
{"level":"debug","time":"2022-07-31T15:10:32-04:00","message":"{Timezone:America/New_York Server:{Port:3500 LocationFilesDir:./app/files/} Logger:{Level:debug LoggingFile:./app/log/goInventorize.log} Authentication:{BasicAuth:false UserName:admin Password:password} Development:false}"}
|
||||||
|
{"level":"info","time":"2022-07-31T15:10:32-04:00","message":"Database and Config loaded, starting webserver..."}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"level":"debug","time":"2022-07-31T15:13:39-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/files/locations/Location0/Location0_cover.png"}
|
||||||
|
{"level":"debug","time":"2022-07-31T15:13:42-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T15:13:44-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T15:13:47-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"level":"debug","time":"2022-07-31T15:13:58-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T15:14:02-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"level":"debug","time":"2022-07-31T15:15:22-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T15:15:25-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"info","time":"2022-07-31T15:15:26-04:00","message":"Getting all Rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"}
|
||||||
|
{"level":"debug","time":"2022-07-31T15:15:28-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T15:16:17-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T15:20:12-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"info","time":"2022-07-31T15:20:24-04:00","message":"Getting all Rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"info","time":"2022-07-31T15:20:28-04:00","message":"Getting all Rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"}
|
||||||
|
{"level":"info","time":"2022-07-31T15:20:34-04:00","message":"Getting all Rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"info","time":"2022-07-31T15:20:43-04:00","message":"Getting all Rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T15:20:46-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:41:30-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:41:35-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:43:24-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:46:35-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:46:36-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:46:38-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:46:41-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:46:44-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:50:04-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:50:13-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:50:17-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:50:56-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:51:51-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:52:31-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:52:33-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:52:43-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:53:22-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:59:52-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T21:59:54-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:02:58-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:04:55-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/config"}
|
||||||
|
{"level":"info","time":"2022-07-31T22:05:02-04:00","message":"Getting all Rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:05:06-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:05:09-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:05:24-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:05:33-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:06:04-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"info","time":"2022-07-31T22:06:11-04:00","message":"Getting all Rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"info","time":"2022-07-31T22:06:15-04:00","message":"Getting all Rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:06:17-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:06:19-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:06:40-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:07:14-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:09:18-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:09:35-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"404", "method":"GET", "path":"/files/locations/undefined/undefined"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:12:05-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"info","time":"2022-07-31T22:12:07-04:00","message":"Getting all Rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:12:12-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"404", "method":"GET", "path":"/files/locations/undefined/undefined"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:12:46-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"debug","time":"2022-07-31T22:12:48-04:00","message":"Returning Locations: [{ID:1 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":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/locations"}
|
||||||
|
{"level":"info","time":"2022-07-31T22:12:50-04:00","message":"Getting all Rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"info","time":"2022-07-31T22:12:52-04:00","message":"Getting all Rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"info","time":"2022-07-31T22:12:54-04:00","message":"Getting all Rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/overview/all"}
|
||||||
|
{"level":"info","time":"2022-07-31T22:12:55-04:00","message":"Getting all Rooms"}
|
||||||
|
{"logtype":"webserver", "pid":"17028", "requestid":"", "status":"200", "method":"GET", "path":"/api/rooms"}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import NotFound from './components/pages/NotFound';
|
|||||||
import { BrowserRouter as Router, Routes, Route} from 'react-router-dom'
|
import { BrowserRouter as Router, Routes, Route} from 'react-router-dom'
|
||||||
import { Modal, Button, Text, Group, TextInput, Loader, AppShell, MediaQuery } from '@mantine/core';
|
import { Modal, Button, Text, Group, TextInput, Loader, AppShell, MediaQuery } from '@mantine/core';
|
||||||
import { useDebouncedValue, useLocalStorageValue } from '@mantine/hooks';
|
import { useDebouncedValue, useLocalStorageValue } from '@mantine/hooks';
|
||||||
import { useNotifications } from '@mantine/notifications';
|
import { showNotification } from '@mantine/notifications';
|
||||||
|
|
||||||
import { backendAPI, defaultURLS } from './services/backend-api';
|
import { backendAPI, defaultURLS } from './services/backend-api';
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ function App() {
|
|||||||
|
|
||||||
const [, setServerConfig] = useAtom(serverConfigAtom)
|
const [, setServerConfig] = useAtom(serverConfigAtom)
|
||||||
|
|
||||||
const notifications = useNotifications();
|
|
||||||
// const navigate = useNavigate();
|
// const navigate = useNavigate();
|
||||||
|
|
||||||
|
|
||||||
@@ -41,14 +41,14 @@ function App() {
|
|||||||
results.data.baseURL = defaultURLS.baseURL
|
results.data.baseURL = defaultURLS.baseURL
|
||||||
console.log("CONFIG: ", results.data)
|
console.log("CONFIG: ", results.data)
|
||||||
setServerConfig(results.data)
|
setServerConfig(results.data)
|
||||||
notifications.showNotification({
|
showNotification({
|
||||||
title: 'Backend Notice',
|
title: 'Backend Notice',
|
||||||
message: 'Config fetched from backend!',
|
message: 'Config fetched from backend!',
|
||||||
color: "green"
|
color: "green"
|
||||||
})
|
})
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
notifications.showNotification({
|
showNotification({
|
||||||
title: 'Backend Notice',
|
title: 'Backend Notice',
|
||||||
message: `Failed to connect to backend! ${err}`,
|
message: `Failed to connect to backend! ${err}`,
|
||||||
autoClose: false,
|
autoClose: false,
|
||||||
@@ -74,11 +74,11 @@ function App() {
|
|||||||
>
|
>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path='*' element={<NotFound />} />
|
<Route path='*' element={<NotFound />} />
|
||||||
<Route index element={<HomePage />} />
|
<Route index element={<HomePage />}/>
|
||||||
<Route path="locations">
|
<Route path="locations">
|
||||||
<Route index element={<LocationsPage />} />
|
<Route index element={<LocationsPage />} />
|
||||||
<Route path=":id" element={<LocationDetailsPage />} />
|
<Route path=":id" element={<LocationDetailsPage />} />
|
||||||
<Route path="new" element={<LocationForm />} />
|
<Route path="new" element={<LocationForm />}/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="rooms">
|
<Route path="rooms">
|
||||||
<Route index element={<RoomsPage />} />
|
<Route index element={<RoomsPage />} />
|
||||||
|
|||||||
72
frontend/src/components/CustomDropZone.js
Normal file
72
frontend/src/components/CustomDropZone.js
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Text, Group, useMantineTheme } from '@mantine/core'
|
||||||
|
import { BsCardImage, BsCloudUpload, BsXLg } from 'react-icons/bs'
|
||||||
|
import { Dropzone } from '@mantine/dropzone';
|
||||||
|
import { showNotification } from '@mantine/notifications';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function CustomDropZone(props) {
|
||||||
|
const {uploadText1, uploadText2, uploadFormat, maxSize, multipleFiles, returnFiles} = props
|
||||||
|
|
||||||
|
const theme = useMantineTheme();
|
||||||
|
|
||||||
|
|
||||||
|
const handleFileRejections = (fileRejections) => {
|
||||||
|
let message = ""
|
||||||
|
let fileName = ""
|
||||||
|
if ((fileRejections.length > 1) && (!multipleFiles)) {
|
||||||
|
showNotification({color: 'red', title: "Too many Files!", message: "Only a single photo is allowed for the coverphoto!"})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fileName = fileRejections[0].file.name
|
||||||
|
const errors = fileRejections[0].errors
|
||||||
|
errors.forEach(error => {
|
||||||
|
message = message + `${error.message} \n\n`
|
||||||
|
})
|
||||||
|
showNotification({color: 'red', title: `Error accepting file: ${fileName}`, message: message})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dropzone
|
||||||
|
onDrop={(files) => returnFiles(files)}
|
||||||
|
onReject={(fileRejections) => handleFileRejections(fileRejections)}
|
||||||
|
maxSize={maxSize}
|
||||||
|
multiple={multipleFiles}
|
||||||
|
accept={uploadFormat}
|
||||||
|
>
|
||||||
|
<Group position="center" spacing="xl" style={{ minHeight: 220, pointerEvents: 'none' }}>
|
||||||
|
<Dropzone.Accept>
|
||||||
|
<BsCloudUpload
|
||||||
|
size={50}
|
||||||
|
stroke={1.5}
|
||||||
|
color={theme.colors[theme.primaryColor][theme.colorScheme === 'dark' ? 4 : 6]}
|
||||||
|
/>
|
||||||
|
</Dropzone.Accept>
|
||||||
|
<Dropzone.Reject>
|
||||||
|
<BsXLg
|
||||||
|
size={50}
|
||||||
|
stroke={1.5}
|
||||||
|
color={theme.colors.red[theme.colorScheme === 'dark' ? 4 : 6]}
|
||||||
|
/>
|
||||||
|
</Dropzone.Reject>
|
||||||
|
<Dropzone.Idle>
|
||||||
|
<BsCardImage size={50} stroke={1.5} />
|
||||||
|
</Dropzone.Idle>
|
||||||
|
<div>
|
||||||
|
<Text size="xl" inline>
|
||||||
|
{uploadText1}
|
||||||
|
</Text>
|
||||||
|
<Text size="sm" color="dimmed" inline mt={7}>
|
||||||
|
{uploadText2}
|
||||||
|
</Text>
|
||||||
|
</div>
|
||||||
|
</Group>
|
||||||
|
</Dropzone>
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CustomDropZone;
|
||||||
@@ -5,7 +5,7 @@ import { BiCabinet } from 'react-icons/bi'
|
|||||||
import { LinksGroup } from './sidebar/SidebarLinksGroup';
|
import { LinksGroup } from './sidebar/SidebarLinksGroup';
|
||||||
|
|
||||||
const sideBarData = [
|
const sideBarData = [
|
||||||
{ label: 'Dashboard', icon: GoDashboard, link: {label: 'Dashboard', link: '/'}},
|
{ label: 'Dashboard', icon: GoDashboard, link: "/"},
|
||||||
{
|
{
|
||||||
label: 'Locations',
|
label: 'Locations',
|
||||||
icon: GoLocation,
|
icon: GoLocation,
|
||||||
@@ -29,7 +29,7 @@ const sideBarData = [
|
|||||||
},
|
},
|
||||||
{ label: 'Cabinets', icon: BiCabinet, link: "/" },
|
{ label: 'Cabinets', icon: BiCabinet, link: "/" },
|
||||||
{ label: 'Items', icon: BsDiagram2, link: "/" },
|
{ label: 'Items', icon: BsDiagram2, link: "/" },
|
||||||
{ label: 'Settings', icon: GoGear, link: '/' },
|
{ label: 'Settings', icon: GoGear, link: '/settings' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const useStyles = createStyles((theme) => ({
|
const useStyles = createStyles((theme) => ({
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ function LocationCard(props) {
|
|||||||
</Group>
|
</Group>
|
||||||
<Text size="sm">{location.Description}</Text>
|
<Text size="sm">{location.Description}</Text>
|
||||||
<Group>
|
<Group>
|
||||||
<Button component={Link} to={`/location/${location.ID}`} state={{ location: location }}>View Details</Button>
|
<Button component={Link} to={`/locations/${location.ID}`} state={{ location: location }}>View Details</Button>
|
||||||
<Button onClick={() => navigateToRooms(location.ID, location.Name)}>View Rooms</Button>
|
<Button onClick={() => navigateToRooms(location.ID, location.Name)}>View Rooms</Button>
|
||||||
</Group>
|
</Group>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import React, {useState, useEffect} from 'react';
|
import React, {useState, useEffect} from 'react';
|
||||||
import { Text, Title, TextInput, Button, NumberInput, Textarea, Grid, Group, useMantineTheme, MantineTheme } from '@mantine/core'
|
import { Text, Title, TextInput, Button, NumberInput, Textarea, Grid, Group, useMantineTheme, MantineTheme, Image, SimpleGrid } from '@mantine/core'
|
||||||
import { DatePicker } from '@mantine/dates';
|
import { DatePicker } from '@mantine/dates';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
import { useForm } from '@mantine/form';
|
import { useForm } from '@mantine/form';
|
||||||
import { useAtom } from 'jotai';
|
import { useAtom } from 'jotai';
|
||||||
import { serverConfigAtom } from '../../state/main'
|
import { serverConfigAtom } from '../../state/main'
|
||||||
import { backendAPI } from '../../services/backend-api';
|
import { backendAPI } from '../../services/backend-api';
|
||||||
import { BsCardImage, BsCloudUpload, BsXLg } from 'react-icons/bs'
|
import { IMAGE_MIME_TYPE } from '@mantine/dropzone';
|
||||||
import { Dropzone, DropzoneStatus, IMAGE_MIME_TYPE, PDF_MIME_TYPE } from '@mantine/dropzone';
|
import CustomDropZone from '../CustomDropZone';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -14,6 +15,11 @@ function LocationForm(props) {
|
|||||||
const {location, modify: bool} = props
|
const {location, modify: bool} = props
|
||||||
const [opened, setOpened] = useState(false);
|
const [opened, setOpened] = useState(false);
|
||||||
const [serverConfig] = useAtom(serverConfigAtom)
|
const [serverConfig] = useAtom(serverConfigAtom)
|
||||||
|
// Cover Photo
|
||||||
|
const [coverPhoto, setCoverPhoto] = useState(null)
|
||||||
|
// Additional Photos
|
||||||
|
const [additionalPhotos, setAdditionalPhotos] = useState([])
|
||||||
|
|
||||||
const theme = useMantineTheme();
|
const theme = useMantineTheme();
|
||||||
|
|
||||||
|
|
||||||
@@ -38,9 +44,6 @@ function LocationForm(props) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// console.log("FORM", form)
|
|
||||||
// }, [form])
|
|
||||||
|
|
||||||
|
|
||||||
const submitNewLocation = (values) => {
|
const submitNewLocation = (values) => {
|
||||||
@@ -63,44 +66,41 @@ function LocationForm(props) {
|
|||||||
console.log("Error adding new location!", err)
|
console.log("Error adding new location!", err)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function ImageUploadIcon({status, ...props}) {
|
const handleFileAccept = (files) => {
|
||||||
if (status.accepted) {
|
form.setFieldValue('CoverPhoto', files[0])
|
||||||
return <BsCloudUpload {...props} />;
|
const imageUrl = URL.createObjectURL(files[0]);
|
||||||
}
|
setCoverPhoto(
|
||||||
|
<Image
|
||||||
if (status.rejected) {
|
key={"coverPhoto"}
|
||||||
return <BsXLg {...props} />;
|
src={imageUrl}
|
||||||
}
|
imageProps={{ onLoad: () => URL.revokeObjectURL(imageUrl) }}
|
||||||
|
/>
|
||||||
return <BsCardImage {...props} />;
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIconColor(status, theme) {
|
const handleAdditionalPhotos = (files) => {
|
||||||
return status.accepted
|
setAdditionalPhotos(oldPhotos => [...oldPhotos, ...files])
|
||||||
? theme.colors[theme.primaryColor][theme.colorScheme === 'dark' ? 4 : 6]
|
// setAdditionalPhotos(files)
|
||||||
: status.rejected
|
console.log("FORM VALUES: ",form.values)
|
||||||
? theme.colors.red[theme.colorScheme === 'dark' ? 4 : 6]
|
const oldValues = form.values['AdditionalPhotos']
|
||||||
: theme.colorScheme === 'dark'
|
form.setFieldValue('AdditionalPhotos', [...oldValues, ...files])
|
||||||
? theme.colors.dark[0]
|
console.log("NEW FORM VALUES: ", form.values)
|
||||||
: theme.colors.gray[7];
|
|
||||||
}
|
|
||||||
|
|
||||||
const dropzoneChildren = (status, theme, multiple) => (
|
}
|
||||||
<Group position="center" spacing="xl" style={{ minHeight: 220, pointerEvents: 'none' }}>
|
|
||||||
<ImageUploadIcon status={status} style={{ color: getIconColor(status, theme) }} size={80} />
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<Text size="xl" inline>
|
|
||||||
Drag images here or click to select file{multiple ? "s" : ""}
|
|
||||||
</Text>
|
|
||||||
<Text size="sm" color="dimmed" inline mt={7}>
|
|
||||||
Attach as many files as you like, each file should not exceed 5mb
|
|
||||||
</Text>
|
|
||||||
</div>
|
|
||||||
</Group>
|
|
||||||
);
|
|
||||||
|
|
||||||
|
const previews = additionalPhotos.map((file, index) => {
|
||||||
|
console.log("FILE IS: ", file)
|
||||||
|
const imageUrl = URL.createObjectURL(file);
|
||||||
|
return (
|
||||||
|
<Image
|
||||||
|
key={index}
|
||||||
|
src={imageUrl}
|
||||||
|
imageProps={{ onLoad: () => URL.revokeObjectURL(imageUrl) }}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -116,37 +116,47 @@ function LocationForm(props) {
|
|||||||
<NumberInput label="Square Feet" value={form.values.SquareFeet} {...form.getInputProps('SquareFeet')} />
|
<NumberInput label="Square Feet" value={form.values.SquareFeet} {...form.getInputProps('SquareFeet')} />
|
||||||
<TextInput label="Latitude" value={form.values.Latitude} {...form.getInputProps('Latitude')} />
|
<TextInput label="Latitude" value={form.values.Latitude} {...form.getInputProps('Latitude')} />
|
||||||
<TextInput label="Longitude" value={form.values.Longitude} {...form.getInputProps('Longitude')}/>
|
<TextInput label="Longitude" value={form.values.Longitude} {...form.getInputProps('Longitude')}/>
|
||||||
<TextInput label="Date Purchased" value={form.values.DatePurchased} {...form.getInputProps('DatePurchased')} />
|
<DatePicker
|
||||||
|
label="Date Purchased"
|
||||||
|
value={form.values.DatePurchased}
|
||||||
|
maxDate={dayjs(new Date()).add(1, 'days').toDate()}
|
||||||
|
{...form.getInputProps('DatePurchased')}
|
||||||
|
/>
|
||||||
<TextInput label="Purchase Price" value={form.values.PurchasePrice} {...form.getInputProps('PurchasePrice')}/>
|
<TextInput label="Purchase Price" value={form.values.PurchasePrice} {...form.getInputProps('PurchasePrice')}/>
|
||||||
<TextInput label="Current Value" value={form.values.CurrentValue} {...form.getInputProps('CurrentValue')}/>
|
<TextInput label="Current Value" value={form.values.CurrentValue} {...form.getInputProps('CurrentValue')}/>
|
||||||
<Group><Title order={4}>Location Cover Photo </Title><Text color="red">*</Text></Group>
|
<Group><Title order={4}>Location Cover Photo </Title><Text color="red">*</Text></Group>
|
||||||
<Dropzone
|
|
||||||
onDrop={(files) => form.setFieldValue('CoverPhoto', files[0])}
|
{coverPhoto ?
|
||||||
onReject={(files) => console.log('rejected files', files)}
|
coverPhoto
|
||||||
|
:
|
||||||
|
<CustomDropZone
|
||||||
|
uploadText1={"Drag Image Here or click to select File"}
|
||||||
|
uploadText2={"Single File, max size: 5mb"}
|
||||||
|
uploadFormat={IMAGE_MIME_TYPE}
|
||||||
maxSize={3 * 1024 ** 2}
|
maxSize={3 * 1024 ** 2}
|
||||||
multiple={false}
|
multipleFiles={false}
|
||||||
accept={IMAGE_MIME_TYPE}
|
returnFiles={handleFileAccept}
|
||||||
>
|
/>
|
||||||
{(status) => dropzoneChildren(status, theme, false)}
|
}
|
||||||
</Dropzone>
|
|
||||||
<Title order={4}>Additional Location Photos</Title>
|
<Title order={4}>Additional Location Photos</Title>
|
||||||
<Dropzone
|
<CustomDropZone
|
||||||
onDrop={(files) => form.setFieldValue('AdditionalPhotos', files)}
|
uploadText1={"Drag Images Here or click to select Files"}
|
||||||
onReject={(files) => console.log('rejected files', files)}
|
uploadText2={"Multiple Files, max size per file: 5mb"}
|
||||||
|
uploadFormat={IMAGE_MIME_TYPE}
|
||||||
maxSize={3 * 1024 ** 2}
|
maxSize={3 * 1024 ** 2}
|
||||||
multiple={true}
|
multipleFiles={true}
|
||||||
accept={PDF_MIME_TYPE}
|
returnFiles={handleAdditionalPhotos}
|
||||||
|
/>
|
||||||
getInputProps={{"capture": "environment"}}
|
<SimpleGrid
|
||||||
|
cols={4}
|
||||||
|
breakpoints={[{ maxWidth: 'sm', cols: 1 }]}
|
||||||
|
mt={previews.length > 0 ? 'xl' : 0}
|
||||||
>
|
>
|
||||||
{(status) => dropzoneChildren(status, theme, true)}
|
{previews}
|
||||||
</Dropzone>
|
</SimpleGrid>
|
||||||
<Button type="submit">Submit</Button>
|
<Button type="submit">Submit</Button>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</>
|
</>
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ function LocationsPage() {
|
|||||||
<>
|
<>
|
||||||
<Center>{ isLoading && <Loader size="xl" variant="bars" />}</Center>
|
<Center>{ isLoading && <Loader size="xl" variant="bars" />}</Center>
|
||||||
<Center><Title order={1}>Locations</Title></Center>
|
<Center><Title order={1}>Locations</Title></Center>
|
||||||
<Button leftIcon={<HiPlus />} onClick={(e) => {navigate("/locations/new")}}>Add New Location</Button>
|
<Button mb="lg" leftIcon={<HiPlus />} onClick={(e) => {navigate("/locations/new")}}>Add New Location</Button>
|
||||||
<SimpleGrid
|
<SimpleGrid
|
||||||
spacing="md"
|
spacing="md"
|
||||||
cols={4}
|
cols={4}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
|
|||||||
import { Group, Box, Collapse, ThemeIcon, Text, UnstyledButton, createStyles } from '@mantine/core';
|
import { Group, Box, Collapse, ThemeIcon, Text, UnstyledButton, createStyles } from '@mantine/core';
|
||||||
import { BiChevronLeft, BiChevronRight } from 'react-icons/bi';
|
import { BiChevronLeft, BiChevronRight } from 'react-icons/bi';
|
||||||
import { NavLink, useLocation } from 'react-router-dom';
|
import { NavLink, useLocation } from 'react-router-dom';
|
||||||
|
import { NoEncryption } from '@material-ui/icons';
|
||||||
|
|
||||||
const useStyles = createStyles((theme, _params, getRef) => {
|
const useStyles = createStyles((theme, _params, getRef) => {
|
||||||
const icon = getRef('icon');
|
const icon = getRef('icon');
|
||||||
@@ -13,6 +14,7 @@ const useStyles = createStyles((theme, _params, getRef) => {
|
|||||||
padding: `${theme.spacing.xs}px ${theme.spacing.md}px`,
|
padding: `${theme.spacing.xs}px ${theme.spacing.md}px`,
|
||||||
color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.black,
|
color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.black,
|
||||||
fontSize: theme.fontSizes.sm,
|
fontSize: theme.fontSizes.sm,
|
||||||
|
textDecoration: 'none',
|
||||||
|
|
||||||
'&:hover': {
|
'&:hover': {
|
||||||
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.colors.gray[0],
|
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.colors.gray[0],
|
||||||
@@ -58,7 +60,7 @@ const useStyles = createStyles((theme, _params, getRef) => {
|
|||||||
}});
|
}});
|
||||||
|
|
||||||
|
|
||||||
export function LinksGroup({ icon: Icon, label, initiallyOpened, links }) {
|
export function LinksGroup({ icon: Icon, label, link, initiallyOpened, links }) {
|
||||||
const mypath = useLocation()
|
const mypath = useLocation()
|
||||||
const { classes, theme, cx } = useStyles();
|
const { classes, theme, cx } = useStyles();
|
||||||
const hasLinks = Array.isArray(links);
|
const hasLinks = Array.isArray(links);
|
||||||
@@ -71,14 +73,41 @@ export function LinksGroup({ icon: Icon, label, initiallyOpened, links }) {
|
|||||||
className={({ isActive}) => (cx(classes.link, {[classes.linkActive]: isActive === true}))}
|
className={({ isActive}) => (cx(classes.link, {[classes.linkActive]: isActive === true}))}
|
||||||
key={link.label}
|
key={link.label}
|
||||||
to={link.link}
|
to={link.link}
|
||||||
|
end
|
||||||
>
|
>
|
||||||
{link.label}
|
{link.label}
|
||||||
</NavLink>
|
</NavLink>
|
||||||
));
|
));
|
||||||
|
|
||||||
|
console.log("TOP LINK: ", link)
|
||||||
|
|
||||||
useEffect(() => {
|
if (link) {
|
||||||
console.log("MYPATH: ", mypath)
|
return (
|
||||||
}, [])
|
<>
|
||||||
|
|
||||||
|
<NavLink
|
||||||
|
className={({ isActive}) => (cx(classes.control, {[classes.linkActive]: isActive === true}))}
|
||||||
|
key={label}
|
||||||
|
to={link}
|
||||||
|
end
|
||||||
|
|
||||||
|
>
|
||||||
|
{/* <UnstyledButton className={classes.control}> */}
|
||||||
|
<Group position="apart" spacing={0}>
|
||||||
|
<Box sx={{ display: 'flex', alignItems: 'center' }}>
|
||||||
|
<ThemeIcon variant="light" size={30}>
|
||||||
|
<Icon size={18} />
|
||||||
|
</ThemeIcon>
|
||||||
|
<Box ml="md">{label}</Box>
|
||||||
|
</Box>
|
||||||
|
</Group>
|
||||||
|
{/* </UnstyledButton> */}
|
||||||
|
</NavLink>
|
||||||
|
|
||||||
|
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user