vitotai / BrewPiLess

Use an ESP8266 to replace RPI and Arduino. Running BrewPi without Pi, therefore, BrewPi-Less
358 stars 134 forks source link

Beer Profiles are broken in v4.2p3 #363

Closed alexlark closed 2 years ago

alexlark commented 2 years ago

Issue: Saved beer profiles are truncated and hyperlinks broken in v4.2p3

To replicate issue: Create a beer profile and save it, navigate away from the beer profiles, navigate back to beer profiles and load a beer profile. The saved profiles will be truncated and hyperlinks broken.

Issue does not exist in v4.1r4

vitotai commented 2 years ago

I just push a new version, modified layout. Try if it works for you.

alexlark commented 2 years ago

I can see the new DEL buttons, and they work, but the profile names are still truncated and do not work when I click them :-/

Should be:

Ale Beer

image

vitotai commented 2 years ago

what browers are you using?

profile IMG_4035

alexlark commented 2 years ago

I'm using Chrome and I tried in Edge on Windows 10. Also tried Chrome on Android.

The profiles save and I can click them but once I navigate away from the page, and back, they are then truncated (Test1, Test2 etc). I saved 2 profiles using 2 characters, you can see them on the screenshot as blank.

Also, my profiles do not have a a forward slash prefix in the UI and when I navigate to http://brewpiless.local:8008/filemanager I am unable to see them.

The DEL button removes them but when navigating away, and back, they re-appear.

Is this a SPIFFS / LittleFS issue as I thought SPIFFS was a flat file structure, the screenshots below show a folder?? Just to reiterate, I'm using an ESP8266

image

image

Version v4.1r4 is OK and I can see them at http://brewpiless.local:8008/filemanager

image

image

vitotai commented 2 years ago

I didn't change anything about control panel or profiles after 4.1. In fact, I totally forget profile loading/saving. There was a delete buttons in classic UI, but it didn't show up in new UI. It was until you mentioned that I just knew that.

What on my Mac with Chrome: 截圖 2022-04-09 上午9 12 32

vitotai commented 2 years ago

It's difficult for me to solve issues if I couldn't reproduce by myself. However, if you can provide more information, I might be able to give it a try. On Chrome, select "View"->"Development Option"->"Javascript Console". Click the icon marked as "1" in the following picture. Click on around "DEL" button. then Click "Computed" marked as "2". Capture the screen and show it to me. 截圖 2022-04-09 上午9 19 55

alexlark commented 2 years ago

This has got to be linked to the way the list of profiles are fetched. The list of profiles are being cut by 2 characters so all further GET /POST requests are using the wrong URL.

Is there a trim being applied to maybe cut the P/ when now it is no longer required, resulting in Test1 being trimmed to st1?

Again, I do not get the leading / prefix for the profile name in version v4.1r4 or v4.2p4 as in your screenshots so something is different.

image

But the profiles are actually getting saved in the correct location....

image

vitotai commented 2 years ago

Yeah. You are right. I'm converting to LittleFS and didn't notice the different behaviors between LittleFS and SPIFFS. Just push a new commit. Sorry about that.

alexlark commented 2 years ago

All working now, thanks. Loading and deleting work as expected.

image

Just a minor observation, when viewing the filemanager the profiles folder does not expand whereas the logs folder does. Just pointing this out if this was unintended or helps with the LittleFS conversion...

image