Adds info log for interactive-editor to store

This commit is contained in:
Alicia Sykes
2021-10-27 21:24:32 +01:00
parent dcdd1018d2
commit 08072f1fb6
3 changed files with 25 additions and 2 deletions

View File

@@ -34,9 +34,9 @@ import JsYaml from 'js-yaml';
import Button from '@/components/FormElements/Button';
import StoreKeys from '@/utils/StoreMutations';
import { modalNames } from '@/utils/defaults';
import DownloadConfigIcon from '@/assets/interface-icons/config-download-file.svg';
import CopyConfigIcon from '@/assets/interface-icons/interactive-editor-copy-clipboard.svg';
import { InfoHandler } from '@/utils/ErrorHandler';
export default {
name: 'ExportConfigMenu',
@@ -70,11 +70,13 @@ export default {
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
InfoHandler('Config downloaded as YAML file', 'Interactive Editor');
},
copyConfigToClipboard() {
const config = this.convertJsonToYaml();
navigator.clipboard.writeText(config);
this.$toasted.show(this.$t('config.data-copied-msg'));
InfoHandler('Config copied to clipboard', 'Interactive Editor');
},
modalClosed() {
this.$store.commit(StoreKeys.SET_MODAL_OPEN, false);