From feb885a20446cc6b3da47366c4e2eab3954048a7 Mon Sep 17 00:00:00 2001 From: SimFG Date: Thu, 9 Jan 2025 10:03:02 +0800 Subject: [PATCH] enhance: [2.4] update the expr static web page (#39089) issue: #39083 pr: #39082 /kind improvement Three new functions of the static web page: 1. The input box can be expanded and scrolled if it exceeds the maximum size 2. Input history 3. It will simply check whether the quotation marks and brackets appear in pairs Signed-off-by: SimFG --- internal/http/static/index.html | 144 +++++++++++++++++++++++++++++++- 1 file changed, 140 insertions(+), 4 deletions(-) diff --git a/internal/http/static/index.html b/internal/http/static/index.html index 246f8970db..4f74f1297c 100644 --- a/internal/http/static/index.html +++ b/internal/http/static/index.html @@ -41,7 +41,8 @@ font-size: 1.25em; } .card input, - .card button { + .card button, + .card textarea { width: 100%; box-sizing: border-box; padding: 10px; @@ -50,6 +51,18 @@ border-radius: 3px; font-size: 1em; } + .card textarea { + resize: vertical; + overflow-y: auto; + } + #auth { + resize: none; + max-height: 50px; + } + #code { + min-height: 100px; + max-height: 200px; + } .card button { background-color: #007bff; color: #ffffff; @@ -59,6 +72,30 @@ .card button:hover { background-color: #0056b3; } + .input-group { + position: relative; + } + .history { + max-height: 200px; + overflow-x: auto; + overflow-y: auto; + position: absolute; + top: 0; + left: -320px; + display: none; + border: 1px solid #ccc; + border-radius: 4px; + padding: 5px; + background-color: #f9f9f9; + width: 300px; + z-index: 100; + } + .history div { + padding: 5px; + } + .history div:hover { + background-color: #e9ecef; + } .result { text-align: left; } @@ -84,7 +121,6 @@ height: 35%; margin: 0px; } - .hint p { width: 100%; height: 100%; @@ -111,8 +147,16 @@

Input

- - + +
+
+ +
+
+
+ +
@@ -135,6 +179,10 @@ Currently, the objects injected by expr include: param, proxy 3. Functions with multiple return values cannot be chained.

\ No newline at end of file