mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-22 10:51:02 +01:00
fix: fallback to execCommand to copy logs to clipboard
This commit is contained in:
@@ -4,11 +4,7 @@
|
||||
|
||||
- font is too small in some places / too squished
|
||||
- rethink job polling architecture
|
||||
- maybe move langauges to general tab or put info directly below it to fill
|
||||
space
|
||||
- adding a database requires double click??? im not running into this personally
|
||||
- new quality handling
|
||||
- copy button on logs page not woprking? cant recreate
|
||||
|
||||
# Adaptive Backoff
|
||||
|
||||
|
||||
@@ -133,8 +133,21 @@
|
||||
try {
|
||||
await navigator.clipboard.writeText(logText);
|
||||
alertStore.add('success', 'Log entry copied to clipboard');
|
||||
} catch (err) {
|
||||
alertStore.add('error', 'Failed to copy to clipboard');
|
||||
} catch {
|
||||
// Fallback for non-secure contexts (HTTP + non-localhost)
|
||||
const textArea = document.createElement('textarea');
|
||||
textArea.value = logText;
|
||||
textArea.style.position = 'fixed';
|
||||
textArea.style.left = '-9999px';
|
||||
document.body.appendChild(textArea);
|
||||
textArea.select();
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
alertStore.add('success', 'Log entry copied to clipboard');
|
||||
} catch {
|
||||
alertStore.add('error', 'Failed to copy to clipboard');
|
||||
}
|
||||
document.body.removeChild(textArea);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user