Fix table formatting

This commit is contained in:
2025-03-07 14:13:25 -05:00
parent 0d386e2d9f
commit e9375ee384
4 changed files with 42 additions and 19 deletions

View File

@@ -75,7 +75,7 @@ func EditorHandler(w http.ResponseWriter, r *http.Request) {
AppLayout(title, *identity, session,
Modal(
"password_generator",
Text("Passkey Generator"),
nil,
HxLoad("/app/generator-hx"),
[]Node {
ButtonUIOutline(ModalCloser(), Text("Close")),
@@ -121,13 +121,16 @@ func EditorHandler(w http.ResponseWriter, r *http.Request) {
FormInput(Class("password"), Type("password"), Name("pas"), Value(secret.Password)),
Br(),
FormLabel(Text("Show password?"), For("show")),
FormCheck(Class("checkbox"), ID("show")),
ButtonUIOutline(Class("passtoggle"),
Type("button"),
Flex(Icon(ICON_EYE, 24), Text(" Toggle password visibility")),
),
InlineScript(`
let check = me(".checkbox", me());
let toggle = me(".passtoggle", me());
let passInput = me(".password", me());
check.on("click", () => {
toggle.on("click", () => {
if (passInput.type === "password") {
passInput.type = "text";
} else if (passInput.type === "text") {

View File

@@ -71,17 +71,24 @@ func VaultHxHandler(w http.ResponseWriter, r *http.Request) {
),
func(entry entries.Secret) Node {
return Tr(
TdLeft(Text(entry.Description)),
TdLeft(
Div(
InlineStyle("$me { overflow-x: auto; }"),
Text(entry.Description),
),
),
TdLeft(
IfElse(entry.Username != "",
Flex(
P(Text(entry.Username)),
Span(
Title("Click to copy username"),
InlineStyle("$me { cursor: pointer; }"),
Icon(ICON_COPY, 16),
),
InlineScript(`
Div(
InlineStyle("$me { overflow-x: auto; }"),
Flex(
Span(
Title("Click to copy username"),
InlineStyle("$me { cursor: pointer; }"),
Icon(ICON_COPY, 16),
),
P(Text(entry.Username)),
InlineScript(`
let btn = me("span", me());
let text = me("p", me());
@@ -89,6 +96,7 @@ func VaultHxHandler(w http.ResponseWriter, r *http.Request) {
navigator.clipboard.writeText(text.innerHTML);
});
`),
),
),
Text("---"),
),
@@ -96,14 +104,14 @@ func VaultHxHandler(w http.ResponseWriter, r *http.Request) {
TdLeft(
IfElse(entry.Password != "",
Flex(
P(Text("•••••••")),
Input(Type("hidden"), Value(entry.Password)),
Span(
Class("copy"),
Title("Click to copy password"),
InlineStyle("$me { cursor: pointer; }"),
Icon(ICON_COPY, 16),
),
P(Text("•••••••")),
Input(Type("hidden"), Value(entry.Password)),
InlineScript(`
let copyBtn = me(".copy", me());
let password = me("input", me()).value;
@@ -119,7 +127,10 @@ func VaultHxHandler(w http.ResponseWriter, r *http.Request) {
),
TdLeft(
IfElse(entry.URL != "",
PageLink(security.SanitizationPolicy.Sanitize(entry.URL), Text(entry.URL), true),
Div(
InlineStyle("$me { overflow-x: auto; }"),
PageLink(security.SanitizationPolicy.Sanitize(entry.URL), Text(entry.URL), true),
),
Text("---"),
),
),