Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some improvments #90

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

ChristianGabs
Copy link

@ChristianGabs ChristianGabs commented Oct 6, 2024

There are lots of issues and try to compose some suggestion

->get()[0] -> use ->first()
node when you have cluster will be an issue ( store node name in vms tables)
Sleep 30 sec -> move to checking when server is offline
POST has exception retify that by try-catch

LXC can have OS Template in different location storage ( Add Storage and OS Storage )

Set as draft while I'm working

@ChristianGabs ChristianGabs changed the title Some inprovments Some improvments Oct 6, 2024
@ChristianGabs
Copy link
Author

Rebuild pvewhmcs addons

Some update on design still in progress

image

Move all function to Dispatcher

image

@ChristianGabs
Copy link
Author

ChristianGabs commented Oct 7, 2024

Overhall, move all functions on Admin Dispatcher

Reskin menu -> Still working on conntent

From 1615 line on pvewhmcs to 158 lines ( sorting out the mess )

Add template with smarty easy to maintain the design and functionallity

Old ->

image

New ->

image

Update

image

WIP

  • Add on dashboard all proxmox servers with info
  • Reskin

@lsthompson
Copy link
Member

lsthompson commented Oct 8, 2024

This is great, many thanks @ChristianGabs - watching how you go!

Some early feedback and additions etc:

  1. Please move the menu up to be right of the module logo. So we don't waste vertical space on-screen.
  2. Also look at tagging any issues you're talking about, so when it merges they close out automatically.

As for suggestions with existing issues/features in the repo:

  1. Proxmox API Calls: Made to 1st node, not WHMCS-set/PVE-paired node #16
  2. GUI Language: Move language from hard-coded to refer back to lang/english.php etc #1
  3. Server Password, Update via WHMCS: "ChangePassword" needs to be functional (CTs) #43
  4. Reinstall VM/CT: Initiate from Client Area (by ISO or TPL) BYO "Upload" #49
  5. Migrate Service: Ability to move VM/CT between PVE Nodes (needs Cron, checks...) #48
  6. Cron Hooks, auto-maintenance: Email Alerts (task error, etc), Node Syncing, etc. #46
  7. Addon Module in Admin Area: +Node Resources, +Task History, +Action Logs, etc #50
  8. Link existing PVE VM/CT to new WHMCS Service Billing entry #75
  9. Redesign Client Area - modernise the module's interface (GUI) #84
  10. RAM/Memory Ballooning - Option to disable  #87

That way this could become more of a v2 release to improve the module faster. :-)

@ChristianGabs
Copy link
Author

ChristianGabs commented Oct 8, 2024

@lsthompson , thank you

I will try to not end up on project creap so this must be done by steps, I will release all the changes for new design and improve on how we write the code on addons. In regards of those I'm aware of the request but I think the priority is clean up the code so we can work on it in future

On each suggestion must be each one treated as new PR as if you start going to deep you could loose the focus what you trying to achieve.

Other note : your Repo should be defork and setup the Credits to intial repo and move as a own repo own stuff.

Thanks

@8bitUpsurge
Copy link

@ChristianGabs Just wanted to say, its incredible, Thank you, I would love to see UI Overhaul!

@ChristianGabs
Copy link
Author

Ready for testing

Thanks

@ChristianGabs ChristianGabs marked this pull request as ready for review October 10, 2024 17:21
@ChristianGabs
Copy link
Author

ChristianGabs commented Oct 10, 2024

Documentation is not yet done, there are some template where I use to rebuild the design, so we have to do that as well

@ChristianGabs
Copy link
Author

Pagination need to be done as well. so I will start new PR for each when I'm going to work on those. and the moment is overhaul UI and migrate to smarty

@ChristianGabs
Copy link
Author

Auto-Node and preseletected WIP

image

Auto-Node logic base by usage

$nodes = $proxmox->get('/nodes');
$threshold_cpu = 0.5; // 50% CPU threshold
$threshold_mem = 0.75; // 75% memory usage threshold
$threshold_disk = 0.8; // 80% disk usage threshold

@lsthompson
Copy link
Member

Many thanks @ChristianGabs - appreciate your efforts here!

Have you moved the Admin Area menu up to be to-the-right of the module logo like I asked? Else it wastes vertical space.

With the 10x issues I linked above, which of those have you solved with this PR? So they can be tagged into this properly.

Also, please let me know what you have tested, and in which cases. Like LXC/QEMU create from blank / from template, etc.

@ChristianGabs
Copy link
Author

ChristianGabs commented Oct 11, 2024

Hi @lsthompson

This is a request to clean up and improve the code on the admin side, focusing on the following points:

  • Reskin: Apply a new design to the Admin interface (Add-ons).
  • Refactor Actions: Move all actions to the controller and handle them via post handlers.
  • Notifications: Add notifications on save, update, and delete actions.

Regarding the menu, I have already designed it and included a logo, as shown in the image below. Although the menu design doesn’t seem like a major issue to me, as it's not taking up too much space. However, this is not a priority for this PR, but I will like you to join this PR and change in the way you see fit, possible to add as well the documentation as you understand it better than me.

Regarding server usage, when dealing with a cluster, there may be an issue selecting which server you want to view. I'll need to look into that. It's possible to add a list, like a tree structure, under the server in WHMCS.

image

In the future, I would like to see this expanded with more options, tasks, logs, and support for multiple IPs per LXC. Each IP should be associated with both a hosting ID and a user ID, allowing us to track where it is assigned and enabling the assignment of multiple IPs as needed.

Whats next?

Addons / Admin Area -> Possible for this PR but not required

  • Pagination
  • Tasks -> When we move on queue jobs
  • Documentation

Not for this repo just for ref

  • Add a logic where Auto-Node or preselected is been set on each product
  • When the KVM or LXC is created, add PVEUser (Experienting the XtermJS and NoVNC direct to Proxmox)
  • Move all actions logit someone else and keep the server side clean as well

Please as well contribuite with any feedback you have.

Thanks

@lsthompson
Copy link
Member

Hi again, thanks for your work on this.

I'm down on time at the moment to review and test this properly.

Does anyone else have time to test this properly and report back with screenshots and info?

There's mention of potential issues with this PR in its current state, so need to ensure we prioritise stability with merging! :-)

@lsthompson lsthompson self-requested a review November 1, 2024 21:57
@lsthompson
Copy link
Member

Hey @ChristianGabs - can you please add screenshots of the Client Area and successful testing of all basic functions? Thanks!

@ChristianGabs
Copy link
Author

ChristianGabs commented Nov 2, 2024

Hi,

I apologize for the late response; I've been busy with work.

On the client side, there aren’t to many changes—these updates are focused on addons. I understand there are changes on the server side, but it’s primarily just a code reformat.

I can run additional tests if needed, but at this point, I've been working in my free time to rebuild the server side. There’s a lot I want to accomplish, but finding the time has been challenging.

Here’s a preview of the server-side updates.

image

As well I ditch the

if (file_exists('../modules/addons/pvewhmcs/proxmox.php')) {
    require_once('../modules/addons/pvewhmcs/proxmox.php');
} else {
    require_once(ROOTDIR.'/modules/addons/pvewhmcs/proxmox.php');
}

I'm using a wrapper ( package ) from Saleh7 where is more easy to use and run proxmox api's

I’ll go back and rerun a test to ensure I haven’t broken anything on the server side.

On another note, I've spent some time adding more features. I'm considering handling longer tasks, like creating a new server, as scheduled jobs to be managed by cron. This would prevent issues with browser timeouts, which aren’t ideal.

Here is a sample of the new changes as well.

image

Again, these changes are long-term and won’t be added here. I've simplified the addons to make it easier for us to start adding or building more features, especially pagination and other ideas we’d like. @lsthompson It would be great if you could join this repo to help with documentation and structuring the remaining pages as you see fit.

Thank you

PS:

How api works

Set config for login

image

Set the login

image

Call a stop for a VM

image

I will stop poiting any directions where I'm going because this PR has no relation with server side

Thanks

@lsthompson
Copy link
Member

Thanks @ChristianGabs - great stuff!

I apologize for the late response; I've been busy with work.

No problem, thanks for your work on this. It's always appreciated to get contributions towards the project. :-)

I'm using a wrapper ( package ) from Saleh7 where is more easy to use and run Proxmox APIs

We can't merge it with that, as we use the wrapper from @CpuID (which I co-maintain).
However, adding to that wrapper would mean anything missing is thereby resolved!

Again, these changes are long-term and won’t be added here.

I don't understand this undertone about isolating some changes from this repo. Please explain?

I will stop posting any directions where I'm going because this PR has no relation with server side

How'd you go with testing everything? We can look to amend and merge this in this quarter, if you can fully test it?
There are minor tweaks we'd make to have it conform with our internal methods, but that's simple & can be done after.

Key thing is that we overhauled this so it does these things, in this order:

  1. Work reliably (ie. be stable)
  2. Offers critical functions 1st
  3. Expand over time (demand)

Hence the key focus is making sure we don't push anything hastily.
I think we can get this out in Jan/Feb together? :-)

@lsthompson lsthompson self-assigned this Jan 2, 2025
@lsthompson lsthompson added feat-major Major feature request triaging Working to understand bug/feature validity/applicability/etc labels Jan 2, 2025
@ChristianGabs
Copy link
Author

ChristianGabs commented Jan 8, 2025

Hi,

I will do my best to finish this with you

Let me start adding some DEMO :

LXC
image

Adding - LXC

image

Adding KVM

image

Testing update for LXC

image

Testing update for KVM

image

I will update here all testing

PS: Do not worry I will add the Balloon part as well

Adding Balloon in design

image

image

Update Balloon

image

adding new KVM plan for balloon test

image

@ChristianGabs
Copy link
Author

Test IPV4 Pools

image

image

Add IPv4 to Pool

image

There was an issue where name="" was specify twice [FIX]

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat-major Major feature request triaging Working to understand bug/feature validity/applicability/etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants