mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
fe39c1d388 | |||
d114f8a651 | |||
84168d1d75 | |||
498a9b48e2 | |||
01f607cd40 | |||
efe134a059 | |||
40cb4dd98d | |||
a142d3c4d7 | |||
89da957a49 | |||
05c2f9836c | |||
ebc325ae0c | |||
39326eb52e | |||
df681147aa | |||
ffc645ba5e | |||
1fb1205319 | |||
c90ab0e880 | |||
9dc700e13e |
31
.github/workflows/create-artifact-macos.yml
vendored
Normal file
31
.github/workflows/create-artifact-macos.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Create artifact [MAC]
|
||||
|
||||
on:
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: npm install & build
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: macos-build
|
||||
retention-days: 3
|
||||
path: |
|
||||
build
|
||||
!build/*-unpacked
|
||||
!build/.icon-ico
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -7,7 +7,8 @@
|
||||
"SQLite",
|
||||
"Windows",
|
||||
"translation",
|
||||
"Linux"
|
||||
"Linux",
|
||||
"MacOS"
|
||||
],
|
||||
"svg.preview.background": "transparent"
|
||||
}
|
28
CHANGELOG.md
28
CHANGELOG.md
@@ -2,6 +2,34 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [0.5.17](https://github.com/antares-sql/antares/compare/v0.5.16...v0.5.17) (2022-09-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* added more editor font sizes, closes [#440](https://github.com/antares-sql/antares/issues/440) ([d114f8a](https://github.com/antares-sql/antares/commit/d114f8a65164f702b23175095e6fc2b021e0e038))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* "run or reload" shortcut triggers on all connections open ([01f607c](https://github.com/antares-sql/antares/commit/01f607cd40c18ab0f9761b2a05705a966aaae43a))
|
||||
* cant run procedures with parameters from leftbar ([efe134a](https://github.com/antares-sql/antares/commit/efe134a059700ca87333dc6e66166d6ec8d289e8))
|
||||
* editor font size doesn't change on new tabs, fixes [#442](https://github.com/antares-sql/antares/issues/442) ([84168d1](https://github.com/antares-sql/antares/commit/84168d1d75460acc2c844bfece7d85f0c977e74c))
|
||||
* empty definer when editing a view, fixes [#437](https://github.com/antares-sql/antares/issues/437) ([498a9b4](https://github.com/antares-sql/antares/commit/498a9b48e25ee061960f5f649c953cdaf6ff1a58))
|
||||
* **MacOS:** empty options on macos menubar ([a142d3c](https://github.com/antares-sql/antares/commit/a142d3c4d77e31375dfbea148eec54ce1f635192))
|
||||
|
||||
### [0.5.16](https://github.com/antares-sql/antares/compare/v0.5.15...v0.5.16) (2022-08-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* CTRL+Right/Left not working on text editor, closes [#427](https://github.com/antares-sql/antares/issues/427) ([ffc645b](https://github.com/antares-sql/antares/commit/ffc645ba5efb1c52670096e4f8c7f992b7335dae))
|
||||
* issue updating datetime cells with null value, closes [#423](https://github.com/antares-sql/antares/issues/423) ([ebc325a](https://github.com/antares-sql/antares/commit/ebc325ae0c656dca2eb8f7544ab271beaee9b47e))
|
||||
* ts exceptions ([df68114](https://github.com/antares-sql/antares/commit/df681147aaf0bfca69f3ffdc474cc1846541b1d8))
|
||||
* **UI:** editor themes group not visible in select element ([9dc700e](https://github.com/antares-sql/antares/commit/9dc700e13ea65bb8c6feac4ff4ffeadd32053614))
|
||||
* **UI:** wrong position of fields resizable area ([c90ab0e](https://github.com/antares-sql/antares/commit/c90ab0e8807ff30a9ab58e9aa3515cf427dd6e86))
|
||||
* unable to set null or delete rows without primary key ([39326eb](https://github.com/antares-sql/antares/commit/39326eb52e038728b5419d4a8de8024c7ead3002))
|
||||
|
||||
### [0.5.15](https://github.com/antares-sql/antares/compare/v0.5.14...v0.5.15) (2022-08-17)
|
||||
|
||||
|
||||
|
@@ -34,6 +34,7 @@ We are actively working on it, hoping to provide new cool features, improvements
|
||||
- SSH tunnel support.
|
||||
- Manual commit mode.
|
||||
- Import and export database dumps.
|
||||
- Customizable keyboard shortcuts.
|
||||
- Dark and light theme.
|
||||
- Editor themes.
|
||||
|
||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "antares",
|
||||
"version": "0.5.15",
|
||||
"version": "0.5.17",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "antares",
|
||||
"version": "0.5.15",
|
||||
"version": "0.5.17",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "antares",
|
||||
"productName": "Antares",
|
||||
"version": "0.5.15",
|
||||
"version": "0.5.17",
|
||||
"description": "A modern, fast and productivity driven SQL client with a focus in UX.",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/antares-sql/antares.git",
|
||||
|
@@ -1,4 +1,5 @@
|
||||
// @ts-check
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-nocheck
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const https = require('https');
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { app, ipcMain, dialog, BrowserWindow } from 'electron';
|
||||
import { app, ipcMain, dialog } from 'electron';
|
||||
import { ShortcutRegister } from '../libs/ShortcutRegister';
|
||||
|
||||
export default () => {
|
||||
@@ -15,26 +15,22 @@ export default () => {
|
||||
});
|
||||
|
||||
ipcMain.handle('resotre-default-shortcuts', () => {
|
||||
const mainWindow = BrowserWindow.getAllWindows()[0];
|
||||
const shortCutRegister = ShortcutRegister.getInstance({ mainWindow });
|
||||
const shortCutRegister = ShortcutRegister.getInstance();
|
||||
shortCutRegister.restoreDefaults();
|
||||
});
|
||||
|
||||
ipcMain.handle('reload-shortcuts', () => {
|
||||
const mainWindow = BrowserWindow.getAllWindows()[0];
|
||||
const shortCutRegister = ShortcutRegister.getInstance({ mainWindow });
|
||||
const shortCutRegister = ShortcutRegister.getInstance();
|
||||
shortCutRegister.reload();
|
||||
});
|
||||
|
||||
ipcMain.handle('update-shortcuts', (event, shortcuts) => {
|
||||
const mainWindow = BrowserWindow.getAllWindows()[0];
|
||||
const shortCutRegister = ShortcutRegister.getInstance({ mainWindow });
|
||||
const shortCutRegister = ShortcutRegister.getInstance();
|
||||
shortCutRegister.updateShortcuts(shortcuts);
|
||||
});
|
||||
|
||||
ipcMain.handle('unregister-shortcuts', () => {
|
||||
const mainWindow = BrowserWindow.getAllWindows()[0];
|
||||
const shortCutRegister = ShortcutRegister.getInstance({ mainWindow });
|
||||
const shortCutRegister = ShortcutRegister.getInstance();
|
||||
shortCutRegister.unregister();
|
||||
});
|
||||
};
|
||||
|
@@ -177,7 +177,10 @@ export default (connections: {[key: string]: antares.Client}) => {
|
||||
if (typeof orgRow[key] === 'string')
|
||||
orgRow[key] = `'${orgRow[key]}'`;
|
||||
|
||||
orgRow[key] = `= ${orgRow[key]}`;
|
||||
if (orgRow[key] === null)
|
||||
orgRow[key] = `IS ${orgRow[key]}`;
|
||||
else
|
||||
orgRow[key] = `= ${orgRow[key]}`;
|
||||
}
|
||||
|
||||
await connections[params.uid]
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { BrowserWindow, globalShortcut } from 'electron';
|
||||
import { BrowserWindow, globalShortcut, Menu, MenuItem, MenuItemConstructorOptions } from 'electron';
|
||||
import * as Store from 'electron-store';
|
||||
import { ShortcutRecord, shortcuts } from 'common/shortcuts';
|
||||
|
||||
@@ -6,19 +6,34 @@ const shortcutsStore = new Store({ name: 'shortcuts' });
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||
const defaultShortcuts = shortcuts.filter(s => s.os.includes(process.platform));
|
||||
|
||||
export type ShortcutMode = 'local' | 'global'
|
||||
export type OsMenu = {
|
||||
[key in NodeJS.Platform]?: MenuItemConstructorOptions[];
|
||||
};
|
||||
|
||||
export class ShortcutRegister {
|
||||
private _shortcuts: ShortcutRecord[];
|
||||
private _mainWindow: BrowserWindow;
|
||||
private _menu: Menu;
|
||||
private _menuTemplate: OsMenu;
|
||||
private _mode: ShortcutMode;
|
||||
private static _instance: ShortcutRegister;
|
||||
|
||||
private constructor (args: { mainWindow: BrowserWindow }) {
|
||||
private constructor (args: { mainWindow: BrowserWindow; menuTemplate?: OsMenu; mode: ShortcutMode }) {
|
||||
this._mainWindow = args.mainWindow;
|
||||
this._menuTemplate = args.menuTemplate || {};
|
||||
this._mode = args.mode;
|
||||
this.shortcuts = shortcutsStore.get('shortcuts', defaultShortcuts) as ShortcutRecord[];
|
||||
}
|
||||
|
||||
public static getInstance (args: { mainWindow: BrowserWindow }) {
|
||||
if (!ShortcutRegister._instance)
|
||||
ShortcutRegister._instance = new ShortcutRegister(args);
|
||||
public static getInstance (args?: { mainWindow?: BrowserWindow; menuTemplate?: OsMenu; mode?: ShortcutMode }) {
|
||||
if (!ShortcutRegister._instance && args.menuTemplate !== undefined && args.mode !== undefined) {
|
||||
ShortcutRegister._instance = new ShortcutRegister({
|
||||
mainWindow: args.mainWindow,
|
||||
menuTemplate: args.menuTemplate,
|
||||
mode: args.mode
|
||||
});
|
||||
}
|
||||
|
||||
return ShortcutRegister._instance;
|
||||
}
|
||||
@@ -33,24 +48,74 @@ export class ShortcutRegister {
|
||||
}
|
||||
|
||||
init () {
|
||||
this._mainWindow.webContents.send('update-shortcuts', this.shortcuts);
|
||||
|
||||
this.buildBaseMenu();
|
||||
|
||||
if (this._mode === 'global')
|
||||
this.setGlobalShortcuts();
|
||||
else if (this._mode === 'local')
|
||||
this.setLocalShortcuts();
|
||||
else
|
||||
throw new Error(`Unknown mode "${this._mode}"`);
|
||||
|
||||
Menu.setApplicationMenu(this._menu);
|
||||
}
|
||||
|
||||
private buildBaseMenu () {
|
||||
if (Object.keys(this._menuTemplate).includes(process.platform))
|
||||
this._menu = Menu.buildFromTemplate(this._menuTemplate[process.platform]);
|
||||
else
|
||||
this._menu = new Menu();
|
||||
}
|
||||
|
||||
private setLocalShortcuts () {
|
||||
for (const shortcut of this.shortcuts) {
|
||||
if (shortcut.os.includes(process.platform)) {
|
||||
for (const key of shortcut.keys) {
|
||||
try {
|
||||
globalShortcut.register(key, () => {
|
||||
this._mainWindow.webContents.send(shortcut.event);
|
||||
if (isDevelopment) console.log('EVENT:', shortcut);
|
||||
});
|
||||
this._menu.append(new MenuItem({
|
||||
label: 'Shortcuts',
|
||||
visible: false,
|
||||
submenu: [{
|
||||
label: String(key),
|
||||
accelerator: key,
|
||||
visible: false,
|
||||
click: () => {
|
||||
this._mainWindow.webContents.send(shortcut.event);
|
||||
if (isDevelopment) console.log('LOCAL EVENT:', shortcut);
|
||||
}
|
||||
}]
|
||||
}));
|
||||
}
|
||||
catch (error) {
|
||||
if (isDevelopment) console.log(error);
|
||||
this.restoreDefaults();
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this._mainWindow.webContents.send('update-shortcuts', this.shortcuts);
|
||||
private setGlobalShortcuts () {
|
||||
for (const shortcut of this.shortcuts) {
|
||||
if (shortcut.os.includes(process.platform)) {
|
||||
for (const key of shortcut.keys) {
|
||||
try {
|
||||
globalShortcut.register(key, () => {
|
||||
this._mainWindow.webContents.send(shortcut.event);
|
||||
if (isDevelopment) console.log('GLOBAL EVENT:', shortcut);
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
if (isDevelopment) console.log(error);
|
||||
this.restoreDefaults();
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reload () {
|
||||
@@ -69,6 +134,6 @@ export class ShortcutRegister {
|
||||
}
|
||||
|
||||
unregister () {
|
||||
globalShortcut.unregisterAll();
|
||||
if (this._mode === 'global') globalShortcut.unregisterAll();
|
||||
}
|
||||
}
|
||||
|
@@ -940,7 +940,7 @@ export class MySQLClient extends AntaresCore {
|
||||
|
||||
return {
|
||||
algorithm: algorithm[0]['Create View'].match(/(?<=CREATE ALGORITHM=).*?(?=\s)/gs)[0],
|
||||
definer: viewInfo[0].DEFINER,
|
||||
definer: viewInfo[0].DEFINER.split('@').map((str: string) => `\`${str}\``).join('@'),
|
||||
security: viewInfo[0].SECURITY_TYPE,
|
||||
updateOption: viewInfo[0].CHECK_OPTION === 'NONE' ? '' : viewInfo[0].CHECK_OPTION,
|
||||
sql: viewInfo[0].VIEW_DEFINITION,
|
||||
@@ -1588,7 +1588,8 @@ export class MySQLClient extends AntaresCore {
|
||||
let timeStop: Date;
|
||||
let keysArr: antares.QueryForeign[] = [];
|
||||
|
||||
const { rows, report, fields, keys, duration } = await new Promise((resolve, reject) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const { rows, report, fields, keys, duration }: any = await new Promise((resolve, reject) => {
|
||||
connection.query({ sql: query, nestTables }).then(async ([response, fields]) => {
|
||||
timeStop = new Date();
|
||||
const queryResult = response;
|
||||
|
@@ -1426,7 +1426,8 @@ export class PostgreSQLClient extends AntaresCore {
|
||||
let timeStop: Date;
|
||||
let keysArr: antares.QueryForeign[] = [];
|
||||
|
||||
const { rows, report, fields, keys, duration } = await new Promise((resolve, reject) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const { rows, report, fields, keys, duration }: any = await new Promise((resolve, reject) => {
|
||||
(async () => {
|
||||
try {
|
||||
const res = await connection.query({ rowMode: args.nest ? 'array' : null, text: query });
|
||||
|
@@ -628,7 +628,8 @@ export class SQLiteClient extends AntaresCore {
|
||||
let timeStop;
|
||||
const keysArr: antares.QueryForeign[] = [];
|
||||
|
||||
const { rows, report, fields, keys, duration } = await new Promise((resolve, reject) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const { rows, report, fields, keys, duration }: any = await new Promise((resolve, reject) => {
|
||||
(async () => {
|
||||
let queryRunResult: sqlite.RunResult;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
@@ -1,16 +1,14 @@
|
||||
import { app, BrowserWindow, globalShortcut, nativeImage, Menu, ipcMain } from 'electron';
|
||||
import { app, BrowserWindow, nativeImage, ipcMain } from 'electron';
|
||||
import * as path from 'path';
|
||||
import * as Store from 'electron-store';
|
||||
import * as windowStateKeeper from 'electron-window-state';
|
||||
import * as remoteMain from '@electron/remote/main';
|
||||
|
||||
import ipcHandlers from './ipc-handlers';
|
||||
import { ShortcutRegister } from './libs/ShortcutRegister';
|
||||
import { OsMenu, ShortcutRegister } from './libs/ShortcutRegister';
|
||||
|
||||
Store.initRenderer();
|
||||
const settingsStore = new Store({ name: 'settings' });
|
||||
|
||||
let shortCutRegister: ShortcutRegister;
|
||||
const appTheme = settingsStore.get('application_theme');
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||
const isMacOS = process.platform === 'darwin';
|
||||
@@ -122,32 +120,12 @@ else {
|
||||
mainWindow = await createMainWindow();
|
||||
createAppMenu();
|
||||
|
||||
shortCutRegister = ShortcutRegister.getInstance({ mainWindow });
|
||||
|
||||
if (isWindows)
|
||||
mainWindow.show();
|
||||
|
||||
if (isDevelopment)
|
||||
mainWindow.webContents.openDevTools();
|
||||
|
||||
app.on('browser-window-focus', () => {
|
||||
// Send registered shortcut events to window
|
||||
shortCutRegister.init();
|
||||
|
||||
if (isDevelopment) { // Dev shortcuts
|
||||
globalShortcut.register('Shift+CommandOrControl+F5', () => {
|
||||
mainWindow.reload();
|
||||
});
|
||||
globalShortcut.register('Shift+CommandOrControl+F12', () => {
|
||||
mainWindow.webContents.openDevTools();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
app.on('browser-window-blur', () => {
|
||||
shortCutRegister.unregister();
|
||||
});
|
||||
|
||||
process.on('uncaughtException', error => {
|
||||
mainWindow.webContents.send('unhandled-exception', error);
|
||||
});
|
||||
@@ -167,10 +145,8 @@ else {
|
||||
}
|
||||
|
||||
function createAppMenu () {
|
||||
let menu: Electron.Menu = null;
|
||||
|
||||
if (isMacOS) {
|
||||
menu = Menu.buildFromTemplate([
|
||||
const menuTemplate: OsMenu = {
|
||||
darwin: [
|
||||
{
|
||||
label: app.name,
|
||||
submenu: [
|
||||
@@ -201,10 +177,11 @@ function createAppMenu () {
|
||||
{
|
||||
role: 'windowMenu'
|
||||
}
|
||||
]);
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Menu.setApplicationMenu(menu);
|
||||
const shortCutRegister = ShortcutRegister.getInstance({ mainWindow, menuTemplate, mode: 'local' });
|
||||
shortCutRegister.init();
|
||||
}
|
||||
|
||||
function saveWindowState () {
|
||||
|
@@ -51,14 +51,17 @@ watch(editorTheme, () => {
|
||||
|
||||
watch(editorFontSize, () => {
|
||||
const sizes = {
|
||||
small: 12,
|
||||
medium: 14,
|
||||
large: 16
|
||||
xsmall: '10px',
|
||||
small: '12px',
|
||||
medium: '14px',
|
||||
large: '16px',
|
||||
xlarge: '18px',
|
||||
xxlarge: '20px'
|
||||
};
|
||||
|
||||
if (editor) {
|
||||
editor.setOptions({
|
||||
fontSize: sizes[editorFontSize.value as undefined as 'small' | 'medium' | 'large']
|
||||
fontSize: sizes[editorFontSize.value]
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@@ -239,7 +239,7 @@
|
||||
<div class="column col-12 h6 text-uppercase mb-2 mt-4">
|
||||
{{ t('message.editorTheme') }}
|
||||
</div>
|
||||
<div class="column col-6 h5 mb-4">
|
||||
<div class="column col-5 h5 mb-4">
|
||||
<BaseSelect
|
||||
v-model="localEditorTheme"
|
||||
class="form-select"
|
||||
@@ -251,28 +251,49 @@
|
||||
@change="changeEditorTheme(localEditorTheme)"
|
||||
/>
|
||||
</div>
|
||||
<div class="column col-6 mb-4">
|
||||
<div class="column col-7 mb-4">
|
||||
<div class="btn-group btn-group-block">
|
||||
<button
|
||||
class="btn btn-dark cut-text"
|
||||
:class="{'active': editorFontSize === 'xsmall'}"
|
||||
@click="changeEditorFontSize('xsmall')"
|
||||
>
|
||||
10px
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-dark cut-text"
|
||||
:class="{'active': editorFontSize === 'small'}"
|
||||
@click="changeEditorFontSize('small')"
|
||||
>
|
||||
{{ t('word.small') }}
|
||||
12px
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-dark cut-text"
|
||||
:class="{'active': editorFontSize === 'medium'}"
|
||||
@click="changeEditorFontSize('medium')"
|
||||
>
|
||||
{{ t('word.medium') }}
|
||||
14px
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-dark cut-text"
|
||||
:class="{'active': editorFontSize === 'large'}"
|
||||
@click="changeEditorFontSize('large')"
|
||||
>
|
||||
{{ t('word.large') }}
|
||||
16px
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-dark cut-text"
|
||||
:class="{'active': editorFontSize === 'xlarge'}"
|
||||
@click="changeEditorFontSize('xlarge')"
|
||||
>
|
||||
18px
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-dark cut-text"
|
||||
:class="{'active': editorFontSize === 'xxlarge'}"
|
||||
@click="changeEditorFontSize('xxlarge')"
|
||||
>
|
||||
20px
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -395,7 +416,29 @@ const contributors = process.env.APP_CONTRIBUTORS;
|
||||
const appLogo = require('../images/logo.svg');
|
||||
const darkPreview = require('../images/dark.png');
|
||||
const lightPreview = require('../images/light.png');
|
||||
const editorThemes= [
|
||||
const exampleQuery = `-- This is an example
|
||||
SELECT
|
||||
employee.id,
|
||||
employee.first_name,
|
||||
employee.last_name,
|
||||
SUM(DATEDIFF("SECOND", call.start, call.end)) AS call_duration
|
||||
FROM call
|
||||
INNER JOIN employee ON call.employee_id = employee.id
|
||||
GROUP BY
|
||||
employee.id,
|
||||
employee.first_name,
|
||||
employee.last_name
|
||||
ORDER BY
|
||||
employee.id ASC;
|
||||
`;
|
||||
|
||||
const localLocale: Ref<AvailableLocale> = ref(null);
|
||||
const localPageSize: Ref<number> = ref(null);
|
||||
const localTimeout: Ref<number> = ref(null);
|
||||
const localEditorTheme: Ref<string> = ref(null);
|
||||
const selectedTab: Ref<string> = ref('general');
|
||||
|
||||
const editorThemes = computed(() => [
|
||||
{
|
||||
group: t('word.light'),
|
||||
themes: [
|
||||
@@ -443,28 +486,7 @@ const editorThemes= [
|
||||
{ code: 'vibrant_ink', name: 'Vibrant Ink' }
|
||||
]
|
||||
}
|
||||
];
|
||||
const exampleQuery = `-- This is an example
|
||||
SELECT
|
||||
employee.id,
|
||||
employee.first_name,
|
||||
employee.last_name,
|
||||
SUM(DATEDIFF("SECOND", call.start, call.end)) AS call_duration
|
||||
FROM call
|
||||
INNER JOIN employee ON call.employee_id = employee.id
|
||||
GROUP BY
|
||||
employee.id,
|
||||
employee.first_name,
|
||||
employee.last_name
|
||||
ORDER BY
|
||||
employee.id ASC;
|
||||
`;
|
||||
|
||||
const localLocale: Ref<AvailableLocale> = ref(null);
|
||||
const localPageSize: Ref<number> = ref(null);
|
||||
const localTimeout: Ref<number> = ref(null);
|
||||
const localEditorTheme: Ref<string> = ref(null);
|
||||
const selectedTab: Ref<string> = ref('general');
|
||||
]);
|
||||
|
||||
const locales = computed(() => {
|
||||
const locales = [];
|
||||
|
@@ -34,6 +34,15 @@ const {
|
||||
lineWrap
|
||||
} = storeToRefs(settingsStore);
|
||||
|
||||
const sizes = {
|
||||
xsmall: '10px',
|
||||
small: '12px',
|
||||
medium: '14px',
|
||||
large: '16px',
|
||||
xlarge: '18px',
|
||||
xxlarge: '20px'
|
||||
};
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: String,
|
||||
workspace: Object as Prop<Workspace>,
|
||||
@@ -240,12 +249,6 @@ watch(editorTheme, () => {
|
||||
});
|
||||
|
||||
watch(editorFontSize, () => {
|
||||
const sizes = {
|
||||
small: '12px',
|
||||
medium: '14px',
|
||||
large: '16px'
|
||||
};
|
||||
|
||||
if (editor.value) {
|
||||
editor.value.setOptions({
|
||||
fontSize: sizes[editorFontSize.value]
|
||||
@@ -305,7 +308,8 @@ onMounted(() => {
|
||||
enableBasicAutocompletion: true,
|
||||
wrap: lineWrap.value,
|
||||
enableSnippets: true,
|
||||
enableLiveAutocompletion: autoComplete.value
|
||||
enableLiveAutocompletion: autoComplete.value,
|
||||
fontSize: sizes[editorFontSize.value]
|
||||
});
|
||||
|
||||
if (!baseCompleter.value.length)
|
||||
|
@@ -326,7 +326,7 @@
|
||||
v-if="tab.type ==='query'"
|
||||
:tab-uid="tab.uid"
|
||||
:tab="tab"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:connection="connection"
|
||||
/>
|
||||
<WorkspaceTabTable
|
||||
@@ -334,7 +334,7 @@
|
||||
v-once
|
||||
:tab-uid="tab.uid"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:table="tab.elementName"
|
||||
:schema="tab.schema"
|
||||
:element-type="tab.elementType"
|
||||
@@ -344,14 +344,14 @@
|
||||
:tab-uid="tab.uid"
|
||||
:tab="tab"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:schema="tab.schema"
|
||||
/>
|
||||
<WorkspaceTabPropsTable
|
||||
v-else-if="tab.type === 'table-props'"
|
||||
:tab-uid="tab.uid"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:table="tab.elementName"
|
||||
:schema="tab.schema"
|
||||
/>
|
||||
@@ -360,13 +360,13 @@
|
||||
:tab-uid="tab.uid"
|
||||
:tab="tab"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:schema="tab.schema"
|
||||
/>
|
||||
<WorkspaceTabPropsView
|
||||
v-else-if="tab.type === 'view-props'"
|
||||
:tab-uid="tab.uid"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:connection="connection"
|
||||
:view="tab.elementName"
|
||||
:schema="tab.schema"
|
||||
@@ -376,7 +376,7 @@
|
||||
:tab-uid="tab.uid"
|
||||
:tab="tab"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:trigger="tab.elementName"
|
||||
:schema="tab.schema"
|
||||
/>
|
||||
@@ -384,7 +384,7 @@
|
||||
v-else-if="['temp-trigger-props', 'trigger-props'].includes(tab.type)"
|
||||
:tab-uid="tab.uid"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:trigger="tab.elementName"
|
||||
:schema="tab.schema"
|
||||
/>
|
||||
@@ -393,7 +393,7 @@
|
||||
:tab-uid="tab.uid"
|
||||
:tab="tab"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:trigger="tab.elementName"
|
||||
:schema="tab.schema"
|
||||
/>
|
||||
@@ -401,7 +401,7 @@
|
||||
v-else-if="['temp-trigger-function-props', 'trigger-function-props'].includes(tab.type)"
|
||||
:tab-uid="tab.uid"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:function="tab.elementName"
|
||||
:schema="tab.schema"
|
||||
/>
|
||||
@@ -410,7 +410,7 @@
|
||||
:tab-uid="tab.uid"
|
||||
:tab="tab"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:trigger="tab.elementName"
|
||||
:schema="tab.schema"
|
||||
/>
|
||||
@@ -418,7 +418,7 @@
|
||||
v-else-if="['temp-routine-props', 'routine-props'].includes(tab.type)"
|
||||
:tab-uid="tab.uid"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:routine="tab.elementName"
|
||||
:schema="tab.schema"
|
||||
/>
|
||||
@@ -427,7 +427,7 @@
|
||||
:tab-uid="tab.uid"
|
||||
:tab="tab"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:trigger="tab.elementName"
|
||||
:schema="tab.schema"
|
||||
/>
|
||||
@@ -435,7 +435,7 @@
|
||||
v-else-if="['temp-function-props', 'function-props'].includes(tab.type)"
|
||||
:tab-uid="tab.uid"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:function="tab.elementName"
|
||||
:schema="tab.schema"
|
||||
/>
|
||||
@@ -444,7 +444,7 @@
|
||||
:tab-uid="tab.uid"
|
||||
:tab="tab"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:trigger="tab.elementName"
|
||||
:schema="tab.schema"
|
||||
/>
|
||||
@@ -452,7 +452,7 @@
|
||||
v-else-if="['temp-scheduler-props', 'scheduler-props'].includes(tab.type)"
|
||||
:tab-uid="tab.uid"
|
||||
:connection="connection"
|
||||
:is-selected="selectedTab === tab.uid"
|
||||
:is-selected="selectedTab === tab.uid && isSelected"
|
||||
:scheduler="tab.elementName"
|
||||
:schema="tab.schema"
|
||||
/>
|
||||
|
@@ -217,7 +217,7 @@ const runElementCheck = () => {
|
||||
};
|
||||
|
||||
const runElement = (params: string[]) => {
|
||||
if (props.selectedMisc.type === 'procedure')
|
||||
if (['procedure', 'routine'].includes(props.selectedMisc.type))
|
||||
runRoutine(params);
|
||||
else if (props.selectedMisc.type === 'function')
|
||||
runFunction(params);
|
||||
|
@@ -377,7 +377,7 @@ const deleteSelected = () => {
|
||||
});
|
||||
|
||||
const params = {
|
||||
primary: primaryField.value.name,
|
||||
primary: primaryField.value?.name,
|
||||
schema: getSchema(resultsetIndex.value),
|
||||
table: getTable(resultsetIndex.value),
|
||||
rows
|
||||
@@ -389,7 +389,7 @@ const setNull = () => {
|
||||
const row = localResults.value.find((row: any) => selectedRows.value.includes(row._antares_id));
|
||||
|
||||
const params = {
|
||||
primary: primaryField.value.name,
|
||||
primary: primaryField.value?.name,
|
||||
schema: getSchema(resultsetIndex.value),
|
||||
table: getTable(resultsetIndex.value),
|
||||
id: getPrimaryValue(row),
|
||||
@@ -611,7 +611,7 @@ const onKey = async (e: KeyboardEvent) => {
|
||||
selectAllRows(e);
|
||||
|
||||
// row navigation stuff
|
||||
if ((e.code.includes('Arrow') || e.code === 'Tab') && sortedResults.value.length > 0 && !e.altKey) {
|
||||
if (!(e.ctrlKey || e.metaKey) && (e.code.includes('Arrow') || e.code === 'Tab') && sortedResults.value.length > 0 && !e.altKey) {
|
||||
e.preventDefault();
|
||||
|
||||
const aviableFields= Object.keys(sortedResults.value[0]).slice(0, -1); // removes _antares_id
|
||||
|
@@ -442,7 +442,7 @@ const editOFF = () => {
|
||||
let content;
|
||||
if (!BLOB.includes(editingType.value)) {
|
||||
if ([...DATETIME, ...TIME].includes(editingType.value)) {
|
||||
if (editingContent.value.substring(editingContent.value.length - 1) === '.')
|
||||
if (editingContent.value !== null && editingContent.value.substring(editingContent.value.length - 1) === '.')
|
||||
editingContent.value = editingContent.value.slice(0, -1);
|
||||
}
|
||||
|
||||
|
@@ -109,7 +109,8 @@ option:checked {
|
||||
|
||||
> div {
|
||||
padding: 0.1rem 0.2rem;
|
||||
min-width: fill-available;
|
||||
/* stylelint-disable-next-line value-no-vendor-prefix */
|
||||
min-width: -webkit-fill-available;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -10,7 +10,7 @@ const isDarkTheme = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
const defaultAppTheme = isDarkTheme.matches ? 'dark' : 'light';
|
||||
const defaultEditorTheme = isDarkTheme.matches ? 'twilight' : 'sqlserver';
|
||||
|
||||
export type EditorFontSize = 'small' | 'medium' | 'large';
|
||||
export type EditorFontSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
|
||||
export type ApplicationTheme = 'light' | 'dark';
|
||||
|
||||
export const useSettingsStore = defineStore('settings', {
|
||||
|
Reference in New Issue
Block a user