Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| db5358d6ce | |||
| 406eec519e | |||
| 9bd847fbe6 | |||
| eb06d3319f | |||
| 667185bc8e | |||
| 1a241880a0 | |||
| eee80cc269 | |||
| 25736b4a0a | |||
| 6d8112a603 | |||
| 6738fa85a7 | |||
| 6903272e92 | |||
| 054a814114 | |||
| 39cc4a3c95 | |||
| 99c33b6b4b | |||
| 252eb6175f | |||
| 53b3b50615 | |||
| 7b3a2195e1 | |||
| e1be7cebdd |
+1
-1
@@ -101,7 +101,7 @@
|
||||
"build:local": "cd ../packages/api && yarn build && cd ../web && yarn build && cd ../../app && yarn predist",
|
||||
"postinstall": "yarn rebuild && patch-package",
|
||||
"rebuild": "electron-builder install-app-deps",
|
||||
"predist": "copyfiles ../packages/api/dist/* packages && copyfiles \"../packages/web/public/*\" packages && copyfiles \"../packages/web/public/**/*\" packages && copyfiles --up 3 \"../plugins/dist/**/*\" packages/plugins"
|
||||
"predist": "copyfiles ../packages/api/dist/* packages && copyfiles \"../packages/web/dist/*\" packages && copyfiles \"../packages/web/dist/**/*\" packages && copyfiles --up 3 \"../plugins/dist/**/*\" packages/plugins"
|
||||
},
|
||||
"main": "src/electron.js",
|
||||
"devDependencies": {
|
||||
|
||||
+1
-1
@@ -285,7 +285,7 @@ function createWindow() {
|
||||
const startUrl =
|
||||
process.env.ELECTRON_START_URL ||
|
||||
url.format({
|
||||
pathname: path.join(__dirname, '../packages/web/public/index.html'),
|
||||
pathname: path.join(__dirname, '../packages/web/dist/index.html'),
|
||||
protocol: 'file:',
|
||||
slashes: true,
|
||||
});
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@
|
||||
"fillPackagedPlugins": "node fillPackagedPlugins",
|
||||
"resetPackagedPlugins": "node resetPackagedPlugins",
|
||||
"prettier": "prettier --write packages/api/src && prettier --write packages/datalib/src && prettier --write packages/filterparser/src && prettier --write packages/sqltree/src && prettier --write packages/tools/src && prettier --write packages/types && prettier --write packages/web/src && prettier --write app/src",
|
||||
"copy:docker:build": "copyfiles packages/api/dist/* docker -f && copyfiles packages/web/public/* docker -u 2 && copyfiles \"packages/web/public/**/*\" docker -u 2 && copyfiles \"plugins/dist/**/*\" docker/plugins -u 2",
|
||||
"copy:docker:build": "copyfiles packages/api/dist/* docker -f && copyfiles packages/web/dist/* docker -u 2 && copyfiles \"packages/web/dist/**/*\" docker -u 2 && copyfiles \"plugins/dist/**/*\" docker/plugins -u 2",
|
||||
"install:sqlite:docker": "cd docker && yarn init --yes && yarn add better-sqlite3 && cd ..",
|
||||
"prepare:docker": "yarn plugins:copydist && yarn build:web:docker && yarn build:api && yarn copy:docker:build && yarn install:sqlite:docker",
|
||||
"start": "concurrently --kill-others-on-fail \"yarn start:api\" \"yarn start:web\"",
|
||||
|
||||
@@ -95,7 +95,7 @@ function start() {
|
||||
console.log('DbGate API listening on port (docker build)', port);
|
||||
server.listen(port);
|
||||
} else if (platformInfo.isNpmDist) {
|
||||
app.use(getExpressPath('/'), express.static(path.join(__dirname, '../../dbgate-web/public')));
|
||||
app.use(getExpressPath('/'), express.static(path.join(__dirname, '../../dbgate-web/dist')));
|
||||
getPort({
|
||||
port: parseInt(
|
||||
// @ts-ignore
|
||||
@@ -107,9 +107,7 @@ function start() {
|
||||
});
|
||||
});
|
||||
} else if (process.env.DEVWEB) {
|
||||
console.log('__dirname', __dirname);
|
||||
console.log(path.join(__dirname, '../../web/public/build'));
|
||||
app.use(getExpressPath('/'), express.static(path.join(__dirname, '../../web/public')));
|
||||
app.use(getExpressPath('/'), express.static(path.join(__dirname, '../../web/dist')));
|
||||
|
||||
const port = process.env.PORT || 3000;
|
||||
console.log('DbGate API & web listening on port (dev web build)', port);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"version": "5.0.0-alpha.1",
|
||||
"name": "dbgate-datalib",
|
||||
"main": "lib/index.js",
|
||||
"module": "src/index.ts",
|
||||
"typings": "lib/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
|
||||
@@ -20,3 +20,4 @@ export * from './PerspectiveCache';
|
||||
export * from './PerspectiveConfig';
|
||||
export * from './processPerspectiveDefaultColunns';
|
||||
export * from './PerspectiveDataPattern';
|
||||
export * from './PerspectiveDataLoader';
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"version": "5.0.0-alpha.1",
|
||||
"name": "dbgate-filterparser",
|
||||
"main": "lib/index.js",
|
||||
"module": "src/index.ts",
|
||||
"typings": "lib/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
lib
|
||||
lib
|
||||
esm
|
||||
@@ -2,6 +2,7 @@
|
||||
"version": "5.0.0-alpha.1",
|
||||
"name": "dbgate-sqltree",
|
||||
"main": "lib/index.js",
|
||||
"module": "esm/index.js",
|
||||
"typings": "lib/index.d.ts",
|
||||
"homepage": "https://dbgate.org/",
|
||||
"repository": {
|
||||
@@ -19,11 +20,12 @@
|
||||
"dbgate"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"start": "tsc --watch"
|
||||
"build": "tsc && tsc --module es2015 --target es5 --outDir esm",
|
||||
"start": "tsc --watch && tsc --watch --module es2015 --target es5 --outDir esm"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
"lib",
|
||||
"esm"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^13.7.0",
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"target": "ES2015",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"declaration": true,
|
||||
"skipLibCheck": true,
|
||||
"outDir": "lib",
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
lib
|
||||
lib
|
||||
esm
|
||||
@@ -2,6 +2,7 @@
|
||||
"version": "5.0.0-alpha.1",
|
||||
"name": "dbgate-tools",
|
||||
"main": "lib/index.js",
|
||||
"module": "esm/index.js",
|
||||
"typings": "lib/index.d.ts",
|
||||
"homepage": "https://dbgate.org/",
|
||||
"repository": {
|
||||
@@ -15,13 +16,14 @@
|
||||
"dbgate"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"start": "tsc --watch",
|
||||
"build": "tsc && tsc --module es2015 --target es5 --outDir esm",
|
||||
"start": "tsc --watch && tsc --watch --module es2015 --target es5 --outDir esm",
|
||||
"test": "jest",
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
"lib",
|
||||
"esm"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^13.7.0",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ColumnInfo, TableInfo, ForeignKeyInfo, DatabaseInfo } from 'dbgate-types';
|
||||
import type { ColumnInfo, TableInfo, ForeignKeyInfo, DatabaseInfo } from 'dbgate-types';
|
||||
import { StringNullableChain } from 'lodash';
|
||||
import _cloneDeep from 'lodash/cloneDeep';
|
||||
import _compact from 'lodash/compact';
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"target": "ES2015",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"declaration": true,
|
||||
"skipLibCheck": true,
|
||||
"outDir": "lib",
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
<link rel="stylesheet" href="dimensions.css" />
|
||||
<link rel="stylesheet" href="bulma.css" />
|
||||
<link rel="stylesheet" href="icon-colors.css" />
|
||||
<link rel="stylesheet" href="build/bundle.css" />
|
||||
<link rel="stylesheet" href="build/fonts/materialdesignicons.css" />
|
||||
<link rel="stylesheet" href="build/diff2html.min.css" />
|
||||
<!-- <link rel="stylesheet" href="build/bundle.css" /> -->
|
||||
<link rel="stylesheet" href="assets/materialdesignicons.css" />
|
||||
<link rel="stylesheet" href="assets/diff2html.min.css" />
|
||||
|
||||
<script defer src="build/bundle.js"></script>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
|
||||
<style>
|
||||
.lds-ellipsis {
|
||||
+14
-20
@@ -2,10 +2,9 @@
|
||||
"name": "dbgate-web",
|
||||
"version": "5.0.0-alpha.1",
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"dev": "cross-env API_URL=http://localhost:3000 rollup -c -w",
|
||||
"build": "vite build",
|
||||
"dev": "cross-env VITE_API_URL=http://localhost:3000 vite",
|
||||
"start": "sirv public --port 5001",
|
||||
"validate": "svelte-check",
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"files": [
|
||||
@@ -14,11 +13,8 @@
|
||||
"devDependencies": {
|
||||
"@ant-design/colors": "^5.0.0",
|
||||
"@mdi/font": "^5.9.55",
|
||||
"@rollup/plugin-commonjs": "^20.0.0",
|
||||
"@rollup/plugin-node-resolve": "^13.0.5",
|
||||
"@rollup/plugin-replace": "^3.0.0",
|
||||
"@rollup/plugin-typescript": "^8.2.5",
|
||||
"@tsconfig/svelte": "^1.0.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^1.1.0",
|
||||
"@tsconfig/svelte": "^3.0.0",
|
||||
"ace-builds": "^1.4.8",
|
||||
"chart.js": "^3.6.0",
|
||||
"chartjs-adapter-moment": "^1.0.0",
|
||||
@@ -37,29 +33,27 @@
|
||||
"lodash": "^4.17.21",
|
||||
"randomcolor": "^0.6.2",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"rollup": "^2.57.0",
|
||||
"rollup-plugin-copy": "^3.3.0",
|
||||
"rollup-plugin-css-only": "^3.1.0",
|
||||
"rollup-plugin-livereload": "^2.0.0",
|
||||
"rollup-plugin-svelte": "^7.0.0",
|
||||
"rollup-plugin-terser": "^7.0.0",
|
||||
"sirv-cli": "^1.0.0",
|
||||
"sql-formatter": "^2.3.3",
|
||||
"svelte": "^3.46.4",
|
||||
"svelte-check": "^1.0.0",
|
||||
"svelte": "^3.52.0",
|
||||
"svelte-check": "^2.9.2",
|
||||
"svelte-markdown": "^0.1.4",
|
||||
"svelte-preprocess": "^4.9.5",
|
||||
"svelte-preprocess": "^4.10.7",
|
||||
"svelte-select": "^4.4.7",
|
||||
"tslib": "^2.3.1",
|
||||
"typescript": "^4.4.3",
|
||||
"uuid": "^3.4.0"
|
||||
"tslib": "^2.4.0",
|
||||
"typescript": "^4.6.4",
|
||||
"uuid": "^3.4.0",
|
||||
"vite": "^3.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
||||
"@rollup/plugin-commonjs": "^23.0.2",
|
||||
"chartjs-plugin-zoom": "^1.2.0",
|
||||
"date-fns": "^2.28.0",
|
||||
"debug": "^4.3.4",
|
||||
"interval-operations": "^1.0.7",
|
||||
"leaflet": "^1.8.0",
|
||||
"vite-plugin-static-copy": "^0.11.1",
|
||||
"wellknown": "^0.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,22 @@ export interface GlobalCommand {
|
||||
menuName?: string;
|
||||
toolbarOrder?: number;
|
||||
disableHandleKeyText?: string;
|
||||
isRelatedToTab?: boolean,
|
||||
isRelatedToTab?: boolean;
|
||||
systemCommand?: boolean;
|
||||
}
|
||||
|
||||
let disableRegisterCommands = false;
|
||||
if (import.meta.hot) {
|
||||
import.meta.hot.on('vite:beforeUpdate', () => {
|
||||
disableRegisterCommands = true;
|
||||
});
|
||||
}
|
||||
|
||||
export default function registerCommand(command: GlobalCommand) {
|
||||
if (disableRegisterCommands) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { testEnabled } = command;
|
||||
commands.update(x => {
|
||||
if (x[command.id]) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getCommands, visibleCommandPalette } from '../stores';
|
||||
import { GlobalCommand } from './registerCommand';
|
||||
import type { GlobalCommand } from './registerCommand';
|
||||
|
||||
export default function runCommand(id) {
|
||||
const commandsValue = getCommands();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { ChangeSet, MacroDefinition, MacroSelectedCell } from 'dbgate-datalib';
|
||||
|
||||
import {
|
||||
ChangeSet,
|
||||
changeSetContainsChanges,
|
||||
changeSetInsertNewRow,
|
||||
createChangeSet,
|
||||
@@ -7,8 +8,6 @@ import {
|
||||
findExistingChangeSetItem,
|
||||
getChangeSetInsertedRows,
|
||||
GridDisplay,
|
||||
MacroDefinition,
|
||||
MacroSelectedCell,
|
||||
revertChangeSetRowChanges,
|
||||
setChangeSetValue,
|
||||
setChangeSetRowData,
|
||||
@@ -16,7 +15,8 @@ import {
|
||||
runMacroOnValue,
|
||||
changeSetInsertDocuments,
|
||||
} from 'dbgate-datalib';
|
||||
import Grider, { GriderRowStatus } from './Grider';
|
||||
import Grider from './Grider';
|
||||
import type { GriderRowStatus } from './Grider';
|
||||
|
||||
function getRowFromItem(row, matchedChangeSetItem) {
|
||||
return matchedChangeSetItem.document
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Grider, { GriderRowStatus } from './Grider';
|
||||
import Grider from './Grider';
|
||||
|
||||
export default class RowsArrayGrider extends Grider {
|
||||
constructor(private rows: any[]) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import _ from 'lodash';
|
||||
import { SeriesSizes } from './SeriesSizes';
|
||||
import { CellAddress } from './selection';
|
||||
import { GridDisplay } from 'dbgate-datalib';
|
||||
import Grider from './Grider';
|
||||
import type { CellAddress } from './selection';
|
||||
import type { GridDisplay } from 'dbgate-datalib';
|
||||
import type Grider from './Grider';
|
||||
import { isJsonLikeLongString, safeJsonParse } from 'dbgate-tools';
|
||||
|
||||
export function countColumnSizes(grider: Grider, columns, containerWidth, display: GridDisplay) {
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
import _ from 'lodash';
|
||||
import {
|
||||
dumpSqlSelect,
|
||||
Select,
|
||||
JoinType,
|
||||
Condition,
|
||||
Relation,
|
||||
mergeConditions,
|
||||
Source,
|
||||
ResultField,
|
||||
Expression,
|
||||
} from 'dbgate-sqltree';
|
||||
import { DesignerInfo, DesignerTableInfo, DesignerReferenceInfo, DesignerJoinType } from './types';
|
||||
import { DesignerComponent } from './DesignerComponentCreator';
|
||||
import type { Select, JoinType, Condition, ResultField, Expression } from 'dbgate-sqltree';
|
||||
|
||||
import { mergeConditions } from 'dbgate-sqltree';
|
||||
import type { DesignerInfo, DesignerTableInfo } from './types';
|
||||
import type { DesignerComponent } from './DesignerComponentCreator';
|
||||
import {
|
||||
getReferenceConditions,
|
||||
referenceIsCrossJoin,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DesignerTableInfo } from './types';
|
||||
import type { DesignerTableInfo } from './types';
|
||||
|
||||
export default class DomTableRef {
|
||||
domTable: Element;
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
import _ from 'lodash';
|
||||
import {
|
||||
IBoxBounds,
|
||||
IPoint,
|
||||
rectangleDistance,
|
||||
rectangleIntersectArea,
|
||||
solveOverlapsInIntervalArray,
|
||||
Vector2D,
|
||||
} from './designerMath';
|
||||
import type { IBoxBounds, IPoint } from './designerMath';
|
||||
import { rectangleDistance, rectangleIntersectArea, solveOverlapsInIntervalArray, Vector2D } from './designerMath';
|
||||
import { union, intersection } from 'interval-operations';
|
||||
|
||||
const MIN_NODE_DISTANCE = 50;
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
);
|
||||
|
||||
if (index >= 0 && index + d >= 0 && index + d < current.columns?.length) {
|
||||
const columns = [...current.columns];
|
||||
let columns = [...current.columns];
|
||||
|
||||
[columns[index], columns[index + d]] = [columns[index + d], columns[index]];
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ChangeSet, ChangeSetRowDefinition } from 'dbgate-datalib';
|
||||
import {
|
||||
ChangeSet,
|
||||
changeSetContainsChanges,
|
||||
changeSetInsertNewRow,
|
||||
createChangeSet,
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
TableFormViewDisplay,
|
||||
revertChangeSetRowChanges,
|
||||
setChangeSetValue,
|
||||
ChangeSetRowDefinition,
|
||||
} from 'dbgate-datalib';
|
||||
import Former from './Former';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { FreeTableModel } from 'dbgate-datalib';
|
||||
import Grider, { GriderRowStatus } from '../datagrid/Grider';
|
||||
import type { FreeTableModel } from 'dbgate-datalib';
|
||||
import Grider from '../datagrid/Grider';
|
||||
|
||||
export default class FreeTableGrider extends Grider {
|
||||
public model: FreeTableModel;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { FreeTableModel, MacroDefinition, MacroSelectedCell, runMacro } from 'dbgate-datalib';
|
||||
import Grider, { GriderRowStatus } from '../datagrid/Grider';
|
||||
import type { FreeTableModel, MacroDefinition, MacroSelectedCell } from 'dbgate-datalib';
|
||||
import { runMacro } from 'dbgate-datalib';
|
||||
import Grider from '../datagrid/Grider';
|
||||
import type { GriderRowStatus } from '../datagrid/Grider';
|
||||
import _ from 'lodash';
|
||||
|
||||
function convertToSet(row, field) {
|
||||
|
||||
@@ -16,13 +16,8 @@
|
||||
useViewInfo,
|
||||
} from '../utility/metadataLoaders';
|
||||
import { onMount, tick } from 'svelte';
|
||||
import {
|
||||
ChangePerspectiveConfigFunc,
|
||||
createPerspectiveNodeConfig,
|
||||
PerspectiveConfig,
|
||||
PerspectiveCustomJoinConfig,
|
||||
PerspectiveTreeNode,
|
||||
} from 'dbgate-datalib';
|
||||
import { createPerspectiveNodeConfig, PerspectiveTreeNode } from 'dbgate-datalib';
|
||||
import type { ChangePerspectiveConfigFunc, PerspectiveConfig, PerspectiveCustomJoinConfig } from 'dbgate-datalib';
|
||||
import getConnectionLabel from '../utility/getConnectionLabel';
|
||||
import uuidv1 from 'uuid/v1';
|
||||
import TextField from '../forms/TextField.svelte';
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
<script lang="ts">
|
||||
import {
|
||||
createPerspectiveNodeConfig,
|
||||
MultipleDatabaseInfo,
|
||||
PerspectiveConfig,
|
||||
PerspectiveDataPatternDict,
|
||||
perspectiveNodesHaveStructure,
|
||||
PerspectiveTreeNode,
|
||||
switchPerspectiveReferenceDirection,
|
||||
} from 'dbgate-datalib';
|
||||
import type { MultipleDatabaseInfo, PerspectiveConfig, PerspectiveDataPatternDict } from 'dbgate-datalib';
|
||||
import type { CollectionInfo } from 'dbgate-types';
|
||||
import _ from 'lodash';
|
||||
import { tick } from 'svelte';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { ChangePerspectiveConfigFunc, PerspectiveConfig, PerspectiveTreeNode } from 'dbgate-datalib';
|
||||
import { PerspectiveTreeNode } from 'dbgate-datalib';
|
||||
import type { ChangePerspectiveConfigFunc, PerspectiveConfig } from 'dbgate-datalib';
|
||||
import { keys } from 'localforage';
|
||||
|
||||
import _, { map } from 'lodash';
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
<script lang="ts">
|
||||
import DataFilterControl from '../datagrid/DataFilterControl.svelte';
|
||||
|
||||
import ColumnLabel from '../elements/ColumnLabel.svelte';
|
||||
import InlineButton from '../buttons/InlineButton.svelte';
|
||||
import FontIcon from '../icons/FontIcon.svelte';
|
||||
import { getFilterType, getFilterValueExpression } from 'dbgate-filterparser';
|
||||
import {
|
||||
ChangePerspectiveConfigFunc,
|
||||
PerspectiveConfig,
|
||||
PerspectiveFilterColumnInfo,
|
||||
PerspectiveTreeNode,
|
||||
} from 'dbgate-datalib';
|
||||
import { showModal } from '../modals/modalTools';
|
||||
import DictionaryLookupModal from '../modals/DictionaryLookupModal.svelte';
|
||||
import ValueLookupModal from '../modals/ValueLookupModal.svelte';
|
||||
import { PerspectiveTreeNode } from 'dbgate-datalib';
|
||||
import type { ChangePerspectiveConfigFunc, PerspectiveConfig, PerspectiveFilterColumnInfo } from 'dbgate-datalib';
|
||||
|
||||
export let filterInfo: PerspectiveFilterColumnInfo;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { ChangePerspectiveConfigFunc, PerspectiveConfig, PerspectiveDisplayColumn } from 'dbgate-datalib';
|
||||
import { PerspectiveDisplayColumn } from 'dbgate-datalib';
|
||||
import type { ChangePerspectiveConfigFunc, PerspectiveConfig } from 'dbgate-datalib';
|
||||
import _, { mapKeys } from 'lodash';
|
||||
|
||||
import DropDownButton from '../buttons/DropDownButton.svelte';
|
||||
@@ -49,13 +50,13 @@
|
||||
.label {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.order-index {
|
||||
/* .order-index {
|
||||
font-size: 10pt;
|
||||
margin-left: -3px;
|
||||
margin-right: 2px;
|
||||
top: -1px;
|
||||
position: relative;
|
||||
}
|
||||
} */
|
||||
.label {
|
||||
flex: 1;
|
||||
min-width: 10px;
|
||||
@@ -68,13 +69,13 @@
|
||||
align-self: center;
|
||||
font-size: 18px;
|
||||
}
|
||||
.grouping {
|
||||
/* .grouping {
|
||||
color: var(--theme-font-alt);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.data-type {
|
||||
color: var(--theme-font-3);
|
||||
}
|
||||
} */
|
||||
|
||||
th {
|
||||
/* border: 1px solid var(--theme-border); */
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { ChangePerspectiveConfigFunc, PerspectiveConfig, PerspectiveTreeNode } from 'dbgate-datalib';
|
||||
import type { ChangePerspectiveConfigFunc, PerspectiveConfig } from 'dbgate-datalib';
|
||||
import { PerspectiveTreeNode } from 'dbgate-datalib';
|
||||
|
||||
import ColumnLabel from '../elements/ColumnLabel.svelte';
|
||||
import { plusExpandIcon } from '../icons/expandIcons';
|
||||
@@ -93,7 +94,7 @@
|
||||
background: var(--theme-bg-hover);
|
||||
}
|
||||
|
||||
.row.isSelected {
|
||||
/* .row.isSelected {
|
||||
background: var(--theme-bg-selected);
|
||||
}
|
||||
} */
|
||||
</style>
|
||||
|
||||
@@ -13,15 +13,14 @@
|
||||
|
||||
<script lang="ts">
|
||||
import {
|
||||
ChangePerspectiveConfigFunc,
|
||||
PerspectiveConfig,
|
||||
PerspectiveDisplay,
|
||||
PerspectivePatternColumnNode,
|
||||
PerspectiveTableColumnNode,
|
||||
PerspectiveTreeNode,
|
||||
PERSPECTIVE_PAGE_SIZE,
|
||||
} from 'dbgate-datalib';
|
||||
import _, { values } from 'lodash';
|
||||
import type { ChangePerspectiveConfigFunc, PerspectiveConfig } from 'dbgate-datalib';
|
||||
import _ from 'lodash';
|
||||
import { onMount, tick } from 'svelte';
|
||||
import resizeObserver from '../utility/resizeObserver';
|
||||
import debug from 'debug';
|
||||
@@ -597,9 +596,9 @@
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
th.filter {
|
||||
/* th.filter {
|
||||
padding: 0;
|
||||
}
|
||||
} */
|
||||
|
||||
thead :global(tr:first-child) :global(th) {
|
||||
border-top: 1px solid var(--theme-border);
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
<script lang="ts">
|
||||
import {
|
||||
ChangeConfigFunc,
|
||||
ChangePerspectiveConfigFunc,
|
||||
GridConfig,
|
||||
PerspectiveConfig,
|
||||
PerspectiveTreeNode,
|
||||
} from 'dbgate-datalib';
|
||||
import { PerspectiveTreeNode } from 'dbgate-datalib';
|
||||
import type { ChangeConfigFunc, ChangePerspectiveConfigFunc, GridConfig, PerspectiveConfig } from 'dbgate-datalib';
|
||||
import { filterName } from 'dbgate-tools';
|
||||
|
||||
import PerspectiveNodeRow from './PerspectiveNodeRow.svelte';
|
||||
|
||||
@@ -26,15 +26,14 @@
|
||||
|
||||
<script lang="ts">
|
||||
import {
|
||||
ChangePerspectiveConfigFunc,
|
||||
extractPerspectiveDatabases,
|
||||
PerspectiveConfig,
|
||||
PerspectiveDataProvider,
|
||||
PerspectiveTableNode,
|
||||
PerspectiveTreeNode,
|
||||
processPerspectiveDefaultColunns,
|
||||
shouldProcessPerspectiveDefaultColunns,
|
||||
} from 'dbgate-datalib';
|
||||
import type { ChangePerspectiveConfigFunc, PerspectiveConfig } from 'dbgate-datalib';
|
||||
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -48,7 +47,7 @@
|
||||
import PerspectiveTable from './PerspectiveTable.svelte';
|
||||
import { apiCall } from '../utility/api';
|
||||
import ManagerInnerContainer from '../elements/ManagerInnerContainer.svelte';
|
||||
import { PerspectiveDataLoader } from 'dbgate-datalib/lib/PerspectiveDataLoader';
|
||||
import { PerspectiveDataLoader } from 'dbgate-datalib';
|
||||
import stableStringify from 'json-stable-stringify';
|
||||
import createActivator, { getActiveComponent } from '../utility/createActivator';
|
||||
import registerCommand from '../commands/registerCommand';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChangePerspectiveConfigFunc, PerspectiveConfig, PerspectiveTreeNode } from 'dbgate-datalib';
|
||||
import type { ChangePerspectiveConfigFunc, PerspectiveConfig, PerspectiveTreeNode } from 'dbgate-datalib';
|
||||
import _ from 'lodash';
|
||||
import { showModal } from '../modals/modalTools';
|
||||
import CustomJoinModal from './CustomJoinModal.svelte';
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
import { useInstalledPlugins } from '../utility/metadataLoaders';
|
||||
import { buildFileFormats, buildQuickExports } from './fileformats';
|
||||
import { buildThemes } from './themes';
|
||||
import dbgateTools from 'dbgate-tools';
|
||||
import * as dbgateTools from 'dbgate-tools';
|
||||
import { apiCall } from '../utility/api';
|
||||
|
||||
let pluginsDict = {};
|
||||
|
||||
@@ -126,7 +126,8 @@
|
||||
import { handleCommandKeyDown } from '../commands/CommandListener.svelte';
|
||||
import resizeObserver from '../utility/resizeObserver';
|
||||
import queryParserWorkerFallback from './queryParserWorkerFallback';
|
||||
|
||||
import QueryParseWorker from './QueryParserWorker.js?worker'
|
||||
|
||||
const EDITOR_ID = `svelte-ace-editor-div:${Math.floor(Math.random() * 10000000000)}`;
|
||||
const dispatch = createEventDispatcher<{
|
||||
init: ace.Editor;
|
||||
@@ -262,7 +263,8 @@
|
||||
if (enabled) {
|
||||
if (!queryParserWorker) {
|
||||
try {
|
||||
queryParserWorker = new Worker('build/query-parser-worker.js');
|
||||
// queryParserWorker = new Worker('build/query-parser-worker.js');
|
||||
queryParserWorker = new QueryParseWorker();
|
||||
// console.log('WORKER', queryParserWorker);
|
||||
queryParserWorker.onmessage = e => {
|
||||
processParserResult(e.data);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DictionaryDescription } from 'dbgate-datalib';
|
||||
import type { DictionaryDescription } from 'dbgate-datalib';
|
||||
import type { ApplicationDefinition, TableInfo } from 'dbgate-types';
|
||||
import _ from 'lodash';
|
||||
import { apiCall } from './api';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import _ from 'lodash';
|
||||
import uuidv1 from 'uuid/v1';
|
||||
import { get } from 'svelte/store';
|
||||
import { getOpenedTabs, openedTabs, TabDefinition } from '../stores';
|
||||
import { getOpenedTabs, openedTabs } from '../stores';
|
||||
import tabs from '../tabs';
|
||||
import { setSelectedTabFunc } from './common';
|
||||
import localforage from 'localforage';
|
||||
|
||||
@@ -2,7 +2,7 @@ import getElectron from './getElectron';
|
||||
|
||||
let apiUrl = null;
|
||||
try {
|
||||
apiUrl = process.env.API_URL;
|
||||
apiUrl = import.meta.env.VITE_API_URL;
|
||||
} catch {}
|
||||
|
||||
export default function resolveApi() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { derived, Readable } from 'svelte/store';
|
||||
import { derived } from 'svelte/store';
|
||||
import type { Readable } from 'svelte/store';
|
||||
import { useDatabaseInfo } from './metadataLoaders';
|
||||
import { MultipleDatabaseInfo } from 'dbgate-datalib';
|
||||
import type { MultipleDatabaseInfo } from 'dbgate-datalib';
|
||||
|
||||
export function useMultipleDatabaseInfo(dbs: { conid: string; database: string }[]): Readable<MultipleDatabaseInfo> {
|
||||
return derived(
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import {
|
||||
analyseDataPattern,
|
||||
import { analyseDataPattern, PerspectiveCache } from 'dbgate-datalib';
|
||||
import type {
|
||||
MultipleDatabaseInfo,
|
||||
PerspectiveCache,
|
||||
PerspectiveConfig,
|
||||
PerspectiveDatabaseConfig,
|
||||
PerspectiveDataLoadProps,
|
||||
PerspectiveDataPattern,
|
||||
PerspectiveDataPatternDict,
|
||||
} from 'dbgate-datalib';
|
||||
import { PerspectiveDataLoader } from 'dbgate-datalib/lib/PerspectiveDataLoader';
|
||||
import { writable, Readable } from 'svelte/store';
|
||||
import type { PerspectiveDataLoader } from 'dbgate-datalib/lib/PerspectiveDataLoader';
|
||||
import { writable } from 'svelte/store';
|
||||
import type { Readable } from 'svelte/store';
|
||||
|
||||
export function getPerspectiveDataPatternsFromCache(
|
||||
databaseConfig: PerspectiveDatabaseConfig,
|
||||
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
/// <reference types="svelte" />
|
||||
/// <reference types="vite/client" />
|
||||
@@ -0,0 +1,23 @@
|
||||
import sveltePreprocess from 'svelte-preprocess';
|
||||
|
||||
const ignoreWarnings = [
|
||||
'a11y-click-events-have-key-events',
|
||||
'a11y-missing-attribute',
|
||||
'a11y-invalid-attribute',
|
||||
'a11y-no-noninteractive-tabindex',
|
||||
'a11y-label-has-associated-control',
|
||||
'vite-plugin-svelte-css-no-scopable-elements',
|
||||
'unused-export-let',
|
||||
];
|
||||
|
||||
export default {
|
||||
// Consult https://github.com/sveltejs/svelte-preprocess
|
||||
// for more information about preprocessors
|
||||
preprocess: sveltePreprocess(),
|
||||
|
||||
onwarn: (warning, handler) => {
|
||||
if (ignoreWarnings.includes(warning.code)) return;
|
||||
// console.log('***************************', warning.code);
|
||||
handler(warning);
|
||||
},
|
||||
};
|
||||
+20
-16
@@ -1,19 +1,23 @@
|
||||
{
|
||||
// "extends": "@tsconfig/svelte/tsconfig.json",
|
||||
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules/*", "public/*"],
|
||||
|
||||
"extends": "@tsconfig/svelte/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "node",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"noImplicitAny": false,
|
||||
"strictNullChecks": false,
|
||||
"strict": false,
|
||||
"target": "es6",
|
||||
// "allowJs": true,
|
||||
// "checkJs": true,
|
||||
}
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"resolveJsonModule": true,
|
||||
/**
|
||||
* Typecheck JS in `.svelte` and `.js` files by default.
|
||||
* Disable checkJs if you'd like to use dynamic types in JS.
|
||||
* Note that setting allowJs false does not prevent the use
|
||||
* of JS in `.svelte` files.
|
||||
*/
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"isolatedModules": true,
|
||||
// "allowSyntheticDefaultImports": true,
|
||||
// "esModuleInterop": true,
|
||||
"importsNotUsedAsValues": "preserve"
|
||||
},
|
||||
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node"
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
||||
import { viteCommonjs } from '@originjs/vite-plugin-commonjs';
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||
import rollupCommonjs from '@rollup/plugin-commonjs';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
server: {
|
||||
port: 5001,
|
||||
},
|
||||
plugins: [
|
||||
svelte(),
|
||||
viteCommonjs({
|
||||
include: ['mainMenuDefinition'],
|
||||
}),
|
||||
viteStaticCopy({
|
||||
targets: [
|
||||
{
|
||||
src: '../../node_modules/@mdi/font/css/materialdesignicons.css',
|
||||
dest: 'assets/',
|
||||
},
|
||||
{
|
||||
src: '../../node_modules/@mdi/font/fonts/*',
|
||||
dest: 'fonts/',
|
||||
},
|
||||
{
|
||||
src: '../../node_modules/diff2html/bundles/css/diff2html.min.css',
|
||||
dest: 'assets/',
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
build: {
|
||||
rollupOptions: {
|
||||
plugins: [rollupCommonjs()],
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"presets": ["@babel/preset-env"]
|
||||
}
|
||||
@@ -31,13 +31,16 @@
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.2",
|
||||
"@babel/preset-env": "^7.20.2",
|
||||
"babel-loader": "^9.1.0",
|
||||
"dbgate-plugin-tools": "^1.0.7",
|
||||
"dbgate-query-splitter": "^4.9.2",
|
||||
"webpack": "^4.42.0",
|
||||
"webpack-cli": "^3.3.11",
|
||||
"dbgate-tools": "^5.0.0-alpha.1",
|
||||
"is-promise": "^4.0.0",
|
||||
"mongodb": "^4.7.0",
|
||||
"mongodb-client-encryption": "^2.1.0"
|
||||
"mongodb-client-encryption": "^2.1.0",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^4.10.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,15 @@ var config = {
|
||||
libraryTarget: 'commonjs2',
|
||||
},
|
||||
|
||||
// module: {
|
||||
// rules: [
|
||||
// {
|
||||
// test: /\.(js)$/,
|
||||
// exclude: /node_modules/,
|
||||
// use: ['babel-loader'],
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// uncomment for disable minimalization
|
||||
// optimization: {
|
||||
// minimize: false,
|
||||
|
||||
Reference in New Issue
Block a user