wizarrrr / wizarr

Wizarr is an advanced user invitation and management system for Jellyfin, Plex, Emby etc.
https://docs.wizarr.dev
MIT License
1.28k stars 89 forks source link

Allow editing all onboarding pages #471

Closed albinmedoc closed 2 months ago

albinmedoc commented 2 months ago

Several people wanted to be able to edit all onboarding pages.

I am working on trying to get this functionality working.

albinmedoc commented 2 months ago

Discord and Request page are not editable, they are very dynamic.

JamsRepos commented 2 months ago

The timing! I’ve just turned off my computer as I’m putting in a new cooler but I’ll get to it as soon as I’m done. 😊

JamsRepos commented 2 months ago

@albinmedoc I'm back at my PC, did you want this reviewed or are you still working?

albinmedoc commented 2 months ago

@albinmedoc I'm back at my PC, did you want this reviewed or are you still working?

I think I can improve the implementation.

JamsRepos commented 2 months ago

No worries! Let me know when you need me.

albinmedoc commented 2 months ago

Now I feel satisfied with the implementation.

During setup, the Welcome & Download page is created automatically based on the server type chosen (plex, jellyfin, emby).

Discord page is added/hidden automatically when connecting/disconnecting from discord.

The same applies to the Request page. If there is at least one request connection, the page is created. When there are no connections, it is hidden.

If you change the server type (for example from plex to Jellyfin), the onboarding pages are NOT updated. Welcome & Download page is just a standard markdown string saved to the DB.

I have created in the migration that Welcome & Download (for the current server type), Discord, Request pages are created. This makes the onboarding page (/help) look exactly like before.

JamsRepos commented 2 months ago

@albinmedoc I'll get it tested for you now, whilst I have you... Did you want to look into an issue people are having with the image upload limit? Seems files larger than 1MB cannot be uploaded, no error message or anything. Perhaps we need to increase it on the web service?

albinmedoc commented 2 months ago

@albinmedoc I'll get it tested for you now, whilst I have you... Did you want to look into an issue people are having with the image upload limit? Seems files larger than 1MB cannot be uploaded, no error message or anything. Perhaps we need to increase it on the web service?

I can take a look

albinmedoc commented 2 months ago

I have only tested this with Plex and Discord.

We must not miss testing this with Jellyfin, Emby and request systems

JamsRepos commented 2 months ago

I have only tested this with Plex and Discord.

We must not miss testing this with Jellyfin, Emby and request systems

No worries, i've got that basis covered :)

adx74 commented 2 months ago

@albinmedoc I'll get it tested for you now, whilst I have you... Did you want to look into an issue people are having with the image upload limit? Seems files larger than 1MB cannot be uploaded, no error message or anything. Perhaps we need to increase it on the web service?

I can take a look

Hey @albinmedoc i've made a shitty fix to test, it's actually the nginx limit, i've paste client_max_body_size 10M; into the nginx.conf for wizarr, and it work, maybe there is a better solution, but i wanna let you know :)

albinmedoc commented 2 months ago

@albinmedoc I'll get it tested for you now, whilst I have you... Did you want to look into an issue people are having with the image upload limit? Seems files larger than 1MB cannot be uploaded, no error message or anything. Perhaps we need to increase it on the web service?

I can take a look

Hey @albinmedoc i've made a shitty fix to test, it's actually the nginx limit, i've paste client_max_body_size 10M; into the nginx.conf for wizarr, and it work, maybe there is a better solution, but i wanna let you know :)

Thanks for the quick fix. I will increase the value and make it configurable using environment.

JamsRepos commented 2 months ago

@albinmedoc One thing I have noticed is if you are upgrading from a pre-existing installation, it will delete the old defaults so now I have only my custom page. Setting up from scratch and it works as intended.

I also noticed that my custom page seems to cut off? As soon as I inspect the page the full onboarding page loads. Might be related to the image, i'm not sure. image image

Is it possible at all to retain the buttons or perhaps does the markdown editor support buttons? Probably not right? Just looks a tad odd without them. Might even just be an idea to leave the download buttons at the bottom hard-coded etc, and just allow the text on the page to be editable? Or we just leave them as hard-coded pages, and give the admin the ability to just "turn off" the page in their onboarding process, so you can turn them on/off or make your own page if you wanted. image

Other than that, the Automatic Media Requests page works great. The Discord widget seems to be showing on my onboarding process even though I have not got it enabled. image image

It might even be an idea to allow toggle on/off for all static pages, just to give that little bit more freedom, after all they can just turn them off and make their own like I mentioned above for the joining process.

albinmedoc commented 2 months ago

Thank you for the feedback. I will mark this as draft again and continue with the work.

albinmedoc commented 2 months ago

@albinmedoc One thing I have noticed is if you are upgrading from a pre-existing installation, it will delete the old defaults so now I have only my custom page. Setting up from scratch and it works as intended.

The pre-existing onboarding pages (Welcome & Download) are just plain markdown texts, I can't separate them from others. This issue will only apply if you were beta-testing and added one or more custom onboarding pages.

I also noticed that my custom page seems to cut off? As soon as I inspect the page the full onboarding page loads. Might be related to the image, i'm not sure.

I need to look this up further.

Is it possible at all to retain the buttons or perhaps does the markdown editor support buttons? Probably not right? Just looks a tad odd without them. Might even just be an idea to leave the download buttons at the bottom hard-coded etc, and just allow the text on the page to be editable? Or we just leave them as hard-coded pages, and give the admin the ability to just "turn off" the page in their onboarding process, so you can turn them on/off or make your own page if you wanted.

Markdown doesn't support buttons. Maybe it is possible to create an extension to the md-editor-v3 library that is used. I know they support extension in some way.

I liked the idea to have the buttons hard coded and make the text editable. I will look into this further.

Other than that, the Automatic Media Requests page works great. The Discord widget seems to be showing on my onboarding process even though I have not got it enabled.

Thats weird, the Discord page should not have been added. I will take a look at this.

It might even be an idea to allow toggle on/off for all static pages, just to give that little bit more freedom, after all they can just turn them off and make their own like I mentioned above for the joining process.

Definitely, I will implement it

JamsRepos commented 2 months ago

Don’t worry about implementing buttons then, unless you see the appeal for them to be used aside from that functionality as we could just have the download page hard coded again and use the toggle system to just allow them to toggle it off and make their own version.

albinmedoc commented 2 months ago

Don’t worry about implementing buttons then, unless you see the appeal for them to be used aside from that functionality as we could just have the download page hard coded again and use the toggle system to just allow them to toggle it off and make their own version.

Yeah, I agree. That sounds like the best option.

albinmedoc commented 2 months ago

I also noticed that my custom page seems to cut off? As soon as I inspect the page the full onboarding page loads. Might be related to the image, i'm not sure.

This might be an caching issue.

albinmedoc commented 2 months ago

I'm happy with this. Please take a look and give comments

JamsRepos commented 2 months ago

image Getting this when trying to hide a default page, move up/down and adding a page. Seems to be with the onboarding endpoint. This is from a fresh install with cache cleared.

albinmedoc commented 2 months ago

image Getting this when trying to hide a default page, move up/down and adding a page. Seems to be with the onboarding endpoint. This is from a fresh install with cache cleared.

I have also encountered this problem. It only happens after setup (ie once).

There is something about the jwt key being incorrect/expired. Try logging out and then logging in.

This error is to be resolved in a separate PR. It's not something I've broken now.

JamsRepos commented 2 months ago

image image

When adding a request server onto the installation.

albinmedoc commented 2 months ago

image image

When adding a request server onto the installation.

It probably depends on something else. Looks like you are trying to add a second request with the same url as a previous one.

I have not changed the requests database table

JamsRepos commented 2 months ago

Give me a moment, i'll completely wipe everything and start again as it occured even adding for the first time.

albinmedoc commented 2 months ago

I don't have a request system, so I haven't tested this.

However, according to the error message, it indicates that a row is trying to be inserted into the database, but requests.url is not unique.

JamsRepos commented 2 months ago

image image

I screenshotted the wrong error, apologies. That's upon adding a request server for the first time.

albinmedoc commented 2 months ago

Great! I think I found the problem. Please try again

JamsRepos commented 2 months ago

Approved :D