mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
Compare commits
41 Commits
v0.7.29-be
...
v0.7.30-be
Author | SHA1 | Date | |
---|---|---|---|
d1f68da495 | |||
2ee9cfcf0b | |||
f0d312fb59 | |||
c97ade949c | |||
38af648440 | |||
ccbcffc7f0 | |||
dfa7cf9905 | |||
6365e07534 | |||
f083a8a185 | |||
|
1e3c9edb50 | ||
60e1e59505 | |||
dba490f226 | |||
b6c5dff15c | |||
d2da8c2446 | |||
b54d2c9f5e | |||
9a0ad80bb5 | |||
2f3f5de8d6 | |||
b2c046fd38 | |||
|
bbc29a6335 | ||
|
b6c337638c | ||
2120a59d41 | |||
2cda4a1fa1 | |||
76c8cd1beb | |||
14aeebed9c | |||
|
1a1118452a | ||
|
4b0f596405 | ||
|
eb749f0f66 | ||
|
d78e59dd09 | ||
7969294a93 | |||
2ae016f0b6 | |||
b4f33bc474 | |||
f185463866 | |||
3fa0bd3cd1 | |||
|
0d3ef39822 | ||
|
a02913f4e5 | ||
f9f993cbcd | |||
|
ebd1a75445 | ||
4201532081 | |||
|
c5cb586358 | ||
|
c111b2c0f5 | ||
b70ed124eb |
@@ -293,6 +293,33 @@
|
|||||||
"contributions": [
|
"contributions": [
|
||||||
"code"
|
"code"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "zwei-c",
|
||||||
|
"name": "CHANG, CHIH WEI",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/55912811?v=4",
|
||||||
|
"profile": "https://github.com/zwei-c",
|
||||||
|
"contributions": [
|
||||||
|
"translation"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "mirrorb",
|
||||||
|
"name": "GaoChun",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/34116207?v=4",
|
||||||
|
"profile": "https://github.com/mirrorb",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "LeviEyal",
|
||||||
|
"name": "Eyal Levi",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/48846533?v=4",
|
||||||
|
"profile": "https://github.com/LeviEyal",
|
||||||
|
"contributions": [
|
||||||
|
"translation"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"contributorsPerLine": 7,
|
"contributorsPerLine": 7,
|
||||||
|
@@ -2,4 +2,5 @@ node_modules
|
|||||||
assets
|
assets
|
||||||
out
|
out
|
||||||
dist
|
dist
|
||||||
build
|
build
|
||||||
|
misc
|
68
CHANGELOG.md
68
CHANGELOG.md
@@ -2,6 +2,74 @@
|
|||||||
|
|
||||||
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.30-beta.1](https://github.com/antares-sql/antares/compare/v0.7.30-beta.0...v0.7.30-beta.1) (2024-11-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* missing support check for table check features ([2ee9cfc](https://github.com/antares-sql/antares/commit/2ee9cfcf0bbcf86e8a194d2eff78801300ce7cb3))
|
||||||
|
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
* **PostgreSQL:** improved support of connection strings, closes [#893](https://github.com/antares-sql/antares/issues/893) ([f0d312f](https://github.com/antares-sql/antares/commit/f0d312fb59fd98d6e4501bc407959b91eb0650f2))
|
||||||
|
|
||||||
|
### [0.7.30-beta.0](https://github.com/antares-sql/antares/compare/v0.7.29...v0.7.30-beta.0) (2024-10-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **MySQL:** check constraints management support ([6365e07](https://github.com/antares-sql/antares/commit/6365e075349e00caa1454cce862e918f2069878f))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* incorrect behavior in sorting tables with null/empty values, fixes [#883](https://github.com/antares-sql/antares/issues/883) ([b6c5dff](https://github.com/antares-sql/antares/commit/b6c5dff15c165261e9a11a389ed415e59c7b7628))
|
||||||
|
* incorrect behavior sorting tables with numeric values ([60e1e59](https://github.com/antares-sql/antares/commit/60e1e595057c3ba7f36e0f829dba11b470e1069b))
|
||||||
|
* **MySQL:** routines do not return results, fixes [#885](https://github.com/antares-sql/antares/issues/885) ([dba490f](https://github.com/antares-sql/antares/commit/dba490f22634f87d3af5a3a4c0866fc3095c9842))
|
||||||
|
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
* added more notifications in debug console ([dfa7cf9](https://github.com/antares-sql/antares/commit/dfa7cf9905a4d0a79eaed823a14477574b329dfa))
|
||||||
|
|
||||||
|
### [0.7.29](https://github.com/antares-sql/antares/compare/v0.7.29-beta.3...v0.7.29) (2024-10-14)
|
||||||
|
|
||||||
|
### [0.7.29-beta.3](https://github.com/antares-sql/antares/compare/v0.7.29-beta.2...v0.7.29-beta.3) (2024-10-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **translation:** add hebrew translation, closes [#878](https://github.com/antares-sql/antares/issues/878) ([2f3f5de](https://github.com/antares-sql/antares/commit/2f3f5de8d6b02cfbf5217adfcb09a61e13d1e901))
|
||||||
|
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
* **MySQL:** made some common errors related to corrupted tables non-blocking, closes [#877](https://github.com/antares-sql/antares/issues/877) ([9a0ad80](https://github.com/antares-sql/antares/commit/9a0ad80bb55f84bd6c90cc1e9b63b33512d336a8))
|
||||||
|
|
||||||
|
### [0.7.29-beta.2](https://github.com/antares-sql/antares/compare/v0.7.29-beta.1...v0.7.29-beta.2) (2024-10-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **UI:** new context menu and some minor improvements to query tabs, closes [#867](https://github.com/antares-sql/antares/issues/867) ([14aeebe](https://github.com/antares-sql/antares/commit/14aeebed9cd8e475548f5e0ade105f4b11954cb2))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **MySQL:** incorrect representation of the DATE if the year is prior to 1900, fixes [#860](https://github.com/antares-sql/antares/issues/860) ([7969294](https://github.com/antares-sql/antares/commit/7969294a93a51861c57d4396c7a0d89ecc7e8a84))
|
||||||
|
* **MySQL:** missing exported values for DEFAULT_GENERATED table fields, fixes [#854](https://github.com/antares-sql/antares/issues/854) ([2cda4a1](https://github.com/antares-sql/antares/commit/2cda4a1fa1c80f3567e160caf0b93bc19d76fbaa))
|
||||||
|
* **PostgreSQL:** error changing the comment for a specific table name ([eb749f0](https://github.com/antares-sql/antares/commit/eb749f0f66bf6547053e30b1503c8b2990ae5950))
|
||||||
|
* **PostgreSQL:** unable to change table comment to empty ([d78e59d](https://github.com/antares-sql/antares/commit/d78e59dd0910d3ea6ec5183a8748420b2db57050))
|
||||||
|
|
||||||
|
### [0.7.29-beta.1](https://github.com/antares-sql/antares/compare/v0.7.29-beta.0...v0.7.29-beta.1) (2024-09-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **PostgreSQL:** table and field comments ([ebd1a75](https://github.com/antares-sql/antares/commit/ebd1a7544594eb4498560cc64de4b94146ee8439))
|
||||||
|
* **translation:** traditional chinese translation, closes [#869](https://github.com/antares-sql/antares/issues/869) ([b70ed12](https://github.com/antares-sql/antares/commit/b70ed124eb753091a6afe637d75e59ee9771c8eb))
|
||||||
|
|
||||||
### [0.7.29-beta.0](https://github.com/antares-sql/antares/compare/v0.7.28...v0.7.29-beta.0) (2024-09-23)
|
### [0.7.29-beta.0](https://github.com/antares-sql/antares/compare/v0.7.28...v0.7.29-beta.0) (2024-09-23)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -152,6 +152,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|||||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bagusindrayana"><img src="https://avatars.githubusercontent.com/u/36830534?v=4?s=100" width="100px;" alt="Bagus Indrayana"/><br /><sub><b>Bagus Indrayana</b></sub></a><br /><a href="https://github.com/antares-sql/antares/commits?author=bagusindrayana" title="Code">💻</a></td>
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bagusindrayana"><img src="https://avatars.githubusercontent.com/u/36830534?v=4?s=100" width="100px;" alt="Bagus Indrayana"/><br /><sub><b>Bagus Indrayana</b></sub></a><br /><a href="https://github.com/antares-sql/antares/commits?author=bagusindrayana" title="Code">💻</a></td>
|
||||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/penguinlab"><img src="https://avatars.githubusercontent.com/u/10959317?v=4?s=100" width="100px;" alt="Naoki Ishikawa"/><br /><sub><b>Naoki Ishikawa</b></sub></a><br /><a href="#translation-penguinlab" title="Translation">🌍</a></td>
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/penguinlab"><img src="https://avatars.githubusercontent.com/u/10959317?v=4?s=100" width="100px;" alt="Naoki Ishikawa"/><br /><sub><b>Naoki Ishikawa</b></sub></a><br /><a href="#translation-penguinlab" title="Translation">🌍</a></td>
|
||||||
<td align="center" valign="top" width="14.28%"><a href="https://fazevedo.dev"><img src="https://avatars.githubusercontent.com/u/1640325?v=4?s=100" width="100px;" alt="Filipe Azevedo"/><br /><sub><b>Filipe Azevedo</b></sub></a><br /><a href="https://github.com/antares-sql/antares/commits?author=mangas" title="Code">💻</a></td>
|
<td align="center" valign="top" width="14.28%"><a href="https://fazevedo.dev"><img src="https://avatars.githubusercontent.com/u/1640325?v=4?s=100" width="100px;" alt="Filipe Azevedo"/><br /><sub><b>Filipe Azevedo</b></sub></a><br /><a href="https://github.com/antares-sql/antares/commits?author=mangas" title="Code">💻</a></td>
|
||||||
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zwei-c"><img src="https://avatars.githubusercontent.com/u/55912811?v=4?s=100" width="100px;" alt="CHANG, CHIH WEI"/><br /><sub><b>CHANG, CHIH WEI</b></sub></a><br /><a href="#translation-zwei-c" title="Translation">🌍</a></td>
|
||||||
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mirrorb"><img src="https://avatars.githubusercontent.com/u/34116207?v=4?s=100" width="100px;" alt="GaoChun"/><br /><sub><b>GaoChun</b></sub></a><br /><a href="https://github.com/antares-sql/antares/commits?author=mirrorb" title="Code">💻</a></td>
|
||||||
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/LeviEyal"><img src="https://avatars.githubusercontent.com/u/48846533?v=4?s=100" width="100px;" alt="Eyal Levi"/><br /><sub><b>Eyal Levi</b></sub></a><br /><a href="#translation-LeviEyal" title="Translation">🌍</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
12
package-lock.json
generated
12
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "antares",
|
"name": "antares",
|
||||||
"version": "0.7.29-beta.0",
|
"version": "0.7.30-beta.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "antares",
|
"name": "antares",
|
||||||
"version": "0.7.29-beta.0",
|
"version": "0.7.30-beta.1",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -42,7 +42,6 @@
|
|||||||
"node-firebird": "~1.1.8",
|
"node-firebird": "~1.1.8",
|
||||||
"node-loader": "~2.0.0",
|
"node-loader": "~2.0.0",
|
||||||
"pg": "~8.11.5",
|
"pg": "~8.11.5",
|
||||||
"pg-connection-string": "~2.5.0",
|
|
||||||
"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.1.7",
|
"pinia": "~2.1.7",
|
||||||
@@ -12142,10 +12141,6 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"node_modules/pg-connection-string": {
|
|
||||||
"version": "2.5.0",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/pg-cursor": {
|
"node_modules/pg-cursor": {
|
||||||
"version": "2.10.3",
|
"version": "2.10.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -24507,9 +24502,6 @@
|
|||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"pg-connection-string": {
|
|
||||||
"version": "2.5.0"
|
|
||||||
},
|
|
||||||
"pg-cursor": {
|
"pg-cursor": {
|
||||||
"version": "2.10.3",
|
"version": "2.10.3",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "antares",
|
"name": "antares",
|
||||||
"productName": "Antares",
|
"productName": "Antares",
|
||||||
"version": "0.7.29-beta.0",
|
"version": "0.7.30-beta.1",
|
||||||
"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",
|
||||||
@@ -151,7 +151,6 @@
|
|||||||
"node-firebird": "~1.1.8",
|
"node-firebird": "~1.1.8",
|
||||||
"node-loader": "~2.0.0",
|
"node-loader": "~2.0.0",
|
||||||
"pg": "~8.11.5",
|
"pg": "~8.11.5",
|
||||||
"pg-connection-string": "~2.5.0",
|
|
||||||
"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.1.7",
|
"pinia": "~2.1.7",
|
||||||
|
@@ -55,6 +55,7 @@ export const defaults: Customizations = {
|
|||||||
tableArray: false,
|
tableArray: false,
|
||||||
tableRealCount: false,
|
tableRealCount: false,
|
||||||
tableDuplicate: false,
|
tableDuplicate: false,
|
||||||
|
tableCheck: false,
|
||||||
viewSettings: false,
|
viewSettings: false,
|
||||||
triggerSettings: false,
|
triggerSettings: false,
|
||||||
triggerFunctionSettings: false,
|
triggerFunctionSettings: false,
|
||||||
|
@@ -47,6 +47,7 @@ export const customizations: Customizations = {
|
|||||||
tableTruncateDisableFKCheck: true,
|
tableTruncateDisableFKCheck: true,
|
||||||
tableDuplicate: true,
|
tableDuplicate: true,
|
||||||
tableDdl: true,
|
tableDdl: true,
|
||||||
|
tableCheck: true,
|
||||||
viewAdd: true,
|
viewAdd: true,
|
||||||
triggerAdd: true,
|
triggerAdd: true,
|
||||||
routineAdd: true,
|
routineAdd: true,
|
||||||
|
@@ -62,6 +62,7 @@ export const customizations: Customizations = {
|
|||||||
indexes: true,
|
indexes: true,
|
||||||
foreigns: true,
|
foreigns: true,
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
comment: true,
|
||||||
tableArray: true,
|
tableArray: true,
|
||||||
procedureSql: '$procedure$\r\n\r\n$procedure$',
|
procedureSql: '$procedure$\r\n\r\n$procedure$',
|
||||||
procedureContext: true,
|
procedureContext: true,
|
||||||
|
@@ -57,6 +57,7 @@ export interface ConnectionParams {
|
|||||||
cert?: string;
|
cert?: string;
|
||||||
key?: string;
|
key?: string;
|
||||||
ca?: string;
|
ca?: string;
|
||||||
|
connString?: string;
|
||||||
untrustedConnection: boolean;
|
untrustedConnection: boolean;
|
||||||
ciphers?: string;
|
ciphers?: string;
|
||||||
ssh: boolean;
|
ssh: boolean;
|
||||||
@@ -159,6 +160,13 @@ export interface TableForeign {
|
|||||||
oldName?: string;
|
oldName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TableCheck {
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
_antares_id?: string;
|
||||||
|
name: string;
|
||||||
|
clause: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface CreateTableParams {
|
export interface CreateTableParams {
|
||||||
/** Connection UID */
|
/** Connection UID */
|
||||||
uid?: string;
|
uid?: string;
|
||||||
@@ -166,6 +174,7 @@ export interface CreateTableParams {
|
|||||||
fields: TableField[];
|
fields: TableField[];
|
||||||
foreigns: TableForeign[];
|
foreigns: TableForeign[];
|
||||||
indexes: TableIndex[];
|
indexes: TableIndex[];
|
||||||
|
checks?: TableCheck[];
|
||||||
options: TableOptions;
|
options: TableOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,6 +202,11 @@ export interface AlterTableParams {
|
|||||||
changes: TableForeign[];
|
changes: TableForeign[];
|
||||||
deletions: TableForeign[];
|
deletions: TableForeign[];
|
||||||
};
|
};
|
||||||
|
checkChanges?: {
|
||||||
|
additions: TableCheck[];
|
||||||
|
changes: TableCheck[];
|
||||||
|
deletions: TableCheck[];
|
||||||
|
};
|
||||||
options: TableOptions;
|
options: TableOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -43,6 +43,7 @@ export interface Customizations {
|
|||||||
tableArray?: boolean;
|
tableArray?: boolean;
|
||||||
tableRealCount?: boolean;
|
tableRealCount?: boolean;
|
||||||
tableTruncateDisableFKCheck?: boolean;
|
tableTruncateDisableFKCheck?: boolean;
|
||||||
|
tableCheck?: boolean;
|
||||||
tableDdl?: boolean;
|
tableDdl?: boolean;
|
||||||
viewAdd?: boolean;
|
viewAdd?: boolean;
|
||||||
viewSettings?: boolean;
|
viewSettings?: boolean;
|
||||||
|
@@ -26,6 +26,7 @@ export default (connections: Record<string, antares.Client>) => {
|
|||||||
user: conn.user,
|
user: conn.user,
|
||||||
password: conn.password,
|
password: conn.password,
|
||||||
readonly: conn.readonly,
|
readonly: conn.readonly,
|
||||||
|
connectionString: conn.connString,
|
||||||
database: '',
|
database: '',
|
||||||
schema: '',
|
schema: '',
|
||||||
databasePath: '',
|
databasePath: '',
|
||||||
@@ -122,6 +123,7 @@ export default (connections: Record<string, antares.Client>) => {
|
|||||||
password: conn.password,
|
password: conn.password,
|
||||||
application_name: 'Antares SQL',
|
application_name: 'Antares SQL',
|
||||||
readonly: conn.readonly,
|
readonly: conn.readonly,
|
||||||
|
connectionString: conn.connString,
|
||||||
database: '',
|
database: '',
|
||||||
schema: '',
|
schema: '',
|
||||||
databasePath: '',
|
databasePath: '',
|
||||||
|
@@ -87,6 +87,19 @@ export default (connections: Record<string, antares.Client>) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ipcMain.handle('get-table-checks', async (event, params) => {
|
||||||
|
if (!validateSender(event.senderFrame)) return { status: 'error', response: 'Unauthorized process' };
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = await connections[params.uid].getTableChecks(params);
|
||||||
|
|
||||||
|
return { status: 'success', response: result };
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
return { status: 'error', response: err.toString() };
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
ipcMain.handle('get-table-ddl', async (event, params) => {
|
ipcMain.handle('get-table-ddl', async (event, params) => {
|
||||||
if (!validateSender(event.senderFrame)) return { status: 'error', response: 'Unauthorized process' };
|
if (!validateSender(event.senderFrame)) return { status: 'error', response: 'Unauthorized process' };
|
||||||
|
|
||||||
|
@@ -3,14 +3,25 @@ import mysql from 'mysql2/promise';
|
|||||||
import * as pg from 'pg';
|
import * as pg from 'pg';
|
||||||
import SSH2Promise = require('@fabio286/ssh2-promise');
|
import SSH2Promise = require('@fabio286/ssh2-promise');
|
||||||
|
|
||||||
const queryLogger = ({ sql, cUid }: {sql: string; cUid: string}) => {
|
export type LoggerLevel = 'query' | 'error'
|
||||||
// Remove comments, newlines and multiple spaces
|
|
||||||
const escapedSql = sql.replace(/(\/\*(.|[\r\n])*?\*\/)|(--(.*|[\r\n]))/gm, '').replace(/\s\s+/g, ' ');
|
const ipcLogger = ({ content, cUid, level }: {content: string; cUid: string; level: LoggerLevel}) => {
|
||||||
if (process.type !== undefined) {
|
if (level === 'error') {
|
||||||
const mainWindow = require('electron').webContents.fromId(1);
|
if (process.type !== undefined) {
|
||||||
mainWindow.send('query-log', { cUid, sql: escapedSql, date: new Date() });
|
const mainWindow = require('electron').webContents.fromId(1);
|
||||||
|
mainWindow.send('non-blocking-exception', { cUid, message: content, date: new Date() });
|
||||||
|
}
|
||||||
|
if (process.env.NODE_ENV === 'development' && process.type === 'browser') console.log(content);
|
||||||
|
}
|
||||||
|
else if (level === 'query') {
|
||||||
|
// Remove comments, newlines and multiple spaces
|
||||||
|
const escapedSql = content.replace(/(\/\*(.|[\r\n])*?\*\/)|(--(.*|[\r\n]))/gm, '').replace(/\s\s+/g, ' ');
|
||||||
|
if (process.type !== undefined) {
|
||||||
|
const mainWindow = require('electron').webContents.fromId(1);
|
||||||
|
mainWindow.send('query-log', { cUid, sql: escapedSql, date: new Date() });
|
||||||
|
}
|
||||||
|
if (process.env.NODE_ENV === 'development' && process.type === 'browser') console.log(escapedSql);
|
||||||
}
|
}
|
||||||
if (process.env.NODE_ENV === 'development' && process.type === 'browser') console.log(escapedSql);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -22,7 +33,7 @@ export abstract class BaseClient {
|
|||||||
protected _params: mysql.ConnectionOptions | pg.ClientConfig | { databasePath: string; readonly: boolean};
|
protected _params: mysql.ConnectionOptions | pg.ClientConfig | { databasePath: string; readonly: boolean};
|
||||||
protected _poolSize: number;
|
protected _poolSize: number;
|
||||||
protected _ssh?: SSH2Promise;
|
protected _ssh?: SSH2Promise;
|
||||||
protected _logger: (args: {sql: string; cUid: string}) => void;
|
protected _logger: (args: {content: string; cUid: string; level: LoggerLevel}) => void;
|
||||||
protected _queryDefaults: antares.QueryBuilderObject;
|
protected _queryDefaults: antares.QueryBuilderObject;
|
||||||
protected _query: antares.QueryBuilderObject;
|
protected _query: antares.QueryBuilderObject;
|
||||||
|
|
||||||
@@ -31,7 +42,7 @@ export abstract class BaseClient {
|
|||||||
this._cUid = args.uid;
|
this._cUid = args.uid;
|
||||||
this._params = args.params;
|
this._params = args.params;
|
||||||
this._poolSize = args.poolSize || undefined;
|
this._poolSize = args.poolSize || undefined;
|
||||||
this._logger = args.logger || queryLogger;
|
this._logger = args.logger || ipcLogger;
|
||||||
|
|
||||||
this._queryDefaults = {
|
this._queryDefaults = {
|
||||||
schema: '',
|
schema: '',
|
||||||
@@ -178,6 +189,10 @@ export abstract class BaseClient {
|
|||||||
throw new Error('Method "dropSchema" not implemented');
|
throw new Error('Method "dropSchema" not implemented');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getTableChecks (...args: any) {
|
||||||
|
throw new Error('Method "getTableDll" not implemented');
|
||||||
|
}
|
||||||
|
|
||||||
getTableDll (...args: any) {
|
getTableDll (...args: any) {
|
||||||
throw new Error('Method "getTableDll" not implemented');
|
throw new Error('Method "getTableDll" not implemented');
|
||||||
}
|
}
|
||||||
|
@@ -1024,7 +1024,7 @@ export class FirebirdSQLClient extends BaseClient {
|
|||||||
alias: string;
|
alias: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._logger({ cUid: this._cUid, sql });
|
this._logger({ cUid: this._cUid, content: sql, level: 'query' });
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
nest: false,
|
nest: false,
|
||||||
|
@@ -161,6 +161,8 @@ export class MySQLClient extends BaseClient {
|
|||||||
|
|
||||||
this._ssh = new SSH2Promise({
|
this._ssh = new SSH2Promise({
|
||||||
...this._params.ssh,
|
...this._params.ssh,
|
||||||
|
reconnect: true,
|
||||||
|
reconnectTries: 3,
|
||||||
debug: process.env.NODE_ENV !== 'production' ? (s) => console.log(s) : null
|
debug: process.env.NODE_ENV !== 'production' ? (s) => console.log(s) : null
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -232,12 +234,13 @@ export class MySQLClient extends BaseClient {
|
|||||||
const dbConfig = await this.getDbConfig();
|
const dbConfig = await this.getDbConfig();
|
||||||
const connection = await mysql.createConnection({
|
const connection = await mysql.createConnection({
|
||||||
...dbConfig,
|
...dbConfig,
|
||||||
typeCast: (field, next) => {
|
dateStrings: true
|
||||||
if (field.type === 'DATETIME')
|
// typeCast: (field, next) => {
|
||||||
return field.string();
|
// if (field.type === 'DATETIME')
|
||||||
else
|
// return field.string();
|
||||||
return next();
|
// else
|
||||||
}
|
// return next();
|
||||||
|
// }
|
||||||
});
|
});
|
||||||
|
|
||||||
return connection;
|
return connection;
|
||||||
@@ -249,12 +252,13 @@ export class MySQLClient extends BaseClient {
|
|||||||
...dbConfig,
|
...dbConfig,
|
||||||
connectionLimit: this._poolSize,
|
connectionLimit: this._poolSize,
|
||||||
enableKeepAlive: true,
|
enableKeepAlive: true,
|
||||||
typeCast: (field, next) => {
|
dateStrings: true
|
||||||
if (field.type === 'DATETIME')
|
// typeCast: (field, next) => {
|
||||||
return field.string();
|
// if (field.type === 'DATETIME')
|
||||||
else
|
// return field.string();
|
||||||
return next();
|
// else
|
||||||
}
|
// return next();
|
||||||
|
// }
|
||||||
});
|
});
|
||||||
|
|
||||||
this._keepaliveTimer = setInterval(async () => {
|
this._keepaliveTimer = setInterval(async () => {
|
||||||
@@ -352,10 +356,21 @@ export class MySQLClient extends BaseClient {
|
|||||||
if (this._params.schema)
|
if (this._params.schema)
|
||||||
filteredDatabases = filteredDatabases.filter(db => db.Database === this._params.schema);
|
filteredDatabases = filteredDatabases.filter(db => db.Database === this._params.schema);
|
||||||
|
|
||||||
const { rows: functions } = await this.raw('SHOW FUNCTION STATUS');
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
const { rows: procedures } = await this.raw('SHOW PROCEDURE STATUS');
|
let functions: any[] = [];
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
let procedures: any[] = [];
|
||||||
let schedulers: any[] = [];
|
let schedulers: any[] = [];
|
||||||
|
/* eslint-enable @typescript-eslint/no-explicit-any */
|
||||||
|
|
||||||
|
try {
|
||||||
|
const { rows: functionRows } = await this.raw('SHOW FUNCTION STATUS');
|
||||||
|
const { rows: procedureRows } = await this.raw('SHOW PROCEDURE STATUS');
|
||||||
|
functions = functionRows;
|
||||||
|
procedures = procedureRows;
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
this._logger({ content: err.sqlMessage, cUid: this._cUid, level: 'error' });
|
||||||
|
}
|
||||||
|
|
||||||
try { // Avoid exception with event_scheduler DISABLED with MariaDB 10
|
try { // Avoid exception with event_scheduler DISABLED with MariaDB 10
|
||||||
const { rows } = await this.raw('SELECT *, EVENT_SCHEMA AS `Db`, EVENT_NAME AS `Name` FROM information_schema.`EVENTS`');
|
const { rows } = await this.raw('SELECT *, EVENT_SCHEMA AS `Db`, EVENT_NAME AS `Name` FROM information_schema.`EVENTS`');
|
||||||
@@ -661,7 +676,7 @@ export class MySQLClient extends BaseClient {
|
|||||||
charset: field.CHARACTER_SET_NAME,
|
charset: field.CHARACTER_SET_NAME,
|
||||||
collation: field.COLLATION_NAME,
|
collation: field.COLLATION_NAME,
|
||||||
autoIncrement: field.EXTRA.includes('auto_increment'),
|
autoIncrement: field.EXTRA.includes('auto_increment'),
|
||||||
generated: field.EXTRA.toLowerCase().includes('generated'),
|
generated: ['VIRTUAL GENERATED', 'VIRTUAL STORED'].includes(field.EXTRA),
|
||||||
onUpdate: field.EXTRA.toLowerCase().includes('on update')
|
onUpdate: field.EXTRA.toLowerCase().includes('on update')
|
||||||
? field.EXTRA.substr(field.EXTRA.indexOf('on update') + 9, field.EXTRA.length).trim()
|
? field.EXTRA.substr(field.EXTRA.indexOf('on update') + 9, field.EXTRA.length).trim()
|
||||||
: '',
|
: '',
|
||||||
@@ -676,6 +691,34 @@ export class MySQLClient extends BaseClient {
|
|||||||
return rows.length ? rows[0].count : 0;
|
return rows.length ? rows[0].count : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getTableChecks ({ schema, table }: { schema: string; table: string }): Promise<antares.TableCheck[]> {
|
||||||
|
const { rows } = await this.raw(`
|
||||||
|
SELECT
|
||||||
|
CONSTRAINT_NAME as name,
|
||||||
|
CHECK_CLAUSE as clausole
|
||||||
|
FROM information_schema.CHECK_CONSTRAINTS
|
||||||
|
WHERE CONSTRAINT_SCHEMA = "${schema}"
|
||||||
|
AND CONSTRAINT_NAME IN (
|
||||||
|
SELECT
|
||||||
|
CONSTRAINT_NAME
|
||||||
|
FROM
|
||||||
|
information_schema.TABLE_CONSTRAINTS
|
||||||
|
WHERE
|
||||||
|
TABLE_SCHEMA = "${schema}"
|
||||||
|
AND TABLE_NAME = "${table}"
|
||||||
|
AND CONSTRAINT_TYPE = 'CHECK'
|
||||||
|
)
|
||||||
|
`);
|
||||||
|
|
||||||
|
if (rows.length) {
|
||||||
|
return rows.map(row => ({
|
||||||
|
name: row.name,
|
||||||
|
clause: row.clausole
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
async getTableOptions ({ schema, table }: { schema: string; table: string }) {
|
async getTableOptions ({ schema, table }: { schema: string; table: string }) {
|
||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
interface TableOptionsResult {
|
interface TableOptionsResult {
|
||||||
@@ -852,11 +895,13 @@ export class MySQLClient extends BaseClient {
|
|||||||
fields,
|
fields,
|
||||||
foreigns,
|
foreigns,
|
||||||
indexes,
|
indexes,
|
||||||
|
checks,
|
||||||
options
|
options
|
||||||
} = params;
|
} = params;
|
||||||
const newColumns: string[] = [];
|
const newColumns: string[] = [];
|
||||||
const newIndexes: string[] = [];
|
const newIndexes: string[] = [];
|
||||||
const newForeigns: string[] = [];
|
const newForeigns: string[] = [];
|
||||||
|
const newChecks: string[] = [];
|
||||||
|
|
||||||
let sql = `CREATE TABLE \`${schema}\`.\`${options.name}\``;
|
let sql = `CREATE TABLE \`${schema}\`.\`${options.name}\``;
|
||||||
|
|
||||||
@@ -897,7 +942,13 @@ export class MySQLClient extends BaseClient {
|
|||||||
newForeigns.push(`CONSTRAINT \`${foreign.constraintName}\` FOREIGN KEY (\`${foreign.field}\`) REFERENCES \`${foreign.refTable}\` (\`${foreign.refField}\`) ON UPDATE ${foreign.onUpdate} ON DELETE ${foreign.onDelete}`);
|
newForeigns.push(`CONSTRAINT \`${foreign.constraintName}\` FOREIGN KEY (\`${foreign.field}\`) REFERENCES \`${foreign.refTable}\` (\`${foreign.refField}\`) ON UPDATE ${foreign.onUpdate} ON DELETE ${foreign.onDelete}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
sql = `${sql} (${[...newColumns, ...newIndexes, ...newForeigns].join(', ')}) COMMENT='${options.comment}', COLLATE='${options.collation}', ENGINE=${options.engine}`;
|
// ADD TABLE CHECKS
|
||||||
|
checks.forEach(check => {
|
||||||
|
if (!check.clause.trim().length) return;
|
||||||
|
newChecks.push(`${check.name ? `CONSTRAINT \`${check.name}\` ` : ''}CHECK (${check.clause})`);
|
||||||
|
});
|
||||||
|
|
||||||
|
sql = `${sql} (${[...newColumns, ...newIndexes, ...newForeigns, ...newChecks].join(', ')}) COMMENT='${options.comment}', COLLATE='${options.collation}', ENGINE=${options.engine}`;
|
||||||
|
|
||||||
return await this.raw(sql);
|
return await this.raw(sql);
|
||||||
}
|
}
|
||||||
@@ -911,6 +962,7 @@ export class MySQLClient extends BaseClient {
|
|||||||
changes,
|
changes,
|
||||||
indexChanges,
|
indexChanges,
|
||||||
foreignChanges,
|
foreignChanges,
|
||||||
|
checkChanges,
|
||||||
options
|
options
|
||||||
} = params;
|
} = params;
|
||||||
|
|
||||||
@@ -918,6 +970,7 @@ export class MySQLClient extends BaseClient {
|
|||||||
const alterColumnsAdd: string[] = [];
|
const alterColumnsAdd: string[] = [];
|
||||||
const alterColumnsChange: string[] = [];
|
const alterColumnsChange: string[] = [];
|
||||||
const alterColumnsDrop: string[] = [];
|
const alterColumnsDrop: string[] = [];
|
||||||
|
const alterQueryes: string[] = [];
|
||||||
|
|
||||||
// OPTIONS
|
// OPTIONS
|
||||||
if ('comment' in options) alterColumnsChange.push(`COMMENT='${options.comment}'`);
|
if ('comment' in options) alterColumnsChange.push(`COMMENT='${options.comment}'`);
|
||||||
@@ -963,6 +1016,12 @@ export class MySQLClient extends BaseClient {
|
|||||||
alterColumnsAdd.push(`ADD CONSTRAINT \`${addition.constraintName}\` FOREIGN KEY (\`${addition.field}\`) REFERENCES \`${addition.refTable}\` (\`${addition.refField}\`) ON UPDATE ${addition.onUpdate} ON DELETE ${addition.onDelete}`);
|
alterColumnsAdd.push(`ADD CONSTRAINT \`${addition.constraintName}\` FOREIGN KEY (\`${addition.field}\`) REFERENCES \`${addition.refTable}\` (\`${addition.refField}\`) ON UPDATE ${addition.onUpdate} ON DELETE ${addition.onDelete}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ADD TABLE CHECKS
|
||||||
|
checkChanges.additions.forEach(addition => {
|
||||||
|
if (!addition.clause.trim().length) return;
|
||||||
|
alterColumnsAdd.push(`ADD ${addition.name ? `CONSTRAINT \`${addition.name}\` ` : ''}CHECK (${addition.clause})`);
|
||||||
|
});
|
||||||
|
|
||||||
// CHANGE FIELDS
|
// CHANGE FIELDS
|
||||||
changes.forEach(change => {
|
changes.forEach(change => {
|
||||||
const typeInfo = this.getTypeInfo(change.type);
|
const typeInfo = this.getTypeInfo(change.type);
|
||||||
@@ -974,9 +1033,9 @@ export class MySQLClient extends BaseClient {
|
|||||||
${change.zerofill ? 'ZEROFILL' : ''}
|
${change.zerofill ? 'ZEROFILL' : ''}
|
||||||
${change.nullable ? 'NULL' : 'NOT NULL'}
|
${change.nullable ? 'NULL' : 'NOT NULL'}
|
||||||
${change.autoIncrement ? 'AUTO_INCREMENT' : ''}
|
${change.autoIncrement ? 'AUTO_INCREMENT' : ''}
|
||||||
|
${change.collation ? `COLLATE ${change.collation}` : ''}
|
||||||
${change.default !== null ? `DEFAULT ${change.default || '\'\''}` : ''}
|
${change.default !== null ? `DEFAULT ${change.default || '\'\''}` : ''}
|
||||||
${change.comment ? `COMMENT '${change.comment}'` : ''}
|
${change.comment ? `COMMENT '${change.comment}'` : ''}
|
||||||
${change.collation ? `COLLATE ${change.collation}` : ''}
|
|
||||||
${change.onUpdate ? `ON UPDATE ${change.onUpdate}` : ''}
|
${change.onUpdate ? `ON UPDATE ${change.onUpdate}` : ''}
|
||||||
${change.after ? `AFTER \`${change.after}\`` : 'FIRST'}`);
|
${change.after ? `AFTER \`${change.after}\`` : 'FIRST'}`);
|
||||||
});
|
});
|
||||||
@@ -1007,6 +1066,13 @@ export class MySQLClient extends BaseClient {
|
|||||||
alterColumnsChange.push(`ADD CONSTRAINT \`${change.constraintName}\` FOREIGN KEY (\`${change.field}\`) REFERENCES \`${change.refTable}\` (\`${change.refField}\`) ON UPDATE ${change.onUpdate} ON DELETE ${change.onDelete}`);
|
alterColumnsChange.push(`ADD CONSTRAINT \`${change.constraintName}\` FOREIGN KEY (\`${change.field}\`) REFERENCES \`${change.refTable}\` (\`${change.refField}\`) ON UPDATE ${change.onUpdate} ON DELETE ${change.onDelete}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// CHANGE CHECK TABLE
|
||||||
|
checkChanges.changes.forEach(change => {
|
||||||
|
if (!change.clause.trim().length) return;
|
||||||
|
alterQueryes.push(`${sql} DROP CONSTRAINT \`${change.name}\``);
|
||||||
|
alterQueryes.push(`${sql} ADD ${change.name ? `CONSTRAINT \`${change.name}\` ` : ''}CHECK (${change.clause})`);
|
||||||
|
});
|
||||||
|
|
||||||
// DROP FIELDS
|
// DROP FIELDS
|
||||||
deletions.forEach(deletion => {
|
deletions.forEach(deletion => {
|
||||||
alterColumnsDrop.push(`DROP COLUMN \`${deletion.name}\``);
|
alterColumnsDrop.push(`DROP COLUMN \`${deletion.name}\``);
|
||||||
@@ -1025,7 +1091,11 @@ export class MySQLClient extends BaseClient {
|
|||||||
alterColumnsDrop.push(`DROP FOREIGN KEY \`${deletion.constraintName}\``);
|
alterColumnsDrop.push(`DROP FOREIGN KEY \`${deletion.constraintName}\``);
|
||||||
});
|
});
|
||||||
|
|
||||||
const alterQueryes = [];
|
// DROP CHECK TABLE
|
||||||
|
checkChanges.deletions.forEach(deletion => {
|
||||||
|
alterQueryes.push(`${sql} DROP CONSTRAINT \`${deletion.name}\``);
|
||||||
|
});
|
||||||
|
|
||||||
if (alterColumnsAdd.length) alterQueryes.push(sql+alterColumnsAdd.join(', '));
|
if (alterColumnsAdd.length) alterQueryes.push(sql+alterColumnsAdd.join(', '));
|
||||||
if (alterColumnsChange.length) alterQueryes.push(sql+alterColumnsChange.join(', '));
|
if (alterColumnsChange.length) alterQueryes.push(sql+alterColumnsChange.join(', '));
|
||||||
if (alterColumnsDrop.length) alterQueryes.push(sql+alterColumnsDrop.join(', '));
|
if (alterColumnsDrop.length) alterQueryes.push(sql+alterColumnsDrop.join(', '));
|
||||||
@@ -1665,7 +1735,7 @@ export class MySQLClient extends BaseClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async raw<T = antares.QueryResult> (sql: string, args?: antares.QueryParams) {
|
async raw<T = antares.QueryResult> (sql: string, args?: antares.QueryParams) {
|
||||||
this._logger({ cUid: this._cUid, sql });
|
this._logger({ cUid: this._cUid, content: sql, level: 'query' });
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
nest: false,
|
nest: false,
|
||||||
@@ -1701,9 +1771,10 @@ export class MySQLClient extends BaseClient {
|
|||||||
connection.query({ sql: query, nestTables }).then(async ([response, fields]) => {
|
connection.query({ sql: query, nestTables }).then(async ([response, fields]) => {
|
||||||
timeStop = new Date();
|
timeStop = new Date();
|
||||||
const queryResult = response;
|
const queryResult = response;
|
||||||
|
const fieldsArr = fields ? Array.isArray(fields[0]) ? fields[0] : fields : false;// Some times fields are nested in an array
|
||||||
|
|
||||||
let remappedFields = fields
|
let remappedFields = fieldsArr
|
||||||
? fields.map(field => {
|
? fieldsArr.map(field => {
|
||||||
if (!field || Array.isArray(field))
|
if (!field || Array.isArray(field))
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|
||||||
@@ -1772,7 +1843,7 @@ export class MySQLClient extends BaseClient {
|
|||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
duration: timeStop.getTime() - timeStart.getTime(),
|
duration: timeStop.getTime() - timeStart.getTime(),
|
||||||
rows: Array.isArray(queryResult) ? queryResult.some(el => Array.isArray(el)) ? [] : queryResult : false,
|
rows: Array.isArray(queryResult) ? queryResult.some(el => Array.isArray(el)) ? queryResult[0] : queryResult : false,
|
||||||
report: !Array.isArray(queryResult) ? queryResult : false,
|
report: !Array.isArray(queryResult) ? queryResult : false,
|
||||||
fields: remappedFields,
|
fields: remappedFields,
|
||||||
keys: keysArr
|
keys: keysArr
|
||||||
|
@@ -155,6 +155,7 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
host: this._params.host,
|
host: this._params.host,
|
||||||
port: this._params.port,
|
port: this._params.port,
|
||||||
user: this._params.user,
|
user: this._params.user,
|
||||||
|
connectionString: this._params.connectionString,
|
||||||
database: 'postgres' as string,
|
database: 'postgres' as string,
|
||||||
password: this._params.password,
|
password: this._params.password,
|
||||||
ssl: null as ConnectionOptions
|
ssl: null as ConnectionOptions
|
||||||
@@ -168,6 +169,8 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
try {
|
try {
|
||||||
this._ssh = new SSH2Promise({
|
this._ssh = new SSH2Promise({
|
||||||
...this._params.ssh,
|
...this._params.ssh,
|
||||||
|
reconnect: true,
|
||||||
|
reconnectTries: 3,
|
||||||
debug: process.env.NODE_ENV !== 'production' ? (s) => console.log(s) : null
|
debug: process.env.NODE_ENV !== 'production' ? (s) => console.log(s) : null
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -498,16 +501,27 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
column_default: string;
|
column_default: string;
|
||||||
character_set_name: string;
|
character_set_name: string;
|
||||||
collation_name: string;
|
collation_name: string;
|
||||||
|
column_comment: string;
|
||||||
}
|
}
|
||||||
/* eslint-enable camelcase */
|
/* eslint-enable camelcase */
|
||||||
|
|
||||||
const { rows } = await this
|
// Table columns
|
||||||
.select('*')
|
const { rows } = await this.raw<antares.QueryResult<TableColumnsResult>>(`
|
||||||
.schema('information_schema')
|
WITH comments AS (
|
||||||
.from('columns')
|
SELECT attr.attname AS column, des.description AS comment, pgc.relname
|
||||||
.where({ table_schema: `= '${schema}'`, table_name: `= '${table}'` })
|
FROM pg_attribute AS attr, pg_description AS des, pg_class AS pgc
|
||||||
.orderBy({ ordinal_position: 'ASC' })
|
WHERE pgc.oid = attr.attrelid
|
||||||
.run<TableColumnsResult>();
|
AND des.objoid = pgc.oid
|
||||||
|
AND pg_table_is_visible(pgc.oid)
|
||||||
|
AND attr.attnum = des.objsubid
|
||||||
|
)
|
||||||
|
SELECT cols.*, comments.comment AS column_comment
|
||||||
|
FROM "information_schema"."columns" AS cols
|
||||||
|
LEFT JOIN comments ON comments.column = cols.column_name AND comments.relname = cols.table_name
|
||||||
|
WHERE cols.table_schema = '${schema}'
|
||||||
|
AND cols.table_name = '${table}'
|
||||||
|
ORDER BY "ordinal_position" ASC
|
||||||
|
`);
|
||||||
|
|
||||||
return rows.map(field => {
|
return rows.map(field => {
|
||||||
let type = field.data_type;
|
let type = field.data_type;
|
||||||
@@ -536,7 +550,7 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
collation: field.collation_name,
|
collation: field.collation_name,
|
||||||
autoIncrement: false,
|
autoIncrement: false,
|
||||||
onUpdate: null,
|
onUpdate: null,
|
||||||
comment: ''
|
comment: field.column_comment
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -873,6 +887,7 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
const newIndexes: string[] = [];
|
const newIndexes: string[] = [];
|
||||||
const manageIndexes: string[] = [];
|
const manageIndexes: string[] = [];
|
||||||
const newForeigns: string[] = [];
|
const newForeigns: string[] = [];
|
||||||
|
const modifyComment: string[] = [];
|
||||||
|
|
||||||
let sql = `CREATE TABLE "${schema}"."${options.name}"`;
|
let sql = `CREATE TABLE "${schema}"."${options.name}"`;
|
||||||
|
|
||||||
@@ -888,6 +903,8 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
${field.nullable ? 'NULL' : 'NOT NULL'}
|
${field.nullable ? 'NULL' : 'NOT NULL'}
|
||||||
${field.default !== null ? `DEFAULT ${field.default || '\'\''}` : ''}
|
${field.default !== null ? `DEFAULT ${field.default || '\'\''}` : ''}
|
||||||
${field.onUpdate ? `ON UPDATE ${field.onUpdate}` : ''}`);
|
${field.onUpdate ? `ON UPDATE ${field.onUpdate}` : ''}`);
|
||||||
|
if (field.comment != null)
|
||||||
|
modifyComment.push(`COMMENT ON COLUMN "${schema}"."${options.name}"."${field.name}" IS '${field.comment}'`);
|
||||||
});
|
});
|
||||||
|
|
||||||
// ADD INDEX
|
// ADD INDEX
|
||||||
@@ -908,8 +925,12 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
newForeigns.push(`CONSTRAINT "${foreign.constraintName}" FOREIGN KEY ("${foreign.field}") REFERENCES "${schema}"."${foreign.refTable}" ("${foreign.refField}") ON UPDATE ${foreign.onUpdate} ON DELETE ${foreign.onDelete}`);
|
newForeigns.push(`CONSTRAINT "${foreign.constraintName}" FOREIGN KEY ("${foreign.field}") REFERENCES "${schema}"."${foreign.refTable}" ("${foreign.refField}") ON UPDATE ${foreign.onUpdate} ON DELETE ${foreign.onDelete}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
sql = `${sql} (${[...newColumns, ...newIndexes, ...newForeigns].join(', ')})`;
|
sql = `${sql} (${[...newColumns, ...newIndexes, ...newForeigns].join(', ')}); `;
|
||||||
if (manageIndexes.length) sql = `${sql}; ${manageIndexes.join(';')}`;
|
if (manageIndexes.length) sql = `${sql} ${manageIndexes.join(';')}; `;
|
||||||
|
// TABLE COMMENT
|
||||||
|
if (options.comment != null) sql = `${sql} COMMENT ON TABLE "${schema}"."${options.name}" IS '${options.comment}'; `;
|
||||||
|
// FIELDS COMMENT
|
||||||
|
if (modifyComment.length) sql = `${sql} ${modifyComment.join(';')}; `;
|
||||||
|
|
||||||
return await this.raw(sql);
|
return await this.raw(sql);
|
||||||
}
|
}
|
||||||
@@ -934,6 +955,7 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
const renameColumns: string[] = [];
|
const renameColumns: string[] = [];
|
||||||
const createSequences: string[] = [];
|
const createSequences: string[] = [];
|
||||||
const manageIndexes: string[] = [];
|
const manageIndexes: string[] = [];
|
||||||
|
const modifyComment: string[] = [];
|
||||||
|
|
||||||
// ADD FIELDS
|
// ADD FIELDS
|
||||||
additions.forEach(addition => {
|
additions.forEach(addition => {
|
||||||
@@ -947,6 +969,8 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
${addition.nullable ? 'NULL' : 'NOT NULL'}
|
${addition.nullable ? 'NULL' : 'NOT NULL'}
|
||||||
${addition.default !== null ? `DEFAULT ${addition.default || '\'\''}` : ''}
|
${addition.default !== null ? `DEFAULT ${addition.default || '\'\''}` : ''}
|
||||||
${addition.onUpdate ? `ON UPDATE ${addition.onUpdate}` : ''}`);
|
${addition.onUpdate ? `ON UPDATE ${addition.onUpdate}` : ''}`);
|
||||||
|
if (addition.comment != null)
|
||||||
|
modifyComment.push(`COMMENT ON COLUMN "${schema}"."${table}"."${addition.name}" IS '${addition.comment}'`);
|
||||||
});
|
});
|
||||||
|
|
||||||
// ADD INDEX
|
// ADD INDEX
|
||||||
@@ -999,6 +1023,8 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
|
|
||||||
if (change.orgName !== change.name)
|
if (change.orgName !== change.name)
|
||||||
renameColumns.push(`ALTER TABLE "${schema}"."${table}" RENAME COLUMN "${change.orgName}" TO "${change.name}"`);
|
renameColumns.push(`ALTER TABLE "${schema}"."${table}" RENAME COLUMN "${change.orgName}" TO "${change.name}"`);
|
||||||
|
if (change.comment != null)
|
||||||
|
modifyComment.push(`COMMENT ON COLUMN "${schema}"."${table}"."${change.name}" IS '${change.comment}'`);
|
||||||
});
|
});
|
||||||
|
|
||||||
// CHANGE INDEX
|
// CHANGE INDEX
|
||||||
@@ -1046,8 +1072,11 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
if (alterColumns.length) sql += `ALTER TABLE "${schema}"."${table}" ${alterColumns.join(', ')}; `;
|
if (alterColumns.length) sql += `ALTER TABLE "${schema}"."${table}" ${alterColumns.join(', ')}; `;
|
||||||
if (createSequences.length) sql = `${createSequences.join(';')}; ${sql}`;
|
if (createSequences.length) sql = `${createSequences.join(';')}; ${sql}`;
|
||||||
if (manageIndexes.length) sql = `${manageIndexes.join(';')}; ${sql}`;
|
if (manageIndexes.length) sql = `${manageIndexes.join(';')}; ${sql}`;
|
||||||
|
// TABLE COMMENT
|
||||||
|
if (options.comment != null) sql = `${sql} COMMENT ON TABLE "${schema}"."${table}" IS '${options.comment}'; `;
|
||||||
|
// FIELDS COMMENT
|
||||||
|
if (modifyComment.length) sql = `${sql} ${modifyComment.join(';')}; `;
|
||||||
if (options.name) sql += `ALTER TABLE "${schema}"."${table}" RENAME TO "${options.name}"; `;
|
if (options.name) sql += `ALTER TABLE "${schema}"."${table}" RENAME TO "${options.name}"; `;
|
||||||
|
|
||||||
// RENAME
|
// RENAME
|
||||||
if (renameColumns.length) sql = `${renameColumns.join(';')}; ${sql}`;
|
if (renameColumns.length) sql = `${renameColumns.join(';')}; ${sql}`;
|
||||||
|
|
||||||
@@ -1619,7 +1648,7 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async raw<T = antares.QueryResult> (sql: string, args?: antares.QueryParams) {
|
async raw<T = antares.QueryResult> (sql: string, args?: antares.QueryParams) {
|
||||||
this._logger({ cUid: this._cUid, sql });
|
this._logger({ cUid: this._cUid, content: sql, level: 'query' });
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
nest: false,
|
nest: false,
|
||||||
|
@@ -612,7 +612,7 @@ export class SQLiteClient extends BaseClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async raw<T = antares.QueryResult> (sql: string, args?: antares.QueryParams) {
|
async raw<T = antares.QueryResult> (sql: string, args?: antares.QueryParams) {
|
||||||
this._logger({ cUid: this._cUid, sql });// TODO: replace BLOB content with a placeholder
|
this._logger({ cUid: this._cUid, content: sql, level: 'query' });// TODO: replace BLOB content with a placeholder
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
nest: false,
|
nest: false,
|
||||||
|
@@ -141,8 +141,11 @@ onMounted(() => {
|
|||||||
|
|
||||||
while (node) {
|
while (node) {
|
||||||
if (node.nodeName.match(/^(input|textarea)$/i) || node.isContentEditable) {
|
if (node.nodeName.match(/^(input|textarea)$/i) || node.isContentEditable) {
|
||||||
InputMenu.popup({ window: getCurrentWindow() });
|
if (!node.parentNode.className.split(' ').includes('editor-query')) {
|
||||||
break;
|
InputMenu.popup({ window: getCurrentWindow() });
|
||||||
|
console.log(node.parentNode.className);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
node = node.parentNode;
|
node = node.parentNode;
|
||||||
}
|
}
|
||||||
|
@@ -612,7 +612,7 @@ const otherContributors = computed(() => {
|
|||||||
return contributors
|
return contributors
|
||||||
.split(',')
|
.split(',')
|
||||||
.filter(c => !c.includes(appAuthor))
|
.filter(c => !c.includes(appAuthor))
|
||||||
.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()));
|
.sort((a, b) => a.toLowerCase().trim().localeCompare(b.toLowerCase()));
|
||||||
});
|
});
|
||||||
|
|
||||||
const selectTab = (tab: string) => {
|
const selectTab = (tab: string) => {
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
<div
|
<div
|
||||||
:id="`editor-${id}`"
|
:id="`editor-${id}`"
|
||||||
class="editor"
|
class="editor"
|
||||||
|
:class="editorClasses"
|
||||||
:style="{height: `${height}px`}"
|
:style="{height: `${height}px`}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -54,7 +55,8 @@ const props = defineProps({
|
|||||||
schema: { type: String, default: '' },
|
schema: { type: String, default: '' },
|
||||||
autoFocus: { type: Boolean, default: false },
|
autoFocus: { type: Boolean, default: false },
|
||||||
readOnly: { type: Boolean, default: false },
|
readOnly: { type: Boolean, default: false },
|
||||||
height: { type: Number, default: 200 }
|
height: { type: Number, default: 200 },
|
||||||
|
editorClasses: { type: String, default: '' }
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue']);
|
||||||
@@ -405,18 +407,17 @@ defineExpose({ editor });
|
|||||||
|
|
||||||
.ace_gutter-cell.ace_breakpoint {
|
.ace_gutter-cell.ace_breakpoint {
|
||||||
&::before {
|
&::before {
|
||||||
content: '\F0403';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 3px;
|
left: 0px;
|
||||||
top: 2px;
|
top: 8px;
|
||||||
color: var(--primary-color);
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font: normal normal normal 24px/1 "Material Design Icons", sans-serif;
|
width: 0;
|
||||||
font-size: inherit;
|
height: 0;
|
||||||
text-rendering: auto;
|
border-left: 8px solid transparent;
|
||||||
line-height: inherit;
|
border-top: 8px solid transparent;
|
||||||
-webkit-font-smoothing: antialiased;
|
border-right: 8px solid var(--primary-color);
|
||||||
-moz-osx-font-smoothing: grayscale;
|
transform: rotate(-45deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@@ -67,7 +67,7 @@
|
|||||||
<div class="column col-7 col-sm-12">
|
<div class="column col-7 col-sm-12">
|
||||||
<input
|
<input
|
||||||
ref="pgString"
|
ref="pgString"
|
||||||
v-model="connection.pgConnString"
|
v-model="connection.connString"
|
||||||
class="form-input"
|
class="form-input"
|
||||||
type="text"
|
type="text"
|
||||||
>
|
>
|
||||||
@@ -502,8 +502,8 @@ const connection = ref({
|
|||||||
sshKey: '',
|
sshKey: '',
|
||||||
sshPort: 22,
|
sshPort: 22,
|
||||||
sshKeepAliveInterval: 1800,
|
sshKeepAliveInterval: 1800,
|
||||||
pgConnString: ''
|
connString: ''
|
||||||
}) as Ref<ConnectionParams & { pgConnString: string }>;
|
}) as Ref<ConnectionParams & { connString: string }>;
|
||||||
|
|
||||||
const firstInput: Ref<HTMLInputElement> = ref(null);
|
const firstInput: Ref<HTMLInputElement> = ref(null);
|
||||||
const isConnecting = ref(false);
|
const isConnecting = ref(false);
|
||||||
|
@@ -68,7 +68,7 @@
|
|||||||
<div class="column col-7 col-sm-12">
|
<div class="column col-7 col-sm-12">
|
||||||
<input
|
<input
|
||||||
ref="pgString"
|
ref="pgString"
|
||||||
v-model="localConnection.pgConnString"
|
v-model="localConnection.connString"
|
||||||
class="form-input"
|
class="form-input"
|
||||||
type="text"
|
type="text"
|
||||||
>
|
>
|
||||||
@@ -502,7 +502,7 @@ const clients = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const firstInput: Ref<HTMLInputElement> = ref(null);
|
const firstInput: Ref<HTMLInputElement> = ref(null);
|
||||||
const localConnection: Ref<ConnectionParams & { pgConnString: string }> = ref(null);
|
const localConnection: Ref<ConnectionParams & { connString: string }> = ref(null);
|
||||||
const isConnecting = ref(false);
|
const isConnecting = ref(false);
|
||||||
const isTesting = ref(false);
|
const isTesting = ref(false);
|
||||||
const isAsking = ref(false);
|
const isAsking = ref(false);
|
||||||
|
@@ -72,6 +72,20 @@
|
|||||||
/>
|
/>
|
||||||
<span>{{ t('database.foreignKeys') }}</span>
|
<span>{{ t('database.foreignKeys') }}</span>
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="workspace.customizations.tableCheck"
|
||||||
|
class="btn btn-dark btn-sm ml-2 mr-0"
|
||||||
|
:disabled="isSaving || !localFields.length"
|
||||||
|
:title="t('database.manageTableChecks')"
|
||||||
|
@click="showTableChecksModal"
|
||||||
|
>
|
||||||
|
<BaseIcon
|
||||||
|
class="mr-1"
|
||||||
|
icon-name="mdiTableCheck"
|
||||||
|
:size="24"
|
||||||
|
/>
|
||||||
|
<span>{{ t('database.tableChecks') }}</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="workspace-query-info">
|
<div class="workspace-query-info">
|
||||||
<div class="d-flex" :title="t('database.schema')">
|
<div class="d-flex" :title="t('database.schema')">
|
||||||
@@ -183,11 +197,19 @@
|
|||||||
@hide="hideForeignModal"
|
@hide="hideForeignModal"
|
||||||
@foreigns-update="foreignsUpdate"
|
@foreigns-update="foreignsUpdate"
|
||||||
/>
|
/>
|
||||||
|
<WorkspaceTabPropsTableChecksModal
|
||||||
|
v-if="isTableChecksModal"
|
||||||
|
:local-checks="localTableChecks"
|
||||||
|
table="new"
|
||||||
|
:workspace="workspace"
|
||||||
|
@hide="hideTableChecksModal"
|
||||||
|
@checks-update="checksUpdate"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ConnectionParams, TableField, TableForeign, TableIndex, TableOptions } from 'common/interfaces/antares';
|
import { ConnectionParams, TableCheck, TableField, TableForeign, TableIndex, TableOptions } from 'common/interfaces/antares';
|
||||||
import { uidGen } from 'common/libs/uidGen';
|
import { uidGen } from 'common/libs/uidGen';
|
||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
@@ -198,6 +220,7 @@ import BaseIcon from '@/components/BaseIcon.vue';
|
|||||||
import BaseLoader from '@/components/BaseLoader.vue';
|
import BaseLoader from '@/components/BaseLoader.vue';
|
||||||
import BaseSelect from '@/components/BaseSelect.vue';
|
import BaseSelect from '@/components/BaseSelect.vue';
|
||||||
import WorkspaceTabNewTableEmptyState from '@/components/WorkspaceTabNewTableEmptyState.vue';
|
import WorkspaceTabNewTableEmptyState from '@/components/WorkspaceTabNewTableEmptyState.vue';
|
||||||
|
import WorkspaceTabPropsTableChecksModal from '@/components/WorkspaceTabPropsTableChecksModal.vue';
|
||||||
import WorkspaceTabPropsTableFields from '@/components/WorkspaceTabPropsTableFields.vue';
|
import WorkspaceTabPropsTableFields from '@/components/WorkspaceTabPropsTableFields.vue';
|
||||||
import WorkspaceTabPropsTableForeignModal from '@/components/WorkspaceTabPropsTableForeignModal.vue';
|
import WorkspaceTabPropsTableForeignModal from '@/components/WorkspaceTabPropsTableForeignModal.vue';
|
||||||
import WorkspaceTabPropsTableIndexesModal from '@/components/WorkspaceTabPropsTableIndexesModal.vue';
|
import WorkspaceTabPropsTableIndexesModal from '@/components/WorkspaceTabPropsTableIndexesModal.vue';
|
||||||
@@ -236,12 +259,16 @@ const isLoading = ref(false);
|
|||||||
const isSaving = ref(false);
|
const isSaving = ref(false);
|
||||||
const isIndexesModal = ref(false);
|
const isIndexesModal = ref(false);
|
||||||
const isForeignModal = ref(false);
|
const isForeignModal = ref(false);
|
||||||
|
const isTableChecksModal = ref(false);
|
||||||
|
|
||||||
const originalFields: Ref<TableField[]> = ref([]);
|
const originalFields: Ref<TableField[]> = ref([]);
|
||||||
const localFields: Ref<TableField[]> = ref([]);
|
const localFields: Ref<TableField[]> = ref([]);
|
||||||
const originalKeyUsage: Ref<TableForeign[]> = ref([]);
|
const originalKeyUsage: Ref<TableForeign[]> = ref([]);
|
||||||
const localKeyUsage: Ref<TableForeign[]> = ref([]);
|
const localKeyUsage: Ref<TableForeign[]> = ref([]);
|
||||||
const originalIndexes: Ref<TableIndex[]> = ref([]);
|
const originalIndexes: Ref<TableIndex[]> = ref([]);
|
||||||
const localIndexes: Ref<TableIndex[]> = ref([]);
|
const localIndexes: Ref<TableIndex[]> = ref([]);
|
||||||
|
const originalTableChecks: Ref<TableCheck[]> = ref([]);
|
||||||
|
const localTableChecks: Ref<TableCheck[]> = ref([]);
|
||||||
const tableOptions: Ref<TableOptions> = ref(null);
|
const tableOptions: Ref<TableOptions> = ref(null);
|
||||||
const localOptions: Ref<TableOptions> = ref(null);
|
const localOptions: Ref<TableOptions> = ref(null);
|
||||||
const newFieldsCounter = ref(0);
|
const newFieldsCounter = ref(0);
|
||||||
@@ -274,6 +301,7 @@ const isChanged = computed(() => {
|
|||||||
return JSON.stringify(originalFields.value) !== JSON.stringify(localFields.value) ||
|
return JSON.stringify(originalFields.value) !== JSON.stringify(localFields.value) ||
|
||||||
JSON.stringify(originalKeyUsage.value) !== JSON.stringify(localKeyUsage.value) ||
|
JSON.stringify(originalKeyUsage.value) !== JSON.stringify(localKeyUsage.value) ||
|
||||||
JSON.stringify(originalIndexes.value) !== JSON.stringify(localIndexes.value) ||
|
JSON.stringify(originalIndexes.value) !== JSON.stringify(localIndexes.value) ||
|
||||||
|
JSON.stringify(originalTableChecks.value) !== JSON.stringify(localTableChecks.value) ||
|
||||||
JSON.stringify(tableOptions.value) !== JSON.stringify(localOptions.value);
|
JSON.stringify(tableOptions.value) !== JSON.stringify(localOptions.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -291,6 +319,7 @@ const saveChanges = async () => {
|
|||||||
fields: localFields.value,
|
fields: localFields.value,
|
||||||
foreigns: localKeyUsage.value,
|
foreigns: localKeyUsage.value,
|
||||||
indexes: localIndexes.value,
|
indexes: localIndexes.value,
|
||||||
|
checks: localTableChecks.value,
|
||||||
options: localOptions.value
|
options: localOptions.value
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -326,6 +355,7 @@ const clearChanges = () => {
|
|||||||
localFields.value = JSON.parse(JSON.stringify(originalFields.value));
|
localFields.value = JSON.parse(JSON.stringify(originalFields.value));
|
||||||
localIndexes.value = JSON.parse(JSON.stringify(originalIndexes.value));
|
localIndexes.value = JSON.parse(JSON.stringify(originalIndexes.value));
|
||||||
localKeyUsage.value = JSON.parse(JSON.stringify(originalKeyUsage.value));
|
localKeyUsage.value = JSON.parse(JSON.stringify(originalKeyUsage.value));
|
||||||
|
localTableChecks.value = JSON.parse(JSON.stringify(originalTableChecks.value));
|
||||||
|
|
||||||
tableOptions.value = {
|
tableOptions.value = {
|
||||||
name: '',
|
name: '',
|
||||||
@@ -446,10 +476,22 @@ const hideForeignModal = () => {
|
|||||||
isForeignModal.value = false;
|
isForeignModal.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const showTableChecksModal = () => {
|
||||||
|
isTableChecksModal.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const hideTableChecksModal = () => {
|
||||||
|
isTableChecksModal.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
const foreignsUpdate = (foreigns: TableForeign[]) => {
|
const foreignsUpdate = (foreigns: TableForeign[]) => {
|
||||||
localKeyUsage.value = foreigns;
|
localKeyUsage.value = foreigns;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const checksUpdate = (checks: TableCheck[]) => {
|
||||||
|
localTableChecks.value = checks;
|
||||||
|
};
|
||||||
|
|
||||||
const saveContentListener = () => {
|
const saveContentListener = () => {
|
||||||
const hasModalOpen = !!document.querySelectorAll('.modal.active').length;
|
const hasModalOpen = !!document.querySelectorAll('.modal.active').length;
|
||||||
if (props.isSelected && !hasModalOpen && isChanged.value)
|
if (props.isSelected && !hasModalOpen && isChanged.value)
|
||||||
|
@@ -62,7 +62,7 @@
|
|||||||
<button
|
<button
|
||||||
class="btn btn-dark btn-sm mr-0"
|
class="btn btn-dark btn-sm mr-0"
|
||||||
:disabled="isSaving"
|
:disabled="isSaving"
|
||||||
:title="t('database.manageIndexes')"
|
:title="t('database.manageForeignKeys')"
|
||||||
@click="showForeignModal"
|
@click="showForeignModal"
|
||||||
>
|
>
|
||||||
<BaseIcon
|
<BaseIcon
|
||||||
@@ -72,6 +72,20 @@
|
|||||||
/>
|
/>
|
||||||
<span>{{ t('database.foreignKeys') }}</span>
|
<span>{{ t('database.foreignKeys') }}</span>
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="workspace.customizations.tableCheck"
|
||||||
|
class="btn btn-dark btn-sm ml-2 mr-0"
|
||||||
|
:disabled="isSaving"
|
||||||
|
:title="t('database.manageTableChecks')"
|
||||||
|
@click="showTableChecksModal"
|
||||||
|
>
|
||||||
|
<BaseIcon
|
||||||
|
class="mr-1"
|
||||||
|
icon-name="mdiTableCheck"
|
||||||
|
:size="24"
|
||||||
|
/>
|
||||||
|
<span>{{ t('database.tableChecks') }}</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
<div class="divider-vert py-3" />
|
<div class="divider-vert py-3" />
|
||||||
|
|
||||||
@@ -218,11 +232,19 @@
|
|||||||
:workspace="workspace"
|
:workspace="workspace"
|
||||||
@hide="hideDdlModal"
|
@hide="hideDdlModal"
|
||||||
/>
|
/>
|
||||||
|
<WorkspaceTabPropsTableChecksModal
|
||||||
|
v-if="isTableChecksModal"
|
||||||
|
:local-checks="localTableChecks"
|
||||||
|
:table="table"
|
||||||
|
:workspace="workspace"
|
||||||
|
@hide="hideTableChecksModal"
|
||||||
|
@checks-update="checksUpdate"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { AlterTableParams, TableField, TableForeign, TableIndex, TableInfos, TableOptions } from 'common/interfaces/antares';
|
import { AlterTableParams, TableCheck, TableField, TableForeign, TableIndex, TableInfos, TableOptions } from 'common/interfaces/antares';
|
||||||
import { uidGen } from 'common/libs/uidGen';
|
import { uidGen } from 'common/libs/uidGen';
|
||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
@@ -232,6 +254,7 @@ import { useI18n } from 'vue-i18n';
|
|||||||
import BaseIcon from '@/components/BaseIcon.vue';
|
import BaseIcon from '@/components/BaseIcon.vue';
|
||||||
import BaseLoader from '@/components/BaseLoader.vue';
|
import BaseLoader from '@/components/BaseLoader.vue';
|
||||||
import BaseSelect from '@/components/BaseSelect.vue';
|
import BaseSelect from '@/components/BaseSelect.vue';
|
||||||
|
import WorkspaceTabPropsTableChecksModal from '@/components/WorkspaceTabPropsTableChecksModal.vue';
|
||||||
import WorkspaceTabPropsTableDdlModal from '@/components/WorkspaceTabPropsTableDdlModal.vue';
|
import WorkspaceTabPropsTableDdlModal from '@/components/WorkspaceTabPropsTableDdlModal.vue';
|
||||||
import WorkspaceTabPropsTableFields from '@/components/WorkspaceTabPropsTableFields.vue';
|
import WorkspaceTabPropsTableFields from '@/components/WorkspaceTabPropsTableFields.vue';
|
||||||
import WorkspaceTabPropsTableForeignModal from '@/components/WorkspaceTabPropsTableForeignModal.vue';
|
import WorkspaceTabPropsTableForeignModal from '@/components/WorkspaceTabPropsTableForeignModal.vue';
|
||||||
@@ -273,13 +296,17 @@ const isLoading = ref(false);
|
|||||||
const isSaving = ref(false);
|
const isSaving = ref(false);
|
||||||
const isIndexesModal = ref(false);
|
const isIndexesModal = ref(false);
|
||||||
const isForeignModal = ref(false);
|
const isForeignModal = ref(false);
|
||||||
|
const isTableChecksModal = ref(false);
|
||||||
const isDdlModal = ref(false);
|
const isDdlModal = ref(false);
|
||||||
|
|
||||||
const originalFields: Ref<TableField[]> = ref([]);
|
const originalFields: Ref<TableField[]> = ref([]);
|
||||||
const localFields: Ref<TableField[]> = ref([]);
|
const localFields: Ref<TableField[]> = ref([]);
|
||||||
const originalKeyUsage: Ref<TableForeign[]> = ref([]);
|
const originalKeyUsage: Ref<TableForeign[]> = ref([]);
|
||||||
const localKeyUsage: Ref<TableForeign[]> = ref([]);
|
const localKeyUsage: Ref<TableForeign[]> = ref([]);
|
||||||
const originalIndexes: Ref<TableIndex[]> = ref([]);
|
const originalIndexes: Ref<TableIndex[]> = ref([]);
|
||||||
const localIndexes: Ref<TableIndex[]> = ref([]);
|
const localIndexes: Ref<TableIndex[]> = ref([]);
|
||||||
|
const originalTableChecks: Ref<TableCheck[]> = ref([]);
|
||||||
|
const localTableChecks: Ref<TableCheck[]> = ref([]);
|
||||||
const tableOptions: Ref<TableOptions> = ref(null);
|
const tableOptions: Ref<TableOptions> = ref(null);
|
||||||
const localOptions: Ref<TableOptions> = ref({} as TableOptions);
|
const localOptions: Ref<TableOptions> = ref({} as TableOptions);
|
||||||
const lastTable = ref(null);
|
const lastTable = ref(null);
|
||||||
@@ -307,6 +334,7 @@ const isChanged = computed(() => {
|
|||||||
return JSON.stringify(originalFields.value) !== JSON.stringify(localFields.value) ||
|
return JSON.stringify(originalFields.value) !== JSON.stringify(localFields.value) ||
|
||||||
JSON.stringify(originalKeyUsage.value) !== JSON.stringify(localKeyUsage.value) ||
|
JSON.stringify(originalKeyUsage.value) !== JSON.stringify(localKeyUsage.value) ||
|
||||||
JSON.stringify(originalIndexes.value) !== JSON.stringify(localIndexes.value) ||
|
JSON.stringify(originalIndexes.value) !== JSON.stringify(localIndexes.value) ||
|
||||||
|
JSON.stringify(originalTableChecks.value) !== JSON.stringify(localTableChecks.value) ||
|
||||||
JSON.stringify(tableOptions.value) !== JSON.stringify(localOptions.value);
|
JSON.stringify(tableOptions.value) !== JSON.stringify(localOptions.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -430,6 +458,27 @@ const getFieldsData = async () => {
|
|||||||
addNotification({ status: 'error', message: err.stack });
|
addNotification({ status: 'error', message: err.stack });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (workspace.value.customizations.tableCheck) {
|
||||||
|
try { // Table checks
|
||||||
|
const { status, response } = await Tables.getTableChecks(params);
|
||||||
|
|
||||||
|
if (status === 'success') {
|
||||||
|
originalTableChecks.value = response.map((check: TableCheck) => {
|
||||||
|
return {
|
||||||
|
_antares_id: uidGen(),
|
||||||
|
...check
|
||||||
|
};
|
||||||
|
});
|
||||||
|
localTableChecks.value = JSON.parse(JSON.stringify(originalTableChecks.value));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
addNotification({ status: 'error', message: response });
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
addNotification({ status: 'error', message: err.stack });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -527,6 +576,33 @@ const saveChanges = async () => {
|
|||||||
// Foreigns Deletions
|
// Foreigns Deletions
|
||||||
foreignChanges.deletions = originalKeyUsage.value.filter(foreign => !localForeignIDs.includes(foreign._antares_id));
|
foreignChanges.deletions = originalKeyUsage.value.filter(foreign => !localForeignIDs.includes(foreign._antares_id));
|
||||||
|
|
||||||
|
// CHECKS
|
||||||
|
const checkChanges = {
|
||||||
|
additions: [] as TableCheck[],
|
||||||
|
changes: [] as TableCheck[],
|
||||||
|
deletions: [] as TableCheck[]
|
||||||
|
};
|
||||||
|
const originalCheckIDs = originalTableChecks.value.reduce((acc, curr) => [...acc, curr._antares_id], []);
|
||||||
|
const localCheckIDs = localTableChecks.value.reduce((acc, curr) => [...acc, curr._antares_id], []);
|
||||||
|
|
||||||
|
// Check Additions
|
||||||
|
checkChanges.additions = localTableChecks.value.filter(check => !originalCheckIDs.includes(check._antares_id));
|
||||||
|
|
||||||
|
// Check Changes
|
||||||
|
originalTableChecks.value.forEach(originalCheck => {
|
||||||
|
const lI = localTableChecks.value.findIndex(localCheck => localCheck._antares_id === originalCheck._antares_id);
|
||||||
|
if (JSON.stringify(originalCheck) !== JSON.stringify(localTableChecks.value[lI])) {
|
||||||
|
if (localTableChecks.value[lI]) {
|
||||||
|
checkChanges.changes.push({
|
||||||
|
...localTableChecks.value[lI]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Check Deletions
|
||||||
|
checkChanges.deletions = originalTableChecks.value.filter(check => !localCheckIDs.includes(check._antares_id));
|
||||||
|
|
||||||
// ALTER
|
// ALTER
|
||||||
const params = {
|
const params = {
|
||||||
uid: props.connection.uid,
|
uid: props.connection.uid,
|
||||||
@@ -543,6 +619,7 @@ const saveChanges = async () => {
|
|||||||
deletions,
|
deletions,
|
||||||
indexChanges,
|
indexChanges,
|
||||||
foreignChanges,
|
foreignChanges,
|
||||||
|
checkChanges,
|
||||||
options
|
options
|
||||||
} as unknown as AlterTableParams;
|
} as unknown as AlterTableParams;
|
||||||
|
|
||||||
@@ -583,6 +660,7 @@ const clearChanges = () => {
|
|||||||
localFields.value = JSON.parse(JSON.stringify(originalFields.value));
|
localFields.value = JSON.parse(JSON.stringify(originalFields.value));
|
||||||
localIndexes.value = JSON.parse(JSON.stringify(originalIndexes.value));
|
localIndexes.value = JSON.parse(JSON.stringify(originalIndexes.value));
|
||||||
localKeyUsage.value = JSON.parse(JSON.stringify(originalKeyUsage.value));
|
localKeyUsage.value = JSON.parse(JSON.stringify(originalKeyUsage.value));
|
||||||
|
localTableChecks.value = JSON.parse(JSON.stringify(originalTableChecks.value));
|
||||||
localOptions.value = JSON.parse(JSON.stringify(tableOptions.value));
|
localOptions.value = JSON.parse(JSON.stringify(tableOptions.value));
|
||||||
newFieldsCounter.value = 0;
|
newFieldsCounter.value = 0;
|
||||||
};
|
};
|
||||||
@@ -702,6 +780,14 @@ const hideForeignModal = () => {
|
|||||||
isForeignModal.value = false;
|
isForeignModal.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const showTableChecksModal = () => {
|
||||||
|
isTableChecksModal.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const hideTableChecksModal = () => {
|
||||||
|
isTableChecksModal.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
const showDdlModal = () => {
|
const showDdlModal = () => {
|
||||||
isDdlModal.value = true;
|
isDdlModal.value = true;
|
||||||
};
|
};
|
||||||
@@ -714,6 +800,10 @@ const foreignsUpdate = (foreigns: TableForeign[]) => {
|
|||||||
localKeyUsage.value = foreigns;
|
localKeyUsage.value = foreigns;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const checksUpdate = (checks: TableCheck[]) => {
|
||||||
|
localTableChecks.value = checks;
|
||||||
|
};
|
||||||
|
|
||||||
const saveContentListener = () => {
|
const saveContentListener = () => {
|
||||||
const hasModalOpen = !!document.querySelectorAll('.modal.active').length;
|
const hasModalOpen = !!document.querySelectorAll('.modal.active').length;
|
||||||
if (props.isSelected && !hasModalOpen && isChanged.value)
|
if (props.isSelected && !hasModalOpen && isChanged.value)
|
||||||
|
268
src/renderer/components/WorkspaceTabPropsTableChecksModal.vue
Normal file
268
src/renderer/components/WorkspaceTabPropsTableChecksModal.vue
Normal file
@@ -0,0 +1,268 @@
|
|||||||
|
<template>
|
||||||
|
<ConfirmModal
|
||||||
|
:confirm-text="t('general.confirm')"
|
||||||
|
size="medium"
|
||||||
|
class="options-modal"
|
||||||
|
@confirm="confirmChecksChange"
|
||||||
|
@hide="$emit('hide')"
|
||||||
|
>
|
||||||
|
<template #header>
|
||||||
|
<div class="d-flex">
|
||||||
|
<BaseIcon
|
||||||
|
class="mr-1"
|
||||||
|
icon-name="mdiTableCheck"
|
||||||
|
:size="24"
|
||||||
|
/>
|
||||||
|
<span class="cut-text">{{ t('database.tableChecks') }} "{{ table }}"</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #body>
|
||||||
|
<div class="columns col-gapless">
|
||||||
|
<div class="column col-5">
|
||||||
|
<div class="panel" :style="{ height: modalInnerHeight + 'px'}">
|
||||||
|
<div class="panel-header pt-0 pl-0">
|
||||||
|
<div class="d-flex">
|
||||||
|
<button class="btn btn-dark btn-sm d-flex" @click="addCheck">
|
||||||
|
<BaseIcon
|
||||||
|
class="mr-1"
|
||||||
|
icon-name="mdiCheckboxMarkedCirclePlusOutline"
|
||||||
|
:size="24"
|
||||||
|
/>
|
||||||
|
<span>{{ t('general.add') }}</span>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-dark btn-sm d-flex ml-2 mr-0"
|
||||||
|
:title="t('database.clearChanges')"
|
||||||
|
:disabled="!isChanged"
|
||||||
|
@click.prevent="clearChanges"
|
||||||
|
>
|
||||||
|
<BaseIcon
|
||||||
|
class="mr-1"
|
||||||
|
icon-name="mdiDeleteSweep"
|
||||||
|
:size="24"
|
||||||
|
/>
|
||||||
|
<span>{{ t('general.clear') }}</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ref="checksPanel" class="panel-body p-0 pr-1">
|
||||||
|
<div
|
||||||
|
v-for="check in checksProxy"
|
||||||
|
:key="check._antares_id"
|
||||||
|
class="tile tile-centered c-hand mb-1 p-1"
|
||||||
|
:class="{'selected-element': selectedCheckID === check._antares_id}"
|
||||||
|
@click="selectCheck($event, check._antares_id)"
|
||||||
|
>
|
||||||
|
<div class="tile-icon">
|
||||||
|
<div>
|
||||||
|
<BaseIcon
|
||||||
|
class="mt-2 column-key"
|
||||||
|
icon-name="mdiCheckboxMarkedCircleOutline"
|
||||||
|
:size="24"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tile-content">
|
||||||
|
<div class="tile-title">
|
||||||
|
{{ check.name }}
|
||||||
|
</div>
|
||||||
|
<small class="tile-subtitle text-gray d-inline-block cut-text" style="width: 100%;">{{ check.clause }}</small>
|
||||||
|
</div>
|
||||||
|
<div class="tile-action">
|
||||||
|
<button
|
||||||
|
class="btn btn-link remove-field p-0 mr-2"
|
||||||
|
:title="t('general.delete')"
|
||||||
|
@click.prevent="removeCheck(check._antares_id)"
|
||||||
|
>
|
||||||
|
<BaseIcon
|
||||||
|
icon-name="mdiClose"
|
||||||
|
:size="18"
|
||||||
|
class="mt-2"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="column col-7 pl-2 editor-col">
|
||||||
|
<form
|
||||||
|
v-if="selectedCheckObj"
|
||||||
|
:style="{ height: modalInnerHeight + 'px'}"
|
||||||
|
class="form-horizontal"
|
||||||
|
>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label col-3">
|
||||||
|
{{ t('general.name') }}
|
||||||
|
</label>
|
||||||
|
<div class="column">
|
||||||
|
<input
|
||||||
|
v-model="selectedCheckObj.name"
|
||||||
|
class="form-input"
|
||||||
|
type="text"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label col-3">
|
||||||
|
{{ t('database.checkClause') }}
|
||||||
|
</label>
|
||||||
|
<div class="column">
|
||||||
|
<textarea
|
||||||
|
v-model="selectedCheckObj.clause"
|
||||||
|
class="form-input"
|
||||||
|
style="resize: vertical;"
|
||||||
|
rows="5"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div v-if="!checksProxy.length" class="empty">
|
||||||
|
<div class="empty-icon">
|
||||||
|
<BaseIcon
|
||||||
|
class="mr-1"
|
||||||
|
icon-name="mdiCheckboxMarkedCircleOutline"
|
||||||
|
:size="48"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<p class="empty-title h5">
|
||||||
|
{{ t('database.thereAreNoTableChecks') }}
|
||||||
|
</p>
|
||||||
|
<div class="empty-action">
|
||||||
|
<button class="btn btn-primary" @click="addCheck">
|
||||||
|
{{ t('database.createNewCheck') }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</ConfirmModal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { TableCheck } from 'common/interfaces/antares';
|
||||||
|
import { uidGen } from 'common/libs/uidGen';
|
||||||
|
import { computed, onMounted, onUnmounted, Ref, ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
import ConfirmModal from '@/components/BaseConfirmModal.vue';
|
||||||
|
import BaseIcon from '@/components/BaseIcon.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
localChecks: Array,
|
||||||
|
table: String,
|
||||||
|
workspace: Object
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['hide', 'checks-update']);
|
||||||
|
|
||||||
|
const checksPanel: Ref<HTMLDivElement> = ref(null);
|
||||||
|
const checksProxy: Ref<TableCheck[]> = ref([]);
|
||||||
|
const selectedCheckID = ref('');
|
||||||
|
const modalInnerHeight = ref(400);
|
||||||
|
|
||||||
|
const selectedCheckObj = computed(() => checksProxy.value.find(index => index._antares_id === selectedCheckID.value));
|
||||||
|
const isChanged = computed(() => JSON.stringify(props.localChecks) !== JSON.stringify(checksProxy.value));
|
||||||
|
|
||||||
|
const confirmChecksChange = () => {
|
||||||
|
const filteredChecks = checksProxy.value.filter(check => check.clause.trim().length);
|
||||||
|
emit('checks-update', filteredChecks);
|
||||||
|
};
|
||||||
|
|
||||||
|
const selectCheck = (event: MouseEvent, id: string) => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
if (selectedCheckID.value !== id && !(event.target as any).classList.contains('remove-field'))
|
||||||
|
selectedCheckID.value = id;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getModalInnerHeight = () => {
|
||||||
|
const modalBody = document.querySelector('.modal-body');
|
||||||
|
if (modalBody)
|
||||||
|
modalInnerHeight.value = modalBody.clientHeight - (parseFloat(getComputedStyle(modalBody).paddingTop) + parseFloat(getComputedStyle(modalBody).paddingBottom));
|
||||||
|
};
|
||||||
|
|
||||||
|
const addCheck = () => {
|
||||||
|
const uid = uidGen();
|
||||||
|
checksProxy.value = [...checksProxy.value, {
|
||||||
|
_antares_id: uid,
|
||||||
|
name: `CHK_${uid.substring(0, 4)}`,
|
||||||
|
clause: ''
|
||||||
|
}];
|
||||||
|
|
||||||
|
if (checksProxy.value.length === 1)
|
||||||
|
resetSelectedID();
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
checksPanel.value.scrollTop = checksPanel.value.scrollHeight + 60;
|
||||||
|
selectedCheckID.value = uid;
|
||||||
|
}, 20);
|
||||||
|
};
|
||||||
|
|
||||||
|
const removeCheck = (id: string) => {
|
||||||
|
checksProxy.value = checksProxy.value.filter(index => index._antares_id !== id);
|
||||||
|
|
||||||
|
if (selectedCheckID.value === id && checksProxy.value.length)
|
||||||
|
resetSelectedID();
|
||||||
|
};
|
||||||
|
|
||||||
|
const clearChanges = () => {
|
||||||
|
checksProxy.value = JSON.parse(JSON.stringify(props.localChecks));
|
||||||
|
if (!checksProxy.value.some(index => index._antares_id === selectedCheckID.value))
|
||||||
|
resetSelectedID();
|
||||||
|
};
|
||||||
|
|
||||||
|
const resetSelectedID = () => {
|
||||||
|
selectedCheckID.value = checksProxy.value.length ? checksProxy.value[0]._antares_id : '';
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
checksProxy.value = JSON.parse(JSON.stringify(props.localChecks));
|
||||||
|
|
||||||
|
if (checksProxy.value.length)
|
||||||
|
resetSelectedID();
|
||||||
|
|
||||||
|
getModalInnerHeight();
|
||||||
|
window.addEventListener('resize', getModalInnerHeight);
|
||||||
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
window.removeEventListener('resize', getModalInnerHeight);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.tile {
|
||||||
|
border-radius: $border-radius;
|
||||||
|
opacity: 0.5;
|
||||||
|
transition: background 0.2s;
|
||||||
|
transition: opacity 0.2s;
|
||||||
|
|
||||||
|
.tile-action {
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.tile-action {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.selected-element {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.fields-list {
|
||||||
|
max-height: 300px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remove-field svg {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
</style>
|
@@ -15,6 +15,7 @@
|
|||||||
:schema="breadcrumbsSchema"
|
:schema="breadcrumbsSchema"
|
||||||
:is-selected="isSelected"
|
:is-selected="isSelected"
|
||||||
:height="editorHeight"
|
:height="editorHeight"
|
||||||
|
editor-classes="editor-query"
|
||||||
/>
|
/>
|
||||||
<div ref="resizer" class="query-area-resizer" />
|
<div ref="resizer" class="query-area-resizer" />
|
||||||
<div ref="queryAreaFooter" class="workspace-query-runner-footer">
|
<div ref="queryAreaFooter" class="workspace-query-runner-footer">
|
||||||
@@ -273,6 +274,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { getCurrentWindow, Menu } from '@electron/remote';
|
||||||
import { Ace } from 'ace-builds';
|
import { Ace } from 'ace-builds';
|
||||||
import { ConnectionParams } from 'common/interfaces/antares';
|
import { ConnectionParams } from 'common/interfaces/antares';
|
||||||
import { uidGen } from 'common/libs/uidGen';
|
import { uidGen } from 'common/libs/uidGen';
|
||||||
@@ -475,6 +477,8 @@ const runQuery = async (query: string) => {
|
|||||||
saveHistory(params);
|
saveHistory(params);
|
||||||
if (!autocommit.value)
|
if (!autocommit.value)
|
||||||
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: true });
|
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: true });
|
||||||
|
|
||||||
|
queryEditor.value.editor.focus();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
addNotification({ status: 'error', message: response });
|
addNotification({ status: 'error', message: response });
|
||||||
@@ -739,7 +743,11 @@ const openFile = async () => {
|
|||||||
|
|
||||||
const saveFileAs = async () => {
|
const saveFileAs = async () => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const result: any = await Application.showSaveDialog({ filters: [{ name: 'SQL', extensions: ['sql'] }], defaultPath: `${queryName.value || 'query'}.sql` });
|
const result: any = await Application.showSaveDialog({
|
||||||
|
filters: [{ name: 'SQL', extensions: ['sql'] }],
|
||||||
|
defaultPath: (!queryName.value.includes('.sql') ? `${queryName.value}.sql` :queryName.value) || 'query.sql'
|
||||||
|
});
|
||||||
|
|
||||||
if (result && !result.canceled) {
|
if (result && !result.canceled) {
|
||||||
await Application.writeFile(result.filePath, query.value);
|
await Application.writeFile(result.filePath, query.value);
|
||||||
addNotification({ status: 'success', message: t('general.actionSuccessful', { action: t('application.saveFile') }) });
|
addNotification({ status: 'success', message: t('general.actionSuccessful', { action: t('application.saveFile') }) });
|
||||||
@@ -750,9 +758,13 @@ const saveFileAs = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const saveFile = async () => {
|
const saveFile = async () => {
|
||||||
await Application.writeFile(filePath.value, query.value);
|
if (filePath.value) {
|
||||||
addNotification({ status: 'success', message: t('general.actionSuccessful', { action: t('application.saveFile') }) });
|
await Application.writeFile(filePath.value, query.value);
|
||||||
lastSavedQuery.value = toRaw(query.value);
|
addNotification({ status: 'success', message: t('general.actionSuccessful', { action: t('application.saveFile') }) });
|
||||||
|
lastSavedQuery.value = toRaw(query.value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
saveFileAs();
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadFileContent = async (file: string) => {
|
const loadFileContent = async (file: string) => {
|
||||||
@@ -785,6 +797,67 @@ onMounted(() => {
|
|||||||
|
|
||||||
if (props.tab.filePath)
|
if (props.tab.filePath)
|
||||||
loadFileContent(props.tab.filePath);
|
loadFileContent(props.tab.filePath);
|
||||||
|
|
||||||
|
queryEditor.value.editor.container.addEventListener('contextmenu', (e) => {
|
||||||
|
const InputMenu = Menu.buildFromTemplate([
|
||||||
|
{
|
||||||
|
label: t('general.run'),
|
||||||
|
click: () => runQuery(query.value)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('general.clear'),
|
||||||
|
click: () => clear()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separator'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('application.saveFile'),
|
||||||
|
click: () => saveFile()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('application.saveFileAs'),
|
||||||
|
click: () => saveFileAs()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('application.openFile'),
|
||||||
|
click: () => openFile()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separator'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('general.cut'),
|
||||||
|
role: 'cut'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('general.copy'),
|
||||||
|
role: 'copy'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('general.paste'),
|
||||||
|
role: 'paste'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separator'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('general.selectAll'),
|
||||||
|
role: 'selectAll'
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
let node: any = e.target;
|
||||||
|
while (node) {
|
||||||
|
if (node.nodeName.match(/^(input|textarea)$/i) || node.isContentEditable) {
|
||||||
|
InputMenu.popup({ window: getCurrentWindow() });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
node = node.parentNode;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
@@ -366,12 +366,21 @@ const sortedResults = computed(() => {
|
|||||||
const sortObj = currentSort.value[resultsetIndex.value];
|
const sortObj = currentSort.value[resultsetIndex.value];
|
||||||
|
|
||||||
return [...localResults.value].sort((a: any, b: any) => {
|
return [...localResults.value].sort((a: any, b: any) => {
|
||||||
let modifier = 1;
|
const modifier = sortObj.dir === 'desc' ? -1 : 1;
|
||||||
let valA = typeof a[sortObj.field] === 'string' ? a[sortObj.field].toLowerCase() : a[sortObj.field];
|
let valA = a[sortObj.field];
|
||||||
if (!isNaN(valA)) valA = Number(valA);
|
let valB = b[sortObj.field];
|
||||||
let valB = typeof b[sortObj.field] === 'string' ? b[sortObj.field].toLowerCase() : b[sortObj.field];
|
|
||||||
if (!isNaN(valB)) valB = Number(valB);
|
// Handle null values
|
||||||
if (sortObj.dir === 'desc') modifier = -1;
|
if (valA === null && valB !== null) return sortObj.dir === 'asc' ? -1 : 1;
|
||||||
|
if (valA !== null && valB === null) return sortObj.dir === 'asc' ? 1 : -1;
|
||||||
|
if (valA === null && valB === null) return 0;
|
||||||
|
|
||||||
|
valA = typeof valA === 'string' ? valA.toLowerCase() : valA;
|
||||||
|
valB = typeof valB === 'string' ? valB.toLowerCase() : valB;
|
||||||
|
|
||||||
|
if (typeof valA !== 'number' && !isNaN(valA)) valA = String(Number(valA));
|
||||||
|
if (typeof valB !== 'number' && !isNaN(valB)) valB = String(Number(valB));
|
||||||
|
|
||||||
if (valA < valB) return -1 * modifier;
|
if (valA < valB) return -1 * modifier;
|
||||||
if (valA > valB) return 1 * modifier;
|
if (valA > valB) return 1 * modifier;
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -126,6 +126,7 @@ export const enUS = {
|
|||||||
insert: 'Insert',
|
insert: 'Insert',
|
||||||
indexes: 'Indexes',
|
indexes: 'Indexes',
|
||||||
foreignKeys: 'Foreign keys',
|
foreignKeys: 'Foreign keys',
|
||||||
|
tableChecks: 'Table checks',
|
||||||
length: 'Length',
|
length: 'Length',
|
||||||
unsigned: 'Unsigned',
|
unsigned: 'Unsigned',
|
||||||
default: 'Default',
|
default: 'Default',
|
||||||
@@ -190,12 +191,15 @@ export const enUS = {
|
|||||||
addNewField: 'Add new field',
|
addNewField: 'Add new field',
|
||||||
manageIndexes: 'Manage indexes',
|
manageIndexes: 'Manage indexes',
|
||||||
manageForeignKeys: 'Manage foreign keys',
|
manageForeignKeys: 'Manage foreign keys',
|
||||||
|
manageTableChecks: 'Manage table checks',
|
||||||
allowNull: 'Allow NULL',
|
allowNull: 'Allow NULL',
|
||||||
zeroFill: 'Zero fill',
|
zeroFill: 'Zero fill',
|
||||||
customValue: 'Custom value',
|
customValue: 'Custom value',
|
||||||
onUpdate: 'On update',
|
onUpdate: 'On update',
|
||||||
deleteField: 'Delete field',
|
deleteField: 'Delete field',
|
||||||
createNewIndex: 'Create new index',
|
createNewIndex: 'Create new index',
|
||||||
|
createNewCheck: 'Create new check',
|
||||||
|
checkClause: 'Check clause',
|
||||||
addToIndex: 'Add to index',
|
addToIndex: 'Add to index',
|
||||||
createNewTable: 'Create new table',
|
createNewTable: 'Create new table',
|
||||||
emptyTable: 'Empty table',
|
emptyTable: 'Empty table',
|
||||||
@@ -205,6 +209,7 @@ export const enUS = {
|
|||||||
emptyConfirm: 'Do you confirm to empty',
|
emptyConfirm: 'Do you confirm to empty',
|
||||||
thereAreNoIndexes: 'There are no indexes',
|
thereAreNoIndexes: 'There are no indexes',
|
||||||
thereAreNoForeign: 'There are no foreign keys',
|
thereAreNoForeign: 'There are no foreign keys',
|
||||||
|
thereAreNoTableChecks: 'There are no table checks',
|
||||||
createNewForeign: 'Create new foreign key',
|
createNewForeign: 'Create new foreign key',
|
||||||
referenceTable: 'Ref. table',
|
referenceTable: 'Ref. table',
|
||||||
referenceField: 'Ref. field',
|
referenceField: 'Ref. field',
|
||||||
|
582
src/renderer/i18n/he-IL.ts
Normal file
582
src/renderer/i18n/he-IL.ts
Normal file
@@ -0,0 +1,582 @@
|
|||||||
|
/**
|
||||||
|
* [TRANSLATION UPDATE HELPER]
|
||||||
|
* - Open a terminal in antares folder and run `npm run translation:check short-code` replacing short-code with the one you are updating.
|
||||||
|
* - The command will output which terms are missing or not translated from english.
|
||||||
|
* - Open antares folder with your editor of choice.
|
||||||
|
* - Go to antares/src/renderer/i18n/ and open the locale file you want to translate.
|
||||||
|
* - Add and translate missing terms and consider whether to translate untranslated terms.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const heIL = {
|
||||||
|
general: { // General purpose terms
|
||||||
|
edit: 'עריכה',
|
||||||
|
save: 'שמירה',
|
||||||
|
close: 'סגירה',
|
||||||
|
delete: 'מחיקה',
|
||||||
|
confirm: 'אישור',
|
||||||
|
cancel: 'ביטול',
|
||||||
|
send: 'שליחה',
|
||||||
|
refresh: 'רענון',
|
||||||
|
autoRefresh: 'רענון אוטומטי',
|
||||||
|
version: 'גרסה',
|
||||||
|
donate: 'תרומה',
|
||||||
|
run: 'הרצה',
|
||||||
|
results: 'תוצאות',
|
||||||
|
size: 'גודל',
|
||||||
|
mimeType: 'סוג MIME',
|
||||||
|
download: 'הורדה',
|
||||||
|
add: 'הוספה',
|
||||||
|
data: 'נתונים',
|
||||||
|
properties: 'מאפיינים',
|
||||||
|
name: 'שם',
|
||||||
|
clear: 'ניקוי',
|
||||||
|
options: 'אפשרויות',
|
||||||
|
insert: 'הכנסה',
|
||||||
|
discard: 'ביטול',
|
||||||
|
stay: 'הישאר',
|
||||||
|
author: 'מחבר',
|
||||||
|
upload: 'העלאה',
|
||||||
|
browse: 'עיון',
|
||||||
|
content: 'תוכן',
|
||||||
|
cut: 'גזירה',
|
||||||
|
copy: 'העתקה',
|
||||||
|
paste: 'הדבקה',
|
||||||
|
duplicate: 'שכפול',
|
||||||
|
tools: 'כלים',
|
||||||
|
seconds: 'שניות',
|
||||||
|
all: 'הכל',
|
||||||
|
new: 'חדש',
|
||||||
|
select: 'בחירה',
|
||||||
|
change: 'שינוי',
|
||||||
|
include: 'כלול',
|
||||||
|
includes: 'כולל',
|
||||||
|
completed: 'הושלם',
|
||||||
|
aborted: 'בוטל',
|
||||||
|
disabled: 'מושבת',
|
||||||
|
enable: 'הפעל',
|
||||||
|
disable: 'השבת',
|
||||||
|
contributors: 'תורמים',
|
||||||
|
pin: 'נעץ',
|
||||||
|
unpin: 'בטל נעיצה',
|
||||||
|
folder: 'תיקייה | תיקיות',
|
||||||
|
none: 'אין',
|
||||||
|
singleQuote: 'מרכאה בודדת',
|
||||||
|
doubleQuote: 'מרכאות כפולות',
|
||||||
|
deleteConfirm: 'האם אתה מאשר את הביטול של',
|
||||||
|
uploadFile: 'העלאת קובץ',
|
||||||
|
format: 'פורמט', // Format code
|
||||||
|
history: 'היסטוריה',
|
||||||
|
filter: 'סינון',
|
||||||
|
manualValue: 'ערך ידני',
|
||||||
|
selectAll: 'בחר הכל',
|
||||||
|
pageNumber: 'מספר עמוד',
|
||||||
|
directoryPath: 'נתיב תיקייה',
|
||||||
|
actionSuccessful: '{action} בוצעה בהצלחה',
|
||||||
|
outputFormat: 'פורמט פלט',
|
||||||
|
singleFile: 'קובץ {ext} בודד',
|
||||||
|
zipCompressedFile: 'קובץ {ext} דחוס ב-ZIP',
|
||||||
|
copyName: 'העתק שם',
|
||||||
|
search: 'חיפוש',
|
||||||
|
title: 'כותרת',
|
||||||
|
archive: 'ארכיון', // verb
|
||||||
|
undo: 'ביטול פעולה',
|
||||||
|
moveTo: 'העבר אל'
|
||||||
|
},
|
||||||
|
connection: { // Database connection
|
||||||
|
connection: 'חיבור',
|
||||||
|
connectionName: 'שם החיבור',
|
||||||
|
hostName: 'שם המארח',
|
||||||
|
client: 'לקוח',
|
||||||
|
port: 'פורט',
|
||||||
|
user: 'משתמש',
|
||||||
|
password: 'סיסמה',
|
||||||
|
credentials: 'אישורים',
|
||||||
|
connect: 'התחבר',
|
||||||
|
connected: 'מחובר',
|
||||||
|
disconnect: 'התנתק',
|
||||||
|
disconnected: 'מנותק',
|
||||||
|
ssl: 'SSL',
|
||||||
|
enableSsl: 'הפעל SSL',
|
||||||
|
privateKey: 'מפתח פרטי',
|
||||||
|
certificate: 'תעודה',
|
||||||
|
caCertificate: 'תעודת CA',
|
||||||
|
ciphers: 'צפנים',
|
||||||
|
untrustedConnection: 'חיבור לא מהימן',
|
||||||
|
passphrase: 'ביטוי סיסמה',
|
||||||
|
sshTunnel: 'מנהרת SSH',
|
||||||
|
enableSsh: 'הפעל SSH',
|
||||||
|
connectionString: 'מחרוזת חיבור',
|
||||||
|
addConnection: 'הוסף חיבור',
|
||||||
|
createConnection: 'צור חיבור',
|
||||||
|
createNewConnection: 'צור חיבור חדש',
|
||||||
|
askCredentials: 'בקש אישורים',
|
||||||
|
testConnection: 'בדוק חיבור',
|
||||||
|
editConnection: 'ערוך חיבור',
|
||||||
|
deleteConnection: 'מחק חיבור',
|
||||||
|
connectionSuccessfullyMade: 'החיבור בוצע בהצלחה!',
|
||||||
|
readOnlyMode: 'מצב קריאה בלבד',
|
||||||
|
allConnections: 'כל החיבורים',
|
||||||
|
searchForConnections: 'חפש חיבורים',
|
||||||
|
keepAliveInterval: 'מרווח שמירת חיבור',
|
||||||
|
singleConnection: 'חיבור בודד'
|
||||||
|
},
|
||||||
|
database: { // Database related terms
|
||||||
|
schema: 'סכימה',
|
||||||
|
type: 'סוג',
|
||||||
|
insert: 'הכנס',
|
||||||
|
indexes: 'אינדקסים',
|
||||||
|
foreignKeys: 'מפתחות זרים',
|
||||||
|
length: 'אורך',
|
||||||
|
unsigned: 'ללא סימן',
|
||||||
|
default: 'ברירת מחדל',
|
||||||
|
comment: 'הערה',
|
||||||
|
key: 'מפתח | מפתחות',
|
||||||
|
order: 'סדר',
|
||||||
|
expression: 'ביטוי',
|
||||||
|
autoIncrement: 'מספור אוטומטי',
|
||||||
|
engine: 'מנוע',
|
||||||
|
field: 'שדה | שדות',
|
||||||
|
approximately: 'בקירוב',
|
||||||
|
total: 'סך הכל',
|
||||||
|
table: 'טבלה | טבלאות',
|
||||||
|
view: 'תצוגה | תצוגות',
|
||||||
|
materializedview: 'תצוגה ממומשת | תצוגות ממומשות',
|
||||||
|
definer: 'מגדיר',
|
||||||
|
algorithm: 'אלגוריתם',
|
||||||
|
trigger: 'טריגר | טריגרים',
|
||||||
|
storedRoutine: 'שגרה שמורה | שגרות שמורות',
|
||||||
|
scheduler: 'מתזמן | מתזמנים',
|
||||||
|
event: 'אירוע',
|
||||||
|
parameters: 'פרמטרים',
|
||||||
|
function: 'פונקציה | פונקציות',
|
||||||
|
deterministic: 'דטרמיניסטי',
|
||||||
|
context: 'הקשר',
|
||||||
|
export: 'ייצוא',
|
||||||
|
import: 'ייבוא',
|
||||||
|
returns: 'מחזיר',
|
||||||
|
timing: 'תזמון',
|
||||||
|
state: 'מצב',
|
||||||
|
execution: 'ביצוע',
|
||||||
|
starts: 'מתחיל',
|
||||||
|
ends: 'מסתיים',
|
||||||
|
variables: 'משתנים',
|
||||||
|
processes: 'תהליכים',
|
||||||
|
database: 'מסד נתונים',
|
||||||
|
array: 'מערך',
|
||||||
|
structure: 'מבנה',
|
||||||
|
row: 'שורה | שורות',
|
||||||
|
cell: 'תא | תאים',
|
||||||
|
triggerFunction: 'פונקציית טריגר | פונקציות טריגר',
|
||||||
|
routine: 'שגרה | שגרות',
|
||||||
|
drop: 'הסר',
|
||||||
|
commit: 'בצע',
|
||||||
|
rollback: 'שחזר',
|
||||||
|
ddl: 'DDL',
|
||||||
|
collation: 'אוסף',
|
||||||
|
resultsTable: 'טבלת תוצאות',
|
||||||
|
unableEditFieldWithoutPrimary: 'לא ניתן לערוך שדה ללא מפתח ראשי בתוצאות',
|
||||||
|
editCell: 'ערוך תא',
|
||||||
|
deleteRows: 'מחק שורה | מחק {count} שורות',
|
||||||
|
confirmToDeleteRows: 'האם אתה מאשר למחוק שורה אחת? | האם אתה מאשר למחוק {count} שורות?',
|
||||||
|
addNewRow: 'הוסף שורה חדשה',
|
||||||
|
numberOfInserts: 'מספר הכנסות',
|
||||||
|
affectedRows: 'שורות מושפעות',
|
||||||
|
createNewDatabase: 'צור מסד נתונים חדש',
|
||||||
|
databaseName: 'שם מסד הנתונים',
|
||||||
|
serverDefault: 'ברירת מחדל של השרת',
|
||||||
|
deleteDatabase: 'מחק מסד נתונים',
|
||||||
|
editDatabase: 'ערוך מסד נתונים',
|
||||||
|
clearChanges: 'נקה שינויים',
|
||||||
|
addNewField: 'הוסף שדה חדש',
|
||||||
|
manageIndexes: 'נהל אינדקסים',
|
||||||
|
manageForeignKeys: 'נהל מפתחות זרים',
|
||||||
|
allowNull: 'אפשר NULL',
|
||||||
|
zeroFill: 'מילוי אפסים',
|
||||||
|
customValue: 'ערך מותאם אישית',
|
||||||
|
onUpdate: 'בעת עדכון',
|
||||||
|
deleteField: 'מחק שדה',
|
||||||
|
createNewIndex: 'צור אינדקס חדש',
|
||||||
|
addToIndex: 'הוסף לאינדקס',
|
||||||
|
createNewTable: 'צור טבלה חדשה',
|
||||||
|
emptyTable: 'רוקן טבלה',
|
||||||
|
duplicateTable: 'שכפל טבלה',
|
||||||
|
deleteTable: 'מחק טבלה',
|
||||||
|
exportTable: 'ייצא טבלה',
|
||||||
|
emptyConfirm: 'האם אתה מאשר לרוקן',
|
||||||
|
thereAreNoIndexes: 'אין אינדקסים',
|
||||||
|
thereAreNoForeign: 'אין מפתחות זרים',
|
||||||
|
createNewForeign: 'צור מפתח זר חדש',
|
||||||
|
referenceTable: 'טבלת התייחסות',
|
||||||
|
referenceField: 'שדה התייחסות',
|
||||||
|
foreignFields: 'שדות זרים',
|
||||||
|
invalidDefault: 'ברירת מחדל לא חוקית',
|
||||||
|
onDelete: 'בעת מחיקה',
|
||||||
|
selectStatement: 'הצהרת SELECT',
|
||||||
|
triggerStatement: 'הצהרת טריגר',
|
||||||
|
sqlSecurity: 'אבטחת SQL',
|
||||||
|
updateOption: 'אפשרות עדכון',
|
||||||
|
deleteView: 'מחק תצוגה',
|
||||||
|
createNewView: 'צור תצוגה חדשה',
|
||||||
|
createNewMaterializedView: 'צור תצוגה ממומשת חדשה',
|
||||||
|
deleteTrigger: 'מחק טריגר',
|
||||||
|
createNewTrigger: 'צור טריגר חדש',
|
||||||
|
currentUser: 'משתמש נוכחי',
|
||||||
|
routineBody: 'גוף השגרה',
|
||||||
|
dataAccess: 'גישה לנתונים',
|
||||||
|
thereAreNoParameters: 'אין פרמטרים',
|
||||||
|
createNewParameter: 'צור פרמטר חדש',
|
||||||
|
createNewRoutine: 'צור שגרה שמורה חדשה',
|
||||||
|
deleteRoutine: 'מחק שגרה שמורה',
|
||||||
|
functionBody: 'גוף הפונקציה',
|
||||||
|
createNewFunction: 'צור פונקציה חדשה',
|
||||||
|
deleteFunction: 'מחק פונקציה',
|
||||||
|
schedulerBody: 'גוף המתזמן',
|
||||||
|
createNewScheduler: 'צור מתזמן חדש',
|
||||||
|
deleteScheduler: 'מחק מתזמן',
|
||||||
|
preserveOnCompletion: 'שמור בסיום',
|
||||||
|
tableFiller: 'ממלא טבלאות',
|
||||||
|
fakeDataLanguage: 'שפת נתונים מזויפים',
|
||||||
|
queryDuration: 'משך השאילתה',
|
||||||
|
setNull: 'הגדר NULL',
|
||||||
|
processesList: 'רשימת תהליכים',
|
||||||
|
processInfo: 'מידע על תהליך',
|
||||||
|
manageUsers: 'נהל משתמשים',
|
||||||
|
createNewSchema: 'צור סכימה חדשה',
|
||||||
|
schemaName: 'שם הסכימה',
|
||||||
|
editSchema: 'ערוך סכימה',
|
||||||
|
deleteSchema: 'מחק סכימה',
|
||||||
|
noSchema: 'אין סכימה',
|
||||||
|
runQuery: 'הרץ שאילתה',
|
||||||
|
thereAreNoTableFields: 'אין שדות בטבלה',
|
||||||
|
newTable: 'טבלה חדשה',
|
||||||
|
newView: 'תצוגה חדשה',
|
||||||
|
newMaterializedView: 'תצוגה ממומשת חדשה',
|
||||||
|
newTrigger: 'טריגר חדש',
|
||||||
|
newRoutine: 'שגרה חדשה',
|
||||||
|
newFunction: 'פונקציה חדשה',
|
||||||
|
newScheduler: 'מתזמן חדש',
|
||||||
|
newTriggerFunction: 'פונקציית טריגר חדשה',
|
||||||
|
thereAreNoQueriesYet: 'אין עדיין שאילתות',
|
||||||
|
searchForQueries: 'חפש שאילתות',
|
||||||
|
killProcess: 'סיים תהליך',
|
||||||
|
exportSchema: 'ייצא סכ',
|
||||||
|
importSchema: 'ייבא סכימה',
|
||||||
|
newInsertStmtEvery: 'הצהרת INSERT חדשה כל',
|
||||||
|
processingTableExport: 'מעבד {table}',
|
||||||
|
fetchingTableExport: 'מביא נתוני {table}',
|
||||||
|
writingTableExport: 'כותב נתוני {table}',
|
||||||
|
checkAllTables: 'סמן את כל הטבלאות',
|
||||||
|
uncheckAllTables: 'בטל סימון כל הטבלאות',
|
||||||
|
killQuery: 'הרוג שאילתה',
|
||||||
|
insertRow: 'הכנס שורה | הכנס שורות',
|
||||||
|
commitMode: 'מצב ביצוע',
|
||||||
|
autoCommit: 'ביצוע אוטומטי',
|
||||||
|
manualCommit: 'ביצוע ידני',
|
||||||
|
importQueryErrors: 'אזהרה: אירעה {n} שגיאה | אזהרה: אירעו {n} שגיאות',
|
||||||
|
executedQueries: 'בוצעה {n} שאילתה | בוצעו {n} שאילתות',
|
||||||
|
disableFKChecks: 'בטל בדיקות מפתח זר',
|
||||||
|
formatQuery: 'עצב שאילתה',
|
||||||
|
queryHistory: 'היסטוריית שאילתות',
|
||||||
|
clearQuery: 'נקה שאילתה',
|
||||||
|
fillCell: 'מלא תא',
|
||||||
|
executeSelectedQuery: 'בצע שאילתה נבחרת',
|
||||||
|
noResultsPresent: 'אין תוצאות',
|
||||||
|
sqlExportOptions: 'אפשרויות ייצוא SQL',
|
||||||
|
targetTable: 'טבלת יעד',
|
||||||
|
switchDatabase: 'החלף מסד נתונים',
|
||||||
|
searchForElements: 'חפש אלמנטים',
|
||||||
|
searchForSchemas: 'חפש סכימות',
|
||||||
|
savedQueries: 'שאילתות שמורות'
|
||||||
|
},
|
||||||
|
application: { // Application related terms
|
||||||
|
settings: 'הגדרות',
|
||||||
|
console: 'קונסולה',
|
||||||
|
general: 'כללי',
|
||||||
|
themes: 'ערכות נושא',
|
||||||
|
update: 'עדכון',
|
||||||
|
about: 'אודות',
|
||||||
|
language: 'שפה',
|
||||||
|
shortcuts: 'קיצורי דרך',
|
||||||
|
key: 'מקש | מקשים', // Keyboard key
|
||||||
|
event: 'אירוע',
|
||||||
|
light: 'בהיר',
|
||||||
|
dark: 'כהה',
|
||||||
|
autoCompletion: 'השלמה אוטומטית',
|
||||||
|
application: 'יישום',
|
||||||
|
editor: 'עורך',
|
||||||
|
changelog: 'יומן שינויים',
|
||||||
|
small: 'קטן',
|
||||||
|
medium: 'בינוני',
|
||||||
|
large: 'גדול',
|
||||||
|
appearance: 'מראה',
|
||||||
|
color: 'צבע',
|
||||||
|
label: 'תווית',
|
||||||
|
icon: 'סמל',
|
||||||
|
customIcon: 'סמל מותאם אישית',
|
||||||
|
fileName: 'שם קובץ',
|
||||||
|
choseFile: 'בחר קובץ',
|
||||||
|
data: 'נתונים',
|
||||||
|
password: 'סיסמה',
|
||||||
|
required: 'נדרש',
|
||||||
|
madeWithJS: 'נוצר עם 💛 ו-JavaScript!',
|
||||||
|
checkForUpdates: 'בדוק עדכונים',
|
||||||
|
noUpdatesAvailable: 'אין עדכונים זמינים',
|
||||||
|
checkingForUpdate: 'בודק עדכונים',
|
||||||
|
checkFailure: 'הבדיקה נכשלה, נסה שוב מאוחר יותר',
|
||||||
|
updateAvailable: 'עדכון זמין',
|
||||||
|
downloadingUpdate: 'מוריד עדכון',
|
||||||
|
updateDownloaded: 'העדכון הורד',
|
||||||
|
restartToInstall: 'הפעל מחדש את Antares כדי להתקין',
|
||||||
|
includeBetaUpdates: 'כלול עדכוני בטא',
|
||||||
|
notificationsTimeout: 'זמן התראות',
|
||||||
|
openNewTab: 'פתח כרטיסייה חדשה',
|
||||||
|
unsavedChanges: 'שינויים שלא נשמרו',
|
||||||
|
discardUnsavedChanges: 'יש לך שינויים שלא נשמרו. סגירת כרטיסייה זו תגרום לאובדן השינויים.',
|
||||||
|
applicationTheme: 'ערכת נושא ליישום',
|
||||||
|
editorTheme: 'ערכת נושא לעורך',
|
||||||
|
wrapLongLines: 'גלישת שורות ארוכות',
|
||||||
|
markdownSupported: 'תמיכה ב-Markdown',
|
||||||
|
plantATree: 'נטע עץ',
|
||||||
|
dataTabPageSize: 'תוצאות לעמוד',
|
||||||
|
noOpenTabs: 'אין כרטיסיות פתוחות, נווט בסרגל השמאלי או:',
|
||||||
|
restorePreviousSession: 'שחזר הפעלה קודמת',
|
||||||
|
closeTab: 'סגור כרטיסייה',
|
||||||
|
goToDownloadPage: 'עבור לדף ההורדה',
|
||||||
|
disableBlur: 'בטל טשטוש',
|
||||||
|
missingOrIncompleteTranslation: 'תרגום חסר או לא שלם?',
|
||||||
|
findOutHowToContribute: 'גלה כיצד לתרום',
|
||||||
|
reportABug: 'דווח על באג',
|
||||||
|
nextTab: 'כרטיסייה הבאה',
|
||||||
|
previousTab: 'כרטיסייה קודמת',
|
||||||
|
selectTabNumber: 'בחר כרטיסייה מספר {param}',
|
||||||
|
toggleConsole: 'הצג/הסתר קונסולה',
|
||||||
|
addShortcut: 'הוסף קיצור דרך',
|
||||||
|
editShortcut: 'ערוך קיצור דרך',
|
||||||
|
deleteShortcut: 'מחק קיצור דרך',
|
||||||
|
restoreDefaults: 'שחזר ברירות מחדל',
|
||||||
|
restoreDefaultsQuestion: 'האם אתה מאשר לשחזר את ערכי ברירת המחדל?',
|
||||||
|
registerAShortcut: 'רשום קיצור דרך',
|
||||||
|
invalidShortcutMessage: 'שילוב לא חוקי, המשך להקליד',
|
||||||
|
shortcutAlreadyExists: 'קיצור הדרך כבר קיים',
|
||||||
|
saveContent: 'שמור תוכן',
|
||||||
|
openAllConnections: 'פתח את כל החיבורים',
|
||||||
|
openSettings: 'פתח הגדרות',
|
||||||
|
runOrReload: 'הרץ או טען מחדש',
|
||||||
|
openFilter: 'פתח מסנן',
|
||||||
|
nextResultsPage: 'עמוד תוצאות הבא',
|
||||||
|
previousResultsPage: 'עמוד תוצאות קודם',
|
||||||
|
editFolder: 'ערוך תיקייה',
|
||||||
|
folderName: 'שם תיקייה',
|
||||||
|
deleteFolder: 'מחק תיקייה',
|
||||||
|
newFolder: 'תיקייה חדשה',
|
||||||
|
outOfFolder: 'מחוץ לתיקייה',
|
||||||
|
editConnectionAppearance: 'ערוך מראה חיבור',
|
||||||
|
defaultCopyType: 'סוג העתקה ברירת מחדל',
|
||||||
|
showTableSize: 'הצג גודל טבלה בסרגל הצד',
|
||||||
|
showTableSizeDescription: 'MySQL/MariaDB בלבד. הפעלת אפשרות זו עלולה להשפיע על הביצועים בסכימה עם טבלאות רבות.',
|
||||||
|
switchSearchMethod: 'החלף שיטת חיפוש',
|
||||||
|
phpArray: 'מערך PHP',
|
||||||
|
closeAllTabs: 'סגור את כל הכרטיסיות',
|
||||||
|
closeOtherTabs: 'סגור כרטיסיות אחרות',
|
||||||
|
closeTabsToLeft: 'סגור כרטיסיות משמאל',
|
||||||
|
closeTabsToRight: 'סגור כרטיסיות מימין',
|
||||||
|
csvFieldDelimiter: 'מפריד שדות',
|
||||||
|
csvLinesTerminator: 'מסיים שורות',
|
||||||
|
csvStringDelimiter: 'מפריד מחרוזות',
|
||||||
|
csvIncludeHeader: 'כלול כותרת',
|
||||||
|
csvExportOptions: 'אפשרויות ייצוא CSV',
|
||||||
|
exportData: 'ייצא נתונים',
|
||||||
|
exportDataExplanation: 'ייצא חיבורים שמורים ל-Antares. תתבקש להזין סיסמה להצפנת הקובץ המיוצא.',
|
||||||
|
importData: 'ייבא נתונים',
|
||||||
|
importDataExplanation: 'מייבא קובץ .antares המכיל חיבורים. תצטרך להזין את הסיסמה שהוגדרה בזמן הייצוא.',
|
||||||
|
includeConnectionPasswords: 'כלול סיסמאות חיבור',
|
||||||
|
includeFolders: 'כלול תיקיות',
|
||||||
|
encryptionPassword: 'סיסמת הצפנה',
|
||||||
|
encryptionPasswordError: 'סיסמת ההצפנה חייבת להיות באורך של 8 תווים לפחות.',
|
||||||
|
ignoreDuplicates: 'התעלם מכפילויות',
|
||||||
|
wrongImportPassword: 'סיסמת ייבוא שגויה',
|
||||||
|
wrongFileFormat: 'פורמט קובץ שגוי',
|
||||||
|
dataImportSuccess: 'הנתונים יובאו בהצלחה',
|
||||||
|
note: 'הערה | הערות',
|
||||||
|
thereAreNoNotesYet: 'אין עדיין הערות',
|
||||||
|
addNote: 'הוסף הערה',
|
||||||
|
editNote: 'ערוך הערה',
|
||||||
|
saveAsNote: 'שמור כהערה',
|
||||||
|
showArchivedNotes: 'הצג הערות בארכיון',
|
||||||
|
hideArchivedNotes: 'הסתר הערות בארכיון',
|
||||||
|
tag: 'תג', // Note tag
|
||||||
|
saveFile: 'שמור קובץ',
|
||||||
|
saveFileAs: 'שמור קובץ בשם',
|
||||||
|
openFile: 'פתח קובץ',
|
||||||
|
openNotes: 'פתח הערות',
|
||||||
|
debugConsole: 'קונסולת ניפוי', // <- console tab name
|
||||||
|
executedQueries: 'שאילתות שבוצעו', // <- console tab name
|
||||||
|
sizeLimitError: 'חריגה מהגודל המקסימלי של {size}'
|
||||||
|
},
|
||||||
|
faker: { // Faker.js methods, used in random generated content
|
||||||
|
address: 'כתובת',
|
||||||
|
commerce: 'מסחר',
|
||||||
|
company: 'חברה',
|
||||||
|
database: 'מסד נתונים',
|
||||||
|
date: 'תאריך',
|
||||||
|
finance: 'פיננסים',
|
||||||
|
git: 'Git',
|
||||||
|
hacker: 'האקר',
|
||||||
|
internet: 'אינטרנט',
|
||||||
|
lorem: 'לורם',
|
||||||
|
name: 'שם',
|
||||||
|
music: 'מוזיקה',
|
||||||
|
phone: 'טלפון',
|
||||||
|
random: 'אקראי',
|
||||||
|
system: 'מערכת',
|
||||||
|
time: 'זמן',
|
||||||
|
vehicle: 'רכב',
|
||||||
|
zipCode: 'מיקוד',
|
||||||
|
zipCodeByState: 'מיקוד לפי מדינה',
|
||||||
|
city: 'עיר',
|
||||||
|
cityPrefix: 'קידומת עיר',
|
||||||
|
citySuffix: 'סיומת עיר',
|
||||||
|
streetName: 'שם רחוב',
|
||||||
|
streetAddress: 'כתובת רחוב',
|
||||||
|
streetSuffix: 'סיומת רחוב',
|
||||||
|
streetPrefix: 'קידומת רחוב',
|
||||||
|
secondaryAddress: 'כתובת משנית',
|
||||||
|
county: 'מחוז',
|
||||||
|
country: 'מדינה',
|
||||||
|
countryCode: 'קוד מדינה',
|
||||||
|
state: 'מדינה',
|
||||||
|
stateAbbr: 'קיצור מדינה',
|
||||||
|
latitude: 'קו רוחב',
|
||||||
|
longitude: 'קו אורך',
|
||||||
|
direction: 'כיוון',
|
||||||
|
cardinalDirection: 'כיוון קרדינלי',
|
||||||
|
ordinalDirection: 'כיוון אורדינלי',
|
||||||
|
nearbyGPSCoordinate: 'קואורדינטת GPS קרובה',
|
||||||
|
timeZone: 'אזור זמן',
|
||||||
|
color: 'צבע',
|
||||||
|
department: 'מחלקה',
|
||||||
|
productName: 'שם מוצר',
|
||||||
|
price: 'מחיר',
|
||||||
|
productAdjective: 'תואר מוצר',
|
||||||
|
productMaterial: 'חומר מוצר',
|
||||||
|
product: 'מוצר',
|
||||||
|
productDescription: 'תיאור מוצר',
|
||||||
|
suffixes: 'סיומות',
|
||||||
|
companyName: 'שם חברה',
|
||||||
|
companySuffix: 'סיומת חברה',
|
||||||
|
catchPhrase: 'סיסמה',
|
||||||
|
bs: 'BS',
|
||||||
|
catchPhraseAdjective: 'תואר סיסמה',
|
||||||
|
catchPhraseDescriptor: 'מתאר סיסמה',
|
||||||
|
catchPhraseNoun: 'שם עצם סיסמה',
|
||||||
|
bsAdjective: 'תואר BS',
|
||||||
|
bsBuzz: 'באז BS',
|
||||||
|
bsNoun: 'שם עצם BS',
|
||||||
|
column: 'עמודה',
|
||||||
|
type: 'סוג',
|
||||||
|
collation: 'קולציה',
|
||||||
|
engine: 'מנוע',
|
||||||
|
past: 'עבר',
|
||||||
|
now: 'עכשיו',
|
||||||
|
|
||||||
|
future: 'עתיד',
|
||||||
|
between: 'בין',
|
||||||
|
recent: 'לאחרונה',
|
||||||
|
soon: 'בקרוב',
|
||||||
|
month: 'חודש',
|
||||||
|
weekday: 'יום בשבוע',
|
||||||
|
account: 'חשבון',
|
||||||
|
accountName: 'שם החשבון',
|
||||||
|
routingNumber: 'מספר ניתוב',
|
||||||
|
mask: 'מסכה',
|
||||||
|
amount: 'סכום',
|
||||||
|
transactionType: 'סוג העסקה',
|
||||||
|
currencyCode: 'קוד מטבע',
|
||||||
|
currencyName: 'שם המטבע',
|
||||||
|
currencySymbol: 'סמל המטבע',
|
||||||
|
bitcoinAddress: 'כתובת ביטקוין',
|
||||||
|
litecoinAddress: 'כתובת לייטקוין',
|
||||||
|
creditCardNumber: 'מספר כרטיס אשראי',
|
||||||
|
creditCardCVV: 'CVV של כרטיס אשראי',
|
||||||
|
ethereumAddress: 'כתובת אתריום',
|
||||||
|
iban: 'איבן',
|
||||||
|
bic: 'BIC',
|
||||||
|
transactionDescription: 'תיאור העסקה',
|
||||||
|
branch: 'סניף',
|
||||||
|
commitEntry: 'ערך קומיט',
|
||||||
|
commitMessage: 'הודעת קומיט',
|
||||||
|
commitSha: 'SHA של קומיט',
|
||||||
|
shortSha: 'SHA קצר',
|
||||||
|
abbreviation: 'קיצור',
|
||||||
|
adjective: 'שם תואר',
|
||||||
|
noun: 'שם עצם',
|
||||||
|
verb: 'פועל',
|
||||||
|
ingverb: 'פועל בצורת -ing',
|
||||||
|
phrase: 'ביטוי',
|
||||||
|
avatar: 'אווטאר',
|
||||||
|
email: 'אימייל',
|
||||||
|
exampleEmail: 'דוגמת אימייל',
|
||||||
|
userName: 'שם משתמש',
|
||||||
|
protocol: 'פרוטוקול',
|
||||||
|
url: 'כתובת URL',
|
||||||
|
domainName: 'שם דומיין',
|
||||||
|
domainSuffix: 'סיומת דומיין',
|
||||||
|
domainWord: 'מילת דומיין',
|
||||||
|
ip: 'IP',
|
||||||
|
ipv6: 'IPv6',
|
||||||
|
userAgent: 'User Agent',
|
||||||
|
mac: 'כתובת MAC',
|
||||||
|
password: 'סיסמה',
|
||||||
|
word: 'מילה',
|
||||||
|
words: 'מילים',
|
||||||
|
sentence: 'משפט',
|
||||||
|
slug: 'סלאג',
|
||||||
|
sentences: 'משפטים',
|
||||||
|
paragraph: 'פסקה',
|
||||||
|
paragraphs: 'פסקאות',
|
||||||
|
text: 'טקסט',
|
||||||
|
lines: 'שורות',
|
||||||
|
genre: 'ז\'אנר',
|
||||||
|
firstName: 'שם פרטי',
|
||||||
|
lastName: 'שם משפחה',
|
||||||
|
middleName: 'שם אמצעי',
|
||||||
|
findName: 'שם מלא',
|
||||||
|
jobTitle: 'תפקיד',
|
||||||
|
gender: 'מין',
|
||||||
|
prefix: 'תחילית',
|
||||||
|
suffix: 'סיומת',
|
||||||
|
title: 'כותרת',
|
||||||
|
jobDescriptor: 'תיאור תפקיד',
|
||||||
|
jobArea: 'תחום תפקיד',
|
||||||
|
jobType: 'סוג תפקיד',
|
||||||
|
phoneNumber: 'מספר טלפון',
|
||||||
|
phoneNumberFormat: 'פורמט מספר טלפון',
|
||||||
|
phoneFormats: 'פורמטים של מספר טלפון',
|
||||||
|
number: 'מספר',
|
||||||
|
float: 'מספר עשרוני',
|
||||||
|
arrayElement: 'אלמנט במערך',
|
||||||
|
arrayElements: 'אלמנטים במערך',
|
||||||
|
objectElement: 'אלמנט באובייקט',
|
||||||
|
uuid: 'UUID',
|
||||||
|
boolean: 'בוליאני',
|
||||||
|
image: 'תמונה',
|
||||||
|
locale: 'לוקאל',
|
||||||
|
alpha: 'אלפא',
|
||||||
|
alphaNumeric: 'אלפאנומרי',
|
||||||
|
hexaDecimal: 'הקסדצימלי',
|
||||||
|
fileName: 'שם קובץ',
|
||||||
|
commonFileName: 'שם קובץ נפוץ',
|
||||||
|
mimeType: 'סוג MIME',
|
||||||
|
commonFileType: 'סוג קובץ נפוץ',
|
||||||
|
commonFileExt: 'סיומת קובץ נפוצה',
|
||||||
|
fileType: 'סוג קובץ',
|
||||||
|
fileExt: 'סיומת קובץ',
|
||||||
|
directoryPath: 'נתיב תיקייה',
|
||||||
|
filePath: 'נתיב קובץ',
|
||||||
|
semver: 'גרסת Semver',
|
||||||
|
manufacturer: 'יצרן',
|
||||||
|
model: 'דגם',
|
||||||
|
fuel: 'דלק',
|
||||||
|
vin: 'מספר רכב (VIN)'
|
||||||
|
}
|
||||||
|
};
|
@@ -7,6 +7,7 @@ import { deDE } from './de-DE';
|
|||||||
import { enUS } from './en-US';
|
import { enUS } from './en-US';
|
||||||
import { esES } from './es-ES';
|
import { esES } from './es-ES';
|
||||||
import { frFR } from './fr-FR';
|
import { frFR } from './fr-FR';
|
||||||
|
import { heIL } from './he-IL';
|
||||||
import { idID } from './id-ID';
|
import { idID } from './id-ID';
|
||||||
import { itIT } from './it-IT';
|
import { itIT } from './it-IT';
|
||||||
import { jaJP } from './ja-JP';
|
import { jaJP } from './ja-JP';
|
||||||
@@ -17,6 +18,8 @@ import { ruRU } from './ru-RU';
|
|||||||
import { ukUA } from './uk-UA';
|
import { ukUA } from './uk-UA';
|
||||||
import { viVN } from './vi-VN';
|
import { viVN } from './vi-VN';
|
||||||
import { zhCN } from './zh-CN';
|
import { zhCN } from './zh-CN';
|
||||||
|
import { zhTW } from './zh-TW';
|
||||||
|
|
||||||
const messages = {
|
const messages = {
|
||||||
'en-US': enUS,
|
'en-US': enUS,
|
||||||
'it-IT': itIT,
|
'it-IT': itIT,
|
||||||
@@ -34,7 +37,9 @@ const messages = {
|
|||||||
'nl-NL': nlNL,
|
'nl-NL': nlNL,
|
||||||
'ca-ES': caES,
|
'ca-ES': caES,
|
||||||
'cs-CZ': csCZ,
|
'cs-CZ': csCZ,
|
||||||
'uk-UA': ukUA
|
'uk-UA': ukUA,
|
||||||
|
'zh-TW': zhTW,
|
||||||
|
'he-IL': heIL
|
||||||
};
|
};
|
||||||
|
|
||||||
type NestedPartial<T> = {
|
type NestedPartial<T> = {
|
||||||
|
@@ -61,7 +61,17 @@ export const ruRU = {
|
|||||||
actionSuccessful: '{action} успешно',
|
actionSuccessful: '{action} успешно',
|
||||||
outputFormat: 'Формат вывода',
|
outputFormat: 'Формат вывода',
|
||||||
singleFile: 'Один {ext} файл',
|
singleFile: 'Один {ext} файл',
|
||||||
zipCompressedFile: 'ZIP сжатие {ext} файла'
|
zipCompressedFile: 'ZIP сжатие {ext} файла',
|
||||||
|
include: 'Включая',
|
||||||
|
none: 'Нет',
|
||||||
|
singleQuote: 'Одинарная кавычка',
|
||||||
|
doubleQuote: 'Двойная кавычка',
|
||||||
|
copyName: 'Скопировать имя',
|
||||||
|
search: 'Поиск',
|
||||||
|
title: 'Название',
|
||||||
|
archive: 'Архив',
|
||||||
|
undo: 'Отменить',
|
||||||
|
moveTo: 'Переместить в'
|
||||||
},
|
},
|
||||||
connection: {
|
connection: {
|
||||||
connectionName: 'Название соединения',
|
connectionName: 'Название соединения',
|
||||||
@@ -96,7 +106,10 @@ export const ruRU = {
|
|||||||
readOnlyMode: 'Режим только чтение',
|
readOnlyMode: 'Режим только чтение',
|
||||||
untrustedConnection: 'Ненадежное соединение',
|
untrustedConnection: 'Ненадежное соединение',
|
||||||
allConnections: 'Все соединения',
|
allConnections: 'Все соединения',
|
||||||
searchForConnections: 'Поиск соединений'
|
searchForConnections: 'Поиск соединений',
|
||||||
|
keepAliveInterval: 'Интервал поддержания соединения',
|
||||||
|
singleConnection: 'Одно соединение',
|
||||||
|
connection: 'Соединение'
|
||||||
},
|
},
|
||||||
database: {
|
database: {
|
||||||
schema: 'Схема',
|
schema: 'Схема',
|
||||||
@@ -255,7 +268,16 @@ export const ruRU = {
|
|||||||
sqlExportOptions: 'Опции SQL экспорта',
|
sqlExportOptions: 'Опции SQL экспорта',
|
||||||
targetTable: 'Целевая таблица',
|
targetTable: 'Целевая таблица',
|
||||||
importQueryErrors: 'Внимание: {n} ошибка возникла | Внимание: {n} ошибок произошло',
|
importQueryErrors: 'Внимание: {n} ошибка возникла | Внимание: {n} ошибок произошло',
|
||||||
executedQueries: '{n} запрос выполнен | {n} запросов выполнено'
|
executedQueries: '{n} запрос выполнен | {n} запросов выполнено',
|
||||||
|
insert: 'Вставить',
|
||||||
|
materializedview: 'Материализованное представление | Материализованные представления',
|
||||||
|
exportTable: 'Экспорт таблицы',
|
||||||
|
createNewMaterializedView: 'Создать новое материализованное представление',
|
||||||
|
newMaterializedView: 'Новое материализованное представление',
|
||||||
|
switchDatabase: 'Переключить базу данных',
|
||||||
|
searchForElements: 'Поиск элементов',
|
||||||
|
searchForSchemas: 'Поиск схем',
|
||||||
|
savedQueries: 'Сохранённые запросы'
|
||||||
},
|
},
|
||||||
application: {
|
application: {
|
||||||
settings: 'Настройки',
|
settings: 'Настройки',
|
||||||
@@ -313,9 +335,9 @@ export const ruRU = {
|
|||||||
previousTab: 'Предыдущая вкладка',
|
previousTab: 'Предыдущая вкладка',
|
||||||
selectTabNumber: 'Выбрать вкладку под номером {param}',
|
selectTabNumber: 'Выбрать вкладку под номером {param}',
|
||||||
toggleConsole: 'Переключиться на консоль',
|
toggleConsole: 'Переключиться на консоль',
|
||||||
addShortcut: 'Добавить горячие клавиши',
|
addShortcut: 'Добавить горячую клавишу',
|
||||||
editShortcut: 'Изменить горячие клавиши',
|
editShortcut: 'Изменить горячую клавишу',
|
||||||
deleteShortcut: 'Удалить горячие клавиши',
|
deleteShortcut: 'Удалить горячую клавишу',
|
||||||
restoreDefaults: 'Восстановить по-умолчанию',
|
restoreDefaults: 'Восстановить по-умолчанию',
|
||||||
restoreDefaultsQuestion: 'Вы подтверждаете восстановление значений по-умолчанию?',
|
restoreDefaultsQuestion: 'Вы подтверждаете восстановление значений по-умолчанию?',
|
||||||
registerAShortcut: 'Зарегистрировать горячие клавиши',
|
registerAShortcut: 'Зарегистрировать горячие клавиши',
|
||||||
@@ -329,13 +351,14 @@ export const ruRU = {
|
|||||||
openFilter: 'Открыть фильтр',
|
openFilter: 'Открыть фильтр',
|
||||||
nextResultsPage: 'Следующая страница',
|
nextResultsPage: 'Следующая страница',
|
||||||
previousResultsPage: 'Предыдущая страница',
|
previousResultsPage: 'Предыдущая страница',
|
||||||
editFolder: 'Изменить директорию',
|
editFolder: 'Изменить папку',
|
||||||
folderName: 'Название директории',
|
folderName: 'Название папки',
|
||||||
deleteFolder: 'Удалить директорию',
|
deleteFolder: 'Удалить папки',
|
||||||
editConnectionAppearance: 'Изменить внешний вид соединения',
|
editConnectionAppearance: 'Изменить внешний вид соединения',
|
||||||
defaultCopyType: 'Тип копирования по-умолчанию',
|
defaultCopyType: 'Тип копирования по-умолчанию',
|
||||||
showTableSize: 'Показывать размер таблицы в сайдбаре',
|
showTableSize: 'Показывать размер таблицы в сайдбаре',
|
||||||
showTableSizeDescription: 'Только MySQL/MariaDB. Включение этого параметра может повлиять на производительность схемы с большим количеством таблиц.',
|
showTableSizeDescription:
|
||||||
|
'Только MySQL/MariaDB. Включение этого параметра может повлиять на производительность схемы с большим количеством таблиц.',
|
||||||
searchForSchemas: 'Поиск схем',
|
searchForSchemas: 'Поиск схем',
|
||||||
searchForElements: 'Поиск элементов',
|
searchForElements: 'Поиск элементов',
|
||||||
switchSearchMethod: 'Переключить способ поиска',
|
switchSearchMethod: 'Переключить способ поиска',
|
||||||
@@ -343,7 +366,49 @@ export const ruRU = {
|
|||||||
closeOtherTabs: 'Закрыть остальные вкладки',
|
closeOtherTabs: 'Закрыть остальные вкладки',
|
||||||
closeTabsToLeft: 'Закрыть вкладки слева',
|
closeTabsToLeft: 'Закрыть вкладки слева',
|
||||||
closeTabsToRight: 'Закрыть вкладки справа',
|
closeTabsToRight: 'Закрыть вкладки справа',
|
||||||
phpArray: 'PHP массив'
|
phpArray: 'PHP массив',
|
||||||
|
event: 'Событие',
|
||||||
|
customIcon: 'Пользовательская иконка',
|
||||||
|
fileName: 'Имя файла',
|
||||||
|
choseFile: 'Выбрать файл',
|
||||||
|
data: 'Данные',
|
||||||
|
password: 'Пароль',
|
||||||
|
required: 'Обязательный',
|
||||||
|
newFolder: 'Новая папка',
|
||||||
|
outOfFolder: 'Вне папки',
|
||||||
|
csvFieldDelimiter: 'Разделитель полей CSV',
|
||||||
|
csvLinesTerminator: 'Терминатор строк CSV',
|
||||||
|
csvStringDelimiter: 'Разделитель строк CSV',
|
||||||
|
csvIncludeHeader: 'Включить заголовок',
|
||||||
|
csvExportOptions: 'Опции экспорта CSV',
|
||||||
|
exportData: 'Экспорт данных',
|
||||||
|
exportDataExplanation:
|
||||||
|
'Экспорт сохранённых соединений в Antares. Вам будет предложено ввести пароль для шифрования экспортируемого файла.',
|
||||||
|
importData: 'Импорт данных',
|
||||||
|
importDataExplanation: 'Импортирует файл .antares, содержащий соединения. Вам нужно будет ввести пароль, заданный во время экспорта.',
|
||||||
|
includeConnectionPasswords: 'Включить пароли соединений',
|
||||||
|
includeFolders: 'Включить папки',
|
||||||
|
encryptionPassword: 'Пароль шифрования',
|
||||||
|
encryptionPasswordError: 'Пароль шифрования должен содержать не менее 8 символов.',
|
||||||
|
ignoreDuplicates: 'Игнорировать дубликаты',
|
||||||
|
wrongImportPassword: 'Неверный пароль импорта',
|
||||||
|
wrongFileFormat: 'Неверный формат файла',
|
||||||
|
dataImportSuccess: 'Данные успешно импортированы',
|
||||||
|
note: 'Заметка | Заметки',
|
||||||
|
thereAreNoNotesYet: 'Заметок пока нет',
|
||||||
|
addNote: 'Добавить заметку',
|
||||||
|
editNote: 'Редактировать заметку',
|
||||||
|
saveAsNote: 'Сохранить как заметку',
|
||||||
|
showArchivedNotes: 'Показать архивированные заметки',
|
||||||
|
hideArchivedNotes: 'Скрыть архивированные заметки',
|
||||||
|
tag: 'Тег',
|
||||||
|
saveFile: 'Сохранить файл',
|
||||||
|
saveFileAs: 'Сохранить файл как',
|
||||||
|
openFile: 'Открыть файл',
|
||||||
|
openNotes: 'Открыть заметки',
|
||||||
|
debugConsole: 'Отладочная консоль',
|
||||||
|
executedQueries: 'Выполненные запросы',
|
||||||
|
sizeLimitError: 'Превышен максимальный размер {size}'
|
||||||
},
|
},
|
||||||
faker: {
|
faker: {
|
||||||
address: 'Адрес',
|
address: 'Адрес',
|
||||||
|
@@ -9,11 +9,13 @@ export const localesNames: Record<string, string> = {
|
|||||||
'vi-VN': 'Tiếng Việt',
|
'vi-VN': 'Tiếng Việt',
|
||||||
'ja-JP': '日本語',
|
'ja-JP': '日本語',
|
||||||
'zh-CN': '简体中文',
|
'zh-CN': '简体中文',
|
||||||
|
'zh-TW': '正體中文',
|
||||||
'ru-RU': 'Русский',
|
'ru-RU': 'Русский',
|
||||||
'id-ID': 'Bahasa Indonesia',
|
'id-ID': 'Bahasa Indonesia',
|
||||||
'ko-KR': '한국어',
|
'ko-KR': '한국어',
|
||||||
'nl-NL': 'Nederlands',
|
'nl-NL': 'Nederlands',
|
||||||
'ca-ES': 'Català',
|
'ca-ES': 'Català',
|
||||||
'cs-CZ': 'Čeština',
|
'cs-CZ': 'Čeština',
|
||||||
'uk-UA': 'Українська'
|
'uk-UA': 'Українська',
|
||||||
|
'he-IL': 'עברית'
|
||||||
};
|
};
|
||||||
|
569
src/renderer/i18n/zh-TW.ts
Normal file
569
src/renderer/i18n/zh-TW.ts
Normal file
@@ -0,0 +1,569 @@
|
|||||||
|
export const zhTW = {
|
||||||
|
general: {
|
||||||
|
// 通用術語
|
||||||
|
edit: '編輯',
|
||||||
|
save: '保存',
|
||||||
|
close: '關閉',
|
||||||
|
delete: '刪除',
|
||||||
|
confirm: '確定',
|
||||||
|
cancel: '取消',
|
||||||
|
send: '發送',
|
||||||
|
refresh: '重新整理',
|
||||||
|
autoRefresh: '自動重新整理',
|
||||||
|
version: '版本',
|
||||||
|
donate: '捐贈',
|
||||||
|
run: '執行',
|
||||||
|
results: '結果',
|
||||||
|
size: '大小',
|
||||||
|
mimeType: 'MIME類型',
|
||||||
|
download: '下載',
|
||||||
|
add: '新增',
|
||||||
|
data: '資料',
|
||||||
|
properties: '屬性',
|
||||||
|
name: '名稱',
|
||||||
|
clear: '清除',
|
||||||
|
options: '選項',
|
||||||
|
insert: '插入',
|
||||||
|
discard: '丟棄',
|
||||||
|
stay: '等待',
|
||||||
|
author: '作者',
|
||||||
|
upload: '上傳',
|
||||||
|
browse: '瀏覽',
|
||||||
|
content: '內容',
|
||||||
|
cut: '剪下',
|
||||||
|
copy: '複製',
|
||||||
|
paste: '貼上',
|
||||||
|
duplicate: '副本',
|
||||||
|
tools: '工具',
|
||||||
|
seconds: '秒',
|
||||||
|
all: '全部',
|
||||||
|
new: '新',
|
||||||
|
select: '選擇',
|
||||||
|
change: '變更',
|
||||||
|
include: '包含',
|
||||||
|
includes: '包含',
|
||||||
|
completed: '已完成',
|
||||||
|
aborted: '中止',
|
||||||
|
disabled: '已禁用',
|
||||||
|
enable: '啟用',
|
||||||
|
disable: '禁用',
|
||||||
|
contributors: '貢獻者',
|
||||||
|
pin: '固定',
|
||||||
|
unpin: '取消固定',
|
||||||
|
folder: '檔案夾 | 檔案夾',
|
||||||
|
none: '無',
|
||||||
|
singleQuote: '單引號',
|
||||||
|
doubleQuote: '雙引號',
|
||||||
|
deleteConfirm: '您是否確認取消',
|
||||||
|
uploadFile: '上傳檔案',
|
||||||
|
format: '格式碼', // 格式碼
|
||||||
|
history: '曆史',
|
||||||
|
filter: '過濾器',
|
||||||
|
manualValue: '手動值',
|
||||||
|
selectAll: '選擇全部',
|
||||||
|
pageNumber: '頁數',
|
||||||
|
directoryPath: '目錄路徑',
|
||||||
|
actionSuccessful: '{action} 成功',
|
||||||
|
outputFormat: '輸出格式',
|
||||||
|
singleFile: '單個 {ext} 檔案',
|
||||||
|
zipCompressedFile: 'ZIP 壓縮 {ext} 檔案',
|
||||||
|
copyName: '複製名稱',
|
||||||
|
search: '搜索',
|
||||||
|
title: '標題',
|
||||||
|
archive: '封存',
|
||||||
|
undo: '重做',
|
||||||
|
moveTo: '移動到'
|
||||||
|
},
|
||||||
|
connection: {
|
||||||
|
// 資料庫連接
|
||||||
|
connection: '連線',
|
||||||
|
connectionName: '連線名稱',
|
||||||
|
hostName: '主機名',
|
||||||
|
client: '資料庫類型',
|
||||||
|
port: '連線埠',
|
||||||
|
user: '使用者',
|
||||||
|
password: '密碼',
|
||||||
|
credentials: '憑證',
|
||||||
|
connect: '連線',
|
||||||
|
connected: '已連線',
|
||||||
|
disconnect: '斷開連線',
|
||||||
|
disconnected: '斷開連線',
|
||||||
|
ssl: 'SSL',
|
||||||
|
enableSsl: '啟用 SSL',
|
||||||
|
privateKey: '私鑰',
|
||||||
|
certificate: '證書',
|
||||||
|
caCertificate: 'CA 證書',
|
||||||
|
ciphers: '密碼',
|
||||||
|
untrustedConnection: '不受信任的連線',
|
||||||
|
passphrase: '密碼提示',
|
||||||
|
sshTunnel: 'SSH 通道',
|
||||||
|
enableSsh: '啟用 SSH',
|
||||||
|
connectionString: '連接字符串',
|
||||||
|
addConnection: '新增連線',
|
||||||
|
createConnection: '建立連線',
|
||||||
|
createNewConnection: '建立新連線',
|
||||||
|
askCredentials: '詢問憑據',
|
||||||
|
testConnection: '測試連線',
|
||||||
|
editConnection: '編輯連線',
|
||||||
|
deleteConnection: '刪除連線',
|
||||||
|
connectionSuccessfullyMade: '連線成功了!',
|
||||||
|
readOnlyMode: '唯讀模式',
|
||||||
|
allConnections: '所有連線',
|
||||||
|
searchForConnections: '搜索連線',
|
||||||
|
keepAliveInterval: '保持活躍間隔',
|
||||||
|
singleConnection: '單一連線'
|
||||||
|
},
|
||||||
|
database: {
|
||||||
|
// 資料庫庫相關術語
|
||||||
|
schema: '模式(schema)',
|
||||||
|
type: '類型',
|
||||||
|
insert: '插入',
|
||||||
|
indexes: '索引',
|
||||||
|
foreignKeys: '外鍵',
|
||||||
|
length: '長度',
|
||||||
|
unsigned: '無符號',
|
||||||
|
default: '預設',
|
||||||
|
comment: '註釋',
|
||||||
|
key: '鍵 | 鍵',
|
||||||
|
order: '排序',
|
||||||
|
expression: '表達式',
|
||||||
|
autoIncrement: '自動增量',
|
||||||
|
engine: '引擎',
|
||||||
|
field: '字段 | 字段',
|
||||||
|
approximately: '大約',
|
||||||
|
total: '總計',
|
||||||
|
table: '表 | 表',
|
||||||
|
view: '視圖 | 視圖',
|
||||||
|
definer: '定義者',
|
||||||
|
algorithm: '算法',
|
||||||
|
trigger: '觸發器 | 觸發器',
|
||||||
|
storedRoutine: '存儲例程 | 存儲例程',
|
||||||
|
scheduler: '調度器 | 調度器',
|
||||||
|
event: '事件',
|
||||||
|
parameters: '參數',
|
||||||
|
function: '函數 | 函數',
|
||||||
|
deterministic: '確定的',
|
||||||
|
context: '上下文',
|
||||||
|
export: '匯出',
|
||||||
|
import: '匯入',
|
||||||
|
returns: '回傳',
|
||||||
|
timing: '定時',
|
||||||
|
state: '狀態',
|
||||||
|
execution: '執行',
|
||||||
|
starts: '開始',
|
||||||
|
ends: '結束',
|
||||||
|
variables: '變數',
|
||||||
|
processes: '進程',
|
||||||
|
database: '資料庫',
|
||||||
|
array: '數據',
|
||||||
|
structure: '結構',
|
||||||
|
row: '行 | 行',
|
||||||
|
cell: '單元格 | 單元格',
|
||||||
|
triggerFunction: '觸發器函數 | 觸發器函數',
|
||||||
|
routine: '例程 | 例程',
|
||||||
|
drop: 'Drop',
|
||||||
|
commit: '提交',
|
||||||
|
rollback: '回滾',
|
||||||
|
ddl: '資料定義語言',
|
||||||
|
collation: '排序規則',
|
||||||
|
resultsTable: '結果表',
|
||||||
|
unableEditFieldWithoutPrimary: '無法編輯結果集中一個沒有主鍵的字段',
|
||||||
|
editCell: '編輯單元格',
|
||||||
|
deleteRows: '刪除行 | 刪除 {count} 行',
|
||||||
|
confirmToDeleteRows: '您是否確認要刪除一行? | 您是否確認要刪除 {count} 行?',
|
||||||
|
addNewRow: '新增行',
|
||||||
|
numberOfInserts: '插入的數量',
|
||||||
|
affectedRows: '受影響的行',
|
||||||
|
createNewDatabase: '建立新資料庫',
|
||||||
|
databaseName: '資料庫名稱',
|
||||||
|
serverDefault: '預設伺服器',
|
||||||
|
deleteDatabase: '刪除資料庫',
|
||||||
|
editDatabase: '編輯資料庫',
|
||||||
|
clearChanges: '清除變更',
|
||||||
|
addNewField: '新增新字段',
|
||||||
|
manageIndexes: '管理索引',
|
||||||
|
manageForeignKeys: '管理外鍵',
|
||||||
|
allowNull: '允許 NULL',
|
||||||
|
zeroFill: 'zeroFill',
|
||||||
|
customValue: '自定義值',
|
||||||
|
onUpdate: '在更新',
|
||||||
|
deleteField: '刪除字段',
|
||||||
|
createNewIndex: '建立新索引',
|
||||||
|
addToIndex: '新增到索引',
|
||||||
|
createNewTable: '建立新表',
|
||||||
|
emptyTable: '清空表',
|
||||||
|
duplicateTable: '重複表',
|
||||||
|
deleteTable: '刪除表',
|
||||||
|
exportTable: '導出表',
|
||||||
|
emptyConfirm: '您是否確認清空',
|
||||||
|
thereAreNoIndexes: '沒有索引',
|
||||||
|
thereAreNoForeign: '沒有外鍵',
|
||||||
|
createNewForeign: '建立新外鍵',
|
||||||
|
referenceTable: '參考表',
|
||||||
|
referenceField: '參考字段',
|
||||||
|
foreignFields: '外鍵字段',
|
||||||
|
invalidDefault: '無效預設值',
|
||||||
|
onDelete: '在刪除',
|
||||||
|
selectStatement: '選擇語句',
|
||||||
|
triggerStatement: '觸發器語句',
|
||||||
|
sqlSecurity: 'SQL 安全',
|
||||||
|
updateOption: '更新選項',
|
||||||
|
deleteView: '刪除視圖',
|
||||||
|
createNewView: '建立新視圖',
|
||||||
|
deleteTrigger: '刪除觸發器',
|
||||||
|
createNewTrigger: '建立新觸發器',
|
||||||
|
currentUser: '當前使用者',
|
||||||
|
routineBody: '例程主體',
|
||||||
|
dataAccess: '數據訪問',
|
||||||
|
thereAreNoParameters: '沒有參數',
|
||||||
|
createNewParameter: '建立新參數',
|
||||||
|
createNewRoutine: '建立新存儲例程',
|
||||||
|
deleteRoutine: '刪除存儲例程',
|
||||||
|
functionBody: '函數體',
|
||||||
|
createNewFunction: '建立新函數',
|
||||||
|
deleteFunction: '刪除函數',
|
||||||
|
schedulerBody: '調度器主體',
|
||||||
|
createNewScheduler: '建立新調度器',
|
||||||
|
deleteScheduler: '刪除調度器',
|
||||||
|
preserveOnCompletion: '完成時保留',
|
||||||
|
tableFiller: '表填充器',
|
||||||
|
fakeDataLanguage: '僞造的數據語言',
|
||||||
|
queryDuration: '查詢持續時間',
|
||||||
|
setNull: '設定 NULL',
|
||||||
|
processesList: '進程列表',
|
||||||
|
processInfo: '進程信息',
|
||||||
|
manageUsers: '管理使用者',
|
||||||
|
createNewSchema: '建立新模式(schema)',
|
||||||
|
schemaName: '模式名稱',
|
||||||
|
editSchema: '編輯模式',
|
||||||
|
deleteSchema: '刪除模式',
|
||||||
|
noSchema: '沒有模式',
|
||||||
|
runQuery: '運行查詢',
|
||||||
|
thereAreNoTableFields: '沒有表的字段',
|
||||||
|
newTable: '新表',
|
||||||
|
newView: '新視圖',
|
||||||
|
newTrigger: '新觸發器',
|
||||||
|
newRoutine: '新例程',
|
||||||
|
newFunction: '新函數',
|
||||||
|
newScheduler: '新調度器',
|
||||||
|
newTriggerFunction: '新觸發器函數',
|
||||||
|
thereAreNoQueriesYet: '目前還沒有任何查詢',
|
||||||
|
searchForQueries: '搜索查詢',
|
||||||
|
killProcess: '終止進程',
|
||||||
|
exportSchema: '導出模式(schema)',
|
||||||
|
importSchema: '導入模式(schema)',
|
||||||
|
newInsertStmtEvery: '每條新的 INSERT 語句',
|
||||||
|
processingTableExport: '處理 {table}',
|
||||||
|
fetchingTableExport: '正在獲取 {table} 數據',
|
||||||
|
writingTableExport: '正在寫入 {table} 數據',
|
||||||
|
checkAllTables: '檢查所有表',
|
||||||
|
uncheckAllTables: '不檢查所有表',
|
||||||
|
killQuery: '終止查詢',
|
||||||
|
insertRow: '插入單行 | 插入多行',
|
||||||
|
commitMode: '提交模式',
|
||||||
|
autoCommit: '自動提交',
|
||||||
|
manualCommit: '手動提交',
|
||||||
|
importQueryErrors: '警告: 發生了 {n} 個錯誤 | 警告: 發生了 {n} 個錯誤',
|
||||||
|
executedQueries: '{n} 個查詢已執行 | {n} 個查詢已執行',
|
||||||
|
disableFKChecks: '禁用外鍵檢查',
|
||||||
|
formatQuery: '格式查詢',
|
||||||
|
queryHistory: '查詢曆史',
|
||||||
|
clearQuery: '清除查詢',
|
||||||
|
fillCell: '填充單元格',
|
||||||
|
executeSelectedQuery: '執行所選查詢',
|
||||||
|
noResultsPresent: '沒有結果',
|
||||||
|
sqlExportOptions: 'SQL 導出選項',
|
||||||
|
targetTable: '目標表',
|
||||||
|
switchDatabase: '切換資料庫',
|
||||||
|
searchForElements: '搜索元素',
|
||||||
|
searchForSchemas: '搜索模式(schema)',
|
||||||
|
savedQueries: '已保存的查詢'
|
||||||
|
},
|
||||||
|
application: {
|
||||||
|
// 應用程式相關術語
|
||||||
|
settings: '設定',
|
||||||
|
console: '控製臺',
|
||||||
|
general: '常規',
|
||||||
|
themes: '主題',
|
||||||
|
update: '更新',
|
||||||
|
about: '關於',
|
||||||
|
language: '語言',
|
||||||
|
shortcuts: '捷徑',
|
||||||
|
key: '按鍵 | 按鍵', // 鍵盤按鍵
|
||||||
|
event: '事件',
|
||||||
|
light: '明亮',
|
||||||
|
dark: '暗黑',
|
||||||
|
autoCompletion: '自動完成',
|
||||||
|
application: '應用程式',
|
||||||
|
editor: '編輯器',
|
||||||
|
changelog: '變更日誌',
|
||||||
|
small: '小',
|
||||||
|
medium: '中',
|
||||||
|
large: '大',
|
||||||
|
appearance: '外觀',
|
||||||
|
color: '顔色',
|
||||||
|
label: '標簽',
|
||||||
|
icon: '圖示',
|
||||||
|
fileName: '檔案名稱',
|
||||||
|
choseFile: '選擇檔案',
|
||||||
|
data: '數據',
|
||||||
|
password: '密碼',
|
||||||
|
required: '依賴',
|
||||||
|
madeWithJS: '使用 💛 和 JavaScript 製作!',
|
||||||
|
checkForUpdates: '檢查更新',
|
||||||
|
noUpdatesAvailable: '無可用更新',
|
||||||
|
checkingForUpdate: '正在檢查更新',
|
||||||
|
checkFailure: '檢查失敗,請稍後再試',
|
||||||
|
updateAvailable: '可用更新',
|
||||||
|
downloadingUpdate: '正在下載更新',
|
||||||
|
updateDownloaded: '已下載更新',
|
||||||
|
restartToInstall: '重啟 Antares 以進行安裝',
|
||||||
|
includeBetaUpdates: '包含測試版更新',
|
||||||
|
notificationsTimeout: '通知超時',
|
||||||
|
openNewTab: '打開一個新標簽',
|
||||||
|
unsavedChanges: '未保存的變更',
|
||||||
|
discardUnsavedChanges: '您有一些未保存的變更, 關閉此標簽將放棄這些變更.',
|
||||||
|
applicationTheme: '應用程式主題',
|
||||||
|
editorTheme: '編輯器主題',
|
||||||
|
wrapLongLines: '將長行換行顯示',
|
||||||
|
markdownSupported: '支援 Markdown',
|
||||||
|
plantATree: '種植一棵樹',
|
||||||
|
dataTabPageSize: '資料標簽的頁面大小',
|
||||||
|
noOpenTabs: '沒有打開的標簽, 請在左側欄上導航或:',
|
||||||
|
restorePreviousSession: '恢複上一個會話',
|
||||||
|
closeTab: '關閉標簽',
|
||||||
|
goToDownloadPage: '轉到下載頁面',
|
||||||
|
disableBlur: '禁用模糊',
|
||||||
|
missingOrIncompleteTranslation: '有缺失或不完整的翻譯?',
|
||||||
|
findOutHowToContribute: '了解如何做出貢獻',
|
||||||
|
reportABug: '報告錯誤',
|
||||||
|
nextTab: '下一個標簽',
|
||||||
|
previousTab: '上一個標簽',
|
||||||
|
selectTabNumber: '選擇標簽編號 {param}',
|
||||||
|
toggleConsole: '切換控製臺',
|
||||||
|
addShortcut: '新增捷徑',
|
||||||
|
editShortcut: '編輯捷徑',
|
||||||
|
deleteShortcut: '刪除捷徑',
|
||||||
|
restoreDefaults: '恢複預設',
|
||||||
|
restoreDefaultsQuestion: '是否確認恢複預設值?',
|
||||||
|
registerAShortcut: '註冊捷徑',
|
||||||
|
invalidShortcutMessage: '無效組合,請繼續鍵入',
|
||||||
|
shortcutAlreadyExists: '捷徑已存在',
|
||||||
|
saveContent: '保存內容',
|
||||||
|
openAllConnections: '打開所有連接',
|
||||||
|
openSettings: '打開設定',
|
||||||
|
openScratchpad: '打開草稿欄',
|
||||||
|
runOrReload: '運行或重新加載',
|
||||||
|
openFilter: '打開過濾器',
|
||||||
|
nextResultsPage: '下一個結果頁',
|
||||||
|
previousResultsPage: '上一個結果頁',
|
||||||
|
editFolder: '編輯檔案夾',
|
||||||
|
folderName: '檔案夾名稱',
|
||||||
|
deleteFolder: '刪除檔案夾',
|
||||||
|
editConnectionAppearance: '編輯連接的外觀',
|
||||||
|
defaultCopyType: '預設複製類型',
|
||||||
|
showTableSize: '在側邊欄顯示表大小',
|
||||||
|
showTableSizeDescription: '僅限 MySQL/MariaDB. 啓用此選項可能會影響許多表的模式(schema)的性能.',
|
||||||
|
switchSearchMethod: '切換搜索方法',
|
||||||
|
phpArray: 'PHP 陣列',
|
||||||
|
closeAllTabs: '關閉所有標簽',
|
||||||
|
closeOtherTabs: '關閉其他標簽',
|
||||||
|
closeTabsToLeft: '關閉左側的標簽',
|
||||||
|
closeTabsToRight: '關閉右側的標簽',
|
||||||
|
csvFieldDelimiter: '字段分隔符',
|
||||||
|
csvLinesTerminator: '行終止符',
|
||||||
|
csvStringDelimiter: '字符串分隔符',
|
||||||
|
csvIncludeHeader: '包含頁眉',
|
||||||
|
csvExportOptions: 'CSV 導出選項',
|
||||||
|
exportData: '導出數據',
|
||||||
|
exportDataExplanation: '將保存的連接導出到 Antares. 係統將要求您輸入密碼以加密導出的檔案.',
|
||||||
|
importData: '導入數據',
|
||||||
|
importDataExplanation: '導入包含連接的 .antares 檔案. 您需要輸入在導出過程中定義的密碼.',
|
||||||
|
includeConnectionPasswords: '包含連接密碼',
|
||||||
|
includeFolders: '包含檔案夾',
|
||||||
|
encryptionPassword: '加密密碼',
|
||||||
|
encryptionPasswordError: '加密密碼的長度必須至少為 8 個字符.',
|
||||||
|
ignoreDuplicates: '忽略重複',
|
||||||
|
wrongImportPassword: '錯誤的導入密碼',
|
||||||
|
wrongFileFormat: '錯誤的檔案格式',
|
||||||
|
dataImportSuccess: '數據已成功導入',
|
||||||
|
note: '筆記 | 筆記',
|
||||||
|
thereAreNoNotesYet: '目前還沒有筆記',
|
||||||
|
addNote: '新增筆記',
|
||||||
|
editNote: '編輯筆記',
|
||||||
|
saveAsNote: '另存為筆記',
|
||||||
|
showArchivedNotes: '顯示歸檔筆記',
|
||||||
|
hideArchivedNotes: '隱藏歸檔筆記',
|
||||||
|
tag: '筆記標簽', // Note tag,
|
||||||
|
saveFile: '保存檔案',
|
||||||
|
saveFileAs: '將檔案另存為',
|
||||||
|
openFile: '打開檔案',
|
||||||
|
openNotes: '打開筆記'
|
||||||
|
},
|
||||||
|
faker: {
|
||||||
|
// Faker.js 方法,用於隨機生成的內容
|
||||||
|
address: '地址',
|
||||||
|
commerce: '商業',
|
||||||
|
company: '公司',
|
||||||
|
database: '資料庫',
|
||||||
|
date: '日期',
|
||||||
|
finance: '財務',
|
||||||
|
git: 'Git',
|
||||||
|
hacker: '駭客',
|
||||||
|
internet: '網際網路',
|
||||||
|
lorem: 'Lorem',
|
||||||
|
name: '姓名',
|
||||||
|
music: '音樂',
|
||||||
|
phone: '電話',
|
||||||
|
random: '隨機',
|
||||||
|
system: '系統',
|
||||||
|
time: '時間',
|
||||||
|
vehicle: '車輛',
|
||||||
|
zipCode: '郵政編碼',
|
||||||
|
zipCodeByState: '各州的郵政編碼',
|
||||||
|
city: '城市',
|
||||||
|
cityPrefix: '城市前綴',
|
||||||
|
citySuffix: '城市字尾',
|
||||||
|
streetName: '街道名稱',
|
||||||
|
streetAddress: '街道地址',
|
||||||
|
streetSuffix: '街道字尾',
|
||||||
|
streetPrefix: '街道前綴',
|
||||||
|
secondaryAddress: '次要地址',
|
||||||
|
county: '縣',
|
||||||
|
country: '國家',
|
||||||
|
countryCode: '國家代碼',
|
||||||
|
state: '州',
|
||||||
|
stateAbbr: '州簡稱',
|
||||||
|
latitude: '緯度',
|
||||||
|
longitude: '經度',
|
||||||
|
direction: '\'方向\'',
|
||||||
|
cardinalDirection: '方位',
|
||||||
|
ordinalDirection: '順序方向',
|
||||||
|
nearbyGPSCoordinate: '附近的 GPS 坐標',
|
||||||
|
timeZone: '時區',
|
||||||
|
color: '顔色',
|
||||||
|
department: '部門',
|
||||||
|
productName: '産品名稱',
|
||||||
|
price: '價格',
|
||||||
|
productAdjective: '産品形容詞',
|
||||||
|
productMaterial: '産品材料',
|
||||||
|
product: '産品',
|
||||||
|
productDescription: '産品說明',
|
||||||
|
suffixes: '字尾',
|
||||||
|
companyName: '公司名稱',
|
||||||
|
companySuffix: '公司字尾',
|
||||||
|
catchPhrase: '流行語',
|
||||||
|
bs: 'BS',
|
||||||
|
catchPhraseAdjective: '流行語形容詞',
|
||||||
|
catchPhraseDescriptor: '流行語說明',
|
||||||
|
catchPhraseNoun: '流行語名詞',
|
||||||
|
bsAdjective: 'BS 形容詞',
|
||||||
|
bsBuzz: 'BS 嗡嗡聲',
|
||||||
|
bsNoun: 'BS 名稱',
|
||||||
|
column: '列',
|
||||||
|
type: '類型',
|
||||||
|
collation: '排序規則',
|
||||||
|
engine: '引擎',
|
||||||
|
past: '過去',
|
||||||
|
now: '現在',
|
||||||
|
future: '未來',
|
||||||
|
between: '之間',
|
||||||
|
recent: '最近',
|
||||||
|
soon: '很快',
|
||||||
|
month: '月',
|
||||||
|
weekday: '工作日',
|
||||||
|
account: '帳戶',
|
||||||
|
accountName: '帳戶名稱',
|
||||||
|
routingNumber: '路由編號',
|
||||||
|
mask: '掩碼',
|
||||||
|
amount: '金額',
|
||||||
|
transactionType: '交易類型',
|
||||||
|
currencyCode: '貨幣代碼',
|
||||||
|
currencyName: '貨幣名稱',
|
||||||
|
currencySymbol: '貨幣符號',
|
||||||
|
bitcoinAddress: '位元幣地址',
|
||||||
|
litecoinAddress: '萊特幣地址',
|
||||||
|
creditCardNumber: '信用卡號碼',
|
||||||
|
creditCardCVV: '信用卡CVV',
|
||||||
|
ethereumAddress: '以太坊地址',
|
||||||
|
iban: 'Iban',
|
||||||
|
bic: 'Bic',
|
||||||
|
transactionDescription: '交易描述',
|
||||||
|
branch: '分支',
|
||||||
|
commitEntry: '提交條目',
|
||||||
|
commitMessage: '提交信息',
|
||||||
|
commitSha: '提交 SHA',
|
||||||
|
shortSha: '短的 SHA',
|
||||||
|
abbreviation: '縮寫',
|
||||||
|
adjective: '形容詞',
|
||||||
|
noun: '名詞',
|
||||||
|
verb: '動詞',
|
||||||
|
ingverb: '英式動詞',
|
||||||
|
phrase: '短語',
|
||||||
|
avatar: '頭像',
|
||||||
|
email: '電子信箱',
|
||||||
|
exampleEmail: '示例電子郵件',
|
||||||
|
userName: '使用者名',
|
||||||
|
protocol: '協議',
|
||||||
|
url: '統一資源定位地址',
|
||||||
|
domainName: '域名',
|
||||||
|
domainSuffix: '域名字尾',
|
||||||
|
domainWord: '域詞',
|
||||||
|
ip: 'Ip',
|
||||||
|
ipv6: 'Ipv6',
|
||||||
|
userAgent: '使用者代理',
|
||||||
|
mac: 'Mac',
|
||||||
|
password: '密碼',
|
||||||
|
word: '單詞',
|
||||||
|
words: '單詞',
|
||||||
|
sentence: '句子',
|
||||||
|
slug: 'Slug',
|
||||||
|
sentences: '句子',
|
||||||
|
paragraph: '段落',
|
||||||
|
paragraphs: '段落',
|
||||||
|
text: '文本',
|
||||||
|
lines: '行',
|
||||||
|
genre: '類型',
|
||||||
|
firstName: '名',
|
||||||
|
lastName: '姓氏',
|
||||||
|
middleName: '中間名',
|
||||||
|
findName: '全名',
|
||||||
|
jobTitle: '職位名稱',
|
||||||
|
gender: '性別',
|
||||||
|
prefix: '前綴',
|
||||||
|
suffix: '字尾',
|
||||||
|
title: '頭銜',
|
||||||
|
jobDescriptor: '工作描述',
|
||||||
|
jobArea: '工作領域',
|
||||||
|
jobType: '工作類型',
|
||||||
|
phoneNumber: '電話號碼',
|
||||||
|
phoneNumberFormat: '電話號碼格式',
|
||||||
|
phoneFormats: '電話格式',
|
||||||
|
number: '號碼',
|
||||||
|
float: 'Float',
|
||||||
|
arrayElement: '陣列元素',
|
||||||
|
arrayElements: '陣列元素',
|
||||||
|
objectElement: '物件元素',
|
||||||
|
uuid: 'Uuid',
|
||||||
|
boolean: '布林',
|
||||||
|
image: '鏡像',
|
||||||
|
locale: '區域',
|
||||||
|
alpha: '阿爾法',
|
||||||
|
alphaNumeric: 'α 數字',
|
||||||
|
hexaDecimal: '十六進製',
|
||||||
|
fileName: '檔案名',
|
||||||
|
commonFileName: '普通檔案名',
|
||||||
|
mimeType: 'MIME類型',
|
||||||
|
commonFileType: '常見檔案類型',
|
||||||
|
commonFileExt: '常見檔案擴展名',
|
||||||
|
fileType: '檔案類型',
|
||||||
|
fileExt: '檔案擴展名',
|
||||||
|
directoryPath: '目錄路徑',
|
||||||
|
filePath: '檔案路徑',
|
||||||
|
semver: 'Semver',
|
||||||
|
manufacturer: '製造商',
|
||||||
|
model: '型號',
|
||||||
|
fuel: 'Fuel',
|
||||||
|
vin: 'Vin'
|
||||||
|
}
|
||||||
|
};
|
@@ -44,6 +44,15 @@ ipcRenderer.on('unhandled-exception', (event, error) => {
|
|||||||
date: new Date()
|
date: new Date()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
ipcRenderer.on('non-blocking-exception', (event, error) => {
|
||||||
|
useNotificationsStore().addNotification({ status: 'error', message: error.message });
|
||||||
|
useConsoleStore().putLog('debug', {
|
||||||
|
level: 'error',
|
||||||
|
process: 'main',
|
||||||
|
message: error.message,
|
||||||
|
date: new Date()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// IPC query logs
|
// IPC query logs
|
||||||
ipcRenderer.on('query-log', (event, logRecord: QueryLog) => {
|
ipcRenderer.on('query-log', (event, logRecord: QueryLog) => {
|
||||||
|
@@ -1,18 +1,15 @@
|
|||||||
import { ConnectionParams, IpcResponse } from 'common/interfaces/antares';
|
import { ConnectionParams, IpcResponse } from 'common/interfaces/antares';
|
||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
|
|
||||||
import connStringConstruct from '../libs/connStringDecode';
|
|
||||||
import { unproxify } from '../libs/unproxify';
|
import { unproxify } from '../libs/unproxify';
|
||||||
|
|
||||||
export default class {
|
export default class {
|
||||||
static makeTest (params: ConnectionParams & { pgConnString?: string }): Promise<IpcResponse> {
|
static makeTest (params: ConnectionParams & { connString?: string }): Promise<IpcResponse> {
|
||||||
const newParams = connStringConstruct(params) as ConnectionParams;
|
return ipcRenderer.invoke('test-connection', unproxify(params));
|
||||||
return ipcRenderer.invoke('test-connection', unproxify(newParams));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static connect (params: ConnectionParams & { pgConnString?: string }): Promise<IpcResponse> {
|
static connect (params: ConnectionParams & { connString?: string }): Promise<IpcResponse> {
|
||||||
const newParams = connStringConstruct(params) as ConnectionParams;
|
return ipcRenderer.invoke('connect', unproxify(params));
|
||||||
return ipcRenderer.invoke('connect', unproxify(newParams));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static abortConnection (uid: string): void {
|
static abortConnection (uid: string): void {
|
||||||
|
@@ -36,6 +36,10 @@ export default class {
|
|||||||
return ipcRenderer.invoke('get-table-indexes', unproxify(params));
|
return ipcRenderer.invoke('get-table-indexes', unproxify(params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getTableChecks (params: { uid: string; schema: string; table: string }): Promise<IpcResponse> {
|
||||||
|
return ipcRenderer.invoke('get-table-checks', unproxify(params));
|
||||||
|
}
|
||||||
|
|
||||||
static getTableDll (params: { uid: string; schema: string; table: string }): Promise<IpcResponse<string>> {
|
static getTableDll (params: { uid: string; schema: string; table: string }): Promise<IpcResponse<string>> {
|
||||||
return ipcRenderer.invoke('get-table-ddl', unproxify(params));
|
return ipcRenderer.invoke('get-table-ddl', unproxify(params));
|
||||||
}
|
}
|
||||||
|
@@ -1,50 +0,0 @@
|
|||||||
import { ConnectionParams } from 'common/interfaces/antares';
|
|
||||||
import * as formatter from 'pg-connection-string'; // parses a connection string
|
|
||||||
|
|
||||||
const formatHost = (host: string) => {
|
|
||||||
const results = host === 'localhost' ? '127.0.0.1' : host;
|
|
||||||
return results;
|
|
||||||
};
|
|
||||||
|
|
||||||
const checkForSSl = (conn: string) => {
|
|
||||||
return conn.includes('ssl=true');
|
|
||||||
};
|
|
||||||
|
|
||||||
const connStringConstruct = (args: ConnectionParams & { pgConnString?: string }): ConnectionParams => {
|
|
||||||
if (!args.pgConnString)
|
|
||||||
return args;
|
|
||||||
|
|
||||||
if (typeof args.pgConnString !== 'string')
|
|
||||||
return args;
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
const stringArgs: any = formatter.parse(args.pgConnString);
|
|
||||||
|
|
||||||
const client = args.client || 'pg';
|
|
||||||
|
|
||||||
args.client = client;
|
|
||||||
args.host = formatHost(stringArgs.host);
|
|
||||||
args.database = stringArgs.database;
|
|
||||||
args.port = stringArgs.port || '5432';
|
|
||||||
args.user = stringArgs.user;
|
|
||||||
args.password = stringArgs.password;
|
|
||||||
|
|
||||||
// ssh
|
|
||||||
args.ssh = stringArgs.ssh || args.ssh;
|
|
||||||
args.sshHost = stringArgs.sshHost;
|
|
||||||
args.sshUser = stringArgs.sshUser;
|
|
||||||
args.sshPass = stringArgs.sshPass;
|
|
||||||
args.sshKey = stringArgs.sshKey;
|
|
||||||
args.sshPort = stringArgs.sshPort;
|
|
||||||
|
|
||||||
// ssl mode
|
|
||||||
args.ssl = checkForSSl(args.pgConnString) || args.ssl;
|
|
||||||
args.cert = stringArgs.sslcert;
|
|
||||||
args.key = stringArgs.sslkey;
|
|
||||||
args.ca = stringArgs.sslrootcert;
|
|
||||||
args.ciphers = stringArgs.ciphers;
|
|
||||||
|
|
||||||
return args;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connStringConstruct;
|
|
@@ -256,6 +256,10 @@ option:checked {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
|
a {
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
.tab-link {
|
.tab-link {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
}
|
}
|
||||||
|
@@ -255,6 +255,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
&.result-tabs .tab-item {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
.workspace-query-runner .workspace-query-runner-footer .workspace-query-buttons .btn {
|
.workspace-query-runner .workspace-query-runner-footer .workspace-query-buttons .btn {
|
||||||
color: $body-font-color-dark;
|
color: $body-font-color-dark;
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,7 @@ export interface QueryLog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface DebugLog {
|
export interface DebugLog {
|
||||||
level: 'log' | 'info' | 'warn' | 'error';
|
level: 'log' | 'info' | 'warn' | 'error' | string;
|
||||||
process: 'renderer' | 'main' | 'worker';
|
process: 'renderer' | 'main' | 'worker';
|
||||||
message: string;
|
message: string;
|
||||||
date: Date;
|
date: Date;
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
import { uidGen } from 'common/libs/uidGen';
|
import { uidGen } from 'common/libs/uidGen';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
|
|
||||||
|
import { useConsoleStore } from './console';
|
||||||
|
|
||||||
export interface Notification {
|
export interface Notification {
|
||||||
uid: string;
|
uid: string;
|
||||||
status: string;
|
status: string;
|
||||||
@@ -15,6 +17,13 @@ export const useNotificationsStore = defineStore('notifications', {
|
|||||||
addNotification (payload: { status: string; message: string }) {
|
addNotification (payload: { status: string; message: string }) {
|
||||||
const notification: Notification = { uid: uidGen('N'), ...payload };
|
const notification: Notification = { uid: uidGen('N'), ...payload };
|
||||||
this.notifications.unshift(notification);
|
this.notifications.unshift(notification);
|
||||||
|
|
||||||
|
useConsoleStore().putLog('debug', {
|
||||||
|
level: notification.status,
|
||||||
|
process: 'renderer',
|
||||||
|
message: notification.message,
|
||||||
|
date: new Date()
|
||||||
|
});
|
||||||
},
|
},
|
||||||
removeNotification (uid: string) {
|
removeNotification (uid: string) {
|
||||||
this.notifications = (this.notifications as Notification[]).filter(item => item.uid !== uid);
|
this.notifications = (this.notifications as Notification[]).filter(item => item.uid !== uid);
|
||||||
|
@@ -147,7 +147,7 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
|||||||
else
|
else
|
||||||
this.selectedWorkspace = uid;
|
this.selectedWorkspace = uid;
|
||||||
},
|
},
|
||||||
async connectWorkspace (connection: ConnectionParams & { pgConnString?: string }, args?: {mode?: string; signal?: AbortSignal}) {
|
async connectWorkspace (connection: ConnectionParams & { connString?: string }, args?: {mode?: string; signal?: AbortSignal}) {
|
||||||
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === connection.uid
|
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === connection.uid
|
||||||
? {
|
? {
|
||||||
...workspace,
|
...workspace,
|
||||||
@@ -427,7 +427,7 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
|||||||
|
|
||||||
this.selectTab({ uid, tab: 0 });
|
this.selectTab({ uid, tab: 0 });
|
||||||
},
|
},
|
||||||
async switchConnection (connection: ConnectionParams & { pgConnString?: string }) {
|
async switchConnection (connection: ConnectionParams & { connString?: string }) {
|
||||||
await Connection.disconnect(connection.uid);
|
await Connection.disconnect(connection.uid);
|
||||||
return this.connectWorkspace(connection, { mode: 'switch' });
|
return this.connectWorkspace(connection, { mode: 'switch' });
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user