mirror of https://github.com/Fabio286/antares.git
feat: functions and schedulers in query suggestions
This commit is contained in:
parent
afcf1c86ed
commit
8ff6e70145
|
@ -67,8 +67,7 @@
|
||||||
"vue-i18n": "^8.22.2",
|
"vue-i18n": "^8.22.2",
|
||||||
"vue-the-mask": "^0.11.1",
|
"vue-the-mask": "^0.11.1",
|
||||||
"vuedraggable": "^2.24.3",
|
"vuedraggable": "^2.24.3",
|
||||||
"vuex": "^3.6.0",
|
"vuex": "^3.6.0"
|
||||||
"vuex-persist": "^3.1.3"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
|
|
|
@ -81,6 +81,34 @@ export default {
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
},
|
},
|
||||||
|
functions () {
|
||||||
|
return this.workspace
|
||||||
|
? this.workspace.structure.filter(schema => schema.name === this.schema)
|
||||||
|
.reduce((acc, curr) => {
|
||||||
|
acc.push(...curr.functions);
|
||||||
|
return acc;
|
||||||
|
}, []).map(func => {
|
||||||
|
return {
|
||||||
|
name: `${func.name}()`,
|
||||||
|
type: 'function'
|
||||||
|
};
|
||||||
|
})
|
||||||
|
: [];
|
||||||
|
},
|
||||||
|
schedulers () {
|
||||||
|
return this.workspace
|
||||||
|
? this.workspace.structure.filter(schema => schema.name === this.schema)
|
||||||
|
.reduce((acc, curr) => {
|
||||||
|
acc.push(...curr.schedulers);
|
||||||
|
return acc;
|
||||||
|
}, []).map(scheduler => {
|
||||||
|
return {
|
||||||
|
name: scheduler.name,
|
||||||
|
type: 'scheduler'
|
||||||
|
};
|
||||||
|
})
|
||||||
|
: [];
|
||||||
|
},
|
||||||
mode () {
|
mode () {
|
||||||
switch (this.workspace.client) {
|
switch (this.workspace.client) {
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
|
@ -160,7 +188,9 @@ export default {
|
||||||
[
|
[
|
||||||
...this.tables,
|
...this.tables,
|
||||||
...this.triggers,
|
...this.triggers,
|
||||||
...this.procedures
|
...this.procedures,
|
||||||
|
...this.functions,
|
||||||
|
...this.schedulers
|
||||||
].forEach(el => {
|
].forEach(el => {
|
||||||
completions.push({
|
completions.push({
|
||||||
value: el.name,
|
value: el.name,
|
||||||
|
|
|
@ -1245,6 +1245,12 @@ ace.define('ace/autocomplete/popup', ['require', 'exports', 'module', 'ace/virtu
|
||||||
case 'routine':
|
case 'routine':
|
||||||
iconClass = 'mdi-sync-circle';
|
iconClass = 'mdi-sync-circle';
|
||||||
break;
|
break;
|
||||||
|
case 'function':
|
||||||
|
iconClass = 'mdi-arrow-right-bold-box';
|
||||||
|
break;
|
||||||
|
case 'scheduler':
|
||||||
|
iconClass = 'mdi-calendar-clock';
|
||||||
|
break;
|
||||||
case 'keyword':
|
case 'keyword':
|
||||||
iconClass = 'mdi-cube';
|
iconClass = 'mdi-cube';
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import Vuex from 'vuex';
|
import Vuex from 'vuex';
|
||||||
import VuexPersist from 'vuex-persist';
|
|
||||||
|
|
||||||
import application from './modules/application.store';
|
import application from './modules/application.store';
|
||||||
import settings from './modules/settings.store';
|
import settings from './modules/settings.store';
|
||||||
|
@ -12,15 +11,6 @@ import notifications from './modules/notifications.store';
|
||||||
|
|
||||||
import ipcUpdates from './plugins/ipcUpdates';
|
import ipcUpdates from './plugins/ipcUpdates';
|
||||||
|
|
||||||
const vuexLocalStorage = new VuexPersist({
|
|
||||||
key: 'application', // The key to store the state on in the storage provider.
|
|
||||||
storage: window.localStorage,
|
|
||||||
reducer: state => ({
|
|
||||||
connections: state.connections,
|
|
||||||
settings: state.settings
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
Vue.use(Vuex);
|
Vue.use(Vuex);
|
||||||
|
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
|
@ -33,7 +23,6 @@ export default new Vuex.Store({
|
||||||
notifications
|
notifications
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
vuexLocalStorage.plugin,
|
|
||||||
ipcUpdates
|
ipcUpdates
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue