From beb6828520086a1cf6c8fe1299cf7c4916e7c4ba Mon Sep 17 00:00:00 2001 From: Ruslan Date: Tue, 28 Apr 2026 13:47:46 +0000 Subject: [PATCH] Add credentials panel on view page; remove copy buttons from dashboard cards --- app/main.py | 65 +++++++++++++++++++++++++++++++++++- app/static/style.css | 20 ----------- app/templates/dashboard.html | 18 ---------- 3 files changed, 64 insertions(+), 39 deletions(-) diff --git a/app/main.py b/app/main.py index d98a9c5..63c57b7 100644 --- a/app/main.py +++ b/app/main.py @@ -2511,6 +2511,42 @@ def session_view_page(session_id: str, request: Request, user: User = Depends(re except Exception: iframe_src = None if iframe_src: + creds_html = "" + if service.type != ServiceType.RDP and (service.svc_login or service.svc_password): + rows = "" + if service.svc_login: + login_esc = service.svc_login.replace('"', '"').replace('<', '<') + rows += f'''
Логин{login_esc}
''' + if service.svc_password: + pass_esc = service.svc_password.replace('"', '"').replace('<', '<') + rows += f'''
Пароль{pass_esc}
''' + if service.svc_cred_hint: + hint_esc = service.svc_cred_hint.replace('<', '<') + rows += f'''

{hint_esc}

''' + creds_html = f''' +
+ + {rows} +
+ ''' + return HTMLResponse( content=f""" @@ -2520,10 +2556,37 @@ def session_view_page(session_id: str, request: Request, user: User = Depends(re {service.name} - + {creds_html} """.strip() diff --git a/app/static/style.css b/app/static/style.css index ee80a12..93acef8 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -392,26 +392,6 @@ button { letter-spacing: .12em; font-size: 0.9rem; } -.svc-cred-copy { - flex-shrink: 0; - width: 26px; - height: 26px; - border: 1px solid #b0c8de; - border-radius: 6px; - background: #fff; - color: #3a6d96; - cursor: pointer; - display: grid; - place-items: center; - padding: 0; - font-size: 0.78rem; - transition: background .15s, color .15s, border-color .15s; - font-family: sans-serif; -} -.svc-cred-copy::before { content: "\2398"; font-size: 0.9rem; } -.svc-cred-copy.copied { background: #1a8a4a; border-color: #1a8a4a; color: #fff; } -.svc-cred-copy.copied::before { content: "\2713"; } -.svc-cred-copy:hover:not(.copied) { background: #e6f0f9; border-color: #7aabcf; } .tile-link { position: absolute; diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html index def2c9f..410d27b 100644 --- a/app/templates/dashboard.html +++ b/app/templates/dashboard.html @@ -91,14 +91,12 @@
Логин {{ service.svc_login }} -
{% endif %} {% if service.svc_password %}
Пароль {{ service.svc_password }} -
{% endif %} {% if service.svc_cred_hint %} @@ -219,21 +217,5 @@ }); })(); -