Always select the support bundle
This commit is contained in:
parent
b89d764b88
commit
d8c8f1c039
@ -456,28 +456,21 @@
|
|||||||
const bundle = await fetchWithAuth("IntroSkipper/SupportBundle", "GET", null);
|
const bundle = await fetchWithAuth("IntroSkipper/SupportBundle", "GET", null);
|
||||||
const bundleText = await bundle.text();
|
const bundleText = await bundle.text();
|
||||||
|
|
||||||
// Display it to the user
|
// Display it to the user and select all
|
||||||
document.querySelector("textarea#supportBundle").value = bundleText;
|
|
||||||
|
|
||||||
// Attempt to copy it to the clipboard automatically, falling back to selecting
|
|
||||||
// all text and prompting the user to press ctrl c.
|
|
||||||
try {
|
|
||||||
navigator.clipboard.writeText(bundleText)
|
|
||||||
Dashboard.alert("Support bundle copied to clipboard");
|
|
||||||
} catch {
|
|
||||||
supportBundleCopyFailed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if the automatic bundle copy fails (likely due to an insecure context), have the
|
|
||||||
// user copy it manually.
|
|
||||||
function supportBundleCopyFailed() {
|
|
||||||
const ta = document.querySelector("textarea#supportBundle");
|
const ta = document.querySelector("textarea#supportBundle");
|
||||||
|
ta.value = bundleText;
|
||||||
ta.focus();
|
ta.focus();
|
||||||
ta.setSelectionRange(0, ta.value.length);
|
ta.setSelectionRange(0, ta.value.length);
|
||||||
|
|
||||||
|
// Attempt to copy it to the clipboard automatically, falling back
|
||||||
|
// to prompting the user to press Ctrl + C.
|
||||||
|
try {
|
||||||
|
navigator.clipboard.writeText(bundleText);
|
||||||
|
Dashboard.alert("Support bundle copied to clipboard");
|
||||||
|
} catch {
|
||||||
Dashboard.alert("Press Ctrl+C to copy support bundle");
|
Dashboard.alert("Press Ctrl+C to copy support bundle");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// show changed, populate seasons
|
// show changed, populate seasons
|
||||||
async function showChanged() {
|
async function showChanged() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user