From 6a21d5bd0b701b071e7d25f8408fd19e2ba7bba6 Mon Sep 17 00:00:00 2001 From: raul Date: Fri, 7 Jun 2024 08:31:52 +0200 Subject: [PATCH] UX improvements --- cmd/httpServer.go | 2 +- cmd/templates/command.html | 17 +++++++++++++---- cmd/templates/index.html | 14 +++++++++++--- cmd/templates/style.css | 26 +++++++++++++++++++------- 4 files changed, 44 insertions(+), 15 deletions(-) diff --git a/cmd/httpServer.go b/cmd/httpServer.go index 0e38c8d..f0396e2 100644 --- a/cmd/httpServer.go +++ b/cmd/httpServer.go @@ -75,5 +75,5 @@ func execCMD(c *gin.Context) { return } prettyOut := strings.Replace(out, "\n", "
", -1) - c.String(http.StatusOK, "$ "+prettyOut) + c.String(http.StatusOK, "$ "+command+"
"+prettyOut) } diff --git a/cmd/templates/command.html b/cmd/templates/command.html index 4269981..10f64a3 100644 --- a/cmd/templates/command.html +++ b/cmd/templates/command.html @@ -13,17 +13,26 @@
-

Hello {{ .UserAgent }}

+ + +
-

Executing commands for {{ .Client.ClientBasicInfo.Hostname }}

+

Executing commands for {{ .Client.ClientBasicInfo.Hostname }}


+
- +
-
diff --git a/cmd/templates/index.html b/cmd/templates/index.html index dd2fd92..3fecba4 100644 --- a/cmd/templates/index.html +++ b/cmd/templates/index.html @@ -13,7 +13,16 @@
-

Hello {{ .UserAgent }}

+ + +

Current clients

@@ -26,9 +35,8 @@ Username Hostname Operating System - Actions - Execute commands + CMD diff --git a/cmd/templates/style.css b/cmd/templates/style.css index 16e99bf..3c1ffbf 100644 --- a/cmd/templates/style.css +++ b/cmd/templates/style.css @@ -31,10 +31,9 @@ td.left { padding-left: 5px; } -td.date { +td { text-align: center; - padding-left: 5px; - padding-right: 5px; + padding: 5px; } on { @@ -99,9 +98,10 @@ form { text-align: center; } -td a { +td a.clickable { display: block; width: 100%; + margin: 0; } a { @@ -139,13 +139,25 @@ footer { } div#command { - width: 50%; - height: 40%; + width: 100%; + height: 50%; border: 2px solid black; overflow: scroll; + padding-bottom: 30px; text-wrap: nowrap; } +input#commandinput { + width: 60%; + height: 20px; +} + +input#commandinput:focus { + outline: 2px solid #ff6e00; + +} + + @media (max-width: 600px) { #main { width: 60vw; @@ -160,7 +172,7 @@ div#command { top: 1px; left: 1px; - outline: solid 1px black; + /* outline: solid 1px black; */ justify-content: center; align-items: center; height: 99vh;