mirror of
https://github.com/HirziDevs/PteroStats
synced 2026-01-09 15:44:01 +00:00
feat(nodes): add server counter and set allocations as max servers
This commit is contained in:
@@ -68,7 +68,8 @@ status:
|
||||
nodes_settings:
|
||||
blacklist: [] # Add node IDs to exclude them from the status embed (e.g., blacklist: [1]).
|
||||
details: true # Show node details such as memory and disk usage (true/false).
|
||||
servers: true # Show server details (true/false).
|
||||
servers: false # Show server details (true/false).
|
||||
allocations_as_max_servers: false # Show allocations as max servers (true/false).
|
||||
unit: "byte" # Unit for node usage, Available types: "byte" or "percentage".
|
||||
limit: 100 # Node limit for usage statistics display.
|
||||
|
||||
|
||||
7
index.js
7
index.js
@@ -130,9 +130,10 @@ async function createMessage({ cache, panel, nodes, servers, users }) {
|
||||
name: `${node.attributes.name} - ${node.status ? config.status.online : config.status.offline}`,
|
||||
value:
|
||||
"```\n" +
|
||||
`Memory: ${convertUnits(node.attributes.allocated_resources.memory, node.attributes.memory, config.nodes_settings.unit)}\n` +
|
||||
`Disk : ${convertUnits(node.attributes.allocated_resources.disk, node.attributes.disk, config.nodes_settings.unit)}` +
|
||||
(node.attributes?.allocated_resources?.cpu ? `\nCPU : ${node.attributes?.allocated_resources?.cpu || 0}%` : "") +
|
||||
`Memory : ${convertUnits(node.attributes.allocated_resources.memory, node.attributes.memory, config.nodes_settings.unit)}\n` +
|
||||
`Disk : ${convertUnits(node.attributes.allocated_resources.disk, node.attributes.disk, config.nodes_settings.unit)}` +
|
||||
(node.attributes?.allocated_resources?.cpu ? `\nCPU : ${node.attributes?.allocated_resources?.cpu || 0}%` : "") +
|
||||
(config.nodes_settings.servers ? `\nServers: ${node.attributes.relationships.servers}${config.nodes_settings.allocations_as_max_servers ? ` / ${node.attributes.relationships.allocations}` : ""}` : "") +
|
||||
"```"
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user