Feature Requests
Share ideas, discuss and vote on requests from other users in community
This object is in archive! 

User actual server ID for server status lookups

Websavers shared this idea 3 years ago
Under Consideration

I'd like to be able to include the loads and other status info about a server when a client is viewing their hosting plan in the Client Area (ie: on the clientareaproductdetails.tpl page/template). It seems like this should be rather simple:

1. Copy over the HTML elements with the correct IDs

2. Copy over the javascript that looks up the server data from serverstatus.php

3. Replace the server ID value with {$serverdata.id} like this: getStats({$serverdata.id})

This would work beautifully except for the fact that getStats() winds up posting the data to serverstats.php which doesn't actually accept the Server ID, despite the comment in whmcs.js indicating it does:


* Fetch load and uptime for a given server.

* @param {number} num Server Id


But the parameter 'num' does *not* actually use the server ID. It uses a linear index seemingly created during a for loop in serverstatus.php, which means I can't programmatically know what the index # is for the server that the client is hosted on, unless I create a hook to pass the complete list of servers to the productdetails template, then loop through until I find a match in the array with the actual server ID or name.

It would be considerably more elegant for WHMCS to simply allow us to look up server status details using the same javascript functions as the serverstatus page by taking the actual server ID rather than a random index.