mirror of
https://github.com/Fabio286/antares.git
synced 2025-04-03 13:01:32 +02:00
Additions
This commit is contained in:
parent
f5917de5d0
commit
6174ffb84e
100
package-lock.json
generated
100
package-lock.json
generated
@ -1121,9 +1121,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/fs-extra": {
|
"@types/fs-extra": {
|
||||||
"version": "8.1.0",
|
"version": "8.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.1.tgz",
|
||||||
"integrity": "sha512-UoOfVEzAUpeSPmjm7h1uk5MH6KZma2z2O7a75onTGjnNvAvMVrPzPL/vBbT65iIGHWj6rokwfmYcmxmlSf2uwg==",
|
"integrity": "sha512-TcUlBem321DFQzBNuz8p0CLLKp0VvF/XH9E4KHNmgwyp4E3AfgI5cjiIVZWlbfThBop2qxFIh4+LeY6hVWWZ2w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
@ -1227,9 +1227,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/yargs": {
|
"@types/yargs": {
|
||||||
"version": "15.0.4",
|
"version": "15.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.5.tgz",
|
||||||
"integrity": "sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg==",
|
"integrity": "sha512-Dk/IDOPtOgubt/IaevIUbTgV7doaKkoorvOyYM2CMwuDyP89bekI7H4xLIwunNYiK9jhCkmc6pUrJk3cj2AB9w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/yargs-parser": "*"
|
"@types/yargs-parser": "*"
|
||||||
@ -1664,27 +1664,27 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"app-builder-bin": {
|
"app-builder-bin": {
|
||||||
"version": "3.5.8",
|
"version": "3.5.9",
|
||||||
"resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-3.5.8.tgz",
|
"resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-3.5.9.tgz",
|
||||||
"integrity": "sha512-ni3q7QTfQNWHNWuyn5x3FZu6GnQZv+TFnfgk5++svqleKEhHGqS1mIaKsh7x5pBX6NFXU3/+ktk98wA/AW4EXw==",
|
"integrity": "sha512-NSjtqZ3x2kYiDp3Qezsgukx/AUzKPr3Xgf9by4cYt05ILWGAptepeeu0Uv+7MO+41o6ujhLixTou8979JGg2Kg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"app-builder-lib": {
|
"app-builder-lib": {
|
||||||
"version": "22.6.0",
|
"version": "22.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-22.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-22.6.1.tgz",
|
||||||
"integrity": "sha512-ky2aLYy92U+Gh6dKq/e8/bNmCotp6/GMhnX8tDZPv9detLg9WuBnWWi1ktBPlpbl1DREusy+TIh+9rgvfduQoA==",
|
"integrity": "sha512-ENL7r+H7IBfDb4faeLASgndsXrAT7AV7m7yJjcpbFDXYma6an7ZWGFIvR0HJrsfiC5TIB8kdLJ/aMSImrrSi/Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"7zip-bin": "~5.0.3",
|
"7zip-bin": "~5.0.3",
|
||||||
"@develar/schema-utils": "~2.6.5",
|
"@develar/schema-utils": "~2.6.5",
|
||||||
"async-exit-hook": "^2.0.1",
|
"async-exit-hook": "^2.0.1",
|
||||||
"bluebird-lst": "^1.0.9",
|
"bluebird-lst": "^1.0.9",
|
||||||
"builder-util": "22.6.0",
|
"builder-util": "22.6.1",
|
||||||
"builder-util-runtime": "8.7.0",
|
"builder-util-runtime": "8.7.0",
|
||||||
"chromium-pickle-js": "^0.2.0",
|
"chromium-pickle-js": "^0.2.0",
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"ejs": "^3.1.2",
|
"ejs": "^3.1.2",
|
||||||
"electron-publish": "22.6.0",
|
"electron-publish": "22.6.1",
|
||||||
"fs-extra": "^9.0.0",
|
"fs-extra": "^9.0.0",
|
||||||
"hosted-git-info": "^3.0.4",
|
"hosted-git-info": "^3.0.4",
|
||||||
"is-ci": "^2.0.0",
|
"is-ci": "^2.0.0",
|
||||||
@ -2499,15 +2499,15 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"builder-util": {
|
"builder-util": {
|
||||||
"version": "22.6.0",
|
"version": "22.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/builder-util/-/builder-util-22.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/builder-util/-/builder-util-22.6.1.tgz",
|
||||||
"integrity": "sha512-jgdES2ExJYkuXC3DEaGAjFctKNA81C4QDy8zdoc+rqdSqheTizuDNtZg02uMFklmUES4V4fggmqds+Y7wraqng==",
|
"integrity": "sha512-A9cF+bSHqRTSKIUHEyE92Tl0Uh12N7yZRH9bccIL3gRUwtp6ulF28LsjNIWTSQ1clZo2M895cT5PCrKzjPQFVg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"7zip-bin": "~5.0.3",
|
"7zip-bin": "~5.0.3",
|
||||||
"@types/debug": "^4.1.5",
|
"@types/debug": "^4.1.5",
|
||||||
"@types/fs-extra": "^8.1.0",
|
"@types/fs-extra": "^8.1.0",
|
||||||
"app-builder-bin": "3.5.8",
|
"app-builder-bin": "3.5.9",
|
||||||
"bluebird-lst": "^1.0.9",
|
"bluebird-lst": "^1.0.9",
|
||||||
"builder-util-runtime": "8.7.0",
|
"builder-util-runtime": "8.7.0",
|
||||||
"chalk": "^4.0.0",
|
"chalk": "^4.0.0",
|
||||||
@ -3684,13 +3684,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dmg-builder": {
|
"dmg-builder": {
|
||||||
"version": "22.6.0",
|
"version": "22.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-22.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-22.6.1.tgz",
|
||||||
"integrity": "sha512-rJxuGhHIpcuDGBtWZMM8aLxkbZNgYO2MO5dUerDIBXebhX1K8DA23iz/uZ8ahcRNgWEv57b8GDqJbXKEfr5T0A==",
|
"integrity": "sha512-jUTN0acP15puzevtQASj7QEPgUGpedWSuSnOwR/++JbeYRTwU2oro09h/KZnaeMcxgxjdmT3tYLJeY1XUfPbRg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"app-builder-lib": "22.6.0",
|
"app-builder-lib": "22.6.1",
|
||||||
"builder-util": "22.6.0",
|
"builder-util": "22.6.1",
|
||||||
"fs-extra": "^9.0.0",
|
"fs-extra": "^9.0.0",
|
||||||
"iconv-lite": "^0.5.1",
|
"iconv-lite": "^0.5.1",
|
||||||
"js-yaml": "^3.13.1",
|
"js-yaml": "^3.13.1",
|
||||||
@ -3885,9 +3885,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ejs": {
|
"ejs": {
|
||||||
"version": "3.1.2",
|
"version": "3.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.3.tgz",
|
||||||
"integrity": "sha512-zFuywxrAWtX5Mk2KAuoJNkXXbfezpNA0v7i+YC971QORguPekpjpAgeOv99YWSdKXwj7JxI2QAWDeDkE8fWtXw==",
|
"integrity": "sha512-wmtrUGyfSC23GC/B1SMv2ogAUgbQEtDmTIhfqielrG5ExIM9TP4UoYdi90jLF1aTcsWCJNEO0UrgKzP0y3nTSg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"jake": "^10.6.1"
|
"jake": "^10.6.1"
|
||||||
@ -3905,18 +3905,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"electron-builder": {
|
"electron-builder": {
|
||||||
"version": "22.6.0",
|
"version": "22.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-22.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-22.6.1.tgz",
|
||||||
"integrity": "sha512-aLHlB6DTfjJ3MI4AUIFeWnwIozNgNlbOk2c2sTHxB10cAKp0dBVSPZ7xF5NK0uwDhElvRzJQubnHtJD6zKg42Q==",
|
"integrity": "sha512-3/VNg9GfXKHM53TilFtfF1+bsAR8THK1XHgeqCpsiequa02J9jTPc/DhpCUKQPkrs6/EIGxP7uboop7XYoew0Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/yargs": "^15.0.4",
|
"@types/yargs": "^15.0.5",
|
||||||
"app-builder-lib": "22.6.0",
|
"app-builder-lib": "22.6.1",
|
||||||
"bluebird-lst": "^1.0.9",
|
"bluebird-lst": "^1.0.9",
|
||||||
"builder-util": "22.6.0",
|
"builder-util": "22.6.1",
|
||||||
"builder-util-runtime": "8.7.0",
|
"builder-util-runtime": "8.7.0",
|
||||||
"chalk": "^4.0.0",
|
"chalk": "^4.0.0",
|
||||||
"dmg-builder": "22.6.0",
|
"dmg-builder": "22.6.1",
|
||||||
"fs-extra": "^9.0.0",
|
"fs-extra": "^9.0.0",
|
||||||
"is-ci": "^2.0.0",
|
"is-ci": "^2.0.0",
|
||||||
"lazy-val": "^1.0.4",
|
"lazy-val": "^1.0.4",
|
||||||
@ -3979,19 +3979,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"electron-publish": {
|
"electron-publish": {
|
||||||
"version": "22.6.0",
|
"version": "22.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-22.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-22.6.1.tgz",
|
||||||
"integrity": "sha512-+v05SBf9qR7Os5au+fifloNHy5QxHQkUGudBj68YaTb43Pn37UkwRxSc49Lf13s4wW32ohM45g8BOVInPJEdnA==",
|
"integrity": "sha512-/MkS47ospdSfAFW5Jp52OzYou14HhGJpZ51uAc3GJ5rCfACeqpimC/n1ajRLE3hcXxTWfd3t9MCuClq5jrUO5w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/fs-extra": "^8.1.0",
|
"@types/fs-extra": "^8.1.0",
|
||||||
"bluebird-lst": "^1.0.9",
|
"bluebird-lst": "^1.0.9",
|
||||||
"builder-util": "22.6.0",
|
"builder-util": "22.6.1",
|
||||||
"builder-util-runtime": "8.7.0",
|
"builder-util-runtime": "8.7.0",
|
||||||
"chalk": "^4.0.0",
|
"chalk": "^4.0.0",
|
||||||
"fs-extra": "^9.0.0",
|
"fs-extra": "^9.0.0",
|
||||||
"lazy-val": "^1.0.4",
|
"lazy-val": "^1.0.4",
|
||||||
"mime": "^2.4.4"
|
"mime": "^2.4.5"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fs-extra": {
|
"fs-extra": {
|
||||||
@ -4016,6 +4016,12 @@
|
|||||||
"universalify": "^1.0.0"
|
"universalify": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"mime": {
|
||||||
|
"version": "2.4.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.5.tgz",
|
||||||
|
"integrity": "sha512-3hQhEUF027BuxZjQA3s7rIv/7VCQPa27hN9u9g87sEkWaKwQPuXOkVKtOeiyUrnWqTDiOs8Ed2rwg733mB0R5w==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"universalify": {
|
"universalify": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz",
|
||||||
@ -4821,9 +4827,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"eventemitter3": {
|
"eventemitter3": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz",
|
||||||
"integrity": "sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==",
|
"integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"events": {
|
"events": {
|
||||||
@ -6753,9 +6759,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"http-proxy": {
|
"http-proxy": {
|
||||||
"version": "1.18.0",
|
"version": "1.18.1",
|
||||||
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.0.tgz",
|
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
|
||||||
"integrity": "sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==",
|
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"eventemitter3": "^4.0.0",
|
"eventemitter3": "^4.0.0",
|
||||||
@ -12582,9 +12588,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vue-i18n": {
|
"vue-i18n": {
|
||||||
"version": "8.17.6",
|
"version": "8.17.7",
|
||||||
"resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.17.6.tgz",
|
"resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.17.7.tgz",
|
||||||
"integrity": "sha512-SsKL5D9Ii3zJPsFhUSllY754XuZvP8uCouUm+Mbylu95h3OwenV09uzIIEjkT7EtWyDQuWSMWObrNaD4ukBGZw=="
|
"integrity": "sha512-7IQJ+72IIIxfR6Mt+X6EDmMP1i5oETFpc0FttnWKA9cgacf1DAlyho1aTItekG+AkbNs6nz4q3sYrXaPdC0irA=="
|
||||||
},
|
},
|
||||||
"vue-loader": {
|
"vue-loader": {
|
||||||
"version": "15.9.1",
|
"version": "15.9.1",
|
||||||
|
@ -35,14 +35,14 @@
|
|||||||
"pg": "^8.2.1",
|
"pg": "^8.2.1",
|
||||||
"source-map-support": "^0.5.16",
|
"source-map-support": "^0.5.16",
|
||||||
"spectre.css": "^0.5.8",
|
"spectre.css": "^0.5.8",
|
||||||
"vue-i18n": "^8.17.6",
|
"vue-i18n": "^8.17.7",
|
||||||
"vuex": "^3.4.0",
|
"vuex": "^3.4.0",
|
||||||
"vuex-persist": "^2.2.0"
|
"vuex-persist": "^2.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"electron": "^8.3.0",
|
"electron": "^8.3.0",
|
||||||
"electron-builder": "^22.4.1",
|
"electron-builder": "^22.6.1",
|
||||||
"electron-devtools-installer": "^3.0.0",
|
"electron-devtools-installer": "^3.0.0",
|
||||||
"electron-webpack": "^2.8.2",
|
"electron-webpack": "^2.8.2",
|
||||||
"electron-webpack-vue": "^2.4.0",
|
"electron-webpack-vue": "^2.4.0",
|
||||||
|
@ -30,7 +30,6 @@ export default () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.handle('connect', async (event, conn) => {
|
ipcMain.handle('connect', async (event, conn) => {
|
||||||
let structure;
|
|
||||||
const connection = knex({
|
const connection = knex({
|
||||||
client: conn.client,
|
client: conn.client,
|
||||||
connection: {
|
connection: {
|
||||||
@ -46,14 +45,13 @@ export default () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
structure = await InformationSchema.getStructure(connection);
|
const structure = await InformationSchema.getStructure(connection);
|
||||||
|
connections[conn.uid] = connection;
|
||||||
|
return { status: 'success', response: structure };
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
return { status: 'error', response: err.toString() };
|
return { status: 'error', response: err.toString() };
|
||||||
}
|
}
|
||||||
|
|
||||||
connections[conn.uid] = connection;
|
|
||||||
return { status: 'success', response: structure };
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.handle('disconnect', (event, uid) => {
|
ipcMain.handle('disconnect', (event, uid) => {
|
||||||
@ -63,12 +61,12 @@ export default () => {
|
|||||||
|
|
||||||
ipcMain.handle('refresh', async (event, uid) => {
|
ipcMain.handle('refresh', async (event, uid) => {
|
||||||
try {
|
try {
|
||||||
structure = await InformationSchema.getStructure(connection);
|
const structure = await InformationSchema.getStructure(connections[uid]);
|
||||||
|
return { status: 'success', response: structure };
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
console.log(err);
|
||||||
return { status: 'error', response: err.toString() };
|
return { status: 'error', response: err.toString() };
|
||||||
}
|
}
|
||||||
|
|
||||||
return { status: 'success', response: structure };
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -2,16 +2,21 @@
|
|||||||
<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.user }}@{{ connection.host }}:{{ connection.port }}</span>
|
<span class="workspace-explorebar-title">{{ connection.user }}@{{ connection.host }}:{{ connection.port }}</span>
|
||||||
<span v-if="isConnected" class="workspace-explorebar-tools">
|
<span v-if="workspace.connected" class="workspace-explorebar-tools">
|
||||||
<i class="material-icons md-18 c-hand mr-1" title="Refresh">cached</i>
|
|
||||||
<i
|
<i
|
||||||
class="material-icons md-18 c-hand"
|
class="material-icons md-18 c-hand"
|
||||||
|
:class="{'rotate':isRefreshing}"
|
||||||
|
title="Refresh"
|
||||||
|
@click="refresh"
|
||||||
|
>refresh</i>
|
||||||
|
<i
|
||||||
|
class="material-icons md-18 c-hand mr-1 ml-2"
|
||||||
title="Disconnect"
|
title="Disconnect"
|
||||||
@click="disconnectWorkspace(connection.uid)"
|
@click="disconnectWorkspace(connection.uid)"
|
||||||
>exit_to_app</i>
|
>exit_to_app</i>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<DatabaseConnectPanel v-if="!isConnected" :connection="connection" />
|
<DatabaseConnectPanel v-if="!workspace.connected" :connection="connection" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -27,18 +32,29 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
connection: Object
|
connection: Object
|
||||||
},
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
isRefreshing: false
|
||||||
|
};
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
connected: 'workspaces/getConnected'
|
getWorkspace: 'workspaces/getWorkspace'
|
||||||
}),
|
}),
|
||||||
isConnected () {
|
workspace () {
|
||||||
return this.connected.includes(this.connection.uid);
|
return this.getWorkspace(this.connection.uid);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions({
|
...mapActions({
|
||||||
disconnectWorkspace: 'workspaces/removeConnected'
|
disconnectWorkspace: 'workspaces/removeConnected',
|
||||||
})
|
refreshStructure: 'workspaces/refreshStructure'
|
||||||
|
}),
|
||||||
|
async refresh () {
|
||||||
|
this.isRefreshing = true;
|
||||||
|
await this.refreshStructure(this.connection.uid);
|
||||||
|
this.isRefreshing = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -76,14 +92,23 @@ export default {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workspace-explorebar-tools > i{
|
.workspace-explorebar-tools {
|
||||||
opacity: .6;
|
display: flex;
|
||||||
transition: opacity .2s;;
|
align-items: center;
|
||||||
|
|
||||||
&:hover{
|
> i{
|
||||||
opacity: 1;
|
opacity: .6;
|
||||||
|
transition: opacity .2s;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
&:hover{
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div v-show="selectedWorkspace === connection.uid" class="workspace column columns">
|
<div v-show="selectedWorkspace === connection.uid" class="workspace column columns">
|
||||||
<DatabaseExploreBar :connection="connection" />
|
<DatabaseExploreBar :connection="connection" />
|
||||||
<div class="workspace-tabs column">
|
<div class="workspace-tabs column">
|
||||||
<pre>{{ JSON.stringify(connection, null, 3) }}</pre>
|
<pre>{{ JSON.stringify(workspace.structure, null, 3) }}</pre>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -23,8 +23,11 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
selectedWorkspace: 'workspaces/getSelected',
|
selectedWorkspace: 'workspaces/getSelected',
|
||||||
getConnected: 'workspaces/getConnected'
|
getWorkspace: 'workspaces/getWorkspace'
|
||||||
})
|
}),
|
||||||
|
workspace () {
|
||||||
|
return this.getWorkspace(this.connection.uid);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async created () {
|
async created () {
|
||||||
this.addWorkspace(this.connection.uid);
|
this.addWorkspace(this.connection.uid);
|
||||||
@ -47,5 +50,10 @@ export default {
|
|||||||
.workspace{
|
.workspace{
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
|
.workspace-tabs{
|
||||||
|
overflow: auto;
|
||||||
|
height: calc(100vh - #{$footer-height});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -41,7 +41,7 @@ export default {
|
|||||||
#notifications-board{
|
#notifications-board{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
right: .8rem;
|
right: 1rem;
|
||||||
bottom: $footer-height+1rem;
|
bottom: $footer-height+1rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -50,6 +50,20 @@ body{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Animations
|
||||||
|
@keyframes rotation {
|
||||||
|
from {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: rotate(359deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.rotate {
|
||||||
|
animation: rotation .8s infinite linear;
|
||||||
|
}
|
||||||
|
|
||||||
/*Override*/
|
/*Override*/
|
||||||
.modal{
|
.modal{
|
||||||
.modal-overlay,
|
.modal-overlay,
|
||||||
|
@ -6,7 +6,6 @@ export default {
|
|||||||
strict: true,
|
strict: true,
|
||||||
state: {
|
state: {
|
||||||
workspaces: [],
|
workspaces: [],
|
||||||
connected_workspaces: [], // TODO: move to state.workspaces
|
|
||||||
selected_workspace: null
|
selected_workspace: null
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
@ -15,20 +14,28 @@ export default {
|
|||||||
if (state.workspaces.length) return state.workspaces[0].uid;
|
if (state.workspaces.length) return state.workspaces[0].uid;
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
getWorkspaces: state => state.workspaces,
|
getWorkspace: state => uid => {
|
||||||
getConnected: state => state.connected_workspaces
|
const workspace = state.workspaces.filter(workspace => workspace.uid === uid);
|
||||||
|
return workspace.length ? workspace[0] : {};
|
||||||
|
},
|
||||||
|
getConnected: state => {
|
||||||
|
return state.workspaces
|
||||||
|
.filter(workspace => workspace.connected)
|
||||||
|
.map(workspace => workspace.uid);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
SELECT_WORKSPACE (state, uid) {
|
SELECT_WORKSPACE (state, uid) {
|
||||||
state.selected_workspace = uid;
|
state.selected_workspace = uid;
|
||||||
},
|
},
|
||||||
ADD_CONNECTED (state, { uid, structure }) {
|
ADD_CONNECTED (state, { uid, structure }) {
|
||||||
state.connected_workspaces.push(uid);
|
state.workspaces = state.workspaces.map(workspace => workspace.uid === uid ? { ...workspace, structure, connected: true } : workspace);
|
||||||
state.workspaces = state.workspaces.map(workspace => workspace.uid === uid ? { ...workspace, structure } : workspace);
|
|
||||||
},
|
},
|
||||||
REMOVE_CONNECTED (state, uid) {
|
REMOVE_CONNECTED (state, uid) {
|
||||||
state.connected_workspaces = state.connected_workspaces.filter(value => value !== 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: {} } : workspace);
|
},
|
||||||
|
REFRESH_STRUCTURE (state, uid) {
|
||||||
|
state.workspaces = state.workspaces.map(workspace => workspace.uid === uid ? { ...workspace, structure } : workspace);
|
||||||
},
|
},
|
||||||
ADD_WORKSPACE (state, workspace) {
|
ADD_WORKSPACE (state, workspace) {
|
||||||
state.workspaces.push(workspace);
|
state.workspaces.push(workspace);
|
||||||
@ -50,6 +57,18 @@ export default {
|
|||||||
dispatch('notifications/addNotification', { status: 'error', message: err.stack }, { root: true });
|
dispatch('notifications/addNotification', { status: 'error', message: err.stack }, { root: true });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async refreshStructure ({ dispatch, commit }, uid) {
|
||||||
|
try {
|
||||||
|
const { status, response } = await Connection.refresh(uid);
|
||||||
|
if (status === 'error')
|
||||||
|
dispatch('notifications/addNotification', { status, message: response }, { root: true });
|
||||||
|
else
|
||||||
|
commit('REFRESH_STRUCTURE', { uid, structure: response });
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
dispatch('notifications/addNotification', { status: 'error', message: err.stack }, { root: true });
|
||||||
|
}
|
||||||
|
},
|
||||||
async removeConnected ({ commit }, uid) {
|
async removeConnected ({ commit }, uid) {
|
||||||
Connection.disconnect(uid);
|
Connection.disconnect(uid);
|
||||||
commit('REMOVE_CONNECTED', uid);
|
commit('REMOVE_CONNECTED', uid);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user