henrygd / beszel

Lightweight server monitoring hub with historical data, docker stats, and alerts.
MIT License
2.93k stars 91 forks source link

24h+ chart cannot be displayed when it is just installed, and some new feature suggestions #223

Open ArsFy opened 1 month ago

ArsFy commented 1 month ago

Issue

Initial Chart Loading Issue: Upon initial server installation (with insufficient statistics), charts spanning 24 hours or more remain in a perpetual loading state.

image

Feature Suggestions

I've noticed that several features are currently missing from the project. I'd like to contribute by adding the following:

image

(Unfinished)

I am eager to contribute to this project and would appreciate your feedback on these suggestions. I will submit a merge request upon completion of the implementation. (this will be a bit slow)

ArsFy commented 1 month ago

Maybe I should continue with the design.... hide the code blocks

henrygd commented 1 month ago

Binary installation

Absolutely, I would welcome this contribution. It's been on my list for a while but haven't gotten around to it yet.

No rush at all. Let me know if you have any questions about the dev setup.

The tabs are a good idea. For the command, I think maybe we do the same thing as docker, with a copy button. Instead of "Copy docker compose" it could say something like "Copy Linux command".

We also have a premade install script which should simplify things. The command could be something like:

curl -sL https://raw.githubusercontent.com/henrygd/beszel/main/supplemental/scripts/install-agent.sh -o install-agent.sh && chmod +x install-agent.sh && ./install-agent.sh -p <port> -k "<key>"

Web SSH / remote command execution

While it would be a great feature, it introduces security concerns the current setup is not equipped for.

Mainly, all users share the same key, and I don't want them to be able to run commands on other users' systems.

I know the majority of people are running single-user instances where that's not an issue. Perhaps it can be an opt-in thing where users can define another key on the agent that's encrypted in the hub.

Unless you have a good idea for this, I'll need to think about it further and maybe make a discussion post to get other opinions.

Initial Chart Loading

To me it seems logical to show a loading indicator if there are no records yet. They will populate eventually if you leave the page open for long enough.

What would you suggest instead? Maybe a message that says no records have been populated yet?


One other thing - I noticed your CPU is showing 8 core / 8 threads. Are you restricting that in your environment, or is that being read incorrectly?

ArsFy commented 1 month ago

Thanks for your reply, I didn't expect it to be so comprehensive and quick.

First, thanks for your script, I will do this.

About web ssh

I think you are right, I overlooked that this is a multi-user system which may bring more security issues. It needs a better solution and community discussion.

About Chart Loading

I think it needs to indicate that there is not enough data. An hour of waiting is too long. And it may make users wonder if there is a problem with the server.

About my CPU

This is because it is running in a virtual machine, the program is good, don't worry.

ArsFy commented 1 month ago

@henrygd I've found the multilingual switch button you left behind and I'm planning to integrate it. Additionally, I think this project could benefit from a comprehensive installation and user guide (like a online docs?), but it's going to take some extra time. What are your thoughts?

image

henrygd commented 1 month ago

That would be a HUGE help!

I have no experience with i18n on the web so I'm not sure what best practices are.

From the little research I've done, Lingui seems like a good standalone framework for this.

I'm open to Crowdin if it makes sense to use a web platform. But if our usage will exceed the free plan I'd rather set up a self-hosted instance of Weblate. Or Tolgee, which also comes with its own React library.

I completely agree that we should have a site for online docs. I've been thinking about using VitePress for this, but I'm open to suggestions.

There's no rush for any of this by the way. Please take as much time as you'd like.

Unfortunately I have a work project that I need to focus on for the next few weeks, but I'm available if you need anything.

ArsFy commented 1 month ago

I've been using react-i18next, and I find it offers higher compatibility and ease of use (for example, passing in transition.json makes it easier to generate translations on translation websites). However, I'm not sure if it's the most suitable choice. But libraries are easy to replace, and the most time-consuming part of localization is identifying the original text and translating it.

Crowdin's limited free tier is indeed a problem, and self-hosting is a good solution, but it comes with additional maintenance. I'm more inclined to use weblate, which offers free hosting for open-source projects.

I like VitePress, it looks sleek, modern, and is easy to use. When you have enough time, you could create a repo (or create an org?), I can write the docs.

henrygd commented 1 month ago

Didn't realize Weblate had a free option for open source -- good on them for doing that.

I went ahead and created a project. I'll add you as an admin if you have an account.

react-i18next is totally fine.

I set up a VitePress site and made some progress: https://preview.beszel.dev/

The repo is here: https://github.com/henrygd/beszel-docs

Any work you can do on the docs is greatly appreciated, and feel free to make changes to anything I've written previously.

Thanks again for your help!

henrygd commented 4 weeks ago

@ArsFy I made some progress on this today.

The Weblate project is set up properly now and should pull changes automatically from the repo.

I added some missing translations and made it so the files are loaded on request rather than all included in the main bundle.

I think we still have a few hidden things like success / error toast notifications to do. And I need to fix some RTL layout things for Arabic. But other than that I think we're good to go.

Thanks again for all your work on this!

https://hosted.weblate.org/engage/beszel/

henrygd commented 3 weeks ago

Update: It turns out Crowdin also has a free tier for open source and they approved me in ten minutes. I've been waiting days for Weblate to get back to me.

So we've come full circle and Beszel is back on Crowdin. I'll invite you as a dev if you want.

I also changed js libraries to lingui, which feels more natural to me. English is left in the source code, the strings should be easier to understand for translators, and it cut down on the bundle size.

Should have the next release out this weekend.

ArsFy commented 3 weeks ago

The world is round, and we're back at Crowdin. Unfortunately, I'm quite busy this weekend and may not be able to dedicate time to this until next week.

I look forward to the new release, a friend of mine was just asking if the new version is available yet.