Skip to content

Commit cc21a33

Browse files
committed
Make copy-token window responsive and closable
1 parent d344d9e commit cc21a33

3 files changed

Lines changed: 32 additions & 1 deletion

File tree

src/gui/src/UI/Dashboard/TabAccount.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ const TabAccount = {
173173
});
174174
$el_window.find('.dashboard-section-account .copy-auth-token').on('click', function (e) {
175175
UIWindowCopyToken({
176+
show_close_button: true,
176177
show_header: true,
177178
window_options: {
178179
parent_uuid: $el_window.attr('data-element_uuid'),

src/gui/src/UI/UIWindowCopyToken.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ function UIWindowCopyToken (options = {}) {
5555
if ( ! options.show_header ) {
5656
h += `<div class="form-label" style="margin-bottom: 5px; font-size: 13px; color: #666;">${i18n('copy_token_message')}</div>`;
5757
}
58+
if ( options.show_close_button ) {
59+
h += '<div class="qr-code-window-close-btn generic-close-window-button"> &times; </div>';
60+
}
5861
h += `<div style="display: flex; gap: 8px; margin-top: ${options.show_header ? '0' : '15'}px; margin-bottom: 15px;">`;
5962
h += `<input type="text" class="token-input" readonly value="${html_encode(window.auth_token)}" style="flex: 1; font-family: monospace; font-size: 13px;" />`;
6063
h += `<button class="button button-primary copy-token-btn">${i18n('copy')}</button>`;
@@ -85,7 +88,7 @@ function UIWindowCopyToken (options = {}) {
8588
height: 'auto',
8689
dominant: true,
8790
show_in_taskbar: false,
88-
window_class: 'window-publishWebsite',
91+
window_class: 'window-copy-auth-token',
8992
body_css: {
9093
width: 'initial',
9194
height: '100%',

src/gui/src/css/style.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3036,6 +3036,22 @@ label {
30363036
}
30373037

30383038
@media screen and (max-width: 768px) {
3039+
.window-copy-auth-token {
3040+
width: 100% !important;
3041+
max-width: none !important;
3042+
max-height: 100vh !important;
3043+
height: 100vh !important;
3044+
top:0 !important;
3045+
left: 0 !important;
3046+
border-radius: 0 !important;
3047+
}
3048+
3049+
.window-copy-auth-token .window-body {
3050+
box-sizing: border-box !important;
3051+
display: flex;
3052+
flex-direction: column;
3053+
justify-content: center;
3054+
}
30393055

30403056
.taskbar {
30413057
justify-content: center;
@@ -4490,6 +4506,17 @@ fieldset[name=number-code] {
44904506
}
44914507

44924508
@media (max-width:480px) {
4509+
.window-copy-auth-token {
4510+
width: 100% !important;
4511+
max-width: none !important;
4512+
height: 100% !important;
4513+
top:0 !important;
4514+
left: 0 !important;
4515+
border-radius: 0 !important;
4516+
}
4517+
.window-copy-auth-token .window-body {
4518+
box-sizing: border-box !important;
4519+
}
44934520
.puter-auth-dialog-content {
44944521
padding: 50px 20px;
44954522
}

0 commit comments

Comments
 (0)