mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-27 06:46:00 +00:00
SYNC: grayed scripts for non active database
This commit is contained in:
committed by
Diflow
parent
3eb8863f67
commit
a96a84d509
@@ -15,6 +15,7 @@
|
|||||||
export let module = null;
|
export let module = null;
|
||||||
|
|
||||||
export let isBold = false;
|
export let isBold = false;
|
||||||
|
export let isGrayed = false;
|
||||||
export let isChoosed = false;
|
export let isChoosed = false;
|
||||||
export let isBusy = false;
|
export let isBusy = false;
|
||||||
export let statusIcon = undefined;
|
export let statusIcon = undefined;
|
||||||
@@ -93,6 +94,7 @@
|
|||||||
<div
|
<div
|
||||||
class="main"
|
class="main"
|
||||||
class:isBold
|
class:isBold
|
||||||
|
class:isGrayed
|
||||||
class:isChoosed
|
class:isChoosed
|
||||||
class:disableHover
|
class:disableHover
|
||||||
draggable={true}
|
draggable={true}
|
||||||
@@ -209,6 +211,10 @@
|
|||||||
.isBold {
|
.isBold {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
.isGrayed {
|
||||||
|
color: var(--theme-font-3);
|
||||||
|
}
|
||||||
|
|
||||||
.isChoosed {
|
.isChoosed {
|
||||||
background-color: var(--theme-bg-3);
|
background-color: var(--theme-bg-3);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
import { apiCall } from '../utility/api';
|
import { apiCall } from '../utility/api';
|
||||||
import newQuery from '../query/newQuery';
|
import newQuery from '../query/newQuery';
|
||||||
import { filterName } from 'dbgate-tools';
|
import { filterName } from 'dbgate-tools';
|
||||||
|
import { currentActiveCloudTags } from '../stores';
|
||||||
|
import _ from 'lodash';
|
||||||
|
|
||||||
export let data;
|
export let data;
|
||||||
|
|
||||||
@@ -34,6 +36,7 @@
|
|||||||
title={data.title}
|
title={data.title}
|
||||||
menu={createMenu}
|
menu={createMenu}
|
||||||
on:click={handleOpenSqlFile}
|
on:click={handleOpenSqlFile}
|
||||||
|
isGrayed={_.intersection($currentActiveCloudTags, data.tags || []).length == 0}
|
||||||
>
|
>
|
||||||
{#if data.description}
|
{#if data.description}
|
||||||
<div class="info">
|
<div class="info">
|
||||||
|
|||||||
@@ -463,4 +463,26 @@ cloudConnectionsStore.subscribe(value => {
|
|||||||
});
|
});
|
||||||
export const getCloudConnectionsStore = () => cloudConnectionsStoreValue;
|
export const getCloudConnectionsStore = () => cloudConnectionsStoreValue;
|
||||||
|
|
||||||
|
export const currentActiveCloudTags = derived(currentDatabase, $currentDatabase => {
|
||||||
|
if (!$currentDatabase || !$currentDatabase.connection) return [];
|
||||||
|
const engine = $currentDatabase.connection?.engine;
|
||||||
|
const [shortName, packageName] = engine.split('@');
|
||||||
|
const tags = [shortName];
|
||||||
|
const res = [...tags];
|
||||||
|
|
||||||
|
if (tags.includes('mariadb')) {
|
||||||
|
res.push('mysql');
|
||||||
|
}
|
||||||
|
if (tags.includes('mysql')) {
|
||||||
|
res.push('mariadb');
|
||||||
|
}
|
||||||
|
if (tags.includes('cockroach')) {
|
||||||
|
res.push('postgres');
|
||||||
|
}
|
||||||
|
if (tags.includes('libsql')) {
|
||||||
|
res.push('sqlite');
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
});
|
||||||
|
|
||||||
window['__changeCurrentTheme'] = theme => currentTheme.set(theme);
|
window['__changeCurrentTheme'] = theme => currentTheme.set(theme);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
"wkx": "^0.5.0",
|
"wkx": "^0.5.0",
|
||||||
"pg-copy-streams": "^6.0.6",
|
"pg-copy-streams": "^6.0.6",
|
||||||
"node-firebird": "^1.1.9",
|
"node-firebird": "^1.1.9",
|
||||||
"dbgate-query-splitter": "^4.11.3",
|
"dbgate-query-splitter": "^4.11.5",
|
||||||
"dbgate-tools": "^6.0.0-alpha.1",
|
"dbgate-tools": "^6.0.0-alpha.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"pg": "^8.11.5"
|
"pg": "^8.11.5"
|
||||||
|
|||||||
Reference in New Issue
Block a user