Still looking at getting a dropdown working
This commit is contained in:
parent
4c6b679bab
commit
364cb5f85a
|
@ -57,6 +57,11 @@
|
||||||
<li><a class="dropdown-item" href="#">Something else here</a></li>
|
<li><a class="dropdown-item" href="#">Something else here</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<img src="assets/icons/drone-icon.svg" class="me-2"/>
|
||||||
|
<label for="composeFile" class="form-label"><b>Drone Select</b></label>
|
||||||
|
<select id="droneSelection" class="form-select mt-2"></select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,7 +13,22 @@ document.onload = initPage();
|
||||||
|
|
||||||
// Function to initialize the page
|
// Function to initialize the page
|
||||||
function initPage() {
|
function initPage() {
|
||||||
|
// TODO: Replace /home/spiri/services with some root level path
|
||||||
|
// Search for drones files in the services directory and populate the dropdown with directory names
|
||||||
|
const currentDrone = getValueByKey(content, "common", "drone");
|
||||||
|
|
||||||
|
addDropDown(drone, drones, currentDrone);
|
||||||
|
}
|
||||||
|
|
||||||
|
function dockerComposeFileChanged() {
|
||||||
|
if (composeFileSelection.value === "") {
|
||||||
|
populateEditor("");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const composeLocation = composeFileSelection.value + "/docker-compose.yaml";
|
||||||
|
cockpit.file(composeLocation)
|
||||||
|
.read().then((content) => successReadFile(content))
|
||||||
|
.catch(error => failureReadFile(error));
|
||||||
}
|
}
|
||||||
|
|
||||||
function successReadFile(content) {
|
function successReadFile(content) {
|
||||||
|
|
Loading…
Reference in New Issue