mirror of
https://github.com/Fabio286/antares.git
synced 2025-03-15 10:50:04 +01:00
perf(UI): element options in setting tabs accessible directly
This commit is contained in:
parent
756d49b259
commit
71e2c911ae
@ -44,6 +44,7 @@ module.exports = {
|
||||
unsigned: false,
|
||||
nullable: false,
|
||||
zerofill: false,
|
||||
tableOptions: false,
|
||||
autoIncrement: false,
|
||||
comment: false,
|
||||
collation: false,
|
||||
|
@ -40,6 +40,7 @@ module.exports = {
|
||||
unsigned: true,
|
||||
nullable: true,
|
||||
zerofill: true,
|
||||
tableOptions: true,
|
||||
autoIncrement: true,
|
||||
comment: true,
|
||||
collation: true,
|
||||
|
@ -9,7 +9,7 @@ autoUpdater.allowPrerelease = persistentStore.get('allow_prerelease', true);
|
||||
export default () => {
|
||||
ipcMain.on('check-for-updates', event => {
|
||||
mainWindow = event;
|
||||
if (process.windowsStore)
|
||||
if (process.windowsStore || (process.platform === 'linux' && !process.env.APPIMAGE))
|
||||
mainWindow.reply('no-auto-update');
|
||||
else {
|
||||
autoUpdater.checkForUpdatesAndNotify().catch(() => {
|
||||
|
@ -63,7 +63,7 @@
|
||||
:ref="breadcrumbs.schema === database.name && breadcrumbs.trigger === trigger.name ? 'explorebar-selected' : ''"
|
||||
class="menu-item"
|
||||
:class="{'selected': breadcrumbs.schema === database.name && breadcrumbs.trigger === trigger.name}"
|
||||
@mousedown="selectMisc({schema: database.name, misc: trigger, type: 'trigger'})"
|
||||
@mousedown.left="selectMisc({schema: database.name, misc: trigger, type: 'trigger'})"
|
||||
@dblclick="openMiscPermanentTab({schema: database.name, misc: trigger, type: 'trigger'})"
|
||||
@contextmenu.prevent="showMiscContext($event, {...trigger, type: 'trigger'})"
|
||||
>
|
||||
@ -97,7 +97,7 @@
|
||||
:ref="breadcrumbs.schema === database.name && breadcrumbs.routine === procedure.name ? 'explorebar-selected' : ''"
|
||||
class="menu-item"
|
||||
:class="{'selected': breadcrumbs.schema === database.name && breadcrumbs.routine === procedure.name}"
|
||||
@mousedown="selectMisc({schema: database.name, misc: procedure, type: 'routine'})"
|
||||
@mousedown.left="selectMisc({schema: database.name, misc: procedure, type: 'routine'})"
|
||||
@dblclick="openMiscPermanentTab({schema: database.name, misc: procedure, type: 'routine'})"
|
||||
@contextmenu.prevent="showMiscContext($event, {...procedure, type: 'procedure'})"
|
||||
>
|
||||
@ -131,7 +131,7 @@
|
||||
:ref="breadcrumbs.schema === database.name && breadcrumbs.triggerFunction === func.name ? 'explorebar-selected' : ''"
|
||||
class="menu-item"
|
||||
:class="{'selected': breadcrumbs.schema === database.name && breadcrumbs.triggerFunction === func.name}"
|
||||
@mousedown="selectMisc({schema: database.name, misc: func, type: 'triggerFunction'})"
|
||||
@mousedown.left="selectMisc({schema: database.name, misc: func, type: 'triggerFunction'})"
|
||||
@dblclick="openMiscPermanentTab({schema: database.name, misc: func, type: 'triggerFunction'})"
|
||||
@contextmenu.prevent="showMiscContext($event, {...func, type: 'triggerFunction'})"
|
||||
>
|
||||
@ -165,7 +165,7 @@
|
||||
:ref="breadcrumbs.schema === database.name && breadcrumbs.function === func.name ? 'explorebar-selected' : ''"
|
||||
class="menu-item"
|
||||
:class="{'selected': breadcrumbs.schema === database.name && breadcrumbs.function === func.name}"
|
||||
@mousedown="selectMisc({schema: database.name, misc: func, type: 'function'})"
|
||||
@mousedown.left="selectMisc({schema: database.name, misc: func, type: 'function'})"
|
||||
@dblclick="openMiscPermanentTab({schema: database.name, misc: func, type: 'function'})"
|
||||
@contextmenu.prevent="showMiscContext($event, {...func, type: 'function'})"
|
||||
>
|
||||
@ -199,7 +199,7 @@
|
||||
:ref="breadcrumbs.schema === database.name && breadcrumbs.scheduler === scheduler.name ? 'explorebar-selected' : ''"
|
||||
class="menu-item"
|
||||
:class="{'selected': breadcrumbs.schema === database.name && breadcrumbs.scheduler === scheduler.name}"
|
||||
@mousedown="selectMisc({schema: database.name, misc: scheduler, type: 'scheduler'})"
|
||||
@mousedown.left="selectMisc({schema: database.name, misc: scheduler, type: 'scheduler'})"
|
||||
@dblclick="openMiscPermanentTab({schema: database.name, misc: scheduler, type: 'scheduler'})"
|
||||
@contextmenu.prevent="showMiscContext($event, {...scheduler, type: 'scheduler'})"
|
||||
>
|
||||
@ -320,8 +320,6 @@ export default {
|
||||
this.addLoadedSchema(schema);
|
||||
this.isLoading = false;
|
||||
}
|
||||
|
||||
this.changeBreadcrumbs({ schema, table: null });
|
||||
},
|
||||
selectTable ({ schema, table }) {
|
||||
this.newTab({ uid: this.connection.uid, elementName: table.name, schema: this.database.name, type: 'temp-data', elementType: table.type });
|
||||
|
@ -51,14 +51,15 @@
|
||||
<i class="mdi mdi-24px mdi-key-link mr-1" />
|
||||
<span>{{ $t('word.foreignKeys') }}</span>
|
||||
</button>
|
||||
<button
|
||||
<!-- <button
|
||||
v-if="workspace.customizations.tableOptions"
|
||||
class="btn btn-dark btn-sm"
|
||||
:disabled="isSaving"
|
||||
@click="showOptionsModal"
|
||||
>
|
||||
<i class="mdi mdi-24px mdi-cogs mr-1" />
|
||||
<span>{{ $t('word.options') }}</span>
|
||||
</button>
|
||||
</button> -->
|
||||
</div>
|
||||
<div class="workspace-query-info">
|
||||
<div class="d-flex" :title="$t('word.schema')">
|
||||
@ -67,6 +68,77 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="columns mb-4">
|
||||
<div class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label">{{ $t('word.name') }}</label>
|
||||
<input
|
||||
v-model="localOptions.name"
|
||||
class="form-input"
|
||||
type="text"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="workspace.customizations.comment" class="column">
|
||||
<div class="form-group">
|
||||
<label class="form-label">{{ $t('word.comment') }}</label>
|
||||
<input
|
||||
v-model="localOptions.comment"
|
||||
class="form-input"
|
||||
type="text"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="workspace.customizations.autoIncrement" class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label">
|
||||
{{ $t('word.autoIncrement') }}
|
||||
</label>
|
||||
<input
|
||||
ref="firstInput"
|
||||
v-model="localOptions.autoIncrement"
|
||||
class="form-input"
|
||||
type="number"
|
||||
:disabled="localOptions.autoIncrement === null"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="workspace.customizations.collations" class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label">
|
||||
{{ $t('word.collation') }}
|
||||
</label>
|
||||
<select v-model="localOptions.collation" class="form-select">
|
||||
<option
|
||||
v-for="collation in workspace.collations"
|
||||
:key="collation.id"
|
||||
:value="collation.collation"
|
||||
>
|
||||
{{ collation.collation }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="workspace.customizations.engines" class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label">
|
||||
{{ $t('word.engine') }}
|
||||
</label>
|
||||
<select v-model="localOptions.engine" class="form-select">
|
||||
<option
|
||||
v-for="engine in workspace.engines"
|
||||
:key="engine.name"
|
||||
:value="engine.name"
|
||||
>
|
||||
{{ engine.name }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="workspace-query-results column col-12 p-relative">
|
||||
<BaseLoader v-if="isLoading" />
|
||||
<WorkspacePropsTable
|
||||
@ -88,14 +160,14 @@
|
||||
@rename-field="renameField"
|
||||
/>
|
||||
</div>
|
||||
<WorkspacePropsOptionsModal
|
||||
<!-- <WorkspacePropsOptionsModal
|
||||
v-if="isOptionsModal"
|
||||
:local-options="localOptions"
|
||||
:table="table"
|
||||
:workspace="workspace"
|
||||
@hide="hideOptionsModal"
|
||||
@options-update="optionsUpdate"
|
||||
/>
|
||||
/> -->
|
||||
<WorkspacePropsIndexesModal
|
||||
v-if="isIndexesModal"
|
||||
:local-indexes="localIndexes"
|
||||
@ -127,7 +199,7 @@ import { uidGen } from 'common/libs/uidGen';
|
||||
import Tables from '@/ipc-api/Tables';
|
||||
import BaseLoader from '@/components/BaseLoader';
|
||||
import WorkspacePropsTable from '@/components/WorkspacePropsTable';
|
||||
import WorkspacePropsOptionsModal from '@/components/WorkspacePropsOptionsModal';
|
||||
// import WorkspacePropsOptionsModal from '@/components/WorkspacePropsOptionsModal';
|
||||
import WorkspacePropsIndexesModal from '@/components/WorkspacePropsIndexesModal';
|
||||
import WorkspacePropsForeignModal from '@/components/WorkspacePropsForeignModal';
|
||||
|
||||
@ -136,7 +208,7 @@ export default {
|
||||
components: {
|
||||
BaseLoader,
|
||||
WorkspacePropsTable,
|
||||
WorkspacePropsOptionsModal,
|
||||
// WorkspacePropsOptionsModal,
|
||||
WorkspacePropsIndexesModal,
|
||||
WorkspacePropsForeignModal
|
||||
},
|
||||
@ -182,7 +254,8 @@ export default {
|
||||
return db && this.table ? db.tables.find(table => table.name === this.table) : {};
|
||||
},
|
||||
defaultEngine () {
|
||||
return this.getDatabaseVariable(this.connection.uid, 'default_storage_engine').value || '';
|
||||
const engine = this.getDatabaseVariable(this.connection.uid, 'default_storage_engine');
|
||||
return engine ? engine.value : '';
|
||||
},
|
||||
schemaTables () {
|
||||
const schemaTables = this.workspace.structure
|
||||
@ -534,6 +607,11 @@ export default {
|
||||
fieldToClone.name = `${fieldToClone.name}_copy`;
|
||||
fieldToClone.order = this.localFields.length + 1;
|
||||
this.localFields = [...this.localFields, fieldToClone];
|
||||
|
||||
setTimeout(() => {
|
||||
const scrollable = this.$refs.indexTable.$refs.tableWrapper;
|
||||
scrollable.scrollTop = scrollable.scrollHeight + 30;
|
||||
}, 20);
|
||||
},
|
||||
removeField (uid) {
|
||||
this.localFields = this.localFields.filter(field => field._id !== uid);
|
||||
|
@ -37,10 +37,10 @@
|
||||
<i class="mdi mdi-24px mdi-dots-horizontal mr-1" />
|
||||
<span>{{ $t('word.parameters') }}</span>
|
||||
</button>
|
||||
<button class="btn btn-dark btn-sm" @click="showOptionsModal">
|
||||
<!-- <button class="btn btn-dark btn-sm" @click="showOptionsModal">
|
||||
<i class="mdi mdi-24px mdi-cogs mr-1" />
|
||||
<span>{{ $t('word.options') }}</span>
|
||||
</button>
|
||||
</button> -->
|
||||
</div>
|
||||
<div class="workspace-query-info">
|
||||
<div class="d-flex" :title="$t('word.schema')">
|
||||
@ -49,6 +49,152 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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="localFunction.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="localFunction.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="localFunction.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 class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label">
|
||||
{{ $t('word.returns') }}
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<select
|
||||
v-model="localFunction.returns"
|
||||
class="form-select text-uppercase"
|
||||
style="max-width: 150px;"
|
||||
>
|
||||
<option v-if="localFunction.returns === 'VOID'">
|
||||
VOID
|
||||
</option>
|
||||
<option v-if="!isInDataTypes">
|
||||
{{ localFunction.returns }}
|
||||
</option>
|
||||
<optgroup
|
||||
v-for="group in workspace.dataTypes"
|
||||
:key="group.group"
|
||||
:label="group.group"
|
||||
>
|
||||
<option
|
||||
v-for="type in group.types"
|
||||
:key="type.name"
|
||||
:selected="localFunction.returns === type.name"
|
||||
:value="type.name"
|
||||
>
|
||||
{{ type.name }}
|
||||
</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
<input
|
||||
v-if="customizations.parametersLength"
|
||||
v-model="localFunction.returnsLength"
|
||||
style="max-width: 150px;"
|
||||
class="form-input"
|
||||
type="number"
|
||||
min="0"
|
||||
:placeholder="$t('word.length')"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="customizations.comment" class="column">
|
||||
<div class="form-group">
|
||||
<label class="form-label">
|
||||
{{ $t('word.comment') }}
|
||||
</label>
|
||||
<input
|
||||
v-model="localFunction.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="localFunction.security" class="form-select">
|
||||
<option>DEFINER</option>
|
||||
<option>INVOKER</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="customizations.functionDataAccess" class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label">
|
||||
{{ $t('message.dataAccess') }}
|
||||
</label>
|
||||
<select v-model="localFunction.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.functionDeterministic" class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label d-invisible">.</label>
|
||||
<label class="form-checkbox form-inline">
|
||||
<input v-model="localFunction.deterministic" type="checkbox"><i class="form-icon" /> {{ $t('word.deterministic') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="workspace-query-results column col-12 mt-2 p-relative">
|
||||
<BaseLoader v-if="isLoading" />
|
||||
<label class="form-label ml-2">{{ $t('message.functionBody') }}</label>
|
||||
@ -61,13 +207,13 @@
|
||||
:height="editorHeight"
|
||||
/>
|
||||
</div>
|
||||
<WorkspacePropsFunctionOptionsModal
|
||||
<!-- <WorkspacePropsFunctionOptionsModal
|
||||
v-if="isOptionsModal"
|
||||
:local-options="localFunction"
|
||||
:workspace="workspace"
|
||||
@hide="hideOptionsModal"
|
||||
@options-update="optionsUpdate"
|
||||
/>
|
||||
/> -->
|
||||
<WorkspacePropsFunctionParamsModal
|
||||
v-if="isParamsModal"
|
||||
:local-parameters="localFunction.parameters"
|
||||
@ -91,7 +237,7 @@ import { mapGetters, mapActions } from 'vuex';
|
||||
import { uidGen } from 'common/libs/uidGen';
|
||||
import BaseLoader from '@/components/BaseLoader';
|
||||
import QueryEditor from '@/components/QueryEditor';
|
||||
import WorkspacePropsFunctionOptionsModal from '@/components/WorkspacePropsFunctionOptionsModal';
|
||||
// import WorkspacePropsFunctionOptionsModal from '@/components/WorkspacePropsFunctionOptionsModal';
|
||||
import WorkspacePropsFunctionParamsModal from '@/components/WorkspacePropsFunctionParamsModal';
|
||||
import ModalAskParameters from '@/components/ModalAskParameters';
|
||||
import Functions from '@/ipc-api/Functions';
|
||||
@ -101,7 +247,7 @@ export default {
|
||||
components: {
|
||||
BaseLoader,
|
||||
QueryEditor,
|
||||
WorkspacePropsFunctionOptionsModal,
|
||||
// WorkspacePropsFunctionOptionsModal,
|
||||
WorkspacePropsFunctionParamsModal,
|
||||
ModalAskParameters
|
||||
},
|
||||
@ -133,6 +279,9 @@ export default {
|
||||
workspace () {
|
||||
return this.getWorkspace(this.connection.uid);
|
||||
},
|
||||
customizations () {
|
||||
return this.workspace.customizations;
|
||||
},
|
||||
tabUid () {
|
||||
return this.$vnode.key;
|
||||
},
|
||||
@ -144,6 +293,19 @@ export default {
|
||||
? this.workspace.users.some(user => this.originalFunction.definer === `\`${user.name}\`@\`${user.host}\``)
|
||||
: true;
|
||||
},
|
||||
isTableNameValid () {
|
||||
return this.localFunction.name !== '';
|
||||
},
|
||||
isInDataTypes () {
|
||||
let typeNames = [];
|
||||
for (const group of this.workspace.dataTypes) {
|
||||
typeNames = group.types.reduce((acc, curr) => {
|
||||
acc.push(curr.name);
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
return typeNames.includes(this.localFunction.returns);
|
||||
},
|
||||
schemaTables () {
|
||||
const schemaTables = this.workspace.structure
|
||||
.filter(schema => schema.name === this.schema)
|
||||
|
@ -37,10 +37,10 @@
|
||||
<i class="mdi mdi-24px mdi-dots-horizontal mr-1" />
|
||||
<span>{{ $t('word.parameters') }}</span>
|
||||
</button>
|
||||
<button class="btn btn-dark btn-sm" @click="showOptionsModal">
|
||||
<!-- <button class="btn btn-dark btn-sm" @click="showOptionsModal">
|
||||
<i class="mdi mdi-24px mdi-cogs mr-1" />
|
||||
<span>{{ $t('word.options') }}</span>
|
||||
</button>
|
||||
</button> -->
|
||||
</div>
|
||||
<div class="workspace-query-info">
|
||||
<div class="d-flex" :title="$t('word.schema')">
|
||||
@ -49,6 +49,108 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<div class="workspace-query-results column col-12 mt-2 p-relative">
|
||||
<BaseLoader v-if="isLoading" />
|
||||
<label class="form-label ml-2">{{ $t('message.routineBody') }}</label>
|
||||
@ -62,13 +164,13 @@
|
||||
:height="editorHeight"
|
||||
/>
|
||||
</div>
|
||||
<WorkspacePropsRoutineOptionsModal
|
||||
<!-- <WorkspacePropsRoutineOptionsModal
|
||||
v-if="isOptionsModal"
|
||||
:local-options="localRoutine"
|
||||
:workspace="workspace"
|
||||
@hide="hideOptionsModal"
|
||||
@options-update="optionsUpdate"
|
||||
/>
|
||||
/> -->
|
||||
<WorkspacePropsRoutineParamsModal
|
||||
v-if="isParamsModal"
|
||||
:local-parameters="localRoutine.parameters"
|
||||
@ -92,7 +194,7 @@ import { mapGetters, mapActions } from 'vuex';
|
||||
import { uidGen } from 'common/libs/uidGen';
|
||||
import QueryEditor from '@/components/QueryEditor';
|
||||
import BaseLoader from '@/components/BaseLoader';
|
||||
import WorkspacePropsRoutineOptionsModal from '@/components/WorkspacePropsRoutineOptionsModal';
|
||||
// import WorkspacePropsRoutineOptionsModal from '@/components/WorkspacePropsRoutineOptionsModal';
|
||||
import WorkspacePropsRoutineParamsModal from '@/components/WorkspacePropsRoutineParamsModal';
|
||||
import ModalAskParameters from '@/components/ModalAskParameters';
|
||||
import Routines from '@/ipc-api/Routines';
|
||||
@ -102,7 +204,7 @@ export default {
|
||||
components: {
|
||||
QueryEditor,
|
||||
BaseLoader,
|
||||
WorkspacePropsRoutineOptionsModal,
|
||||
// WorkspacePropsRoutineOptionsModal,
|
||||
WorkspacePropsRoutineParamsModal,
|
||||
ModalAskParameters
|
||||
},
|
||||
@ -134,6 +236,9 @@ export default {
|
||||
workspace () {
|
||||
return this.getWorkspace(this.connection.uid);
|
||||
},
|
||||
customizations () {
|
||||
return this.workspace.customizations;
|
||||
},
|
||||
tabUid () {
|
||||
return this.$vnode.key;
|
||||
},
|
||||
@ -143,6 +248,9 @@ export default {
|
||||
isDefinerInUsers () {
|
||||
return this.originalRoutine ? this.workspace.users.some(user => this.originalRoutine.definer === `\`${user.name}\`@\`${user.host}\``) : true;
|
||||
},
|
||||
isTableNameValid () {
|
||||
return this.localRoutine.name !== '';
|
||||
},
|
||||
schemaTables () {
|
||||
const schemaTables = this.workspace.structure
|
||||
.filter(schema => schema.name === this.schema)
|
||||
|
@ -37,7 +37,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="columns mb-4">
|
||||
<div class="columns">
|
||||
<div class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label">{{ $t('word.name') }}</label>
|
||||
@ -87,8 +87,6 @@
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<div class="form-group">
|
||||
<label class="form-label mr-2">{{ $t('word.state') }}</label>
|
||||
|
@ -31,7 +31,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="columns mb-4">
|
||||
<div class="columns">
|
||||
<div class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label">{{ $t('word.name') }}</label>
|
||||
@ -71,49 +71,49 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<fieldset class="columns" :disabled="customizations.triggerOnlyRename">
|
||||
<div class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label">{{ $t('word.table') }}</label>
|
||||
<select v-model="localTrigger.table" class="form-select">
|
||||
<option v-for="table in schemaTables" :key="table.name">
|
||||
{{ table.name }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label">{{ $t('word.event') }}</label>
|
||||
<div class="input-group">
|
||||
<select v-model="localTrigger.activation" class="form-select">
|
||||
<option>BEFORE</option>
|
||||
<option>AFTER</option>
|
||||
</select>
|
||||
<select
|
||||
v-if="!customizations.triggerMultipleEvents"
|
||||
v-model="localTrigger.event"
|
||||
class="form-select"
|
||||
>
|
||||
<option v-for="event in Object.keys(localEvents)" :key="event">
|
||||
{{ event }}
|
||||
<fieldset class="column columns mb-0" :disabled="customizations.triggerOnlyRename">
|
||||
<div class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label">{{ $t('word.table') }}</label>
|
||||
<select v-model="localTrigger.table" class="form-select">
|
||||
<option v-for="table in schemaTables" :key="table.name">
|
||||
{{ table.name }}
|
||||
</option>
|
||||
</select>
|
||||
<div v-if="customizations.triggerMultipleEvents" class="px-4">
|
||||
<label
|
||||
v-for="event in Object.keys(localEvents)"
|
||||
:key="event"
|
||||
class="form-checkbox form-inline"
|
||||
@change.prevent="changeEvents(event)"
|
||||
</div>
|
||||
</div>
|
||||
<div class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label">{{ $t('word.event') }}</label>
|
||||
<div class="input-group">
|
||||
<select v-model="localTrigger.activation" class="form-select">
|
||||
<option>BEFORE</option>
|
||||
<option>AFTER</option>
|
||||
</select>
|
||||
<select
|
||||
v-if="!customizations.triggerMultipleEvents"
|
||||
v-model="localTrigger.event"
|
||||
class="form-select"
|
||||
>
|
||||
<input :checked="localEvents[event]" type="checkbox"><i class="form-icon" /> {{ event }}
|
||||
</label>
|
||||
<option v-for="event in Object.keys(localEvents)" :key="event">
|
||||
{{ event }}
|
||||
</option>
|
||||
</select>
|
||||
<div v-if="customizations.triggerMultipleEvents" class="px-4">
|
||||
<label
|
||||
v-for="event in Object.keys(localEvents)"
|
||||
:key="event"
|
||||
class="form-checkbox form-inline"
|
||||
@change.prevent="changeEvents(event)"
|
||||
>
|
||||
<input :checked="localEvents[event]" type="checkbox"><i class="form-icon" /> {{ event }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="workspace-query-results column col-12 mt-2 p-relative">
|
||||
<BaseLoader v-if="isLoading" />
|
||||
|
@ -25,10 +25,64 @@
|
||||
|
||||
<div class="divider-vert py-3" />
|
||||
|
||||
<button class="btn btn-dark btn-sm" @click="showOptionsModal">
|
||||
<!-- <button class="btn btn-dark btn-sm" @click="showOptionsModal">
|
||||
<i class="mdi mdi-24px mdi-cogs mr-1" />
|
||||
<span>{{ $t('word.options') }}</span>
|
||||
</button>
|
||||
</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="columns">
|
||||
<div v-if="customizations.triggerFunctionlanguages" class="column col-auto">
|
||||
<div class="form-group">
|
||||
<label class="form-label">
|
||||
{{ $t('word.language') }}
|
||||
</label>
|
||||
<select v-model="localFunction.language" class="form-select">
|
||||
<option v-for="language in customizations.triggerFunctionlanguages" :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="localFunction.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="form-group">
|
||||
<label class="form-label">
|
||||
{{ $t('word.comment') }}
|
||||
</label>
|
||||
<input
|
||||
v-model="localFunction.comment"
|
||||
class="form-input"
|
||||
type="text"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -44,13 +98,13 @@
|
||||
:height="editorHeight"
|
||||
/>
|
||||
</div>
|
||||
<WorkspacePropsTriggerFunctionOptionsModal
|
||||
<!-- <WorkspacePropsTriggerFunctionOptionsModal
|
||||
v-if="isOptionsModal"
|
||||
:local-options="localFunction"
|
||||
:workspace="workspace"
|
||||
@hide="hideOptionsModal"
|
||||
@options-update="optionsUpdate"
|
||||
/>
|
||||
/> -->
|
||||
<ModalAskParameters
|
||||
v-if="isAskingParameters"
|
||||
:local-routine="localFunction"
|
||||
@ -66,7 +120,7 @@ import { mapGetters, mapActions } from 'vuex';
|
||||
import { uidGen } from 'common/libs/uidGen';
|
||||
import BaseLoader from '@/components/BaseLoader';
|
||||
import QueryEditor from '@/components/QueryEditor';
|
||||
import WorkspacePropsTriggerFunctionOptionsModal from '@/components/WorkspacePropsTriggerFunctionOptionsModal';
|
||||
// import WorkspacePropsTriggerFunctionOptionsModal from '@/components/WorkspacePropsTriggerFunctionOptionsModal';
|
||||
import ModalAskParameters from '@/components/ModalAskParameters';
|
||||
import Functions from '@/ipc-api/Functions';
|
||||
|
||||
@ -75,7 +129,7 @@ export default {
|
||||
components: {
|
||||
BaseLoader,
|
||||
QueryEditor,
|
||||
WorkspacePropsTriggerFunctionOptionsModal,
|
||||
// WorkspacePropsTriggerFunctionOptionsModal,
|
||||
ModalAskParameters
|
||||
},
|
||||
props: {
|
||||
@ -106,6 +160,9 @@ export default {
|
||||
workspace () {
|
||||
return this.getWorkspace(this.connection.uid);
|
||||
},
|
||||
customizations () {
|
||||
return this.workspace.customizations;
|
||||
},
|
||||
tabUid () {
|
||||
return this.$vnode.key;
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user