Additions
52
package-lock.json
generated
@ -3357,6 +3357,58 @@
|
|||||||
"xpipe": "*"
|
"xpipe": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"cross-env": {
|
||||||
|
"version": "7.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz",
|
||||||
|
"integrity": "sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"cross-spawn": "^7.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"cross-spawn": {
|
||||||
|
"version": "7.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||||
|
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"path-key": "^3.1.0",
|
||||||
|
"shebang-command": "^2.0.0",
|
||||||
|
"which": "^2.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"path-key": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"shebang-command": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"shebang-regex": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"shebang-regex": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"which": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"isexe": "^2.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"cross-spawn": {
|
"cross-spawn": {
|
||||||
"version": "6.0.5",
|
"version": "6.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
|
||||||
|
11
package.json
@ -6,15 +6,15 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": "https://github.com/Fabio286/antares.git",
|
"repository": "https://github.com/Fabio286/antares.git",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "electron-webpack dev",
|
"dev": "cross-env NODE_ENV=development electron-webpack dev",
|
||||||
"compile": "electron-webpack",
|
"compile": "electron-webpack",
|
||||||
"dist": "npm run compile && electron-builder",
|
"dist": "cross-env NODE_ENV=production npm run compile && electron-builder",
|
||||||
"dist:dir": "npm run dist --dir -c.compression=store -c.mac.identity=null"
|
"dist:dir": "cross-env NODE_ENV=production npm run dist --dir -c.compression=store -c.mac.identity=null"
|
||||||
},
|
},
|
||||||
"author": "Fabio Di Stasio <fabio286@gmail.com>",
|
"author": "Fabio Di Stasio <fabio286@gmail.com>",
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "com.estarium.${name}",
|
"appId": "com.estarium.antares",
|
||||||
"artifactName": "${productName}.${ext}",
|
"artifactName": "${productName}-${version}-${channel}-${os}_${arch}.${ext}",
|
||||||
"files": [
|
"files": [
|
||||||
"static/*"
|
"static/*"
|
||||||
]
|
]
|
||||||
@ -46,6 +46,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
|
"cross-env": "^7.0.2",
|
||||||
"electron": "^8.3.0",
|
"electron": "^8.3.0",
|
||||||
"electron-builder": "^22.7.0",
|
"electron-builder": "^22.7.0",
|
||||||
"electron-devtools-installer": "^3.0.0",
|
"electron-devtools-installer": "^3.0.0",
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import { app, BrowserWindow } from 'electron';
|
import { app, BrowserWindow, nativeImage } from 'electron';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { format as formatUrl } from 'url';
|
import { format as formatUrl } from 'url';
|
||||||
import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer';
|
|
||||||
import { autoUpdater } from 'electron-updater';
|
import { autoUpdater } from 'electron-updater';
|
||||||
|
|
||||||
import ipcHandlers from './ipc-handlers';
|
import ipcHandlers from './ipc-handlers';
|
||||||
|
|
||||||
const isDevelopment = process.env.NODE_ENV !== 'production';
|
const isDevelopment = process.env.NODE_ENV === 'development';
|
||||||
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true';
|
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true';
|
||||||
|
|
||||||
// global reference to mainWindow (necessary to prevent window from being garbage collected)
|
// global reference to mainWindow (necessary to prevent window from being garbage collected)
|
||||||
let mainWindow;
|
let mainWindow;
|
||||||
|
|
||||||
function createMainWindow () {
|
function createMainWindow () {
|
||||||
|
const icon = require('../renderer/images/logo-32.png');
|
||||||
const window = new BrowserWindow({
|
const window = new BrowserWindow({
|
||||||
width: 1600,
|
width: 1600,
|
||||||
height: 1000,
|
height: 1000,
|
||||||
@ -22,7 +22,7 @@ function createMainWindow () {
|
|||||||
minWidth: 900,
|
minWidth: 900,
|
||||||
title: 'Antares',
|
title: 'Antares',
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
icon: path.join(__static, 'logo-32.png'),
|
icon: nativeImage.createFromDataURL(icon.default),
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
'web-security': false
|
'web-security': false
|
||||||
@ -40,6 +40,7 @@ function createMainWindow () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isDevelopment) {
|
if (isDevelopment) {
|
||||||
|
const { default: installExtension, VUEJS_DEVTOOLS } = require('electron-devtools-installer');
|
||||||
window.webContents.openDevTools();
|
window.webContents.openDevTools();
|
||||||
|
|
||||||
installExtension(VUEJS_DEVTOOLS)
|
installExtension(VUEJS_DEVTOOLS)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="workspace-explorebar column">
|
<div class="workspace-explorebar column">
|
||||||
<div class="workspace-explorebar-header">
|
<div class="workspace-explorebar-header">
|
||||||
<span class="workspace-explorebar-title">{{ connection.ask ? '': connection.user+'@' }}{{ connection.host }}:{{ connection.port }}</span>
|
<span class="workspace-explorebar-title">{{ connectionName }}</span>
|
||||||
<span v-if="workspace.connected" class="workspace-explorebar-tools">
|
<span v-if="workspace.connected" class="workspace-explorebar-tools">
|
||||||
<i
|
<i
|
||||||
class="material-icons md-18 c-hand"
|
class="material-icons md-18 c-hand"
|
||||||
@ -17,6 +17,26 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<DatabaseConnectPanel v-if="!workspace.connected" :connection="connection" />
|
<DatabaseConnectPanel v-if="!workspace.connected" :connection="connection" />
|
||||||
|
<div class="workspace-explorebar-body">
|
||||||
|
<div
|
||||||
|
v-for="db of workspace.structure"
|
||||||
|
:key="db.dbName"
|
||||||
|
>
|
||||||
|
<div class="database-name">
|
||||||
|
<i class="material-icons md-18 mr-1">view_agenda</i>{{ db.dbName }}
|
||||||
|
</div>
|
||||||
|
<div class="d-block ml-4">
|
||||||
|
<div
|
||||||
|
v-for="table of db.tables"
|
||||||
|
:key="table.TABLE_NAME"
|
||||||
|
>
|
||||||
|
<div class="table-name">
|
||||||
|
<i class="material-icons md-18 mr-1">view_headline</i>{{ table.TABLE_NAME }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -39,10 +59,14 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
getWorkspace: 'workspaces/getWorkspace'
|
getWorkspace: 'workspaces/getWorkspace',
|
||||||
|
getConnectionName: 'connections/getConnectionName'
|
||||||
}),
|
}),
|
||||||
workspace () {
|
workspace () {
|
||||||
return this.getWorkspace(this.connection.uid);
|
return this.getWorkspace(this.connection.uid);
|
||||||
|
},
|
||||||
|
connectionName () {
|
||||||
|
return this.getConnectionName(this.connection.uid);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -62,6 +86,8 @@ export default {
|
|||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.workspace-explorebar{
|
.workspace-explorebar{
|
||||||
width: $explorebar-width;
|
width: $explorebar-width;
|
||||||
|
height: calc(100vh - #{$footer-height});
|
||||||
|
overflow: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
@ -112,5 +138,15 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.workspace-explorebar-body{
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.database-name,
|
||||||
|
.table-name{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -13,10 +13,22 @@
|
|||||||
<form class="form-horizontal">
|
<form class="form-horizontal">
|
||||||
<fieldset class="m-0" :disabled="isTesting">
|
<fieldset class="m-0" :disabled="isTesting">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-3 col-sm-12">
|
<div class="col-4 col-sm-12">
|
||||||
|
<label class="form-label">{{ $t('word.connectionName') }}:</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-8 col-sm-12">
|
||||||
|
<input
|
||||||
|
v-model="localConnection.name"
|
||||||
|
class="form-input"
|
||||||
|
type="text"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-4 col-sm-12">
|
||||||
<label class="form-label">{{ $t('word.client') }}:</label>
|
<label class="form-label">{{ $t('word.client') }}:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9 col-sm-12">
|
<div class="col-8 col-sm-12">
|
||||||
<select v-model="localConnection.client" class="form-select">
|
<select v-model="localConnection.client" class="form-select">
|
||||||
<option value="mysql">
|
<option value="mysql">
|
||||||
MySQL/MariaDB
|
MySQL/MariaDB
|
||||||
@ -34,10 +46,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-3 col-sm-12">
|
<div class="col-4 col-sm-12">
|
||||||
<label class="form-label">{{ $t('word.hostName') }}/IP:</label>
|
<label class="form-label">{{ $t('word.hostName') }}/IP:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9 col-sm-12">
|
<div class="col-8 col-sm-12">
|
||||||
<input
|
<input
|
||||||
v-model="localConnection.host"
|
v-model="localConnection.host"
|
||||||
class="form-input"
|
class="form-input"
|
||||||
@ -46,10 +58,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-3 col-sm-12">
|
<div class="col-4 col-sm-12">
|
||||||
<label class="form-label">{{ $t('word.port') }}:</label>
|
<label class="form-label">{{ $t('word.port') }}:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9 col-sm-12">
|
<div class="col-8 col-sm-12">
|
||||||
<input
|
<input
|
||||||
v-model="localConnection.port"
|
v-model="localConnection.port"
|
||||||
class="form-input"
|
class="form-input"
|
||||||
@ -60,10 +72,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-3 col-sm-12">
|
<div class="col-4 col-sm-12">
|
||||||
<label class="form-label">{{ $t('word.user') }}:</label>
|
<label class="form-label">{{ $t('word.user') }}:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9 col-sm-12">
|
<div class="col-8 col-sm-12">
|
||||||
<input
|
<input
|
||||||
v-model="localConnection.user"
|
v-model="localConnection.user"
|
||||||
class="form-input"
|
class="form-input"
|
||||||
@ -73,10 +85,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-3 col-sm-12">
|
<div class="col-4 col-sm-12">
|
||||||
<label class="form-label">{{ $t('word.password') }}:</label>
|
<label class="form-label">{{ $t('word.password') }}:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9 col-sm-12">
|
<div class="col-8 col-sm-12">
|
||||||
<input
|
<input
|
||||||
v-model="localConnection.password"
|
v-model="localConnection.password"
|
||||||
class="form-input"
|
class="form-input"
|
||||||
@ -86,8 +98,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-3 col-sm-12" />
|
<div class="col-4 col-sm-12" />
|
||||||
<div class="col-9 col-sm-12">
|
<div class="col-8 col-sm-12">
|
||||||
<label class="form-checkbox form-inline">
|
<label class="form-checkbox form-inline">
|
||||||
<input v-model="localConnection.ask" type="checkbox"><i class="form-icon" /> {{ $t('message.askCredentials') }}
|
<input v-model="localConnection.ask" type="checkbox"><i class="form-icon" /> {{ $t('message.askCredentials') }}
|
||||||
</label>
|
</label>
|
||||||
|
@ -13,10 +13,22 @@
|
|||||||
<form class="form-horizontal">
|
<form class="form-horizontal">
|
||||||
<fieldset class="m-0" :disabled="isTesting">
|
<fieldset class="m-0" :disabled="isTesting">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-3 col-sm-12">
|
<div class="col-4 col-sm-12">
|
||||||
|
<label class="form-label">{{ $t('word.connectionName') }}:</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-8 col-sm-12">
|
||||||
|
<input
|
||||||
|
v-model="connection.name"
|
||||||
|
class="form-input"
|
||||||
|
type="text"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-4 col-sm-12">
|
||||||
<label class="form-label">{{ $t('word.client') }}:</label>
|
<label class="form-label">{{ $t('word.client') }}:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9 col-sm-12">
|
<div class="col-8 col-sm-12">
|
||||||
<select
|
<select
|
||||||
v-model="connection.client"
|
v-model="connection.client"
|
||||||
class="form-select"
|
class="form-select"
|
||||||
@ -38,10 +50,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-3 col-sm-12">
|
<div class="col-4 col-sm-12">
|
||||||
<label class="form-label">{{ $t('word.hostName') }}/IP:</label>
|
<label class="form-label">{{ $t('word.hostName') }}/IP:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9 col-sm-12">
|
<div class="col-8 col-sm-12">
|
||||||
<input
|
<input
|
||||||
v-model="connection.host"
|
v-model="connection.host"
|
||||||
class="form-input"
|
class="form-input"
|
||||||
@ -50,10 +62,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-3 col-sm-12">
|
<div class="col-4 col-sm-12">
|
||||||
<label class="form-label">{{ $t('word.port') }}:</label>
|
<label class="form-label">{{ $t('word.port') }}:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9 col-sm-12">
|
<div class="col-8 col-sm-12">
|
||||||
<input
|
<input
|
||||||
v-model="connection.port"
|
v-model="connection.port"
|
||||||
class="form-input"
|
class="form-input"
|
||||||
@ -64,10 +76,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-3 col-sm-12">
|
<div class="col-4 col-sm-12">
|
||||||
<label class="form-label">{{ $t('word.user') }}:</label>
|
<label class="form-label">{{ $t('word.user') }}:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9 col-sm-12">
|
<div class="col-8 col-sm-12">
|
||||||
<input
|
<input
|
||||||
v-model="connection.user"
|
v-model="connection.user"
|
||||||
class="form-input"
|
class="form-input"
|
||||||
@ -77,10 +89,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-3 col-sm-12">
|
<div class="col-4 col-sm-12">
|
||||||
<label class="form-label">{{ $t('word.password') }}:</label>
|
<label class="form-label">{{ $t('word.password') }}:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9 col-sm-12">
|
<div class="col-8 col-sm-12">
|
||||||
<input
|
<input
|
||||||
v-model="connection.password"
|
v-model="connection.password"
|
||||||
class="form-input"
|
class="form-input"
|
||||||
@ -90,8 +102,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-3 col-sm-12" />
|
<div class="col-4 col-sm-12" />
|
||||||
<div class="col-9 col-sm-12">
|
<div class="col-8 col-sm-12">
|
||||||
<label class="form-checkbox form-inline">
|
<label class="form-checkbox form-inline">
|
||||||
<input v-model="connection.ask" type="checkbox"><i class="form-icon" /> {{ $t('message.askCredentials') }}
|
<input v-model="connection.ask" type="checkbox"><i class="form-icon" /> {{ $t('message.askCredentials') }}
|
||||||
</label>
|
</label>
|
||||||
@ -146,6 +158,7 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
connection: {
|
connection: {
|
||||||
|
name: '',
|
||||||
client: 'mysql',
|
client: 'mysql',
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
port: '3306',
|
port: '3306',
|
||||||
|
@ -47,7 +47,10 @@
|
|||||||
<div class="col-6 col-sm-12">
|
<div class="col-6 col-sm-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-6 col-sm-12">
|
<div class="col-6 col-sm-12">
|
||||||
<label class="form-label">{{ $t('word.language') }}:</label>
|
<label class="form-label">
|
||||||
|
<i class="material-icons md-18 mr-1">translate</i>
|
||||||
|
{{ $t('word.language') }}:
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 col-sm-12">
|
<div class="col-6 col-sm-12">
|
||||||
<select
|
<select
|
||||||
@ -55,8 +58,12 @@
|
|||||||
class="form-select"
|
class="form-select"
|
||||||
@change="changeLocale(localLocale)"
|
@change="changeLocale(localLocale)"
|
||||||
>
|
>
|
||||||
<option v-for="(locale, key) in locales" :key="key">
|
<option
|
||||||
{{ locale }}
|
v-for="(locale, key) in locales"
|
||||||
|
:key="key"
|
||||||
|
:value="locale.code"
|
||||||
|
>
|
||||||
|
{{ locale.name }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -72,7 +79,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="selectedTab === 'about'" class="panel-body py-4">
|
<div v-if="selectedTab === 'about'" class="panel-body py-4">
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<img src="logo.svg" width="128">
|
<img :src="require('@/images/logo.svg').default" width="128">
|
||||||
<h4>{{ appName }}</h4>
|
<h4>{{ appName }}</h4>
|
||||||
<p>
|
<p>
|
||||||
{{ $t('word.version') }}: {{ appVersion }}<br>
|
{{ $t('word.version') }}: {{ appVersion }}<br>
|
||||||
@ -88,6 +95,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapActions, mapGetters } from 'vuex';
|
import { mapActions, mapGetters } from 'vuex';
|
||||||
|
import localesNames from '@/i18n/supported-locales';
|
||||||
const { shell } = require('electron');
|
const { shell } = require('electron');
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -103,14 +111,20 @@ export default {
|
|||||||
...mapGetters({
|
...mapGetters({
|
||||||
appName: 'application/appName',
|
appName: 'application/appName',
|
||||||
appVersion: 'application/appVersion',
|
appVersion: 'application/appVersion',
|
||||||
|
selectedSettingTab: 'application/selectedSettingTab',
|
||||||
selectedLocale: 'settings/getLocale'
|
selectedLocale: 'settings/getLocale'
|
||||||
}),
|
}),
|
||||||
locales () {
|
locales () {
|
||||||
return this.$i18n.availableLocales;
|
const locales = [];
|
||||||
|
for (const locale of this.$i18n.availableLocales)
|
||||||
|
locales.push({ code: locale, name: localesNames[locale] });
|
||||||
|
|
||||||
|
return locales;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.localLocale = this.selectedLocale;
|
this.localLocale = this.selectedLocale;
|
||||||
|
this.selectedTab = this.selectedSettingTab;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions({
|
...mapActions({
|
||||||
@ -140,6 +154,11 @@ export default {
|
|||||||
.badge::after{
|
.badge::after{
|
||||||
background: #32b643;
|
background: #32b643;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-label{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<div :slot="'body'">
|
<div :slot="'body'">
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
{{ $t('message.deleteConnectionCorfirm') }} <b>{{ contextConnection.user }}@{{ contextConnection.host }}:{{ contextConnection.port }}</b>?
|
{{ $t('message.deleteConnectionCorfirm') }} <b>{{ connectionName }}</b>?
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ConfirmModal>
|
</ConfirmModal>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapActions } from 'vuex';
|
import { mapActions, mapGetters } from 'vuex';
|
||||||
import BaseContextMenu from '@/components/BaseContextMenu';
|
import BaseContextMenu from '@/components/BaseContextMenu';
|
||||||
import ConfirmModal from '@/components/BaseConfirmModal';
|
import ConfirmModal from '@/components/BaseConfirmModal';
|
||||||
|
|
||||||
@ -47,6 +47,14 @@ export default {
|
|||||||
isConfirmModal: false
|
isConfirmModal: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters({
|
||||||
|
getConnectionName: 'connections/getConnectionName'
|
||||||
|
}),
|
||||||
|
connectionName () {
|
||||||
|
return this.getConnectionName(this.contextConnection.uid);
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions({
|
...mapActions({
|
||||||
deleteConnection: 'connections/deleteConnection',
|
deleteConnection: 'connections/deleteConnection',
|
||||||
|
@ -3,17 +3,22 @@
|
|||||||
<div class="footer-left-elements">
|
<div class="footer-left-elements">
|
||||||
<ul class="footer-elements">
|
<ul class="footer-elements">
|
||||||
<li class="footer-element">
|
<li class="footer-element">
|
||||||
<i class="material-icons md-18">memory</i>
|
<i class="material-icons md-18 mr-1">memory</i>
|
||||||
|
<small>{{ appVersion }}</small>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="footer-right-elements">
|
<div class="footer-right-elements">
|
||||||
<ul class="footer-elements">
|
<ul class="footer-elements">
|
||||||
<li class="footer-element">
|
<li class="footer-element footer-link">
|
||||||
<i class="material-icons md-18">favorite</i>
|
<i class="material-icons md-18 mr-1">favorite</i>
|
||||||
|
<small>{{ $t('word.donate') }}</small>
|
||||||
</li>
|
</li>
|
||||||
<li class="footer-element">
|
<li class="footer-element footer-link">
|
||||||
|
<i class="material-icons md-18">bug_report</i>
|
||||||
|
</li>
|
||||||
|
<li class="footer-element footer-link" @click="showSettingModal('about')">
|
||||||
<i class="material-icons md-18">info_outline</i>
|
<i class="material-icons md-18">info_outline</i>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -22,9 +27,21 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapActions, mapGetters } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
name: 'TheFooter',
|
||||||
|
computed: {
|
||||||
|
...mapGetters({
|
||||||
|
appName: 'application/appName',
|
||||||
|
appVersion: 'application/appVersion'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions({
|
||||||
|
showSettingModal: 'application/showSettingModal'
|
||||||
|
})
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -46,9 +63,23 @@ export default {
|
|||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
.footer-element{
|
.footer-element{
|
||||||
|
height: $footer-height;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
padding: 0 .4rem;
|
padding: 0 .4rem;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
&.footer-link{
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background .2s;
|
||||||
|
|
||||||
|
&:hover{
|
||||||
|
background: rgba($color: #fff, $alpha: .1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
draggable="true"
|
draggable="true"
|
||||||
class="settingbar-element btn btn-link tooltip tooltip-right"
|
class="settingbar-element btn btn-link tooltip tooltip-right"
|
||||||
:class="{'selected': connection.uid === selectedWorkspace}"
|
:class="{'selected': connection.uid === selectedWorkspace}"
|
||||||
:data-tooltip="`${connection.ask ? '': connection.user+'@'}${connection.host}:${connection.port}`"
|
:data-tooltip="`${getConnectionName(connection.uid)}`"
|
||||||
@click="selectWorkspace(connection.uid)"
|
@click="selectWorkspace(connection.uid)"
|
||||||
@contextmenu.prevent="contextMenu($event, connection)"
|
@contextmenu.prevent="contextMenu($event, connection)"
|
||||||
>
|
>
|
||||||
@ -37,7 +37,7 @@
|
|||||||
<li
|
<li
|
||||||
class="settingbar-element btn btn-link tooltip tooltip-right mb-2"
|
class="settingbar-element btn btn-link tooltip tooltip-right mb-2"
|
||||||
:data-tooltip="$t('word.settings')"
|
:data-tooltip="$t('word.settings')"
|
||||||
@click="showSettingModal"
|
@click="showSettingModal('general')"
|
||||||
>
|
>
|
||||||
<i class="settingbar-element-icon material-icons text-light">settings</i>
|
<i class="settingbar-element-icon material-icons text-light">settings</i>
|
||||||
</li>
|
</li>
|
||||||
@ -68,6 +68,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
getConnections: 'connections/getConnections',
|
getConnections: 'connections/getConnections',
|
||||||
|
getConnectionName: 'connections/getConnectionName',
|
||||||
connected: 'workspaces/getConnected',
|
connected: 'workspaces/getConnected',
|
||||||
selectedWorkspace: 'workspaces/getSelected'
|
selectedWorkspace: 'workspaces/getSelected'
|
||||||
}),
|
}),
|
||||||
@ -91,6 +92,9 @@ export default {
|
|||||||
this.contextEvent = event;
|
this.contextEvent = event;
|
||||||
this.contextConnection = connection;
|
this.contextConnection = connection;
|
||||||
this.isContext = true;
|
this.isContext = true;
|
||||||
|
},
|
||||||
|
workspaceName (connection) {
|
||||||
|
return connection.ask ? '' : `${connection.user + '@'}${connection.host}:${connection.port}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,7 @@ module.exports = {
|
|||||||
confirm: 'Confirm',
|
confirm: 'Confirm',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
send: 'Send',
|
send: 'Send',
|
||||||
|
connectionName: 'Connection name',
|
||||||
client: 'Client',
|
client: 'Client',
|
||||||
hostName: 'Host name',
|
hostName: 'Host name',
|
||||||
port: 'Port',
|
port: 'Port',
|
||||||
@ -24,7 +25,8 @@ module.exports = {
|
|||||||
update: 'Update',
|
update: 'Update',
|
||||||
about: 'About',
|
about: 'About',
|
||||||
language: 'Language',
|
language: 'Language',
|
||||||
version: 'Version'
|
version: 'Version',
|
||||||
|
donate: 'Donate'
|
||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
appWelcome: 'Welcome to Antares SQL Client!',
|
appWelcome: 'Welcome to Antares SQL Client!',
|
||||||
|
@ -7,6 +7,7 @@ module.exports = {
|
|||||||
confirm: 'Conferma',
|
confirm: 'Conferma',
|
||||||
cancel: 'Annulla',
|
cancel: 'Annulla',
|
||||||
send: 'Invia',
|
send: 'Invia',
|
||||||
|
connectionName: 'Nome connessione',
|
||||||
client: 'Client',
|
client: 'Client',
|
||||||
hostName: 'Nome host',
|
hostName: 'Nome host',
|
||||||
port: 'Porta',
|
port: 'Porta',
|
||||||
@ -24,7 +25,8 @@ module.exports = {
|
|||||||
update: 'Aggiornamento',
|
update: 'Aggiornamento',
|
||||||
about: 'Informazioni',
|
about: 'Informazioni',
|
||||||
language: 'Lingua',
|
language: 'Lingua',
|
||||||
version: 'Versione'
|
version: 'Versione',
|
||||||
|
donate: 'Dona'
|
||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
appWelcome: 'Benvenuto in Antares SQL Client!',
|
appWelcome: 'Benvenuto in Antares SQL Client!',
|
||||||
|
4
src/renderer/i18n/supported-locales.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export default {
|
||||||
|
'en-US': 'English',
|
||||||
|
'it-IT': 'Italiano'
|
||||||
|
};
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 892 B After Width: | Height: | Size: 892 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 1004 B After Width: | Height: | Size: 1004 B |
@ -34,19 +34,19 @@ body{
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
|
||||||
&.dbi-mysql{
|
&.dbi-mysql{
|
||||||
background-image: url('/svg/mysql.svg');
|
background-image: url('../images/svg/mysql.svg');
|
||||||
}
|
}
|
||||||
|
|
||||||
&.dbi-mssql{
|
&.dbi-mssql{
|
||||||
background-image: url('/svg/mssql.svg');
|
background-image: url('../images/svg/mssql.svg');
|
||||||
}
|
}
|
||||||
|
|
||||||
&.dbi-pg{
|
&.dbi-pg{
|
||||||
background-image: url('/svg/pg.svg');
|
background-image: url('../images/svg/pg.svg');
|
||||||
}
|
}
|
||||||
|
|
||||||
&.dbi-oracledb{
|
&.dbi-oracledb{
|
||||||
background-image: url('/svg/oracledb.svg');
|
background-image: url('../images/svg/oracledb.svg');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ export default {
|
|||||||
is_new_modal: false,
|
is_new_modal: false,
|
||||||
is_edit_modal: false,
|
is_edit_modal: false,
|
||||||
is_setting_modal: false,
|
is_setting_modal: false,
|
||||||
|
selected_setting_tab: 'general',
|
||||||
selected_conection: {}
|
selected_conection: {}
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
@ -18,7 +19,8 @@ export default {
|
|||||||
getSelectedConnection: state => state.selected_conection,
|
getSelectedConnection: state => state.selected_conection,
|
||||||
isNewModal: state => state.is_new_modal,
|
isNewModal: state => state.is_new_modal,
|
||||||
isEditModal: state => state.is_edit_modal,
|
isEditModal: state => state.is_edit_modal,
|
||||||
isSettingModal: state => state.is_setting_modal
|
isSettingModal: state => state.is_setting_modal,
|
||||||
|
selectedSettingTab: state => state.selected_setting_tab
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
SET_LOADING_STATUS (state, payload) {
|
SET_LOADING_STATUS (state, payload) {
|
||||||
@ -37,7 +39,8 @@ export default {
|
|||||||
HIDE_EDIT_CONNECTION_MODAL (state) {
|
HIDE_EDIT_CONNECTION_MODAL (state) {
|
||||||
state.is_edit_modal = false;
|
state.is_edit_modal = false;
|
||||||
},
|
},
|
||||||
SHOW_SETTING_MODAL (state) {
|
SHOW_SETTING_MODAL (state, tab) {
|
||||||
|
state.selected_setting_tab = tab;
|
||||||
state.is_setting_modal = true;
|
state.is_setting_modal = true;
|
||||||
},
|
},
|
||||||
HIDE_SETTING_MODAL (state) {
|
HIDE_SETTING_MODAL (state) {
|
||||||
@ -61,8 +64,8 @@ export default {
|
|||||||
hideEditConnModal ({ commit }) {
|
hideEditConnModal ({ commit }) {
|
||||||
commit('HIDE_EDIT_CONNECTION_MODAL');
|
commit('HIDE_EDIT_CONNECTION_MODAL');
|
||||||
},
|
},
|
||||||
showSettingModal ({ commit }) {
|
showSettingModal ({ commit }, tab) {
|
||||||
commit('SHOW_SETTING_MODAL');
|
commit('SHOW_SETTING_MODAL', tab);
|
||||||
},
|
},
|
||||||
hideSettingModal ({ commit }) {
|
hideSettingModal ({ commit }) {
|
||||||
commit('HIDE_SETTING_MODAL');
|
commit('HIDE_SETTING_MODAL');
|
||||||
|
@ -7,7 +7,15 @@ export default {
|
|||||||
connections: []
|
connections: []
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
getConnections: state => state.connections
|
getConnections: state => state.connections,
|
||||||
|
getConnectionName: state => uid => {
|
||||||
|
const connection = state.connections.filter(connection => connection.uid === uid)[0];
|
||||||
|
return connection.name
|
||||||
|
? connection.name
|
||||||
|
: connection.ask
|
||||||
|
? ''
|
||||||
|
: `${connection.user + '@'}${connection.host}:${connection.port}`;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
ADD_CONNECTION (state, connection) {
|
ADD_CONNECTION (state, connection) {
|
||||||
|
@ -1,5 +1,16 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import Connection from '@/ipc-api/Connection';
|
import Connection from '@/ipc-api/Connection';
|
||||||
|
function remapStructure (structure) {
|
||||||
|
const databases = structure.map(table => table.TABLE_SCHEMA)
|
||||||
|
.filter((value, index, self) => self.indexOf(value) === index);
|
||||||
|
|
||||||
|
return databases.map(db => {
|
||||||
|
return {
|
||||||
|
dbName: db,
|
||||||
|
tables: structure.filter(table => table.TABLE_SCHEMA === db)
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
@ -34,7 +45,7 @@ export default {
|
|||||||
REMOVE_CONNECTED (state, uid) {
|
REMOVE_CONNECTED (state, uid) {
|
||||||
state.workspaces = state.workspaces.map(workspace => workspace.uid === uid ? { ...workspace, structure: {}, connected: false } : workspace);
|
state.workspaces = state.workspaces.map(workspace => workspace.uid === uid ? { ...workspace, structure: {}, connected: false } : workspace);
|
||||||
},
|
},
|
||||||
REFRESH_STRUCTURE (state, uid) {
|
REFRESH_STRUCTURE (state, { uid, structure }) {
|
||||||
state.workspaces = state.workspaces.map(workspace => workspace.uid === uid ? { ...workspace, structure } : workspace);
|
state.workspaces = state.workspaces.map(workspace => workspace.uid === uid ? { ...workspace, structure } : workspace);
|
||||||
},
|
},
|
||||||
ADD_WORKSPACE (state, workspace) {
|
ADD_WORKSPACE (state, workspace) {
|
||||||
@ -51,7 +62,7 @@ export default {
|
|||||||
if (status === 'error')
|
if (status === 'error')
|
||||||
dispatch('notifications/addNotification', { status, message: response }, { root: true });
|
dispatch('notifications/addNotification', { status, message: response }, { root: true });
|
||||||
else
|
else
|
||||||
commit('ADD_CONNECTED', { uid: connection.uid, structure: response });
|
commit('ADD_CONNECTED', { uid: connection.uid, structure: remapStructure(response) });
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
dispatch('notifications/addNotification', { status: 'error', message: err.stack }, { root: true });
|
dispatch('notifications/addNotification', { status: 'error', message: err.stack }, { root: true });
|
||||||
@ -63,7 +74,7 @@ export default {
|
|||||||
if (status === 'error')
|
if (status === 'error')
|
||||||
dispatch('notifications/addNotification', { status, message: response }, { root: true });
|
dispatch('notifications/addNotification', { status, message: response }, { root: true });
|
||||||
else
|
else
|
||||||
commit('REFRESH_STRUCTURE', { uid, structure: response });
|
commit('REFRESH_STRUCTURE', { uid, structure: remapStructure(response) });
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
dispatch('notifications/addNotification', { status: 'error', message: err.stack }, { root: true });
|
dispatch('notifications/addNotification', { status: 'error', message: err.stack }, { root: true });
|
||||||
|