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

Compare commits

..

10 Commits

14 changed files with 14820 additions and 412 deletions

BIN
.nvmrc Normal file

Binary file not shown.

View File

@@ -2,6 +2,20 @@
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. 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.19](https://github.com/antares-sql/antares/compare/v0.7.19-beta.2...v0.7.19) (2023-11-01)
### Bug Fixes
* table field changes not saved on text fields if pressing enter on textarea modal ([f6fb266](https://github.com/antares-sql/antares/commit/f6fb266771f2d798c8ae42b997c1e33520cf21c3))
### [0.7.19-beta.2](https://github.com/antares-sql/antares/compare/v0.7.19-beta.1...v0.7.19-beta.2) (2023-10-29)
### Bug Fixes
* ssh tunnel keep-alive not working properly ([debc1da](https://github.com/antares-sql/antares/commit/debc1da289d5e35d59adf69d094b329cf93af536))
### [0.7.19-beta.1](https://github.com/antares-sql/antares/compare/v0.7.19-beta.0...v0.7.19-beta.1) (2023-10-25) ### [0.7.19-beta.1](https://github.com/antares-sql/antares/compare/v0.7.19-beta.0...v0.7.19-beta.1) (2023-10-25)

14951
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{ {
"name": "antares", "name": "antares",
"productName": "Antares", "productName": "Antares",
"version": "0.7.19-beta.1", "version": "0.7.19",
"description": "A modern, fast and productivity driven SQL client with a focus in UX.", "description": "A modern, fast and productivity driven SQL client with a focus in UX.",
"license": "MIT", "license": "MIT",
"repository": "https://github.com/antares-sql/antares.git", "repository": "https://github.com/antares-sql/antares.git",
@@ -146,7 +146,7 @@
"source-map-support": "~0.5.20", "source-map-support": "~0.5.20",
"spectre.css": "~0.5.9", "spectre.css": "~0.5.9",
"sql-formatter": "~13.0.0", "sql-formatter": "~13.0.0",
"ssh2-promise": "~1.0.2", "@fabio286/ssh2-promise": "~1.0.4-b",
"v-mask": "~2.3.0", "v-mask": "~2.3.0",
"vue": "~3.3.4", "vue": "~3.3.4",
"vue-i18n": "~9.2.2", "vue-i18n": "~9.2.2",
@@ -193,10 +193,10 @@
"sass-loader": "~12.3.0", "sass-loader": "~12.3.0",
"standard-version": "~9.3.1", "standard-version": "~9.3.1",
"style-loader": "~3.3.1", "style-loader": "~3.3.1",
"stylelint": "~14.9.1", "stylelint": "^15.11.0",
"stylelint-config-recommended-vue": "~1.4.0", "stylelint-config-recommended-vue": "~1.5.0",
"stylelint-config-standard": "~26.0.0", "stylelint-config-standard": "~34.0.0",
"stylelint-scss": "~4.3.0", "stylelint-scss": "~5.3.0",
"tree-kill": "~1.2.2", "tree-kill": "~1.2.2",
"ts-loader": "~9.2.8", "ts-loader": "~9.2.8",
"ts-node": "~10.9.1", "ts-node": "~10.9.1",
@@ -208,10 +208,5 @@
"webpack-cli": "~4.9.1", "webpack-cli": "~4.9.1",
"webpack-dev-server": "~4.11.1", "webpack-dev-server": "~4.11.1",
"xvfb-maybe": "~0.2.1" "xvfb-maybe": "~0.2.1"
},
"overrides": {
"ssh2-promise": {
"ssh2": "github:Fabio286/ssh2"
}
} }
} }

View File

@@ -1,3 +1,4 @@
import SSHConfig from '@fabio286/ssh2-promise/lib/sshConfig';
import * as mysql from 'mysql2/promise'; import * as mysql from 'mysql2/promise';
import * as pg from 'pg'; import * as pg from 'pg';
import { FirebirdSQLClient } from 'src/main/libs/clients/FirebirdSQLClient'; import { FirebirdSQLClient } from 'src/main/libs/clients/FirebirdSQLClient';
@@ -5,7 +6,6 @@ import MysqlExporter from 'src/main/libs/exporters/sql/MysqlExporter';
import PostgreSQLExporter from 'src/main/libs/exporters/sql/PostgreSQLExporter'; import PostgreSQLExporter from 'src/main/libs/exporters/sql/PostgreSQLExporter';
import MySQLImporter from 'src/main/libs/importers/sql/MySQLlImporter'; import MySQLImporter from 'src/main/libs/importers/sql/MySQLlImporter';
import PostgreSQLImporter from 'src/main/libs/importers/sql/PostgreSQLImporter'; import PostgreSQLImporter from 'src/main/libs/importers/sql/PostgreSQLImporter';
import SSHConfig from 'ssh2-promise/lib/sshConfig';
import { MySQLClient } from '../../main/libs/clients/MySQLClient'; import { MySQLClient } from '../../main/libs/clients/MySQLClient';
import { PostgreSQLClient } from '../../main/libs/clients/PostgreSQLClient'; import { PostgreSQLClient } from '../../main/libs/clients/PostgreSQLClient';

View File

@@ -55,7 +55,7 @@ export default (connections: {[key: string]: antares.Client}) => {
port: conn.sshPort ? conn.sshPort : 22, port: conn.sshPort ? conn.sshPort : 22,
privateKey: conn.sshKey ? fs.readFileSync(conn.sshKey).toString() : null, privateKey: conn.sshKey ? fs.readFileSync(conn.sshKey).toString() : null,
passphrase: conn.sshPassphrase, passphrase: conn.sshPassphrase,
keepaliveInterval: conn.sshKeepAliveInterval ?? conn.sshKeepAliveInterval*1000 keepaliveInterval: conn.sshKeepAliveInterval ? conn.sshKeepAliveInterval*1000 : null
}; };
} }
@@ -137,7 +137,7 @@ export default (connections: {[key: string]: antares.Client}) => {
port: conn.sshPort ? conn.sshPort : 22, port: conn.sshPort ? conn.sshPort : 22,
privateKey: conn.sshKey ? fs.readFileSync(conn.sshKey).toString() : null, privateKey: conn.sshKey ? fs.readFileSync(conn.sshKey).toString() : null,
passphrase: conn.sshPassphrase, passphrase: conn.sshPassphrase,
keepaliveInterval: conn.sshKeepAliveInterval ?? conn.sshKeepAliveInterval*1000 keepaliveInterval: conn.sshKeepAliveInterval ? conn.sshKeepAliveInterval*1000 : null
}; };
} }

View File

@@ -1,7 +1,7 @@
import * as antares from 'common/interfaces/antares'; import * as antares from 'common/interfaces/antares';
import mysql from 'mysql2/promise'; import mysql from 'mysql2/promise';
import * as pg from 'pg'; import * as pg from 'pg';
import SSH2Promise from 'ssh2-promise'; import SSH2Promise = require('@fabio286/ssh2-promise');
const queryLogger = ({ sql, cUid }: {sql: string; cUid: string}) => { const queryLogger = ({ sql, cUid }: {sql: string; cUid: string}) => {
// Remove comments, newlines and multiple spaces // Remove comments, newlines and multiple spaces
@@ -16,7 +16,7 @@ const queryLogger = ({ sql, cUid }: {sql: string; cUid: string}) => {
/** /**
* As Simple As Possible Query Builder Core * As Simple As Possible Query Builder Core
*/ */
export abstract class AntaresCore { export abstract class BaseClient {
_client: antares.ClientCode; _client: antares.ClientCode;
protected _cUid: string protected _cUid: string
protected _params: mysql.ConnectionOptions | pg.ClientConfig | { databasePath: string; readonly: boolean}; protected _params: mysql.ConnectionOptions | pg.ClientConfig | { databasePath: string; readonly: boolean};

View File

@@ -4,9 +4,9 @@ import * as antares from 'common/interfaces/antares';
import * as firebird from 'node-firebird'; import * as firebird from 'node-firebird';
import * as path from 'path'; import * as path from 'path';
import { AntaresCore } from '../AntaresCore'; import { BaseClient } from './BaseClient';
export class FirebirdSQLClient extends AntaresCore { export class FirebirdSQLClient extends BaseClient {
private _schema?: string; private _schema?: string;
private _runningConnections: Map<string, number>; private _runningConnections: Map<string, number>;
private _connectionsToCommit: Map<string, firebird.Transaction>; private _connectionsToCommit: Map<string, firebird.Transaction>;

View File

@@ -1,12 +1,12 @@
import SSH2Promise = require('@fabio286/ssh2-promise');
import SSHConfig from '@fabio286/ssh2-promise/lib/sshConfig';
import dataTypes from 'common/data-types/mysql'; import dataTypes from 'common/data-types/mysql';
import * as antares from 'common/interfaces/antares'; import * as antares from 'common/interfaces/antares';
import * as mysql from 'mysql2/promise'; import * as mysql from 'mysql2/promise';
import { AntaresCore } from '../AntaresCore'; import { BaseClient } from './BaseClient';
import SSH2Promise = require('ssh2-promise');
import SSHConfig from 'ssh2-promise/lib/sshConfig';
export class MySQLClient extends AntaresCore { export class MySQLClient extends BaseClient {
private _schema?: string; private _schema?: string;
private _runningConnections: Map<string, number>; private _runningConnections: Map<string, number>;
private _connectionsToCommit: Map<string, mysql.Connection | mysql.PoolConnection>; private _connectionsToCommit: Map<string, mysql.Connection | mysql.PoolConnection>;
@@ -168,7 +168,10 @@ export class MySQLClient extends AntaresCore {
dbConfig.port = tunnel.localPort; dbConfig.port = tunnel.localPort;
} }
catch (err) { catch (err) {
if (this._ssh) this._ssh.close(); if (this._ssh) {
this._ssh.close();
this._ssh.closeTunnel();
}
throw err; throw err;
} }
} }
@@ -187,7 +190,10 @@ export class MySQLClient extends AntaresCore {
this._connection.end(); this._connection.end();
clearInterval(this._keepaliveTimer); clearInterval(this._keepaliveTimer);
this._keepaliveTimer = undefined; this._keepaliveTimer = undefined;
if (this._ssh) this._ssh.close(); if (this._ssh) {
this._ssh.close();
this._ssh.closeTunnel();
}
} }
async getConnection () { async getConnection () {

View File

@@ -1,13 +1,13 @@
import SSH2Promise = require('@fabio286/ssh2-promise');
import SSHConfig from '@fabio286/ssh2-promise/lib/sshConfig';
import dataTypes from 'common/data-types/postgresql'; import dataTypes from 'common/data-types/postgresql';
import * as antares from 'common/interfaces/antares'; import * as antares from 'common/interfaces/antares';
import * as pg from 'pg'; import * as pg from 'pg';
import * as pgAst from 'pgsql-ast-parser'; import * as pgAst from 'pgsql-ast-parser';
import { AntaresCore } from '../AntaresCore';
import SSH2Promise = require('ssh2-promise');
import SSHConfig from 'ssh2-promise/lib/sshConfig';
import { ConnectionOptions } from 'tls'; import { ConnectionOptions } from 'tls';
import { BaseClient } from './BaseClient';
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
function pgToString (value: any) { function pgToString (value: any) {
return value.toString(); return value.toString();
@@ -81,7 +81,7 @@ type builtinsTypes =
'JSONB' | 'JSONB' |
'REGNAMESPACE' | 'REGNAMESPACE' |
'REGROLE'; 'REGROLE';
export class PostgreSQLClient extends AntaresCore { export class PostgreSQLClient extends BaseClient {
private _schema?: string; private _schema?: string;
private _runningConnections: Map<string, number>; private _runningConnections: Map<string, number>;
private _connectionsToCommit: Map<string, pg.Client | pg.PoolClient>; private _connectionsToCommit: Map<string, pg.Client | pg.PoolClient>;
@@ -180,7 +180,10 @@ export class PostgreSQLClient extends AntaresCore {
dbConfig.port = tunnel.localPort; dbConfig.port = tunnel.localPort;
} }
catch (err) { catch (err) {
if (this._ssh) this._ssh.close(); if (this._ssh) {
this._ssh.close();
this._ssh.closeTunnel();
}
throw err; throw err;
} }
} }
@@ -236,7 +239,10 @@ export class PostgreSQLClient extends AntaresCore {
this._connection.end(); this._connection.end();
clearInterval(this._keepaliveTimer); clearInterval(this._keepaliveTimer);
this._keepaliveTimer = undefined; this._keepaliveTimer = undefined;
if (this._ssh) this._ssh.close(); if (this._ssh) {
this._ssh.close();
this._ssh.closeTunnel();
}
} }
private async keepAlive () { private async keepAlive () {

View File

@@ -3,9 +3,9 @@ import dataTypes from 'common/data-types/sqlite';
import { DATETIME, FLOAT, NUMBER, TIME } from 'common/fieldTypes'; import { DATETIME, FLOAT, NUMBER, TIME } from 'common/fieldTypes';
import * as antares from 'common/interfaces/antares'; import * as antares from 'common/interfaces/antares';
import { AntaresCore } from '../AntaresCore'; import { BaseClient } from './BaseClient';
export class SQLiteClient extends AntaresCore { export class SQLiteClient extends BaseClient {
private _schema?: string; private _schema?: string;
private _connectionsToCommit: Map<string, sqlite.Database>; private _connectionsToCommit: Map<string, sqlite.Database>;
protected _connection?: sqlite.Database; protected _connection?: sqlite.Database;

View File

@@ -1,8 +1,8 @@
import SSHConfig from '@fabio286/ssh2-promise/lib/sshConfig';
import * as antares from 'common/interfaces/antares'; import * as antares from 'common/interfaces/antares';
import { ImportOptions } from 'common/interfaces/importer'; import { ImportOptions } from 'common/interfaces/importer';
import * as mysql from 'mysql2'; import * as mysql from 'mysql2';
import * as pg from 'pg'; import * as pg from 'pg';
import SSHConfig from 'ssh2-promise/lib/sshConfig';
import { MySQLClient } from '../libs/clients/MySQLClient'; import { MySQLClient } from '../libs/clients/MySQLClient';
import { PostgreSQLClient } from '../libs/clients/PostgreSQLClient'; import { PostgreSQLClient } from '../libs/clients/PostgreSQLClient';

View File

@@ -580,7 +580,7 @@ const onKey = (e: KeyboardEvent) => {
if (!editingField.value && e.key === 'Enter') if (!editingField.value && e.key === 'Enter')
return editON(props.selectedCell); return editON(props.selectedCell);
if (editingField.value && e.key === 'Enter' && !isBaseSelectField.value) if (editingField.value && e.key === 'Enter' && !isBaseSelectField.value && !isTextareaEditor.value)
return editOFF(); return editOFF();
if (editingField.value && e.key === 'Escape') { if (editingField.value && e.key === 'Escape') {

View File

@@ -4,109 +4,109 @@ declare module '@/App.vue';
declare module 'v-mask'; declare module 'v-mask';
declare module 'json2php'; declare module 'json2php';
declare module 'vuedraggable' {// <- to export as default declare module 'vuedraggable' {// <- to export as default
const draggableComponent: import('vue').DefineComponent<{ const draggableComponent: import('vue').DefineComponent<{
list: { list: {
type: ArrayConstructor; type: ArrayConstructor;
required: boolean; required: boolean;
default: any; default: any;
}; };
modelValue: { modelValue: {
type: ArrayConstructor; type: ArrayConstructor;
required: boolean; required: boolean;
default: any; default: any;
}; };
itemKey: { itemKey: {
type: (FunctionConstructor | StringConstructor)[]; type: (FunctionConstructor | StringConstructor)[];
required: boolean; required: boolean;
}; };
clone: { clone: {
type: FunctionConstructor; type: FunctionConstructor;
default: (original: any) => any; default: (original: any) => any;
}; };
tag: { tag: {
type: StringConstructor; type: StringConstructor;
default: string; default: string;
}; };
move: { move: {
type: FunctionConstructor; type: FunctionConstructor;
default: any; default: any;
}; };
componentData: { componentData: {
type: ObjectConstructor; type: ObjectConstructor;
required: boolean; required: boolean;
default: any; default: any;
}; };
}, unknown, { }, unknown, {
error: boolean; error: boolean;
}, { }, {
realList(): any; realList(): any;
getKey(): any; getKey(): any;
}, { }, {
getUnderlyingVm(domElement: any): any; getUnderlyingVm(domElement: any): any;
getUnderlyingPotencialDraggableComponent(htmElement: any): any; getUnderlyingPotencialDraggableComponent(htmElement: any): any;
emitChanges(evt: any): void; emitChanges(evt: any): void;
alterList(onList: any): void; alterList(onList: any): void;
spliceList(): void; spliceList(): void;
updatePosition(oldIndex: any, newIndex: any): void; updatePosition(oldIndex: any, newIndex: any): void;
getRelatedContextFromMoveEvent({ to, related }: { getRelatedContextFromMoveEvent({ to, related }: {
to: any; to: any;
related: any; related: any;
}): any; }): any;
getVmIndexFromDomIndex(domIndex: any): any; getVmIndexFromDomIndex(domIndex: any): any;
onDragStart(evt: any): void; onDragStart(evt: any): void;
onDragAdd(evt: any): void; onDragAdd(evt: any): void;
onDragRemove(evt: any): void; onDragRemove(evt: any): void;
onDragUpdate(evt: any): void; onDragUpdate(evt: any): void;
computeFutureIndex(relatedContext: any, evt: any): any; computeFutureIndex(relatedContext: any, evt: any): any;
onDragMove(evt: any, originalEvent: any): any; onDragMove(evt: any, originalEvent: any): any;
onDragEnd(): void; onDragEnd(): void;
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, any[], any, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, Readonly<{ }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, any[], any, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, Readonly<{
move: Function; move: Function;
tag: string; tag: string;
clone: Function; clone: Function;
list: unknown[]; list: unknown[];
modelValue: unknown[]; modelValue: unknown[];
componentData: Record<string, any>; componentData: Record<string, any>;
} & { } & {
itemKey?: string | Function; itemKey?: string | Function;
}>, { }>, {
move: Function; move: Function;
tag: string; tag: string;
clone: Function; clone: Function;
list: unknown[]; list: unknown[];
modelValue: unknown[]; modelValue: unknown[];
componentData: Record<string, any>; componentData: Record<string, any>;
}>; }>;
export = draggableComponent; export = draggableComponent;
} }
declare const SvgIcon: import('vue').DefineComponent<{ declare const SvgIcon: import('vue').DefineComponent<{
type: { type: {
type: StringConstructor; type: StringConstructor;
default: string; default: string;
}; };
path: { path: {
type: StringConstructor; type: StringConstructor;
default: string; default: string;
}; };
size: { size: {
type: NumberConstructor; type: NumberConstructor;
optional: boolean; optional: boolean;
}; };
viewbox: { viewbox: {
type: StringConstructor; type: StringConstructor;
optional: boolean; optional: boolean;
}; };
flip: { flip: {
type: StringConstructor; type: StringConstructor;
optional: boolean; optional: boolean;
}; };
rotate: { rotate: {
type: NumberConstructor; type: NumberConstructor;
optional: boolean; optional: boolean;
}; };
}>; }>;
declare module '@jamescoyle/vue-icon' { declare module '@jamescoyle/vue-icon' {
export default SvgIcon; export default SvgIcon;
} }