feat(web-ui): clipboard copy feedback on Troubleshooting logs (#4803)
Co-authored-by: eduardomozart <2974895+eduardomozart@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
5d219c7aa7
commit
655b1902bb
@@ -177,7 +177,8 @@
|
|||||||
<chevrons-down :size="18" class="icon"></chevrons-down>
|
<chevrons-down :size="18" class="icon"></chevrons-down>
|
||||||
</button>
|
</button>
|
||||||
<button class="log-nav-btn" @click="copyLogs" title="Copy Logs">
|
<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>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -195,6 +196,7 @@
|
|||||||
import {
|
import {
|
||||||
AlertCircle,
|
AlertCircle,
|
||||||
AlertTriangle,
|
AlertTriangle,
|
||||||
|
Check,
|
||||||
CheckCircle,
|
CheckCircle,
|
||||||
ChevronDown,
|
ChevronDown,
|
||||||
ChevronUp,
|
ChevronUp,
|
||||||
@@ -214,6 +216,7 @@
|
|||||||
Navbar,
|
Navbar,
|
||||||
AlertCircle,
|
AlertCircle,
|
||||||
AlertTriangle,
|
AlertTriangle,
|
||||||
|
Check,
|
||||||
CheckCircle,
|
CheckCircle,
|
||||||
ChevronDown,
|
ChevronDown,
|
||||||
ChevronUp,
|
ChevronUp,
|
||||||
@@ -234,6 +237,7 @@
|
|||||||
closeAppStatus: null,
|
closeAppStatus: null,
|
||||||
ddResetPressed: false,
|
ddResetPressed: false,
|
||||||
ddResetStatus: null,
|
ddResetStatus: null,
|
||||||
|
logsCopied: false,
|
||||||
logs: 'Loading...',
|
logs: 'Loading...',
|
||||||
logFilter: null,
|
logFilter: null,
|
||||||
logInterval: null,
|
logInterval: null,
|
||||||
@@ -375,6 +379,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this._logsCopyTimeout = null;
|
||||||
fetch("/api/config")
|
fetch("/api/config")
|
||||||
.then((r) => r.json())
|
.then((r) => r.json())
|
||||||
.then((r) => {
|
.then((r) => {
|
||||||
@@ -468,7 +473,20 @@
|
|||||||
},
|
},
|
||||||
copyLogs() {
|
copyLogs() {
|
||||||
// Copy the filtered view if a filter is active.
|
// 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() {
|
restart() {
|
||||||
this.restartPressed = true;
|
this.restartPressed = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user