1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-02-16 19:50:37 +01:00

Merge branch 'develop' of https://github.com/antares-sql/antares into beta

This commit is contained in:
Fabio Di Stasio 2023-10-26 01:06:54 +02:00
commit cf24adf99e
8 changed files with 20 additions and 11 deletions

8
package-lock.json generated
View File

@ -63,7 +63,7 @@
"chalk": "~4.1.2",
"cross-env": "~7.0.2",
"css-loader": "~6.5.0",
"electron": "~22.3.23",
"electron": "~22.3.27",
"electron-builder": "~22.10.3",
"eslint": "~7.32.0",
"eslint-config-standard": "~16.0.3",
@ -5744,9 +5744,9 @@
}
},
"node_modules/electron": {
"version": "22.3.23",
"resolved": "https://registry.npmjs.org/electron/-/electron-22.3.23.tgz",
"integrity": "sha512-2p6NsLFPfM2RmgATchjKZKBUP3O6NxQMWOrHt9W5U2GRtfI8qWlicUR1wnh5D1VLt4c1YsjvpF6dct+1JNRubA==",
"version": "22.3.27",
"resolved": "https://registry.npmjs.org/electron/-/electron-22.3.27.tgz",
"integrity": "sha512-7Rht21vHqj4ZFRnKuZdFqZFsvMBCmDqmjetiMqPtF+TmTBiGne1mnstVXOA/SRGhN2Qy5gY5bznJKpiqogjM8A==",
"hasInstallScript": true,
"dependencies": {
"@electron/get": "^2.0.0",

View File

@ -171,7 +171,7 @@
"chalk": "~4.1.2",
"cross-env": "~7.0.2",
"css-loader": "~6.5.0",
"electron": "~22.3.23",
"electron": "~22.3.27",
"electron-builder": "~22.10.3",
"eslint": "~7.32.0",
"eslint-config-standard": "~16.0.3",

View File

@ -9,6 +9,7 @@ export const defaults: Customizations = {
dataTypes: [],
indexTypes: [],
foreignActions: [],
operators: ['=', '!=', '>', '<', '>=', '<=', 'IN', 'NOT IN', 'LIKE', 'NOT LIKE', 'BETWEEN', 'IS NULL', 'IS NOT NULL'],
// Core
database: false,
collations: false,

View File

@ -9,6 +9,7 @@ export const customizations: Customizations = {
defaultUser: 'root',
defaultDatabase: null,
dataTypes: mysqlTypes,
operators: ['=', '!=', '>', '<', '>=', '<=', 'IN', 'NOT IN', 'LIKE', 'NOT LIKE', 'RLIKE', 'NOT RLIKE', 'BETWEEN', 'IS NULL', 'IS NOT NULL'],
indexTypes: [
'PRIMARY',
'INDEX',

View File

@ -1,4 +1,5 @@
import { TypesGroup } from './antares';
import { TableFilterOperator } from './tableApis';
export interface Customizations {
// Defaults
@ -8,6 +9,7 @@ export interface Customizations {
dataTypes?: TypesGroup[];
indexTypes?: string[];
foreignActions?: string[];
operators?: TableFilterOperator[];
// Core
database?: boolean;
collations?: boolean;

View File

@ -21,7 +21,7 @@ export interface TableDeleteParams {
rows: {[key: string]: any};
}
export type TableFilterOperator = '=' | '!=' | '>' | '<' | '>=' | '<=' | 'IN' | 'NOT IN' | 'LIKE' | 'NOT LIKE' | 'BETWEEN' | 'IS NULL' | 'IS NOT NULL'
export type TableFilterOperator = '=' | '!=' | '>' | '<' | '>=' | '<=' | 'IN' | 'NOT IN' | 'LIKE' | 'NOT LIKE' | 'RLIKE' | 'NOT RLIKE' | 'BETWEEN' | 'IS NULL' | 'IS NOT NULL'
export interface TableFilterClausole {
active: boolean;

View File

@ -183,6 +183,7 @@
<WorkspaceTabTableFilters
v-if="isSearch"
:fields="fields"
:is-quering="isQuering"
:conn-client="connection.client"
@filter="updateFilters"
@filter-change="onFilterChange"

View File

@ -9,6 +9,7 @@
<input
v-model="row.active"
type="checkbox"
:disabled="isQuering"
@change="doFilter"
><i class="form-icon" />
</label>
@ -18,11 +19,13 @@
:options="fields"
option-track-by="name"
option-label="name"
:disabled="isQuering"
/>
<BaseSelect
v-model="row.op"
class="form-select ml-2 col-auto select-sm"
:options="operators"
:disabled="isQuering"
/>
<div class="workspace-table-filters-row-value ml-2">
<input
@ -30,12 +33,14 @@
v-model="row.value"
type="text"
class="form-input input-sm"
:disabled="isQuering"
>
<input
v-if="row.op === 'BETWEEN'"
v-model="row.value2"
type="text"
class="form-input ml-2 input-sm"
:disabled="isQuering"
>
</div>
<button
@ -87,15 +92,14 @@ const { t } = useI18n();
const props = defineProps({
fields: Array as Prop<TableField[]>,
connClient: String as Prop<ClientCode>
connClient: String as Prop<ClientCode>,
isQuering: Boolean
});
const emit = defineEmits(['filter-change', 'filter']);
const rows = ref([]);
const operators = ref<TableFilterOperator[]>([
'=', '!=', '>', '<', '>=', '<=', 'IN', 'NOT IN', 'LIKE', 'NOT LIKE', 'BETWEEN', 'IS NULL', 'IS NOT NULL'
]);
const operators: TableFilterOperator[] = customizations[props.connClient].operators;
const clientCustomizations = computed(() => customizations[props.connClient]);
@ -122,7 +126,7 @@ const createClausole = (filter: TableFilterClausole) => {
const { elementsWrapper: ew, stringsWrapper: sw } = clientCustomizations.value;
let value;
if (isNumeric && !['IN', 'NOT IN'].includes(filter.op)) {
if (isNumeric && !['IN', 'NOT IN', 'RLIKE', 'NOT RLIKE'].includes(filter.op)) {
if (isNaN(Number(filter.value)))
filter.value = '';
if (isNaN(Number(filter.value2)))