updates
This commit is contained in:
@@ -197,15 +197,16 @@
|
||||
<table class="table table-sm table-hover mb-0">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th style="width: 30%">Service</th>
|
||||
<th style="width: 15%">Status</th>
|
||||
<th style="width: 15%">Enabled</th>
|
||||
<th style="width: 40%">Actions</th>
|
||||
<th style="width: 25%">Service</th>
|
||||
<th style="width: 30%">Description</th>
|
||||
<th style="width: 12%">Status</th>
|
||||
<th style="width: 12%">Enabled</th>
|
||||
<th style="width: 21%">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="services-tbody">
|
||||
<tr>
|
||||
<td colspan="4" class="text-center py-3">Loading services...</td>
|
||||
<td colspan="5" class="text-center py-3">Loading services...</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -1008,6 +1009,12 @@ function displayServices(services) {
|
||||
nameCell.textContent = service.display_name || service.name;
|
||||
row.appendChild(nameCell);
|
||||
|
||||
// Description
|
||||
const descCell = document.createElement('td');
|
||||
descCell.textContent = service.description || 'No description available';
|
||||
descCell.className = 'text-muted small';
|
||||
row.appendChild(descCell);
|
||||
|
||||
// Status
|
||||
const statusCell = document.createElement('td');
|
||||
const statusBadge = document.createElement('span');
|
||||
@@ -1054,7 +1061,7 @@ function showServiceError(message) {
|
||||
const tbody = document.getElementById('services-tbody');
|
||||
tbody.innerHTML = `
|
||||
<tr>
|
||||
<td colspan="4" class="text-center text-danger">
|
||||
<td colspan="5" class="text-center text-danger">
|
||||
<i class="bi bi-exclamation-triangle"></i> ${message}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1027,19 +1027,19 @@ if ($type == "execute_command") {
|
||||
// Get systemd services status
|
||||
if ($type == "get_systemd_services") {
|
||||
try {
|
||||
// List of NebuleAir services to monitor
|
||||
// List of NebuleAir services to monitor with descriptions
|
||||
$services = [
|
||||
'nebuleair-npm-data.timer',
|
||||
'nebuleair-envea-data.timer',
|
||||
'nebuleair-sara-data.timer',
|
||||
'nebuleair-bme280-data.timer',
|
||||
'nebuleair-mppt-data.timer',
|
||||
'nebuleair-db-cleanup-data.timer'
|
||||
'nebuleair-npm-data.timer' => 'Collects particulate matter data from NextPM sensor',
|
||||
'nebuleair-envea-data.timer' => 'Reads environmental data from Envea sensors',
|
||||
'nebuleair-sara-data.timer' => 'Transmits collected data via 4G cellular modem',
|
||||
'nebuleair-bme280-data.timer' => 'Monitors temperature and humidity (BME280)',
|
||||
'nebuleair-mppt-data.timer' => 'Tracks solar panel and battery status',
|
||||
'nebuleair-db-cleanup-data.timer' => 'Cleans up old data from database'
|
||||
];
|
||||
|
||||
$serviceStatus = [];
|
||||
|
||||
foreach ($services as $service) {
|
||||
foreach ($services as $service => $description) {
|
||||
// Get service active status
|
||||
$activeCmd = "systemctl is-active " . escapeshellarg($service) . " 2>/dev/null";
|
||||
$activeStatus = trim(shell_exec($activeCmd));
|
||||
@@ -1057,6 +1057,7 @@ if ($type == "get_systemd_services") {
|
||||
$serviceStatus[] = [
|
||||
'name' => $service,
|
||||
'display_name' => $displayName,
|
||||
'description' => $description,
|
||||
'active' => $isActive,
|
||||
'enabled' => $isEnabled
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user