updating table based on host computer

This commit is contained in:
Alice Sedgwick 2024-11-24 16:47:47 -05:00
parent d04c1bd2c5
commit 957d0319df
2 changed files with 21 additions and 9 deletions

View File

@ -46,23 +46,17 @@
<thead>
<tr>
<th scope="col">Drone</th>
<th scope="col">Mu1</th>
<th scope="col">Mu2</th>
<th scope="col">Mu3</th>
<td id="name"></th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">IP Address</th>
<td>1</td>
<td>2</td>
<td>3</td>
<td id="address"></td>
</tr>
<tr>
<th scope="row">Docker Container</th>
<td>Container1</td>
<td>Container2</td>
<td>Container3</td>
<td id="container"></td>
</tr>
</tbody>
</table>

View File

@ -19,6 +19,24 @@ function initPage() {
// Search for drones files in the services directory and populate the dropdown with directory names
addDropDown(droneDropdown, drones, "1");
const command1 = "hostname -I"
const command2 = "hostname"
const command3 = "docker container ls"
cockpit.spawn(["bash", "-c", command1])
.then((data) => {
console.log(data.split(" ")[0]);
})
.catch((error) => console.log(error));
cockpit.spawn(["bash", "-c", command2])
.then((data) => {
console.log(data.split(" ")[0]);
})
.catch((error) => console.log(error));
cockpit.spawn(["bash", "-c", command3])
.then((data) => {
console.log(data.split(" ")[0]);
})
.catch((error) => console.log(error));
}
function droneChange() {