ci(frontend): added in big button for docs lol
This commit is contained in:
@@ -58,7 +58,19 @@
|
||||
<button type="button" id="btnCopyLatest">Send</button>
|
||||
</form>
|
||||
</div>
|
||||
<button id="btnUpdateServer">Server Update</button>
|
||||
<div>
|
||||
<form onsubmit="return false;">
|
||||
<input
|
||||
type="text"
|
||||
id="updateServerInput"
|
||||
placeholder="Type something here"
|
||||
/>
|
||||
<button type="button" id="updateServerButton">
|
||||
Update Server
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
>
|
||||
</div>
|
||||
|
||||
<div id="logWindow"></div>
|
||||
@@ -144,6 +156,10 @@
|
||||
window.onload = () => {
|
||||
const input = document.getElementById("myInput");
|
||||
const button = document.getElementById("btnCopyLatest");
|
||||
const updateServerInput =
|
||||
document.getElementById("updateServerInput");
|
||||
const updateServerButton =
|
||||
document.getElementById("updateServerButton");
|
||||
|
||||
button.onclick = () => {
|
||||
const fromMyInput = input.value;
|
||||
@@ -162,14 +178,24 @@
|
||||
|
||||
input.focus();
|
||||
};
|
||||
};
|
||||
|
||||
document.getElementById("btnUpdateServer").onclick = () => {
|
||||
socket.emit("update", {
|
||||
action: "update",
|
||||
target: "usmcd1vms036",
|
||||
}); // "frontend" = payload target
|
||||
logMessage("update", "Update The server");
|
||||
updateServerButton.onclick = () => {
|
||||
const fromMyInput = updateServerInput.value;
|
||||
if (!fromMyInput) return;
|
||||
|
||||
// Emit to backend (adjust event name as required)
|
||||
socket.emit("update", {
|
||||
action: "update",
|
||||
target: fromMyInput,
|
||||
});
|
||||
|
||||
// You can define your own logMessage function
|
||||
logMessage("info", `Updating to ${fromMyInput}`);
|
||||
|
||||
input.value = "";
|
||||
|
||||
input.focus();
|
||||
};
|
||||
};
|
||||
|
||||
socket.on("logs", (msg) => logMessage("logs", msg));
|
||||
|
||||
Reference in New Issue
Block a user