working on location form, dropzone and previews

This commit is contained in:
2022-07-31 22:13:39 -04:00
parent bd6319b6b1
commit cf6e40db56
8 changed files with 368 additions and 75 deletions

View File

@@ -234,3 +234,185 @@
{"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:[]}]"}
{"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"}

View File

@@ -8,7 +8,7 @@ import NotFound from './components/pages/NotFound';
import { BrowserRouter as Router, Routes, Route} from 'react-router-dom'
import { Modal, Button, Text, Group, TextInput, Loader, AppShell, MediaQuery } from '@mantine/core';
import { useDebouncedValue, useLocalStorageValue } from '@mantine/hooks';
import { useNotifications } from '@mantine/notifications';
import { showNotification } from '@mantine/notifications';
import { backendAPI, defaultURLS } from './services/backend-api';
@@ -27,7 +27,7 @@ function App() {
const [, setServerConfig] = useAtom(serverConfigAtom)
const notifications = useNotifications();
// const navigate = useNavigate();
@@ -41,14 +41,14 @@ function App() {
results.data.baseURL = defaultURLS.baseURL
console.log("CONFIG: ", results.data)
setServerConfig(results.data)
notifications.showNotification({
showNotification({
title: 'Backend Notice',
message: 'Config fetched from backend!',
color: "green"
})
setIsLoading(false)
}).catch(err => {
notifications.showNotification({
showNotification({
title: 'Backend Notice',
message: `Failed to connect to backend! ${err}`,
autoClose: false,
@@ -74,11 +74,11 @@ function App() {
>
<Routes>
<Route path='*' element={<NotFound />} />
<Route index element={<HomePage />} />
<Route index element={<HomePage />}/>
<Route path="locations">
<Route index element={<LocationsPage />} />
<Route path=":id" element={<LocationDetailsPage />} />
<Route path="new" element={<LocationForm />} />
<Route path="new" element={<LocationForm />}/>
</Route>
<Route path="rooms">
<Route index element={<RoomsPage />} />

View 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;

View File

@@ -5,7 +5,7 @@ import { BiCabinet } from 'react-icons/bi'
import { LinksGroup } from './sidebar/SidebarLinksGroup';
const sideBarData = [
{ label: 'Dashboard', icon: GoDashboard, link: {label: 'Dashboard', link: '/'}},
{ label: 'Dashboard', icon: GoDashboard, link: "/"},
{
label: 'Locations',
icon: GoLocation,
@@ -29,7 +29,7 @@ const sideBarData = [
},
{ label: 'Cabinets', icon: BiCabinet, link: "/" },
{ label: 'Items', icon: BsDiagram2, link: "/" },
{ label: 'Settings', icon: GoGear, link: '/' },
{ label: 'Settings', icon: GoGear, link: '/settings' },
];
const useStyles = createStyles((theme) => ({

View File

@@ -52,7 +52,7 @@ function LocationCard(props) {
</Group>
<Text size="sm">{location.Description}</Text>
<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>
</Group>
</Card>

View File

@@ -1,12 +1,13 @@
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 dayjs from 'dayjs';
import { useForm } from '@mantine/form';
import { useAtom } from 'jotai';
import { serverConfigAtom } from '../../state/main'
import { backendAPI } from '../../services/backend-api';
import { BsCardImage, BsCloudUpload, BsXLg } from 'react-icons/bs'
import { Dropzone, DropzoneStatus, IMAGE_MIME_TYPE, PDF_MIME_TYPE } from '@mantine/dropzone';
import { IMAGE_MIME_TYPE } from '@mantine/dropzone';
import CustomDropZone from '../CustomDropZone';
@@ -14,6 +15,11 @@ function LocationForm(props) {
const {location, modify: bool} = props
const [opened, setOpened] = useState(false);
const [serverConfig] = useAtom(serverConfigAtom)
// Cover Photo
const [coverPhoto, setCoverPhoto] = useState(null)
// Additional Photos
const [additionalPhotos, setAdditionalPhotos] = useState([])
const theme = useMantineTheme();
@@ -38,9 +44,6 @@ function LocationForm(props) {
},
});
// useEffect(() => {
// console.log("FORM", form)
// }, [form])
const submitNewLocation = (values) => {
@@ -63,44 +66,41 @@ function LocationForm(props) {
console.log("Error adding new location!", err)
})
}
function ImageUploadIcon({status, ...props}) {
if (status.accepted) {
return <BsCloudUpload {...props} />;
}
if (status.rejected) {
return <BsXLg {...props} />;
}
return <BsCardImage {...props} />;
}
const handleFileAccept = (files) => {
form.setFieldValue('CoverPhoto', files[0])
const imageUrl = URL.createObjectURL(files[0]);
setCoverPhoto(
<Image
key={"coverPhoto"}
src={imageUrl}
imageProps={{ onLoad: () => URL.revokeObjectURL(imageUrl) }}
/>
)
}
function getIconColor(status, theme) {
return status.accepted
? theme.colors[theme.primaryColor][theme.colorScheme === 'dark' ? 4 : 6]
: status.rejected
? theme.colors.red[theme.colorScheme === 'dark' ? 4 : 6]
: theme.colorScheme === 'dark'
? theme.colors.dark[0]
: theme.colors.gray[7];
}
const handleAdditionalPhotos = (files) => {
setAdditionalPhotos(oldPhotos => [...oldPhotos, ...files])
// setAdditionalPhotos(files)
console.log("FORM VALUES: ",form.values)
const oldValues = form.values['AdditionalPhotos']
form.setFieldValue('AdditionalPhotos', [...oldValues, ...files])
console.log("NEW FORM VALUES: ", form.values)
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 (
<>
@@ -116,37 +116,47 @@ function LocationForm(props) {
<NumberInput label="Square Feet" value={form.values.SquareFeet} {...form.getInputProps('SquareFeet')} />
<TextInput label="Latitude" value={form.values.Latitude} {...form.getInputProps('Latitude')} />
<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="Current Value" value={form.values.CurrentValue} {...form.getInputProps('CurrentValue')}/>
<Group><Title order={4}>Location Cover Photo </Title><Text color="red">*</Text></Group>
<Dropzone
onDrop={(files) => form.setFieldValue('CoverPhoto', files[0])}
onReject={(files) => console.log('rejected files', files)}
{coverPhoto ?
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}
multiple={false}
accept={IMAGE_MIME_TYPE}
>
{(status) => dropzoneChildren(status, theme, false)}
</Dropzone>
multipleFiles={false}
returnFiles={handleFileAccept}
/>
}
<Title order={4}>Additional Location Photos</Title>
<Dropzone
onDrop={(files) => form.setFieldValue('AdditionalPhotos', files)}
onReject={(files) => console.log('rejected files', files)}
<CustomDropZone
uploadText1={"Drag Images Here or click to select Files"}
uploadText2={"Multiple Files, max size per file: 5mb"}
uploadFormat={IMAGE_MIME_TYPE}
maxSize={3 * 1024 ** 2}
multiple={true}
accept={PDF_MIME_TYPE}
getInputProps={{"capture": "environment"}}
multipleFiles={true}
returnFiles={handleAdditionalPhotos}
/>
<SimpleGrid
cols={4}
breakpoints={[{ maxWidth: 'sm', cols: 1 }]}
mt={previews.length > 0 ? 'xl' : 0}
>
{(status) => dropzoneChildren(status, theme, true)}
</Dropzone>
{previews}
</SimpleGrid>
<Button type="submit">Submit</Button>
</Grid.Col>
</Grid>
</form>
</>

View File

@@ -53,7 +53,7 @@ function LocationsPage() {
<>
<Center>{ isLoading && <Loader size="xl" variant="bars" />}</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
spacing="md"
cols={4}

View File

@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
import { Group, Box, Collapse, ThemeIcon, Text, UnstyledButton, createStyles } from '@mantine/core';
import { BiChevronLeft, BiChevronRight } from 'react-icons/bi';
import { NavLink, useLocation } from 'react-router-dom';
import { NoEncryption } from '@material-ui/icons';
const useStyles = createStyles((theme, _params, getRef) => {
const icon = getRef('icon');
@@ -13,6 +14,7 @@ const useStyles = createStyles((theme, _params, getRef) => {
padding: `${theme.spacing.xs}px ${theme.spacing.md}px`,
color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.black,
fontSize: theme.fontSizes.sm,
textDecoration: 'none',
'&:hover': {
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 { classes, theme, cx } = useStyles();
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}))}
key={link.label}
to={link.link}
end
>
{link.label}
</NavLink>
));
console.log("TOP LINK: ", link)
useEffect(() => {
console.log("MYPATH: ", mypath)
}, [])
if (link) {
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 (