mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
refactor: emits in components
This commit is contained in:
@ -43,4 +43,4 @@ export function mimeFromHex (hex) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
@ -5,4 +5,4 @@
|
|||||||
*/
|
*/
|
||||||
export function uidGen (prefix) {
|
export function uidGen (prefix) {
|
||||||
return (prefix ? `${prefix}:` : '') + Math.random().toString(36).substr(2, 9).toUpperCase();
|
return (prefix ? `${prefix}:` : '') + Math.random().toString(36).substr(2, 9).toUpperCase();
|
||||||
};
|
}
|
||||||
|
@ -10,7 +10,7 @@ export default () => {
|
|||||||
event.returnValue = key;
|
event.returnValue = key;
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.handle('showOpenDialog', (event, options) => {
|
ipcMain.handle('show-open-dialog', (event, options) => {
|
||||||
return dialog.showOpenDialog(options);
|
return dialog.showOpenDialog(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -135,9 +135,6 @@ export default (connections: {[key: string]: antares.Client}) => {
|
|||||||
|
|
||||||
await connection.connect();
|
await connection.connect();
|
||||||
|
|
||||||
// TODO: temporary
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-ignore
|
|
||||||
const structure = await connection.getStructure(new Set());
|
const structure = await connection.getStructure(new Set());
|
||||||
|
|
||||||
connections[conn.uid] = connection;
|
connections[conn.uid] = connection;
|
||||||
|
@ -58,6 +58,7 @@ export default {
|
|||||||
confirmText: String,
|
confirmText: String,
|
||||||
cancelText: String
|
cancelText: String
|
||||||
},
|
},
|
||||||
|
emits: ['confirm', 'hide'],
|
||||||
computed: {
|
computed: {
|
||||||
hasHeader () {
|
hasHeader () {
|
||||||
return !!this.$slots.header;
|
return !!this.$slots.header;
|
||||||
|
@ -21,6 +21,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
contextEvent: MouseEvent
|
contextEvent: MouseEvent
|
||||||
},
|
},
|
||||||
|
emits: ['close-context'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
contextSize: null,
|
contextSize: null,
|
||||||
|
@ -27,6 +27,7 @@ export default {
|
|||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
emits: ['close'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isExpanded: false
|
isExpanded: false
|
||||||
|
@ -17,7 +17,7 @@ import { mapGetters } from 'vuex';
|
|||||||
export default {
|
export default {
|
||||||
name: 'BaseTextEditor',
|
name: 'BaseTextEditor',
|
||||||
props: {
|
props: {
|
||||||
value: String,
|
modelValue: String,
|
||||||
mode: { type: String, default: 'text' },
|
mode: { type: String, default: 'text' },
|
||||||
editorClass: { type: String, default: '' },
|
editorClass: { type: String, default: '' },
|
||||||
autoFocus: { type: Boolean, default: false },
|
autoFocus: { type: Boolean, default: false },
|
||||||
@ -25,6 +25,7 @@ export default {
|
|||||||
showLineNumbers: { type: Boolean, default: true },
|
showLineNumbers: { type: Boolean, default: true },
|
||||||
height: { type: Number, default: 200 }
|
height: { type: Number, default: 200 }
|
||||||
},
|
},
|
||||||
|
emits: ['update:modelValue'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
editor: null,
|
editor: null,
|
||||||
@ -83,7 +84,7 @@ export default {
|
|||||||
this.editor = ace.edit(`editor-${this.id}`, {
|
this.editor = ace.edit(`editor-${this.id}`, {
|
||||||
mode: `ace/mode/${this.mode}`,
|
mode: `ace/mode/${this.mode}`,
|
||||||
theme: `ace/theme/${this.editorTheme}`,
|
theme: `ace/theme/${this.editorTheme}`,
|
||||||
value: this.value || '',
|
value: this.modelValue || '',
|
||||||
fontSize: '14px',
|
fontSize: '14px',
|
||||||
printMargin: false,
|
printMargin: false,
|
||||||
readOnly: this.readOnly,
|
readOnly: this.readOnly,
|
||||||
@ -100,7 +101,7 @@ export default {
|
|||||||
|
|
||||||
this.editor.session.on('change', () => {
|
this.editor.session.on('change', () => {
|
||||||
const content = this.editor.getValue();
|
const content = this.editor.getValue();
|
||||||
this.$emit('update:value', content);
|
this.$emit('update:modelValue', content);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.autoFocus) {
|
if (this.autoFocus) {
|
||||||
|
@ -22,6 +22,7 @@ export default {
|
|||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
emits: ['close'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isVisible: false
|
isVisible: false
|
||||||
|
@ -35,6 +35,7 @@ export default {
|
|||||||
type: String
|
type: String
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
emits: ['change', 'clear'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
id: null
|
id: null
|
||||||
|
@ -129,6 +129,7 @@ export default {
|
|||||||
fieldLength: Number,
|
fieldLength: Number,
|
||||||
fieldObj: Object
|
fieldObj: Object
|
||||||
},
|
},
|
||||||
|
emits: ['update:value'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
localType: null,
|
localType: null,
|
||||||
|
@ -34,6 +34,7 @@ export default {
|
|||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
emits: ['update:value', 'blur'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
foreignList: []
|
foreignList: []
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalAskCredentials',
|
name: 'ModalAskCredentials',
|
||||||
|
emits: ['close-asking', 'credentials'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
credentials: {
|
credentials: {
|
||||||
|
@ -60,6 +60,7 @@ export default {
|
|||||||
localRoutine: Object,
|
localRoutine: Object,
|
||||||
client: String
|
client: String
|
||||||
},
|
},
|
||||||
|
emits: ['confirm', 'close'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
values: {}
|
values: {}
|
||||||
|
@ -26,6 +26,7 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
ConfirmModal
|
ConfirmModal
|
||||||
},
|
},
|
||||||
|
emits: ['confirm', 'close'],
|
||||||
created () {
|
created () {
|
||||||
window.addEventListener('keydown', this.onKey);
|
window.addEventListener('keydown', this.onKey);
|
||||||
},
|
},
|
||||||
|
@ -74,6 +74,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
selectedSchema: String
|
selectedSchema: String
|
||||||
},
|
},
|
||||||
|
emits: ['close'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
database: {
|
database: {
|
||||||
|
@ -281,6 +281,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
selectedSchema: String
|
selectedSchema: String
|
||||||
},
|
},
|
||||||
|
emits: ['close'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isExporting: false,
|
isExporting: false,
|
||||||
|
@ -200,6 +200,7 @@ export default {
|
|||||||
fields: Array,
|
fields: Array,
|
||||||
keyUsage: Array
|
keyUsage: Array
|
||||||
},
|
},
|
||||||
|
emits: ['reload', 'hide'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
localRow: {},
|
localRow: {},
|
||||||
|
@ -108,6 +108,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
connection: Object
|
connection: Object
|
||||||
},
|
},
|
||||||
|
emits: ['select-query', 'close'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
resultsSize: 1000,
|
resultsSize: 1000,
|
||||||
|
@ -58,6 +58,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
selectedSchema: String
|
selectedSchema: String
|
||||||
},
|
},
|
||||||
|
emits: ['close'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
sqlFile: '',
|
sqlFile: '',
|
||||||
|
@ -71,6 +71,7 @@ import Schema from '@/ipc-api/Schema';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalNewSchema',
|
name: 'ModalNewSchema',
|
||||||
|
emits: ['reload', 'close'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
@ -137,6 +137,7 @@ export default {
|
|||||||
fields: Array,
|
fields: Array,
|
||||||
keyUsage: Array
|
keyUsage: Array
|
||||||
},
|
},
|
||||||
|
emits: ['reload', 'hide'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
localRow: {},
|
localRow: {},
|
||||||
|
@ -149,6 +149,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
connection: Object
|
connection: Object
|
||||||
},
|
},
|
||||||
|
emits: ['close'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
resultsSize: 1000,
|
resultsSize: 1000,
|
||||||
|
@ -52,6 +52,7 @@ export default {
|
|||||||
selectedRow: Number,
|
selectedRow: Number,
|
||||||
selectedCell: Object
|
selectedCell: Object
|
||||||
},
|
},
|
||||||
|
emits: ['close-context', 'copy-cell', 'copy-row', 'kill-process'],
|
||||||
computed: {
|
computed: {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -56,6 +56,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
row: Object
|
row: Object
|
||||||
},
|
},
|
||||||
|
emits: ['select-row', 'contextmenu', 'stop-refresh'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isInlineEditor: {},
|
isInlineEditor: {},
|
||||||
|
@ -26,6 +26,7 @@ export default {
|
|||||||
readOnly: { type: Boolean, default: false },
|
readOnly: { type: Boolean, default: false },
|
||||||
height: { type: Number, default: 200 }
|
height: { type: Number, default: 200 }
|
||||||
},
|
},
|
||||||
|
emits: ['update:value'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
editor: null,
|
editor: null,
|
||||||
|
@ -45,6 +45,7 @@ export default {
|
|||||||
contextEvent: MouseEvent,
|
contextEvent: MouseEvent,
|
||||||
contextConnection: Object
|
contextConnection: Object
|
||||||
},
|
},
|
||||||
|
emits: ['close-context'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isConfirmModal: false,
|
isConfirmModal: false,
|
||||||
|
@ -39,6 +39,7 @@ export default {
|
|||||||
ConfirmModal,
|
ConfirmModal,
|
||||||
TextEditor
|
TextEditor
|
||||||
},
|
},
|
||||||
|
emits: ['hide'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
localNotes: '',
|
localNotes: '',
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
import { mapGetters, mapActions } from 'vuex';
|
import { mapGetters, mapActions } from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
name: 'WorkspaceEmptyState',
|
name: 'WorkspaceEmptyState',
|
||||||
|
emits: ['new-tab'],
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
applicationTheme: 'settings/getApplicationTheme',
|
applicationTheme: 'settings/getApplicationTheme',
|
||||||
|
@ -86,6 +86,7 @@ export default {
|
|||||||
selectedMisc: Object,
|
selectedMisc: Object,
|
||||||
selectedSchema: String
|
selectedSchema: String
|
||||||
},
|
},
|
||||||
|
emits: ['close-context', 'reload'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isDeleteModal: false,
|
isDeleteModal: false,
|
||||||
|
@ -55,6 +55,7 @@ export default {
|
|||||||
selectedMisc: String,
|
selectedMisc: String,
|
||||||
selectedSchema: String
|
selectedSchema: String
|
||||||
},
|
},
|
||||||
|
emits: ['open-create-trigger-tab', 'open-create-routine-tab', 'open-create-function-tab', 'open-create-trigger-function-tab', 'open-create-scheduler-tab', 'close-context'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
localElement: {}
|
localElement: {}
|
||||||
|
@ -252,6 +252,7 @@ export default {
|
|||||||
database: Object,
|
database: Object,
|
||||||
connection: Object
|
connection: Object
|
||||||
},
|
},
|
||||||
|
emits: ['show-schema-context', 'show-table-context', 'show-misc-context', 'show-misc-folder-context'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isLoading: false
|
isLoading: false
|
||||||
|
@ -146,6 +146,17 @@ export default {
|
|||||||
contextEvent: MouseEvent,
|
contextEvent: MouseEvent,
|
||||||
selectedSchema: String
|
selectedSchema: String
|
||||||
},
|
},
|
||||||
|
emits: [
|
||||||
|
'open-create-table-tab',
|
||||||
|
'open-create-view-tab',
|
||||||
|
'open-create-trigger-tab',
|
||||||
|
'open-create-routine-tab',
|
||||||
|
'open-create-function-tab',
|
||||||
|
'open-create-trigger-function-tab',
|
||||||
|
'open-create-scheduler-tab',
|
||||||
|
'close-context',
|
||||||
|
'reload'
|
||||||
|
],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isDeleteModal: false,
|
isDeleteModal: false,
|
||||||
|
@ -88,6 +88,7 @@ export default {
|
|||||||
selectedTable: Object,
|
selectedTable: Object,
|
||||||
selectedSchema: String
|
selectedSchema: String
|
||||||
},
|
},
|
||||||
|
emits: ['close-context', 'duplicate-table', 'reload', 'delete-table'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isDeleteModal: false,
|
isDeleteModal: false,
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'WorkspaceTabNewTableEmptyState'
|
name: 'WorkspaceTabNewTableEmptyState',
|
||||||
|
emits: ['new-field']
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -185,6 +185,7 @@ export default {
|
|||||||
func: String,
|
func: String,
|
||||||
workspace: Object
|
workspace: Object
|
||||||
},
|
},
|
||||||
|
emits: ['hide', 'parameters-update'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
parametersProxy: [],
|
parametersProxy: [],
|
||||||
|
@ -185,6 +185,7 @@ export default {
|
|||||||
routine: String,
|
routine: String,
|
||||||
workspace: Object
|
workspace: Object
|
||||||
},
|
},
|
||||||
|
emits: ['parameters-update', 'hide'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
parametersProxy: [],
|
parametersProxy: [],
|
||||||
|
@ -154,6 +154,7 @@ export default {
|
|||||||
localOptions: Object,
|
localOptions: Object,
|
||||||
workspace: Object
|
workspace: Object
|
||||||
},
|
},
|
||||||
|
emits: ['hide', 'options-update'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
optionsProxy: {},
|
optionsProxy: {},
|
||||||
|
@ -56,6 +56,7 @@ export default {
|
|||||||
indexTypes: Array,
|
indexTypes: Array,
|
||||||
selectedField: Object
|
selectedField: Object
|
||||||
},
|
},
|
||||||
|
emits: ['close-context', 'duplicate-selected', 'delete-selected', 'add-new-index', 'add-to-index'],
|
||||||
computed: {
|
computed: {
|
||||||
hasPrimary () {
|
hasPrimary () {
|
||||||
return this.indexes.some(index => index.type === 'PRIMARY');
|
return this.indexes.some(index => index.type === 'PRIMARY');
|
||||||
|
@ -148,6 +148,7 @@ export default {
|
|||||||
schema: String,
|
schema: String,
|
||||||
mode: String
|
mode: String
|
||||||
},
|
},
|
||||||
|
emits: ['add-new-index', 'add-to-index', 'rename-field', 'duplicate-field', 'remove-field'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
resultsSize: 1000,
|
resultsSize: 1000,
|
||||||
|
@ -221,6 +221,7 @@ export default {
|
|||||||
fields: Array,
|
fields: Array,
|
||||||
workspace: Object
|
workspace: Object
|
||||||
},
|
},
|
||||||
|
emits: ['foreigns-update', 'hide'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
foreignProxy: [],
|
foreignProxy: [],
|
||||||
|
@ -153,6 +153,7 @@ export default {
|
|||||||
workspace: Object,
|
workspace: Object,
|
||||||
indexTypes: Array
|
indexTypes: Array
|
||||||
},
|
},
|
||||||
|
emits: ['hide', 'indexes-update'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
indexesProxy: [],
|
indexesProxy: [],
|
||||||
|
@ -358,6 +358,7 @@ export default {
|
|||||||
foreigns: Array,
|
foreigns: Array,
|
||||||
customizations: Object
|
customizations: Object
|
||||||
},
|
},
|
||||||
|
emits: ['contextmenu', 'rename-field'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
localRow: {},
|
localRow: {},
|
||||||
|
@ -132,6 +132,7 @@ export default {
|
|||||||
isSelected: Boolean,
|
isSelected: Boolean,
|
||||||
elementType: { type: String, default: 'table' }
|
elementType: { type: String, default: 'table' }
|
||||||
},
|
},
|
||||||
|
emits: ['update-field', 'delete-selected', 'hard-sort'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
resultsSize: 0,
|
resultsSize: 0,
|
||||||
|
@ -61,6 +61,7 @@ export default {
|
|||||||
selectedRows: Array,
|
selectedRows: Array,
|
||||||
selectedCell: Object
|
selectedCell: Object
|
||||||
},
|
},
|
||||||
|
emits: ['show-delete-modal', 'close-context', 'set-null', 'copy-cell', 'copy-row'],
|
||||||
methods: {
|
methods: {
|
||||||
showConfirmModal () {
|
showConfirmModal () {
|
||||||
this.$emit('show-delete-modal');
|
this.$emit('show-delete-modal');
|
||||||
|
@ -243,6 +243,7 @@ export default {
|
|||||||
itemHeight: Number,
|
itemHeight: Number,
|
||||||
elementType: { type: String, default: 'table' }
|
elementType: { type: String, default: 'table' }
|
||||||
},
|
},
|
||||||
|
emits: ['update-field', 'select-row', 'contextmenu'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isInlineEditor: {},
|
isInlineEditor: {},
|
||||||
|
@ -79,6 +79,7 @@ export default {
|
|||||||
fields: Array,
|
fields: Array,
|
||||||
connClient: String
|
connClient: String
|
||||||
},
|
},
|
||||||
|
emits: ['filter-change', 'filter'],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
rows: [],
|
rows: [],
|
||||||
|
Reference in New Issue
Block a user