mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-26 06:50:45 +01:00
admin: keep the copy confirmation in front of the access key modal (#10856)
* admin: raise nested modals above the ones already open Bootstrap gives every modal and every backdrop the same z-index, so a modal opened while another is showing paints behind it and its buttons cannot be clicked. Viewing an access key secret and then copying a field left the confirmation stuck behind the details modal with no way to dismiss it. Give each nested modal, and the backdrop Bootstrap creates for it, a z-index above what is already on screen, and put back the scroll lock that Bootstrap drops as soon as any one of them closes. * admin: confirm clipboard copies with a toast The access key details modal offers three copy buttons, and each one raised a modal that had to be dismissed before the next copy. Confirm with a toast instead, so the credentials stay in view and nothing has to be clicked away.
This commit is contained in:
1 parent
6c7f184381
commit
bd34565e56
2 files changed
+69
-5
No files matched your search
@@ -634,7 +634,7 @@ function formatDate(date) {
|
||||
function adminCopyToClipboard(text) {
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
showAlert('Copied to clipboard!', 'success');
|
||||
showToast('Copied to clipboard!');
|
||||
}).catch(err => {
|
||||
console.error('Failed to copy text: ', err);
|
||||
fallbackCopyText(text);
|
||||
@@ -660,7 +660,7 @@ function fallbackCopyText(text) {
|
||||
try {
|
||||
const successful = document.execCommand('copy');
|
||||
if (successful) {
|
||||
showAlert('Copied to clipboard!', 'success');
|
||||
showToast('Copied to clipboard!');
|
||||
} else {
|
||||
showAlert('Failed to copy to clipboard', 'danger');
|
||||
}
|
||||
@@ -2265,11 +2265,11 @@ function copyFromInput(inputId) {
|
||||
try {
|
||||
const successful = document.execCommand('copy');
|
||||
if (successful) {
|
||||
showAlert('Copied to clipboard!', 'success');
|
||||
showToast('Copied to clipboard!');
|
||||
} else {
|
||||
// Try modern clipboard API as fallback
|
||||
navigator.clipboard.writeText(input.value).then(() => {
|
||||
showAlert('Copied to clipboard!', 'success');
|
||||
showToast('Copied to clipboard!');
|
||||
}).catch(() => {
|
||||
showAlert('Failed to copy', 'danger');
|
||||
});
|
||||
@@ -2277,7 +2277,7 @@ function copyFromInput(inputId) {
|
||||
} catch (err) {
|
||||
// Try modern clipboard API as fallback
|
||||
navigator.clipboard.writeText(input.value).then(() => {
|
||||
showAlert('Copied to clipboard!', 'success');
|
||||
showToast('Copied to clipboard!');
|
||||
}).catch(() => {
|
||||
showAlert('Failed to copy', 'danger');
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user