Fix copy base64 link on download tab
parent
9e54885d17
commit
824b0312fd
|
@ -100,7 +100,7 @@ THE SOFTWARE.
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.setupCopy();
|
this.setupCopy(this.$refs.copyTar);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
tabClass(tab) {
|
tabClass(tab) {
|
||||||
|
@ -148,27 +148,27 @@ THE SOFTWARE.
|
||||||
const b64 = btoa(String.fromCharCode(...contents));
|
const b64 = btoa(String.fromCharCode(...contents));
|
||||||
return `echo '${b64}' | base64 --decode | tee ${this.$props.data.global.nginx.nginxConfigDirectory.computed}/${this.tarName} > /dev/null`;
|
return `echo '${b64}' | base64 --decode | tee ${this.$props.data.global.nginx.nginxConfigDirectory.computed}/${this.tarName} > /dev/null`;
|
||||||
},
|
},
|
||||||
setupCopy() {
|
setupCopy(elm) {
|
||||||
const originalText = this.$refs.copyTar.textContent;
|
const originalText = elm.textContent;
|
||||||
|
|
||||||
const resetText = () => {
|
const resetText = () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$refs.copyTar.textContent = originalText;
|
elm.textContent = originalText;
|
||||||
}, 5000);
|
}, 5000);
|
||||||
};
|
};
|
||||||
|
|
||||||
const clipboard = new ClipboardJS(this.$refs.copyTar, {
|
const clipboard = new ClipboardJS(elm, {
|
||||||
text: this.copyTar,
|
text: this.copyTar,
|
||||||
});
|
});
|
||||||
|
|
||||||
clipboard.on('success', e => {
|
clipboard.on('success', e => {
|
||||||
this.$refs.copyTar.textContent = 'Copied';
|
elm.textContent = 'Copied';
|
||||||
e.clearSelection();
|
e.clearSelection();
|
||||||
resetText();
|
resetText();
|
||||||
});
|
});
|
||||||
|
|
||||||
clipboard.on('error', () => {
|
clipboard.on('error', () => {
|
||||||
this.$refs.copyTar.textContent = 'Press Ctrl + C to copy';
|
elm.textContent = 'Press Ctrl + C to copy';
|
||||||
resetText();
|
resetText();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -39,7 +39,7 @@ THE SOFTWARE.
|
||||||
<p>
|
<p>
|
||||||
{{ i18n.templates.setupSections.download.or }}
|
{{ i18n.templates.setupSections.download.or }}
|
||||||
<b>
|
<b>
|
||||||
<a @click="$parent.copyTar">
|
<a ref="copyTar">
|
||||||
{{ i18n.templates.setupSections.download.copyBase64StringOfCompressedConfig }}</a>
|
{{ i18n.templates.setupSections.download.copyBase64StringOfCompressedConfig }}</a>
|
||||||
</b>
|
</b>
|
||||||
<span v-html="i18n.templates.setupSections.download.pasteItInYourServersCommandLineAndExecute"></span>
|
<span v-html="i18n.templates.setupSections.download.pasteItInYourServersCommandLineAndExecute"></span>
|
||||||
|
@ -94,5 +94,8 @@ THE SOFTWARE.
|
||||||
i18n,
|
i18n,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$parent.setupCopy(this.$refs.copyTar);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue