Include ability to remotely execute commands

This commit is contained in:
raul 2024-06-06 09:29:39 +02:00
parent 1f95d44e3e
commit f0c31dcd95
3 changed files with 10 additions and 4 deletions

View File

@ -6,7 +6,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="/style.css" rel="stylesheet">
<script href="htmx.js" integrity="sha384-qbtR4rS9RrUMECUWDWM2+YGgN3U4V4ZncZ0BvUcg9FGct0jqXz3PUdVpU1p0yrXS"
<script src="/htmx.js" integrity="sha384-qbtR4rS9RrUMECUWDWM2+YGgN3U4V4ZncZ0BvUcg9FGct0jqXz3PUdVpU1p0yrXS"
crossorigin="anonymous"></script>
</head>
@ -15,10 +15,14 @@
<div id="main">
<p>Hello {{ .UserAgent }}</p>
<hr>
<h2>Executing commands for {{ .Client.ClientBasicInfo.Hostname }}</h2>
<hr>
<div id=command>
</div>
<input type="text" name="command" value="" hx-post="command/{{ .Client.ClientID }}" hx-target="command"
hx-trigger="keyup[keyCode==13]">
<form hx-post="/command/{{ .Client.ClientID }}" hx-target="#command" hx-on--after-request="this.reset()">
<label><input type="text" name="cmd" value=""></label>
<button type="submit" id="but">Submit</button>
</form>
<hr>
</div>
</div>

View File

@ -6,7 +6,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="/style.css" rel="stylesheet">
<script href="htmx.js" integrity="sha384-qbtR4rS9RrUMECUWDWM2+YGgN3U4V4ZncZ0BvUcg9FGct0jqXz3PUdVpU1p0yrXS"
<script src="/htmx.js" integrity="sha384-qbtR4rS9RrUMECUWDWM2+YGgN3U4V4ZncZ0BvUcg9FGct0jqXz3PUdVpU1p0yrXS"
crossorigin="anonymous"></script>
</head>

View File

@ -142,6 +142,8 @@ div#command {
width: 50%;
height: 40%;
border: 2px solid black;
overflow: scroll;
text-wrap: nowrap;
}
@media (max-width: 600px) {