1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

Compare commits

...

6 Commits

10 changed files with 4851 additions and 11843 deletions

View File

@@ -2,6 +2,21 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [0.7.11](https://github.com/antares-sql/antares/compare/v0.7.10...v0.7.11) (2023-06-04)
### Features
* context menu to close tabs, closes [#392](https://github.com/antares-sql/antares/issues/392) ([787014c](https://github.com/antares-sql/antares/commit/787014c38df743315c04962871a3801805a93c55))
### Bug Fixes
* disable filter during table content loading, fixes [#588](https://github.com/antares-sql/antares/issues/588) ([e60726c](https://github.com/antares-sql/antares/commit/e60726c741276b7da0d54c0986d2a45ed9979bc9))
* **MySQL:** unable to get users list with some db settings ([9046707](https://github.com/antares-sql/antares/commit/904670781d47b1ac0dcfd982215ba1786f8c8145))
* unique keys not recognized in table settings on some MariaDB versions ([4461998](https://github.com/antares-sql/antares/commit/446199827be4b07382453739f42d46fa0201d04c))
* weird behavior in some text editors ([22bdaac](https://github.com/antares-sql/antares/commit/22bdaac18b1c46a57802cbbd3ad339ee075ec70b))
### [0.7.10](https://github.com/antares-sql/antares/compare/v0.7.9...v0.7.10) (2023-05-28)

16537
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"name": "antares",
"productName": "Antares",
"version": "0.7.10",
"version": "0.7.11",
"description": "A modern, fast and productivity driven SQL client with a focus in UX.",
"license": "MIT",
"repository": "https://github.com/antares-sql/antares.git",

View File

@@ -689,11 +689,11 @@ export class MySQLClient extends AntaresCore {
return rows.map(row => {
return {
unique: !row.Non_unique,
unique: !Number(row.Non_unique),
name: row.Key_name,
column: row.Column_name,
indexType: row.Index_type,
type: row.Key_name === 'PRIMARY' ? 'PRIMARY' : !row.Non_unique ? 'UNIQUE' : row.Index_type === 'FULLTEXT' ? 'FULLTEXT' : 'INDEX',
type: row.Key_name === 'PRIMARY' ? 'PRIMARY' : !Number(row.Non_unique) ? 'UNIQUE' : row.Index_type === 'FULLTEXT' ? 'FULLTEXT' : 'INDEX',
cardinality: row.Cardinality,
comment: row.Comment,
indexComment: row.Index_comment
@@ -764,7 +764,7 @@ export class MySQLClient extends AntaresCore {
}
async getUsers () {
const { rows } = await this.raw('SELECT `user`, `host`, authentication_string AS `password` FROM `mysql`.`user`');
const { rows } = await this.raw('SELECT `user` as \'user\', `host` as \'host\', authentication_string AS `password` FROM `mysql`.`user`');
return rows.map(row => {
return {

View File

@@ -124,8 +124,8 @@ else {
if (isWindows)
mainWindow.show();
// if (isDevelopment)
// mainWindow.webContents.openDevTools();
if (isDevelopment)
mainWindow.webContents.openDevTools();
process.on('uncaughtException', error => {
mainWindow.webContents.send('unhandled-exception', error);

View File

@@ -45,7 +45,7 @@ watch(() => props.mode, () => {
});
watch(() => props.modelValue, () => {
if (editor)
if (editor && props.readOnly)
editor.session.setValue(props.modelValue);
});

View File

@@ -1,5 +1,15 @@
<template>
<div v-show="isSelected" class="workspace column columns col-gapless">
<WorkspaceTabsContext
v-if="isTabContext"
:context-event="contextEvent"
:selected-tab="selectedContextTab"
@close-all-tabs="closeAllTabs"
@close-other-tabs="closeOtherTabs"
@close-to-left="closeTabsToLeft"
@close-to-right="closeTabsToRight"
@close-context="closeContext"
/>
<WorkspaceExploreBar
v-if="workspace?.connectionStatus === 'connected'"
:connection="connection"
@@ -23,6 +33,7 @@
:class="{'active': selectedTab === element.uid}"
@mousedown.left="selectTab({uid: workspace.uid, tab: element.uid})"
@mouseup.middle="closeTab(element)"
@contextmenu.prevent="contextMenu($event, element)"
>
<a
v-if="element.type === 'query'"
@@ -501,6 +512,7 @@ import WorkspaceTabNewRoutine from '@/components/WorkspaceTabNewRoutine.vue';
import WorkspaceTabNewFunction from '@/components/WorkspaceTabNewFunction.vue';
import WorkspaceTabNewScheduler from '@/components/WorkspaceTabNewScheduler.vue';
import WorkspaceTabNewTriggerFunction from '@/components/WorkspaceTabNewTriggerFunction.vue';
import WorkspaceTabsContext from '@/components/WorkspaceTabsContext.vue';
import WorkspaceTabPropsTable from '@/components/WorkspaceTabPropsTable.vue';
import WorkspaceTabPropsView from '@/components/WorkspaceTabPropsView.vue';
@@ -545,6 +557,9 @@ const hasWheelEvent = ref(false);
const isProcessesModal = ref(false);
const unsavedTab = ref(null);
const tabWrap = ref(null);
const contextEvent = ref(null);
const isTabContext = ref(false);
const selectedContextTab = ref(null);
const workspace = computed(() => getWorkspace(props.connection.uid));
@@ -627,6 +642,34 @@ const closeTab = (tab: WorkspaceTab, force = false) => {
removeTab({ uid: props.connection.uid, tab: tab.uid });
};
const closeAllTabs = () => {
for (const tab of draggableTabs.value)
removeTab({ uid: props.connection.uid, tab: tab.uid });
};
const closeOtherTabs = () => {
const otherTabs = draggableTabs.value.filter(t => t.uid !== selectedContextTab.value.uid);
for (const tab of otherTabs)
removeTab({ uid: props.connection.uid, tab: tab.uid });
};
const closeTabsToLeft = () => {
const tabIndex = draggableTabs.value.findIndex(t => t.uid === selectedContextTab.value.uid);
const leftTabs = draggableTabs.value.filter((t, i) => i < tabIndex);
for (const tab of leftTabs)
removeTab({ uid: props.connection.uid, tab: tab.uid });
};
const closeTabsToRight = () => {
const tabIndex = draggableTabs.value.findIndex(t => t.uid === selectedContextTab.value.uid);
const leftTabs = draggableTabs.value.filter((t, i) => i > tabIndex);
for (const tab of leftTabs)
removeTab({ uid: props.connection.uid, tab: tab.uid });
};
const showProcessesModal = () => {
isProcessesModal.value = true;
};
@@ -647,6 +690,16 @@ const addWheelEvent = () => {
}
};
const contextMenu = (event: MouseEvent, tab: WorkspaceTab) => {
selectedContextTab.value = tab;
contextEvent.value = event;
isTabContext.value = true;
};
const closeContext = () => {
isTabContext.value = false;
};
(async () => {
await addWorkspace(props.connection.uid);
const isInitiated = await Connection.checkConnection(props.connection.uid);

View File

@@ -73,6 +73,7 @@
<button
class="btn btn-sm"
:title="t('word.filter')"
:disabled="isQuering"
:class="{'btn-primary': isSearch, 'btn-dark': !isSearch}"
@click="isSearch = !isSearch"
>
@@ -269,7 +270,7 @@ const keyUsage = computed(() => {
});
const getTableData = async () => {
if (!props.table || !props.isSelected) return;
if (!props.table || !props.isSelected || isQuering.value) return;
isQuering.value = true;
// if table changes clear cached values

View File

@@ -0,0 +1,66 @@
<template>
<BaseContextMenu
:context-event="props.contextEvent"
@close-context="closeContext"
>
<div class="context-element" @click.stop="closeAllTabs">
<span class="d-flex"><i class="mdi mdi-18px mdi-asterisk text-light pr-1" /> {{ t('message.closeAllTabs') }}</span>
</div>
<div class="context-element" @click.stop="closeOtherTabs">
<span class="d-flex"><i class="mdi mdi-18px mdi-not-equal text-light pr-1" /> {{ t('message.closeOtherTabs') }}</span>
</div>
<div class="context-element" @click.stop="closeLeftTabs">
<span class="d-flex"><i class="mdi mdi-18px mdi-less-than text-light pr-1" /> {{ t('message.closeTabsToLeft') }}</span>
</div>
<div class="context-element" @click.stop="closeRightTabs">
<span class="d-flex"><i class="mdi mdi-18px mdi-greater-than text-light pr-1" /> {{ t('message.closeTabsToRight') }}</span>
</div>
</BaseContextMenu>
</template>
<script setup lang="ts">
import BaseContextMenu from '@/components/BaseContextMenu.vue';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const props = defineProps({
contextEvent: MouseEvent,
selectedTab: Object
});
const emit = defineEmits([
'close-context',
'close-all-tabs',
'close-other-tabs',
'close-to-left',
'close-to-right'
]);
const closeContext = () => {
emit('close-context');
};
const closeAllTabs = () => {
emit('close-all-tabs');
closeContext();
};
const closeLeftTabs = () => {
emit('close-to-left');
closeContext();
};
const closeRightTabs = () => {
emit('close-to-right');
closeContext();
};
const closeOtherTabs = () => {
emit('close-other-tabs');
closeContext();
};
</script>

View File

@@ -344,7 +344,11 @@ export const enUS = {
noResultsPresent: 'No results present',
sqlExportOptions: 'SQL export options',
targetTable: 'Target table',
phpArray: 'PHP array'
phpArray: 'PHP array',
closeAllTabs: 'Close all tabs',
closeOtherTabs: 'Close other tabs',
closeTabsToLeft: 'Close tabs to the left',
closeTabsToRight: 'Close tabs to the right'
},
faker: {
address: 'Address',