1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-02-17 12:10:39 +01:00

Merge branch 'master' of https://github.com/antares-sql/antares into pr/toriphes/245

This commit is contained in:
Fabio Di Stasio 2022-05-14 09:57:09 +02:00
commit b0d464952f
23 changed files with 271 additions and 187 deletions

View File

@ -21,9 +21,6 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: npm i run: npm i
- name: Run tests
run: npm run test
- name: Build/release Electron app - name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1 uses: samuelmeuli/action-electron-builder@v1

View File

@ -22,9 +22,6 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: npm i run: npm i
- name: Run tests
run: npm run test
- name: Build/release Electron app - name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1 uses: samuelmeuli/action-electron-builder@v1
with: with:

View File

@ -22,9 +22,6 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: npm i run: npm i
- name: Run tests
run: npm run test
- name: Build/release Electron app - name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1 uses: samuelmeuli/action-electron-builder@v1
with: with:

26
.github/workflows/test-e2e-linux.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Test end-to-end [linux]
on: push
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install dependencies
run: npm i
- name: Run tests
run: npm run test:e2e

View File

@ -2,6 +2,52 @@
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.5.4](https://github.com/antares-sql/antares/compare/v0.5.3...v0.5.4) (2022-05-10)
### Bug Fixes
* app blocked by BIT fields with no default, closes [#256](https://github.com/antares-sql/antares/issues/256) ([e62f280](https://github.com/antares-sql/antares/commit/e62f280528edb0ff4550ee75038ea216e81e4f10))
* file upload input not working ([58611bf](https://github.com/antares-sql/antares/commit/58611bf07f343e6899a7446bfcd1247b0c75fc7f))
* SSH tunnel not working ([6d61518](https://github.com/antares-sql/antares/commit/6d6151814e5006935d493b9b83dbda1aa5b35391))
* unable to insert auto-generated datetime fields ([ff27244](https://github.com/antares-sql/antares/commit/ff272440bdc2a7fe699e04f8809bd5af8f9529c0))
### Improvements
* **UI:** left alignment for numbers in result tables, closes [#249](https://github.com/antares-sql/antares/issues/249) ([e02565c](https://github.com/antares-sql/antares/commit/e02565c0d9bb63efa76a79f38e3ed3586a30ad1c))
### [0.5.3](https://github.com/antares-sql/antares/compare/v0.5.2...v0.5.3) (2022-05-08)
### Features
* default open schema if only one present ([0fa22fb](https://github.com/antares-sql/antares/commit/0fa22fbe72fd4e3b2cfff6fc1847347f69fafda6))
### Bug Fixes
* can not use vue teleport with props as root element ([88eb9f7](https://github.com/antares-sql/antares/commit/88eb9f7ab80c407ec6517206c27cce715c41eb24))
* importer webpack config ([f82db96](https://github.com/antares-sql/antares/commit/f82db96f34579c5f5f0c025ba82aff13047eb045))
* importer webpack config ([b4d9821](https://github.com/antares-sql/antares/commit/b4d9821300991bf000846ae38ed18d79564db67b))
* LIKE operator in table filter not properly working, closes [#242](https://github.com/antares-sql/antares/issues/242) ([eb1afed](https://github.com/antares-sql/antares/commit/eb1afed108d97e2acb7ea5279aabd582014c3c58))
* locale change ([6af0c33](https://github.com/antares-sql/antares/commit/6af0c33461dfab868bca757e55ae62e6c6094c6c))
* missing storeToRefs imports ([ff8bb45](https://github.com/antares-sql/antares/commit/ff8bb45d6d19303b2e7701639d22e52e4ae2976c))
* missing tabs uid ([18b66b5](https://github.com/antares-sql/antares/commit/18b66b50323e69ed9d0090a4cbbe0ada9e10838d))
* **MySQL:** creating temporary tables on export to overcome view dependency errors ([e4c5d9b](https://github.com/antares-sql/antares/commit/e4c5d9b404c2b20cf113607a80ee928b810e6f05))
* **MySQL:** support to ANSI_QUOTES mode not working, closes [#243](https://github.com/antares-sql/antares/issues/243) ([9fcc7d1](https://github.com/antares-sql/antares/commit/9fcc7d1cefc3c035a63e843616c3138c772037f1))
* prevents query tabs targets previous schema if not in explorebar, closes [#236](https://github.com/antares-sql/antares/issues/236) ([5e4abd3](https://github.com/antares-sql/antares/commit/5e4abd3e81d70bcb9b3a897d38d6f8ec3ff0706b))
* query editor table fields suggestion ([e9dedfa](https://github.com/antares-sql/antares/commit/e9dedfaf3203f5621e54fd707003a47e6e5a5c4d))
* **SQLite:** tables with sqlite in name not visible, closes [#239](https://github.com/antares-sql/antares/issues/239) ([690cdcb](https://github.com/antares-sql/antares/commit/690cdcb2eb1c7bf514271000c31211d1c0b33e54))
* unable to add parameters to new routines/functions ([350d536](https://github.com/antares-sql/antares/commit/350d53642e2491fd2dedbbf999579ba9c9bc59a0))
* unable to disconnect from database ([47e1f27](https://github.com/antares-sql/antares/commit/47e1f27bb83b99288157185ad8b62d190a9e7881))
* unable to set an empty string as field default ([bfdb463](https://github.com/antares-sql/antares/commit/bfdb463390453a55963af29ef0e7cd3aea26f4cf))
* undefined uid variable in the setting bar ([3cca3ed](https://github.com/antares-sql/antares/commit/3cca3ed2b31c5763794c52cce34ccba1e848efe2))
* various warnings and exceptions ([c50cbc5](https://github.com/antares-sql/antares/commit/c50cbc577f667c17ba676960cf2c840d24366c80))
* verbose devtool loggin with missing sourcemap ([1174bab](https://github.com/antares-sql/antares/commit/1174bab0cc895c4e294804d810b0789166602725))
* wrong path module importation ([472fa6f](https://github.com/antares-sql/antares/commit/472fa6f4300b7e3fbf8c8079a548ca34d941f5fb))
* wrong path module importation ([9a0f982](https://github.com/antares-sql/antares/commit/9a0f98272342d201e9bc979d5bc5768cfd20f3fb))
### [0.5.2](https://github.com/antares-sql/antares/compare/v0.5.1...v0.5.2) (2022-04-10) ### [0.5.2](https://github.com/antares-sql/antares/compare/v0.5.1...v0.5.2) (2022-04-10)

View File

@ -1,7 +1,7 @@
{ {
"name": "antares", "name": "antares",
"productName": "Antares", "productName": "Antares",
"version": "0.5.2", "version": "0.5.4",
"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",
@ -20,8 +20,8 @@
"release:pre": "npm run release -- --prerelease alpha", "release:pre": "npm run release -- --prerelease alpha",
"devtools:install": "node scripts/devtoolsInstaller", "devtools:install": "node scripts/devtoolsInstaller",
"postinstall": "electron-builder install-app-deps && npm run devtools:install", "postinstall": "electron-builder install-app-deps && npm run devtools:install",
"test": "npm run compile && npm run test:dry", "test:e2e": "npm run compile && npm run test:e2e-dry",
"test:dry": "xvfb-maybe -- playwright test", "test:e2e-dry": "xvfb-maybe -- playwright test",
"lint": "eslint . --ext .js,.vue && stylelint \"./src/**/*.{css,scss,sass,vue}\"", "lint": "eslint . --ext .js,.vue && stylelint \"./src/**/*.{css,scss,sass,vue}\"",
"lint:fix": "eslint . --ext .js,.vue --fix && stylelint \"./src/**/*.{css,scss,sass,vue}\" --fix", "lint:fix": "eslint . --ext .js,.vue --fix && stylelint \"./src/**/*.{css,scss,sass,vue}\" --fix",
"contributors:add": "all-contributors add", "contributors:add": "all-contributors add",
@ -109,83 +109,83 @@
} }
}, },
"dependencies": { "dependencies": {
"@electron/remote": "^2.0.1", "@electron/remote": "~2.0.1",
"@faker-js/faker": "^6.1.2", "@faker-js/faker": "~6.1.2",
"@mdi/font": "^6.1.95", "@mdi/font": "~6.1.95",
"@turf/helpers": "^6.5.0", "@turf/helpers": "~6.5.0",
"@vscode/vscode-languagedetection": "^1.0.21", "@vscode/vscode-languagedetection": "~1.0.21",
"ace-builds": "^1.4.13", "ace-builds": "~1.4.13",
"better-sqlite3": "^7.5.0", "better-sqlite3": "~7.5.0",
"electron-log": "^4.4.1", "electron-log": "~4.4.1",
"electron-store": "^8.0.1", "electron-store": "~8.0.1",
"electron-updater": "^5.0.1", "electron-updater": "~4.6.5",
"electron-window-state": "^5.0.3", "electron-window-state": "~5.0.3",
"encoding": "^0.1.13", "encoding": "~0.1.13",
"leaflet": "^1.7.1", "leaflet": "~1.7.1",
"marked": "^4.0.0", "marked": "~4.0.0",
"moment": "^2.29.1", "moment": "~2.29.1",
"mysql2": "^2.3.2", "mysql2": "~2.3.2",
"pg": "^8.7.1", "pg": "~8.7.1",
"pg-query-stream": "^4.2.3", "pg-query-stream": "~4.2.3",
"pgsql-ast-parser": "^7.2.1", "pgsql-ast-parser": "~7.2.1",
"pinia": "^2.0.13", "pinia": "~2.0.13",
"source-map-support": "^0.5.20", "source-map-support": "~0.5.20",
"spectre.css": "^0.5.9", "spectre.css": "~0.5.9",
"sql-formatter": "^4.0.2", "sql-formatter": "~4.0.2",
"ssh2-promise": "^1.0.2", "ssh2-promise": "~1.0.2",
"v-mask": "^2.3.0", "v-mask": "~2.3.0",
"vue": "^3.2.33", "vue": "~3.2.33",
"vue-i18n": "^9.1.9", "vue-i18n": "~9.1.9",
"vuedraggable": "^4.1.0" "vuedraggable": "~4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/eslint-parser": "^7.15.7", "@babel/eslint-parser": "~7.15.7",
"@babel/preset-env": "^7.15.8", "@babel/preset-env": "~7.15.8",
"@babel/preset-typescript": "^7.16.7", "@babel/preset-typescript": "~7.16.7",
"@playwright/test": "^1.21.1", "@playwright/test": "~1.21.1",
"@types/better-sqlite3": "^7.5.0", "@types/better-sqlite3": "~7.5.0",
"@types/node": "^17.0.23", "@types/node": "~17.0.23",
"@types/pg": "^8.6.5", "@types/pg": "~8.6.5",
"@typescript-eslint/eslint-plugin": "^5.18.0", "@typescript-eslint/eslint-plugin": "~5.18.0",
"@typescript-eslint/parser": "^5.18.0", "@typescript-eslint/parser": "~5.18.0",
"@vue/compiler-sfc": "^3.2.33", "@vue/compiler-sfc": "~3.2.33",
"all-contributors-cli": "^6.20.0", "all-contributors-cli": "~6.20.0",
"babel-loader": "^8.2.3", "babel-loader": "~8.2.3",
"chalk": "^4.1.2", "chalk": "~4.1.2",
"cross-env": "^7.0.2", "cross-env": "~7.0.2",
"css-loader": "^6.5.0", "css-loader": "~6.5.0",
"electron": "^17.0.1", "electron": "~17.4.3",
"electron-builder": "^23.0.3", "electron-builder": "~23.0.3",
"eslint": "^7.32.0", "eslint": "~7.32.0",
"eslint-config-standard": "^16.0.3", "eslint-config-standard": "~16.0.3",
"eslint-plugin-import": "^2.24.2", "eslint-plugin-import": "~2.24.2",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "~11.1.0",
"eslint-plugin-promise": "^5.2.0", "eslint-plugin-promise": "~5.2.0",
"eslint-plugin-vue": "^8.0.3", "eslint-plugin-vue": "~8.0.3",
"file-loader": "^6.2.0", "file-loader": "~6.2.0",
"html-webpack-plugin": "^5.5.0", "html-webpack-plugin": "~5.5.0",
"mini-css-extract-plugin": "~2.4.5", "mini-css-extract-plugin": "~2.4.5",
"node-loader": "^2.0.0", "node-loader": "~2.0.0",
"playwright": "^1.21.1", "playwright": "~1.21.1",
"playwright-core": "^1.21.1", "playwright-core": "~1.21.1",
"progress-webpack-plugin": "^1.0.12", "progress-webpack-plugin": "~1.0.12",
"rimraf": "^3.0.2", "rimraf": "~3.0.2",
"sass": "^1.42.1", "sass": "~1.42.1",
"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": "^13.13.1", "stylelint": "~13.13.1",
"stylelint-config-standard": "^22.0.0", "stylelint-config-standard": "~22.0.0",
"stylelint-scss": "^3.21.0", "stylelint-scss": "~3.21.0",
"tree-kill": "^1.2.2", "tree-kill": "~1.2.2",
"ts-loader": "^9.2.8", "ts-loader": "~9.2.8",
"typescript": "^4.6.3", "typescript": "~4.6.3",
"unzip-crx-3": "^0.2.0", "unzip-crx-3": "~0.2.0",
"vue-eslint-parser": "^8.3.0", "vue-eslint-parser": "~8.3.0",
"vue-loader": "^16.8.3", "vue-loader": "~16.8.3",
"webpack": "^5.60.0", "webpack": "~5.60.0",
"webpack-cli": "^4.9.1", "webpack-cli": "~4.9.1",
"webpack-dev-server": "^4.4.0", "webpack-dev-server": "~4.4.0",
"xvfb-maybe": "^0.2.1" "xvfb-maybe": "~0.2.1"
} }
} }

View File

@ -2,7 +2,7 @@ import * as antares from 'common/interfaces/antares';
import { InsertRowsParams } from 'common/interfaces/tableApis'; import { InsertRowsParams } from 'common/interfaces/tableApis';
import { ipcMain } from 'electron'; import { ipcMain } from 'electron';
import { faker } from '@faker-js/faker'; import { faker } from '@faker-js/faker';
import moment from 'moment'; import * as moment from 'moment';
import { sqlEscaper } from 'common/libs/sqlEscaper'; import { sqlEscaper } from 'common/libs/sqlEscaper';
import { TEXT, LONG_TEXT, ARRAY, TEXT_SEARCH, NUMBER, FLOAT, BLOB, BIT, DATE, DATETIME } from 'common/fieldTypes'; import { TEXT, LONG_TEXT, ARRAY, TEXT_SEARCH, NUMBER, FLOAT, BLOB, BIT, DATE, DATETIME } from 'common/fieldTypes';
import * as customizations from 'common/customizations'; import * as customizations from 'common/customizations';

View File

@ -2,7 +2,7 @@ import * as antares from 'common/interfaces/antares';
import * as mysql from 'mysql2/promise'; import * as mysql from 'mysql2/promise';
import { AntaresCore } from '../AntaresCore'; import { AntaresCore } from '../AntaresCore';
import * as dataTypes from 'common/data-types/mysql'; import * as dataTypes from 'common/data-types/mysql';
import SSH2Promise from 'ssh2-promise'; import SSH2Promise = require('ssh2-promise');
import SSHConfig from 'ssh2-promise/lib/sshConfig'; import SSHConfig from 'ssh2-promise/lib/sshConfig';
export class MySQLClient extends AntaresCore { export class MySQLClient extends AntaresCore {

View File

@ -5,7 +5,7 @@ import * as pg from 'pg';
import * as pgAst from 'pgsql-ast-parser'; import * as pgAst from 'pgsql-ast-parser';
import { AntaresCore } from '../AntaresCore'; import { AntaresCore } from '../AntaresCore';
import * as dataTypes from 'common/data-types/postgresql'; import * as dataTypes from 'common/data-types/postgresql';
import SSH2Promise from 'ssh2-promise'; import SSH2Promise = require('ssh2-promise');
import SSHConfig from 'ssh2-promise/lib/sshConfig'; import SSHConfig from 'ssh2-promise/lib/sshConfig';
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any

View File

@ -23,6 +23,8 @@
</template> </template>
<script> <script>
import { uidGen } from 'common/libs/uidGen';
export default { export default {
name: 'BaseUploadInput', name: 'BaseUploadInput',
props: { props: {
@ -38,12 +40,9 @@ export default {
emits: ['change', 'clear'], emits: ['change', 'clear'],
data () { data () {
return { return {
id: null id: uidGen()
}; };
}, },
mounted () {
this.id = this._uid;
},
methods: { methods: {
clear () { clear () {
this.$emit('clear'); this.$emit('clear');

View File

@ -40,7 +40,7 @@
> >
<BaseUploadInput <BaseUploadInput
v-else-if="inputProps().type === 'file'" v-else-if="inputProps().type === 'file'"
:value="selectedValue" :model-value="selectedValue"
:message="$t('word.browse')" :message="$t('word.browse')"
@clear="clearValue" @clear="clearValue"
@change="filesChange($event)" @change="filesChange($event)"

View File

@ -233,7 +233,7 @@ export default {
else if ([...TIME, ...DATE].includes(field.type)) else if ([...TIME, ...DATE].includes(field.type))
fieldDefault = field.default; fieldDefault = field.default;
else if (BIT.includes(field.type)) else if (BIT.includes(field.type))
fieldDefault = field.default.replaceAll('\'', '').replaceAll('b', ''); fieldDefault = field.default?.replaceAll('\'', '').replaceAll('b', '');
else if (DATETIME.includes(field.type)) { else if (DATETIME.includes(field.type)) {
if (field.default && ['current_timestamp', 'now()'].some(term => field.default.toLowerCase().includes(term))) { if (field.default && ['current_timestamp', 'now()'].some(term => field.default.toLowerCase().includes(term))) {
let datePrecision = ''; let datePrecision = '';

View File

@ -42,12 +42,16 @@ export default {
methods: { methods: {
async getChangelog () { async getChangelog () {
try { try {
const apiRes = await fetch(`https://api.github.com/repos/Fabio286/antares/releases/tags/v${this.appVersion}`, { const apiRes = await fetch(`https://api.github.com/repos/antares-sql/antares/releases/tags/v${this.appVersion}`, {
method: 'GET' method: 'GET'
}); });
const { body } = await apiRes.json(); const { body } = await apiRes.json();
const markdown = body.substr(0, body.indexOf('### Download')); const cutOffset = body.indexOf('### Download');
const markdown = cutOffset >= 0
? body.substr(0, cutOffset)
: body;
const renderer = { const renderer = {
link (href, title, text) { link (href, title, text) {
return text; return text;

View File

@ -90,7 +90,7 @@
</div> </div>
<div class="column col-8 col-sm-12"> <div class="column col-8 col-sm-12">
<BaseUploadInput <BaseUploadInput
:value="connection.databasePath" :model-value="connection.databasePath"
:message="$t('word.browse')" :message="$t('word.browse')"
@clear="pathClear('databasePath')" @clear="pathClear('databasePath')"
@change="pathSelection($event, 'databasePath')" @change="pathSelection($event, 'databasePath')"
@ -205,7 +205,7 @@
</div> </div>
<div class="column col-8 col-sm-12"> <div class="column col-8 col-sm-12">
<BaseUploadInput <BaseUploadInput
:value="connection.key" :model-value="connection.key"
:message="$t('word.browse')" :message="$t('word.browse')"
@clear="pathClear('key')" @clear="pathClear('key')"
@change="pathSelection($event, 'key')" @change="pathSelection($event, 'key')"
@ -218,7 +218,7 @@
</div> </div>
<div class="column col-8 col-sm-12"> <div class="column col-8 col-sm-12">
<BaseUploadInput <BaseUploadInput
:value="connection.cert" :model-value="connection.cert"
:message="$t('word.browse')" :message="$t('word.browse')"
@clear="pathClear('cert')" @clear="pathClear('cert')"
@change="pathSelection($event, 'cert')" @change="pathSelection($event, 'cert')"
@ -231,7 +231,7 @@
</div> </div>
<div class="column col-8 col-sm-12"> <div class="column col-8 col-sm-12">
<BaseUploadInput <BaseUploadInput
:value="connection.ca" :model-value="connection.ca"
:message="$t('word.browse')" :message="$t('word.browse')"
@clear="pathClear('ca')" @clear="pathClear('ca')"
@change="pathSelection($event, 'ca')" @change="pathSelection($event, 'ca')"
@ -336,7 +336,7 @@
</div> </div>
<div class="column col-8 col-sm-12"> <div class="column col-8 col-sm-12">
<BaseUploadInput <BaseUploadInput
:value="connection.sshKey" :model-value="connection.sshKey"
:message="$t('word.browse')" :message="$t('word.browse')"
@clear="pathClear('sshKey')" @clear="pathClear('sshKey')"
@change="pathSelection($event, 'sshKey')" @change="pathSelection($event, 'sshKey')"

View File

@ -92,7 +92,7 @@
</div> </div>
<div class="column col-8 col-sm-12"> <div class="column col-8 col-sm-12">
<BaseUploadInput <BaseUploadInput
:value="localConnection.databasePath" :model-value="localConnection.databasePath"
:message="$t('word.browse')" :message="$t('word.browse')"
@clear="pathClear('databasePath')" @clear="pathClear('databasePath')"
@change="pathSelection($event, 'databasePath')" @change="pathSelection($event, 'databasePath')"
@ -207,7 +207,7 @@
</div> </div>
<div class="column col-8 col-sm-12"> <div class="column col-8 col-sm-12">
<BaseUploadInput <BaseUploadInput
:value="localConnection.key" :model-value="localConnection.key"
:message="$t('word.browse')" :message="$t('word.browse')"
@clear="pathClear('key')" @clear="pathClear('key')"
@change="pathSelection($event, 'key')" @change="pathSelection($event, 'key')"
@ -220,7 +220,7 @@
</div> </div>
<div class="column col-8 col-sm-12"> <div class="column col-8 col-sm-12">
<BaseUploadInput <BaseUploadInput
:value="localConnection.cert" :model-value="localConnection.cert"
:message="$t('word.browse')" :message="$t('word.browse')"
@clear="pathClear('cert')" @clear="pathClear('cert')"
@change="pathSelection($event, 'cert')" @change="pathSelection($event, 'cert')"
@ -233,7 +233,7 @@
</div> </div>
<div class="column col-8 col-sm-12"> <div class="column col-8 col-sm-12">
<BaseUploadInput <BaseUploadInput
:value="localConnection.ca" :model-value="localConnection.ca"
:message="$t('word.browse')" :message="$t('word.browse')"
@clear="pathClear('ca')" @clear="pathClear('ca')"
@change="pathSelection($event, 'ca')" @change="pathSelection($event, 'ca')"
@ -330,7 +330,7 @@
</div> </div>
<div class="column col-8 col-sm-12"> <div class="column col-8 col-sm-12">
<BaseUploadInput <BaseUploadInput
:value="localConnection.sshKey" :model-value="localConnection.sshKey"
:message="$t('word.browse')" :message="$t('word.browse')"
@clear="pathClear('sshKey')" @clear="pathClear('sshKey')"
@change="pathSelection($event, 'sshKey')" @change="pathSelection($event, 'sshKey')"

View File

@ -80,6 +80,7 @@ module.exports = {
deterministic: 'Xác định', deterministic: 'Xác định',
context: 'Context', context: 'Context',
export: 'Xuất', export: 'Xuất',
import: 'Nhập',
returns: 'Returns', returns: 'Returns',
timing: 'Thời gian', timing: 'Thời gian',
state: 'Trạng thái', state: 'Trạng thái',
@ -122,9 +123,23 @@ module.exports = {
select: 'Chọn', select: 'Chọn',
passphrase: 'Cụm mật khẩu', passphrase: 'Cụm mật khẩu',
filter: 'Bộ lọc', filter: 'Bộ lọc',
change: 'Thay đổi',
views: 'Xem',
triggers: 'Trình kích hoạt',
routines: 'Routines',
functions: 'Functions',
schedulers: 'Lên lịch',
includes: 'Includes',
drop: 'Drop',
completed: 'Completed',
aborted: 'Aborted',
disabled: 'Đã tắt', disabled: 'Đã tắt',
enable: 'Bật', enable: 'Bật',
disable: 'Tắt' disable: 'Tắt',
commit: 'Cam kết',
rollback: 'Hoàn nguyên',
connectionString: 'Chuỗi kết nối',
contributors: 'Người đóng góp'
}, },
message: { message: {
appWelcome: 'Chào bạn đến với Antares SQL Client!', appWelcome: 'Chào bạn đến với Antares SQL Client!',
@ -250,8 +265,32 @@ module.exports = {
searchForQueries: 'Tìm kiếm truy vấn', searchForQueries: 'Tìm kiếm truy vấn',
killProcess: 'Huỷ quá trình', killProcess: 'Huỷ quá trình',
closeTab: 'Đóng tab', closeTab: 'Đóng tab',
exportSchema: 'Xuất lược đồ',
importSchema: 'Nhập lược đồ',
directoryPath: 'Đường dẫn thu mục',
newInserStmtEvery: 'Câu lệnh INSERT mới mỗi',
processingTableExport: 'Đang tiến hành {table}',
fechingTableExport: 'Đang lấy dữ liệu {table}',
writingTableExport: 'Đang ghi dữ liệu {table}',
checkAllTables: 'Chọn tất cả các bảng',
uncheckAllTables: 'Bỏ chọn tất cả các bảng',
goToDownloadPage: 'Tới trang tải về', goToDownloadPage: 'Tới trang tải về',
readOnlyMode: 'Chế độ chỉ đọc' readOnlyMode: 'Chế độ chỉ đọc',
killQuery: 'Hủy truy vấn',
insertRow: 'Chèn hàng | Chèn hàng',
commitMode: 'Chế độ cam kết',
autoCommit: 'Cam kết tự động',
manualCommit: 'Cam kết thủ công',
actionSuccessful: '{action} thành công',
importQueryErrors: 'Cảnh báo: {n} lỗi đã xảy ra | Carh báo: {n} lỗi đã xảy ra',
executedQueries: '{n} truy vấn đã chạy | {n} truy vấn đã chạy',
ourputFormat: 'Định dạng đầu ra',
singleFile: 'Một tệp {ext}',
zipCompressedFile: 'Tệp nén zip {ext}',
disableBlur: 'Tắt làm mờ',
untrustedConnection: 'Kết nối không đáng tin cậy',
missingOrIncompleteTranslation: 'Bản dịch thiếu hoặc không đầy đủ?',
findOutHowToContribute: 'Tìm hiểu cách đóng góp'
}, },
faker: { faker: {
address: 'Địa chỉ', address: 'Địa chỉ',

View File

@ -1,13 +1,17 @@
'use strict'; 'use strict';
import { ipcRenderer } from 'electron';
import { createApp } from 'vue'; import { createApp } from 'vue';
import { createPinia } from 'pinia';
import '@mdi/font/css/materialdesignicons.css'; import '@mdi/font/css/materialdesignicons.css';
import 'leaflet/dist/leaflet.css'; import 'leaflet/dist/leaflet.css';
import '@/scss/main.scss'; import '@/scss/main.scss';
import { VueMaskDirective } from 'v-mask'; import { VueMaskDirective } from 'v-mask';
import { useApplicationStore } from '@/stores/application';
import { useSettingsStore } from '@/stores/settings'; import { useSettingsStore } from '@/stores/settings';
import { useNotificationsStore } from '@/stores/notifications';
import App from '@/App.vue'; import App from '@/App.vue';
import { pinia } from '@/stores';
import i18n from '@/i18n'; import i18n from '@/i18n';
// https://github.com/probil/v-mask/issues/498#issuecomment-827027834 // https://github.com/probil/v-mask/issues/498#issuecomment-827027834
@ -20,9 +24,58 @@ const vMaskV3 = {
createApp(App) createApp(App)
.directive('mask', vMaskV3) .directive('mask', vMaskV3)
.use(pinia) .use(createPinia())
.use(i18n) .use(i18n)
.mount('#app'); .mount('#app');
const { locale } = useSettingsStore(); const { locale } = useSettingsStore();
i18n.global.locale = locale; i18n.global.locale = locale;
// IPC exceptions
ipcRenderer.on('unhandled-exception', (event, error) => {
useNotificationsStore().addNotification({ status: 'error', message: error.message });
});
// IPC app updates
ipcRenderer.on('checking-for-update', () => {
useApplicationStore().updateStatus = 'checking';
});
ipcRenderer.on('update-available', () => {
useApplicationStore().updateStatus = 'available';
});
ipcRenderer.on('update-not-available', () => {
useApplicationStore().updateStatus = 'noupdate';
});
ipcRenderer.on('check-failed', () => {
useApplicationStore().updateStatus = 'nocheck';
});
ipcRenderer.on('no-auto-update', () => {
useApplicationStore().updateStatus = 'disabled';
});
ipcRenderer.on('download-progress', (event, data) => {
useApplicationStore().updateStatus = 'downloading';
useApplicationStore().downloadprogress = data.percent;
});
ipcRenderer.on('update-downloaded', () => {
useApplicationStore().updateStatus = 'downloaded';
});
ipcRenderer.on('link-to-download', () => {
useApplicationStore().updateStatus = 'link';
});
// IPC shortcuts
ipcRenderer.on('toggle-preferences', () => {
useApplicationStore().showSettingModal('general');
});
ipcRenderer.on('open-updates-preferences', () => {
useApplicationStore().showSettingModal('update');
ipcRenderer.send('check-for-updates');
});

View File

@ -1,14 +1,8 @@
@mixin type-colors($types) { @mixin type-colors($types) {
$numbers: ('int','tinyint','smallint','mediumint','float','double','decimal');
@each $type, $color in $types { @each $type, $color in $types {
.type-#{$type} { .type-#{$type} {
color: $color; color: $color;
@if index($numbers, $type) {
text-align: right;
}
} }
} }
} }

View File

@ -1,13 +0,0 @@
// @ts-check
import { createPinia } from 'pinia';
import { ipcUpdates } from './plugins/ipcUpdates';
import { ipcShortcuts } from './plugins/ipcShortcuts';
import { ipcExceptions } from './plugins/ipcExceptions';
const pinia = createPinia();
pinia
.use(ipcUpdates)
.use(ipcShortcuts)
.use(ipcExceptions);
export { pinia };

View File

@ -1,7 +0,0 @@
import { ipcRenderer } from 'electron';
export function ipcExceptions ({ store }) {
ipcRenderer.on('unhandled-exception', (event, error) => {
store.notifications.addNotification({ status: 'error', message: error.message });
});
}

View File

@ -1,12 +0,0 @@
import { ipcRenderer } from 'electron';
export function ipcShortcuts ({ store }) {
ipcRenderer.on('toggle-preferences', () => {
store.application.showSettingModal('general');
});
ipcRenderer.on('open-updates-preferences', () => {
store.application.showSettingModal('update');
ipcRenderer.send('check-for-updates');
});
}

View File

@ -1,36 +0,0 @@
import { ipcRenderer } from 'electron';
export function ipcUpdates ({ store }) {
ipcRenderer.on('checking-for-update', () => {
store.application.updateStatus = 'checking';
});
ipcRenderer.on('update-available', () => {
store.application.updateStatus = 'available';
});
ipcRenderer.on('update-not-available', () => {
store.application.updateStatus = 'noupdate';
});
ipcRenderer.on('check-failed', () => {
store.application.updateStatus = 'nocheck';
});
ipcRenderer.on('no-auto-update', () => {
store.application.updateStatus = 'disabled';
});
ipcRenderer.on('download-progress', (event, data) => {
store.application.updateStatus = 'downloading';
store.application.downloadprogress = data.percent;
});
ipcRenderer.on('update-downloaded', () => {
store.application.updateStatus = 'downloaded';
});
ipcRenderer.on('link-to-download', () => {
store.application.updateStatus = 'link';
});
}

View File

@ -14,7 +14,7 @@ const parsedContributors = contributors.reduce((acc, c) => {
}, []).join(','); }, []).join(',');
const isDevMode = process.env.NODE_ENV !== 'production'; const isDevMode = process.env.NODE_ENV !== 'production';
const whiteListedModules = ['.bin', 'vue', '@vue', 'pinia', 'vue-i18n']; const whiteListedModules = ['.bin'];
const externals = {}; const externals = {};
fs.readdirSync('node_modules') fs.readdirSync('node_modules')