2021-01-05 17:25:18 +01:00
|
|
|
<template>
|
2021-07-20 16:59:59 +02:00
|
|
|
<div v-show="isSelected" class="workspace-query-tab column col-12 columns col-gapless">
|
2021-01-05 17:25:18 +01:00
|
|
|
<div class="workspace-query-runner column col-12">
|
|
|
|
<div class="workspace-query-runner-footer">
|
|
|
|
<div class="workspace-query-buttons">
|
|
|
|
<button
|
|
|
|
class="btn btn-primary btn-sm"
|
|
|
|
:disabled="!isChanged"
|
|
|
|
:class="{'loading':isSaving}"
|
2021-04-20 17:39:15 +02:00
|
|
|
title="CTRL+S"
|
2021-01-05 17:25:18 +01:00
|
|
|
@click="saveChanges"
|
|
|
|
>
|
2021-07-09 15:51:02 +02:00
|
|
|
<i class="mdi mdi-24px mdi-content-save mr-1" />
|
2021-01-05 17:25:18 +01:00
|
|
|
<span>{{ $t('word.save') }}</span>
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
:disabled="!isChanged"
|
|
|
|
class="btn btn-link btn-sm mr-0"
|
|
|
|
:title="$t('message.clearChanges')"
|
|
|
|
@click="clearChanges"
|
|
|
|
>
|
2021-07-09 15:51:02 +02:00
|
|
|
<i class="mdi mdi-24px mdi-delete-sweep mr-1" />
|
2021-01-05 17:25:18 +01:00
|
|
|
<span>{{ $t('word.clear') }}</span>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<div class="divider-vert py-3" />
|
|
|
|
|
|
|
|
<button
|
2021-02-25 12:39:50 +01:00
|
|
|
class="btn btn-dark btn-sm"
|
2021-01-05 17:25:18 +01:00
|
|
|
:disabled="isChanged"
|
2021-02-25 12:39:50 +01:00
|
|
|
@click="runRoutineCheck"
|
2021-01-05 17:25:18 +01:00
|
|
|
>
|
2021-07-09 15:51:02 +02:00
|
|
|
<i class="mdi mdi-24px mdi-play mr-1" />
|
2021-01-05 17:25:18 +01:00
|
|
|
<span>{{ $t('word.run') }}</span>
|
|
|
|
</button>
|
|
|
|
<button class="btn btn-dark btn-sm" @click="showParamsModal">
|
2021-07-09 15:51:02 +02:00
|
|
|
<i class="mdi mdi-24px mdi-dots-horizontal mr-1" />
|
2021-01-05 17:25:18 +01:00
|
|
|
<span>{{ $t('word.parameters') }}</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2021-07-20 16:59:59 +02:00
|
|
|
<div class="workspace-query-info">
|
|
|
|
<div class="d-flex" :title="$t('word.schema')">
|
|
|
|
<i class="mdi mdi-18px mdi-database mr-1" /><b>{{ schema }}</b>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-05 17:25:18 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-08-10 18:12:13 +02:00
|
|
|
<div class="container">
|
|
|
|
<div class="columns">
|
|
|
|
<div class="column col-auto">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-label">
|
|
|
|
{{ $t('word.name') }}
|
|
|
|
</label>
|
|
|
|
<input
|
|
|
|
ref="firstInput"
|
|
|
|
v-model="localRoutine.name"
|
|
|
|
class="form-input"
|
|
|
|
:class="{'is-error': !isTableNameValid}"
|
|
|
|
type="text"
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="customizations.languages" class="column col-auto">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-label">
|
|
|
|
{{ $t('word.language') }}
|
|
|
|
</label>
|
|
|
|
<select v-model="localRoutine.language" class="form-select">
|
|
|
|
<option v-for="language in customizations.languages" :key="language">
|
|
|
|
{{ language }}
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="customizations.definer" class="column col-auto">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-label">
|
|
|
|
{{ $t('word.definer') }}
|
|
|
|
</label>
|
|
|
|
<select
|
|
|
|
v-if="workspace.users.length"
|
|
|
|
v-model="localRoutine.definer"
|
|
|
|
class="form-select"
|
|
|
|
>
|
|
|
|
<option value="">
|
|
|
|
{{ $t('message.currentUser') }}
|
|
|
|
</option>
|
|
|
|
<option
|
|
|
|
v-for="user in workspace.users"
|
|
|
|
:key="`${user.name}@${user.host}`"
|
|
|
|
:value="`\`${user.name}\`@\`${user.host}\``"
|
|
|
|
>
|
|
|
|
{{ user.name }}@{{ user.host }}
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
<select v-if="!workspace.users.length" class="form-select">
|
|
|
|
<option value="">
|
|
|
|
{{ $t('message.currentUser') }}
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="customizations.comment" class="column">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-label">
|
|
|
|
{{ $t('word.comment') }}
|
|
|
|
</label>
|
|
|
|
<input
|
|
|
|
v-model="localRoutine.comment"
|
|
|
|
class="form-input"
|
|
|
|
type="text"
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="column col-auto">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-label">
|
|
|
|
{{ $t('message.sqlSecurity') }}
|
|
|
|
</label>
|
|
|
|
<select v-model="localRoutine.security" class="form-select">
|
|
|
|
<option>DEFINER</option>
|
|
|
|
<option>INVOKER</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="customizations.procedureDataAccess" class="column col-auto">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-label">
|
|
|
|
{{ $t('message.dataAccess') }}
|
|
|
|
</label>
|
|
|
|
<select v-model="localRoutine.dataAccess" class="form-select">
|
|
|
|
<option>CONTAINS SQL</option>
|
|
|
|
<option>NO SQL</option>
|
|
|
|
<option>READS SQL DATA</option>
|
|
|
|
<option>MODIFIES SQL DATA</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="customizations.procedureDeterministic" class="column col-auto">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="form-label d-invisible">.</label>
|
|
|
|
<label class="form-checkbox form-inline">
|
|
|
|
<input v-model="localRoutine.deterministic" type="checkbox"><i class="form-icon" /> {{ $t('word.deterministic') }}
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-22 18:27:45 +01:00
|
|
|
<div class="workspace-query-results column col-12 mt-2 p-relative">
|
|
|
|
<BaseLoader v-if="isLoading" />
|
2021-01-05 17:25:18 +01:00
|
|
|
<label class="form-label ml-2">{{ $t('message.routineBody') }}</label>
|
|
|
|
<QueryEditor
|
2021-03-08 18:11:00 +01:00
|
|
|
v-show="isSelected"
|
|
|
|
:key="`${routine}-${_uid}`"
|
2021-01-05 17:25:18 +01:00
|
|
|
ref="queryEditor"
|
2022-04-21 14:39:24 +02:00
|
|
|
v-model="localRoutine.sql"
|
2021-01-05 17:25:18 +01:00
|
|
|
:workspace="workspace"
|
|
|
|
:schema="schema"
|
|
|
|
:height="editorHeight"
|
|
|
|
/>
|
|
|
|
</div>
|
2021-08-12 09:54:13 +02:00
|
|
|
<WorkspaceTabPropsRoutineParamsModal
|
2021-01-05 17:25:18 +01:00
|
|
|
v-if="isParamsModal"
|
|
|
|
:local-parameters="localRoutine.parameters"
|
|
|
|
:workspace="workspace"
|
|
|
|
:routine="localRoutine.name"
|
|
|
|
@hide="hideParamsModal"
|
|
|
|
@parameters-update="parametersUpdate"
|
|
|
|
/>
|
2021-02-25 12:39:50 +01:00
|
|
|
<ModalAskParameters
|
|
|
|
v-if="isAskingParameters"
|
|
|
|
:local-routine="localRoutine"
|
2021-04-10 20:38:46 +02:00
|
|
|
:client="workspace.client"
|
2021-02-25 12:39:50 +01:00
|
|
|
@confirm="runRoutine"
|
|
|
|
@close="hideAskParamsModal"
|
|
|
|
/>
|
2021-01-05 17:25:18 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-04-30 00:47:37 +02:00
|
|
|
import { useNotificationsStore } from '@/stores/notifications';
|
|
|
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
2021-02-24 12:46:31 +01:00
|
|
|
import { uidGen } from 'common/libs/uidGen';
|
2021-01-05 17:25:18 +01:00
|
|
|
import QueryEditor from '@/components/QueryEditor';
|
2021-01-22 18:27:45 +01:00
|
|
|
import BaseLoader from '@/components/BaseLoader';
|
2021-08-12 09:54:13 +02:00
|
|
|
import WorkspaceTabPropsRoutineParamsModal from '@/components/WorkspaceTabPropsRoutineParamsModal';
|
2021-02-25 12:39:50 +01:00
|
|
|
import ModalAskParameters from '@/components/ModalAskParameters';
|
2021-01-05 17:25:18 +01:00
|
|
|
import Routines from '@/ipc-api/Routines';
|
2022-04-30 00:47:37 +02:00
|
|
|
import { storeToRefs } from 'pinia';
|
2021-01-05 17:25:18 +01:00
|
|
|
|
|
|
|
export default {
|
2021-08-12 09:54:13 +02:00
|
|
|
name: 'WorkspaceTabPropsRoutine',
|
2021-01-05 17:25:18 +01:00
|
|
|
components: {
|
|
|
|
QueryEditor,
|
2021-01-22 18:27:45 +01:00
|
|
|
BaseLoader,
|
2021-08-12 09:54:13 +02:00
|
|
|
WorkspaceTabPropsRoutineParamsModal,
|
2021-02-25 12:39:50 +01:00
|
|
|
ModalAskParameters
|
2021-01-05 17:25:18 +01:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
connection: Object,
|
2021-07-20 16:59:59 +02:00
|
|
|
routine: String,
|
|
|
|
isSelected: Boolean,
|
|
|
|
schema: String
|
2021-01-05 17:25:18 +01:00
|
|
|
},
|
2022-04-30 00:47:37 +02:00
|
|
|
setup () {
|
|
|
|
const { addNotification } = useNotificationsStore();
|
|
|
|
const workspacesStore = useWorkspacesStore();
|
|
|
|
|
|
|
|
const { getSelected: selectedWorkspace } = storeToRefs(workspacesStore);
|
|
|
|
|
|
|
|
const {
|
|
|
|
getWorkspace,
|
|
|
|
refreshStructure,
|
|
|
|
renameTabs,
|
|
|
|
newTab,
|
|
|
|
changeBreadcrumbs,
|
|
|
|
setUnsavedChanges
|
|
|
|
} = workspacesStore;
|
|
|
|
|
|
|
|
return {
|
|
|
|
addNotification,
|
|
|
|
selectedWorkspace,
|
|
|
|
getWorkspace,
|
|
|
|
refreshStructure,
|
|
|
|
renameTabs,
|
|
|
|
newTab,
|
|
|
|
changeBreadcrumbs,
|
|
|
|
setUnsavedChanges
|
|
|
|
};
|
|
|
|
},
|
2021-01-05 17:25:18 +01:00
|
|
|
data () {
|
|
|
|
return {
|
2021-01-22 18:27:45 +01:00
|
|
|
isLoading: false,
|
2021-01-05 17:25:18 +01:00
|
|
|
isSaving: false,
|
|
|
|
isParamsModal: false,
|
2021-02-25 12:39:50 +01:00
|
|
|
isAskingParameters: false,
|
2021-01-05 17:25:18 +01:00
|
|
|
originalRoutine: null,
|
|
|
|
localRoutine: { sql: '' },
|
|
|
|
lastRoutine: null,
|
|
|
|
sqlProxy: '',
|
|
|
|
editorHeight: 300
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
workspace () {
|
|
|
|
return this.getWorkspace(this.connection.uid);
|
|
|
|
},
|
2021-08-10 18:12:13 +02:00
|
|
|
customizations () {
|
|
|
|
return this.workspace.customizations;
|
|
|
|
},
|
2021-07-20 16:59:59 +02:00
|
|
|
tabUid () {
|
2022-04-22 17:49:13 +02:00
|
|
|
return this.$vnode?.key;
|
2021-01-05 17:25:18 +01:00
|
|
|
},
|
|
|
|
isChanged () {
|
|
|
|
return JSON.stringify(this.originalRoutine) !== JSON.stringify(this.localRoutine);
|
|
|
|
},
|
|
|
|
isDefinerInUsers () {
|
|
|
|
return this.originalRoutine ? this.workspace.users.some(user => this.originalRoutine.definer === `\`${user.name}\`@\`${user.host}\``) : true;
|
|
|
|
},
|
2021-08-10 18:12:13 +02:00
|
|
|
isTableNameValid () {
|
|
|
|
return this.localRoutine.name !== '';
|
|
|
|
},
|
2021-01-05 17:25:18 +01:00
|
|
|
schemaTables () {
|
|
|
|
const schemaTables = this.workspace.structure
|
|
|
|
.filter(schema => schema.name === this.schema)
|
|
|
|
.map(schema => schema.tables);
|
|
|
|
|
|
|
|
return schemaTables.length ? schemaTables[0].filter(table => table.type === 'table') : [];
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
2021-07-20 16:59:59 +02:00
|
|
|
async schema () {
|
2021-01-05 17:25:18 +01:00
|
|
|
if (this.isSelected) {
|
|
|
|
await this.getRoutineData();
|
|
|
|
this.$refs.queryEditor.editor.session.setValue(this.localRoutine.sql);
|
|
|
|
this.lastRoutine = this.routine;
|
|
|
|
}
|
|
|
|
},
|
2021-07-20 16:59:59 +02:00
|
|
|
async routine () {
|
|
|
|
if (this.isSelected) {
|
2021-01-05 17:25:18 +01:00
|
|
|
await this.getRoutineData();
|
|
|
|
this.$refs.queryEditor.editor.session.setValue(this.localRoutine.sql);
|
|
|
|
this.lastRoutine = this.routine;
|
|
|
|
}
|
|
|
|
},
|
2021-07-20 16:59:59 +02:00
|
|
|
async isSelected (val) {
|
|
|
|
if (val) {
|
|
|
|
this.changeBreadcrumbs({ schema: this.schema, routine: this.routine });
|
|
|
|
|
2021-07-23 10:56:41 +02:00
|
|
|
setTimeout(() => {
|
|
|
|
this.resizeQueryEditor();
|
|
|
|
}, 200);
|
|
|
|
|
2021-07-20 16:59:59 +02:00
|
|
|
if (this.lastRoutine !== this.routine)
|
|
|
|
this.getRoutineData();
|
|
|
|
}
|
|
|
|
},
|
2021-01-05 17:25:18 +01:00
|
|
|
isChanged (val) {
|
2021-07-20 16:59:59 +02:00
|
|
|
this.setUnsavedChanges({ uid: this.connection.uid, tUid: this.tabUid, isChanged: val });
|
2021-01-05 17:25:18 +01:00
|
|
|
}
|
|
|
|
},
|
2021-07-20 16:59:59 +02:00
|
|
|
async created () {
|
|
|
|
await this.getRoutineData();
|
|
|
|
this.$refs.queryEditor.editor.session.setValue(this.localRoutine.sql);
|
|
|
|
window.addEventListener('keydown', this.onKey);
|
|
|
|
},
|
2021-01-05 17:25:18 +01:00
|
|
|
mounted () {
|
|
|
|
window.addEventListener('resize', this.resizeQueryEditor);
|
|
|
|
},
|
2022-04-21 14:39:24 +02:00
|
|
|
unmounted () {
|
2021-01-05 17:25:18 +01:00
|
|
|
window.removeEventListener('resize', this.resizeQueryEditor);
|
|
|
|
},
|
2022-04-21 14:39:24 +02:00
|
|
|
beforeUnmount () {
|
2021-04-20 17:39:15 +02:00
|
|
|
window.removeEventListener('keydown', this.onKey);
|
|
|
|
},
|
2021-01-05 17:25:18 +01:00
|
|
|
methods: {
|
|
|
|
async getRoutineData () {
|
|
|
|
if (!this.routine) return;
|
2021-07-20 16:59:59 +02:00
|
|
|
|
2021-01-22 18:27:45 +01:00
|
|
|
this.localRoutine = { sql: '' };
|
|
|
|
this.isLoading = true;
|
2021-07-20 16:59:59 +02:00
|
|
|
this.lastRoutine = this.routine;
|
2021-01-05 17:25:18 +01:00
|
|
|
|
|
|
|
const params = {
|
|
|
|
uid: this.connection.uid,
|
|
|
|
schema: this.schema,
|
2021-07-20 16:59:59 +02:00
|
|
|
routine: this.routine
|
2021-01-05 17:25:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
try {
|
|
|
|
const { status, response } = await Routines.getRoutineInformations(params);
|
|
|
|
if (status === 'success') {
|
|
|
|
this.originalRoutine = response;
|
2021-02-24 12:46:31 +01:00
|
|
|
|
|
|
|
this.originalRoutine.parameters = [...this.originalRoutine.parameters.map(param => {
|
2021-11-08 15:12:37 +01:00
|
|
|
param._antares_id = uidGen();
|
2021-02-24 12:46:31 +01:00
|
|
|
return param;
|
|
|
|
})];
|
|
|
|
|
2021-01-05 17:25:18 +01:00
|
|
|
this.localRoutine = JSON.parse(JSON.stringify(this.originalRoutine));
|
|
|
|
this.sqlProxy = this.localRoutine.sql;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
this.addNotification({ status: 'error', message: response });
|
|
|
|
}
|
|
|
|
catch (err) {
|
|
|
|
this.addNotification({ status: 'error', message: err.stack });
|
|
|
|
}
|
|
|
|
|
|
|
|
this.resizeQueryEditor();
|
2021-01-22 18:27:45 +01:00
|
|
|
this.isLoading = false;
|
2021-01-05 17:25:18 +01:00
|
|
|
},
|
|
|
|
async saveChanges () {
|
|
|
|
if (this.isSaving) return;
|
|
|
|
this.isSaving = true;
|
|
|
|
const params = {
|
|
|
|
uid: this.connection.uid,
|
|
|
|
routine: {
|
|
|
|
...this.localRoutine,
|
2021-07-21 14:40:29 +02:00
|
|
|
schema: this.schema,
|
2021-01-05 17:25:18 +01:00
|
|
|
oldName: this.originalRoutine.name
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
try {
|
|
|
|
const { status, response } = await Routines.alterRoutine(params);
|
|
|
|
|
|
|
|
if (status === 'success') {
|
|
|
|
const oldName = this.originalRoutine.name;
|
|
|
|
|
|
|
|
await this.refreshStructure(this.connection.uid);
|
|
|
|
|
|
|
|
if (oldName !== this.localRoutine.name) {
|
2021-07-20 16:59:59 +02:00
|
|
|
this.renameTabs({
|
|
|
|
uid: this.connection.uid,
|
|
|
|
schema: this.schema,
|
|
|
|
elementName: oldName,
|
|
|
|
elementNewName: this.localRoutine.name,
|
|
|
|
elementType: 'procedure'
|
|
|
|
});
|
|
|
|
|
2021-01-05 17:25:18 +01:00
|
|
|
this.changeBreadcrumbs({ schema: this.schema, procedure: this.localRoutine.name });
|
|
|
|
}
|
2021-07-21 18:50:22 +02:00
|
|
|
else
|
|
|
|
this.getRoutineData();
|
2021-01-05 17:25:18 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
this.addNotification({ status: 'error', message: response });
|
|
|
|
}
|
|
|
|
catch (err) {
|
|
|
|
this.addNotification({ status: 'error', message: err.stack });
|
|
|
|
}
|
|
|
|
|
|
|
|
this.isSaving = false;
|
|
|
|
},
|
|
|
|
clearChanges () {
|
|
|
|
this.localRoutine = JSON.parse(JSON.stringify(this.originalRoutine));
|
|
|
|
this.$refs.queryEditor.editor.session.setValue(this.localRoutine.sql);
|
|
|
|
},
|
|
|
|
resizeQueryEditor () {
|
|
|
|
if (this.$refs.queryEditor) {
|
|
|
|
const footer = document.getElementById('footer');
|
|
|
|
const size = window.innerHeight - this.$refs.queryEditor.$el.getBoundingClientRect().top - footer.offsetHeight;
|
|
|
|
this.editorHeight = size;
|
|
|
|
this.$refs.queryEditor.editor.resize();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
optionsUpdate (options) {
|
|
|
|
this.localRoutine = options;
|
|
|
|
},
|
|
|
|
parametersUpdate (parameters) {
|
|
|
|
this.localRoutine = { ...this.localRoutine, parameters };
|
|
|
|
},
|
2021-02-25 12:39:50 +01:00
|
|
|
runRoutineCheck () {
|
|
|
|
if (this.localRoutine.parameters.length)
|
|
|
|
this.showAskParamsModal();
|
|
|
|
else
|
|
|
|
this.runRoutine();
|
|
|
|
},
|
|
|
|
runRoutine (params) {
|
|
|
|
if (!params) params = [];
|
|
|
|
|
2021-02-24 12:46:31 +01:00
|
|
|
let sql;
|
|
|
|
switch (this.connection.client) { // TODO: move in a better place
|
|
|
|
case 'maria':
|
|
|
|
case 'mysql':
|
|
|
|
case 'pg':
|
2021-04-10 20:38:46 +02:00
|
|
|
sql = `CALL ${this.originalRoutine.name}(${params.join(',')})`;
|
2021-02-24 12:46:31 +01:00
|
|
|
break;
|
|
|
|
case 'mssql':
|
2021-02-25 12:39:50 +01:00
|
|
|
sql = `EXEC ${this.originalRoutine.name} ${params.join(',')}`;
|
2021-02-24 12:46:31 +01:00
|
|
|
break;
|
|
|
|
default:
|
2021-04-10 20:38:46 +02:00
|
|
|
sql = `CALL \`${this.originalRoutine.name}\`(${params.join(',')})`;
|
2021-02-24 12:46:31 +01:00
|
|
|
}
|
|
|
|
|
2021-07-12 19:18:29 +02:00
|
|
|
this.newTab({ uid: this.connection.uid, content: sql, type: 'query', autorun: true });
|
2021-02-24 12:46:31 +01:00
|
|
|
},
|
2021-01-05 17:25:18 +01:00
|
|
|
showParamsModal () {
|
|
|
|
this.isParamsModal = true;
|
|
|
|
},
|
|
|
|
hideParamsModal () {
|
|
|
|
this.isParamsModal = false;
|
2021-02-25 12:39:50 +01:00
|
|
|
},
|
|
|
|
showAskParamsModal () {
|
|
|
|
this.isAskingParameters = true;
|
|
|
|
},
|
|
|
|
hideAskParamsModal () {
|
|
|
|
this.isAskingParameters = false;
|
2021-04-20 17:39:15 +02:00
|
|
|
},
|
|
|
|
onKey (e) {
|
|
|
|
if (this.isSelected) {
|
|
|
|
e.stopPropagation();
|
|
|
|
if (e.ctrlKey && e.keyCode === 83) { // CTRL + S
|
|
|
|
if (this.isChanged)
|
|
|
|
this.saveChanges();
|
|
|
|
}
|
|
|
|
}
|
2021-01-05 17:25:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|