Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src_assets/common/assets/web/troubleshooting.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ <h2 id="logs">{{ $t('troubleshooting.logs') }}</h2>
<chevrons-down :size="18" class="icon"></chevrons-down>
</button>
<button class="log-nav-btn" @click="copyLogs" title="Copy Logs">
<copy :size="18" class="icon"></copy>
<check :size="18" class="icon text-success" v-if="logsCopied"></check>
<copy :size="18" class="icon" v-else></copy>
</button>
</div>
</div>
Expand All @@ -195,6 +196,7 @@ <h2 id="logs">{{ $t('troubleshooting.logs') }}</h2>
import {
AlertCircle,
AlertTriangle,
Check,
CheckCircle,
ChevronDown,
ChevronUp,
Expand All @@ -214,6 +216,7 @@ <h2 id="logs">{{ $t('troubleshooting.logs') }}</h2>
Navbar,
AlertCircle,
AlertTriangle,
Check,
CheckCircle,
ChevronDown,
ChevronUp,
Expand All @@ -234,6 +237,7 @@ <h2 id="logs">{{ $t('troubleshooting.logs') }}</h2>
closeAppStatus: null,
ddResetPressed: false,
ddResetStatus: null,
logsCopied: false,
logs: 'Loading...',
logFilter: null,
logInterval: null,
Expand Down Expand Up @@ -375,6 +379,7 @@ <h2 id="logs">{{ $t('troubleshooting.logs') }}</h2>
}
},
created() {
this._logsCopyTimeout = null;
fetch("/api/config")
.then((r) => r.json())
.then((r) => {
Expand Down Expand Up @@ -468,7 +473,20 @@ <h2 id="logs">{{ $t('troubleshooting.logs') }}</h2>
},
copyLogs() {
// Copy the filtered view if a filter is active.
navigator.clipboard.writeText(this.actualLogs);
navigator.clipboard.writeText(this.actualLogs).then(() => {
// Clear any existing reset timer (handles rapid successive clicks).
if (this._logsCopyTimeout) clearTimeout(this._logsCopyTimeout);

// Show checkmark feedback.
this.logsCopied = true;

// Revert icon after 2 seconds.
this._logsCopyTimeout = setTimeout(() => {
this.logsCopied = false;
}, 2000);
}).catch((err) => {
console.error('Failed to copy logs:', err);
});
},
restart() {
this.restartPressed = true;
Expand Down
Loading