author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
141,908
29.04.2020 22:09:41
-28,800
d39713d4adf42c28f554567ed10bb7a5fed6bf7f
support export data
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "\"@types/node\": \"*\"\n}\n},\n+ \"@types/xlsx\": {\n+ \"version\": \"0.0.36\",\n+ \"resolved\": \"https://registry.npm.taobao.org/@types/xlsx/download/@types/xlsx-0.0.36.tgz\",\n+ \"integrity\": \"sha1-tQYgA+XFN0q08I/dO/adpNQBOvg=\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"xlsx\": \"*\"\n+ }\n+ },\n+ \"adler-32\": {\n+ \"version\": \"1.2.0\",\n+ \"resolved\": \"https://registry.npm.taobao.org/adler-32/download/adler-32-1.2.0.tgz\",\n+ \"integrity\": \"sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU=\",\n+ \"requires\": {\n+ \"exit-on-epipe\": \"~1.0.1\",\n+ \"printj\": \"~1.1.0\"\n+ }\n+ },\n\"agent-base\": {\n\"version\": \"4.3.0\",\n\"resolved\": \"https://registry.npm.taobao.org/agent-base/download/agent-base-4.3.0.tgz?cache=0&sync_timestamp=1579811507521&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fagent-base%2Fdownload%2Fagent-base-4.3.0.tgz\",\n\"buffer-from\": {\n\"version\": \"1.1.1\",\n\"resolved\": \"https://registry.npm.taobao.org/buffer-from/download/buffer-from-1.1.1.tgz\",\n- \"integrity\": \"sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=\",\n- \"dev\": true\n+ \"integrity\": \"sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=\"\n},\n\"builtin-modules\": {\n\"version\": \"1.1.1\",\n- \"resolved\": \"https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz\",\n+ \"resolved\": \"https://registry.npm.taobao.org/builtin-modules/download/builtin-modules-1.1.1.tgz\",\n\"integrity\": \"sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=\",\n\"dev\": true\n},\n\"integrity\": \"sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=\",\n\"dev\": true\n},\n+ \"cfb\": {\n+ \"version\": \"1.1.4\",\n+ \"resolved\": \"https://registry.npm.taobao.org/cfb/download/cfb-1.1.4.tgz?cache=0&sync_timestamp=1584079392655&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcfb%2Fdownload%2Fcfb-1.1.4.tgz\",\n+ \"integrity\": \"sha1-gf017eTJGdjwliqUWC4d+vcFHio=\",\n+ \"requires\": {\n+ \"adler-32\": \"~1.2.0\",\n+ \"commander\": \"^2.16.0\",\n+ \"crc-32\": \"~1.2.0\",\n+ \"printj\": \"~1.1.2\"\n+ },\n+ \"dependencies\": {\n+ \"commander\": {\n+ \"version\": \"2.20.3\",\n+ \"resolved\": \"https://registry.npm.taobao.org/commander/download/commander-2.20.3.tgz?cache=0&sync_timestamp=1587781810870&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.20.3.tgz\",\n+ \"integrity\": \"sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=\"\n+ }\n+ }\n+ },\n\"chalk\": {\n\"version\": \"2.4.2\",\n\"resolved\": \"https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz\",\n\"supports-color\": \"^5.3.0\"\n}\n},\n+ \"codepage\": {\n+ \"version\": \"1.14.0\",\n+ \"resolved\": \"https://registry.npm.taobao.org/codepage/download/codepage-1.14.0.tgz\",\n+ \"integrity\": \"sha1-jL4lSBMjVZ19MHVxsP/5HnodL5k=\",\n+ \"requires\": {\n+ \"commander\": \"~2.14.1\",\n+ \"exit-on-epipe\": \"~1.0.1\"\n+ },\n+ \"dependencies\": {\n+ \"commander\": {\n+ \"version\": \"2.14.1\",\n+ \"resolved\": \"https://registry.npm.taobao.org/commander/download/commander-2.14.1.tgz?cache=0&sync_timestamp=1587781810870&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.14.1.tgz\",\n+ \"integrity\": \"sha1-IjUSPjevjKPGXfRbAm29NXsBuao=\"\n+ }\n+ }\n+ },\n\"color-convert\": {\n\"version\": \"1.9.3\",\n\"resolved\": \"https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz?cache=0&sync_timestamp=1566248870121&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcolor-convert%2Fdownload%2Fcolor-convert-1.9.3.tgz\",\n},\n\"color-name\": {\n\"version\": \"1.1.3\",\n- \"resolved\": \"https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz\",\n+ \"resolved\": \"https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz\",\n\"integrity\": \"sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=\",\n\"dev\": true\n},\n\"resolved\": \"https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz\",\n\"integrity\": \"sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=\"\n},\n+ \"crc-32\": {\n+ \"version\": \"1.2.0\",\n+ \"resolved\": \"https://registry.npm.taobao.org/crc-32/download/crc-32-1.2.0.tgz\",\n+ \"integrity\": \"sha1-yy224puIUI4y2d0OwWk+e0Ghggg=\",\n+ \"requires\": {\n+ \"exit-on-epipe\": \"~1.0.1\",\n+ \"printj\": \"~1.1.0\"\n+ }\n+ },\n\"dashdash\": {\n\"version\": \"1.14.1\",\n\"resolved\": \"https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz\",\n\"integrity\": \"sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=\",\n\"dev\": true\n},\n+ \"exit-on-epipe\": {\n+ \"version\": \"1.0.1\",\n+ \"resolved\": \"https://registry.npm.taobao.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz\",\n+ \"integrity\": \"sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI=\"\n+ },\n\"extend\": {\n\"version\": \"3.0.2\",\n\"resolved\": \"https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz\",\n\"mime-types\": \"^2.1.12\"\n}\n},\n+ \"frac\": {\n+ \"version\": \"1.1.2\",\n+ \"resolved\": \"https://registry.npm.taobao.org/frac/download/frac-1.1.2.tgz\",\n+ \"integrity\": \"sha1-PXT39keMiKG1AgMG10fcYxPHTQs=\"\n+ },\n\"fs.realpath\": {\n\"version\": \"1.0.0\",\n\"resolved\": \"https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz\",\n},\n\"lodash.defaults\": {\n\"version\": \"4.2.0\",\n- \"resolved\": \"https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz\",\n+ \"resolved\": \"https://registry.npm.taobao.org/lodash.defaults/download/lodash.defaults-4.2.0.tgz\",\n\"integrity\": \"sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=\"\n},\n\"long\": {\n}\n}\n},\n+ \"node-xlsx\": {\n+ \"version\": \"0.15.0\",\n+ \"resolved\": \"https://registry.npm.taobao.org/node-xlsx/download/node-xlsx-0.15.0.tgz\",\n+ \"integrity\": \"sha1-HxsNetzlxwboa/2WpaoABb+KncM=\",\n+ \"requires\": {\n+ \"buffer-from\": \"^1.1.0\",\n+ \"xlsx\": \"^0.14.1\"\n+ },\n+ \"dependencies\": {\n+ \"commander\": {\n+ \"version\": \"2.17.1\",\n+ \"resolved\": \"https://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1587781810870&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.17.1.tgz\",\n+ \"integrity\": \"sha1-vXerfebelCBc6sxy8XFtKfIKd78=\"\n+ },\n+ \"xlsx\": {\n+ \"version\": \"0.14.5\",\n+ \"resolved\": \"https://registry.npm.taobao.org/xlsx/download/xlsx-0.14.5.tgz?cache=0&sync_timestamp=1584260308730&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxlsx%2Fdownload%2Fxlsx-0.14.5.tgz\",\n+ \"integrity\": \"sha1-NjfpFNeRvcpzgoFuFz99cl7Q4NI=\",\n+ \"requires\": {\n+ \"adler-32\": \"~1.2.0\",\n+ \"cfb\": \"^1.1.2\",\n+ \"codepage\": \"~1.14.0\",\n+ \"commander\": \"~2.17.1\",\n+ \"crc-32\": \"~1.2.0\",\n+ \"exit-on-epipe\": \"~1.0.1\",\n+ \"ssf\": \"~0.10.2\"\n+ }\n+ }\n+ }\n+ },\n\"oauth-sign\": {\n\"version\": \"0.9.0\",\n\"resolved\": \"https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz\",\n}\n}\n},\n+ \"printj\": {\n+ \"version\": \"1.1.2\",\n+ \"resolved\": \"https://registry.npm.taobao.org/printj/download/printj-1.1.2.tgz\",\n+ \"integrity\": \"sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI=\"\n+ },\n\"process-nextick-args\": {\n\"version\": \"2.0.1\",\n\"resolved\": \"https://registry.npm.taobao.org/process-nextick-args/download/process-nextick-args-2.0.1.tgz\",\n},\n\"sprintf-js\": {\n\"version\": \"1.0.3\",\n- \"resolved\": \"https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz\",\n+ \"resolved\": \"https://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.0.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsprintf-js%2Fdownload%2Fsprintf-js-1.0.3.tgz\",\n\"integrity\": \"sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=\",\n\"dev\": true\n},\n\"resolved\": \"https://registry.npm.taobao.org/sqlstring/download/sqlstring-2.3.1.tgz?cache=0&sync_timestamp=1587004209757&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsqlstring%2Fdownload%2Fsqlstring-2.3.1.tgz\",\n\"integrity\": \"sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A=\"\n},\n+ \"ssf\": {\n+ \"version\": \"0.10.3\",\n+ \"resolved\": \"https://registry.npm.taobao.org/ssf/download/ssf-0.10.3.tgz\",\n+ \"integrity\": \"sha1-jq4fwpyQpVLnkhII+BiS1vd6yys=\",\n+ \"requires\": {\n+ \"frac\": \"~1.1.2\"\n+ }\n+ },\n\"sshpk\": {\n\"version\": \"1.16.1\",\n\"resolved\": \"https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz\",\n},\n\"ssh2\": {\n\"version\": \"0.5.4\",\n- \"resolved\": \"https://registry.npmjs.org/ssh2/-/ssh2-0.5.4.tgz\",\n+ \"resolved\": \"https://registry.npm.taobao.org/ssh2/download/ssh2-0.5.4.tgz\",\n\"integrity\": \"sha1-G/a2soyW6u8mf01sRqWiUXpZnic=\",\n\"requires\": {\n\"ssh2-streams\": \"~0.1.15\"\n},\n\"ssh2-streams\": {\n\"version\": \"0.1.20\",\n- \"resolved\": \"https://registry.npmjs.org/ssh2-streams/-/ssh2-streams-0.1.20.tgz\",\n+ \"resolved\": \"https://registry.npm.taobao.org/ssh2-streams/download/ssh2-streams-0.1.20.tgz\",\n\"integrity\": \"sha1-URGNFUVV31Rp7h9n4M8efoosDjo=\",\n\"requires\": {\n\"asn1\": \"~0.2.0\",\n\"https-proxy-agent\": \"^2.2.1\"\n}\n},\n+ \"wmf\": {\n+ \"version\": \"1.0.2\",\n+ \"resolved\": \"https://registry.npm.taobao.org/wmf/download/wmf-1.0.2.tgz\",\n+ \"integrity\": \"sha1-fRnWIQcaCMK9xrfmiKnENSmMwto=\"\n+ },\n\"wrappy\": {\n\"version\": \"1.0.2\",\n\"resolved\": \"https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz\",\n\"integrity\": \"sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=\",\n\"dev\": true\n},\n+ \"xlsx\": {\n+ \"version\": \"0.15.6\",\n+ \"resolved\": \"https://registry.npm.taobao.org/xlsx/download/xlsx-0.15.6.tgz?cache=0&sync_timestamp=1584260308730&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxlsx%2Fdownload%2Fxlsx-0.15.6.tgz\",\n+ \"integrity\": \"sha1-Rh+EHW2eoag3XizSRr8jrs4IodU=\",\n+ \"requires\": {\n+ \"adler-32\": \"~1.2.0\",\n+ \"cfb\": \"^1.1.4\",\n+ \"codepage\": \"~1.14.0\",\n+ \"commander\": \"~2.17.1\",\n+ \"crc-32\": \"~1.2.0\",\n+ \"exit-on-epipe\": \"~1.0.1\",\n+ \"ssf\": \"~0.10.3\",\n+ \"wmf\": \"~1.0.1\"\n+ },\n+ \"dependencies\": {\n+ \"commander\": {\n+ \"version\": \"2.17.1\",\n+ \"resolved\": \"https://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1587781810870&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.17.1.tgz\",\n+ \"integrity\": \"sha1-vXerfebelCBc6sxy8XFtKfIKd78=\"\n+ }\n+ }\n+ },\n\"yallist\": {\n\"version\": \"3.1.1\",\n\"resolved\": \"https://registry.npm.taobao.org/yallist/download/yallist-3.1.1.tgz\",\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"tslint\": \"tslint -t verbose src/**/*.ts\"\n},\n\"devDependencies\": {\n+ \"@types/async-lock\": \"^1.1.2\",\n\"@types/mockjs\": \"^1.0.2\",\n\"@types/mysql\": \"^2.15.10\",\n\"@types/node\": \"^7.10.10\",\n\"@types/ssh2\": \"^0.5.43\",\n\"tslint\": \"^5.8.0\",\n\"typescript\": \"^3.8.3\",\n- \"@types/async-lock\": \"^1.1.2\",\n\"vscode\": \"^1.1.36\"\n},\n\"dependencies\": {\n\"mockjs\": \"^1.1.0\",\n\"mysql\": \"^2.18.1\",\n\"mysqldump\": \"^3.1.0\",\n+ \"node-xlsx\": \"^0.15.0\",\n\"portfinder\": \"^1.0.26\",\n\"sql-formatter\": \"^2.3.3\",\n\"tunnel-ssh\": \"^4.1.4\"\n" }, { "change_type": "MODIFY", "old_path": "resources/webview/pages/result/components/toolbar.html", "new_path": "resources/webview/pages/result/components/toolbar.html", "diff": "<el-table-column fixed=\"left\" label=\"Operations\" width=\"130\" v-if=\"result.primaryKey\" align=\"center\">\n<template slot-scope=\"scope\">\n<div v-if=\"scope.row.isFilter\" style=\"text-align: center;\">\n+ <el-button @click=\"exportData()\" type=\"primary\" size=\"small\" icon=\"el-icon-orange\" circle title=\"Export\"></el-button>\n<el-popover placement=\"bottom\" title=\"Select columns to show\" width=\"200\" trigger=\"click\">\n<el-checkbox-group v-model=\"toolbar.showColumns\">\n<el-checkbox v-for=\"(column,index) in result.fields\" :label=\"column.name\" :key=\"index\">\n</el-button>\n</el-popover>\n<el-button @click=\"resetFilter\" title=\"Reset filter\" type=\"warning\" size=\"small\" icon=\"el-icon-refresh\"\n- circle title=\"Reset\">\n+ circle>\n</el-button>\n</div>\n<div v-if=\"scope.row[result.primaryKey]\">\n" }, { "change_type": "MODIFY", "old_path": "resources/webview/pages/result/index.html", "new_path": "resources/webview/pages/result/index.html", "diff": "}\n},\nmethods: {\n+ exportData() {\n+ this.$confirm('Export without limit?', 'Export', {\n+ confirmButtonText: 'Yes',\n+ cancelButtonText: 'No',\n+ type: 'warning'\n+ }).then(() => {\n+ vscode.postMessage({\n+ type: 'export',\n+ sql: this.result.sql.replace(/\\blimit\\b.+/ig, '')\n+ });\n+ }).catch(() => {\n+ vscode.postMessage({\n+ type: 'export',\n+ sql: this.result.sql\n+ });\n+ });\n+\n+ },\nfilter(event, column) {\nlet inputvalue = \"\" + event.target.value\n" }, { "change_type": "MODIFY", "old_path": "src/common/constants.ts", "new_path": "src/common/constants.ts", "diff": "@@ -15,12 +15,12 @@ export class Pattern {\nexport class OperateType {\npublic static execute = 'execute';\n+ public static export = 'export';\npublic static init = 'init';\npublic static previous = 2;\npublic static next = 3;\npublic static save = 4;\npublic static delete = 5;\n- public static export = 6;\n}\nexport enum CacheKey {\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/service/export/abstractExportService.ts", "diff": "+import * as vscode from \"vscode\";\n+import { ExportService } from \"./exportService\";\n+import { FieldInfo } from \"mysql\";\n+import * as fs from \"fs\";\n+import { Console } from \"../../common/outputChannel\";\n+\n+export abstract class AbstractExportService implements ExportService {\n+ public export(sql: string): void {\n+ vscode.window.showOpenDialog({ canSelectMany: false, openLabel: \"Select export file path\", canSelectFiles: false, canSelectFolders: true }).then((folderPath) => {\n+ if (folderPath) {\n+ this.exportExcel(folderPath[0].fsPath, sql)\n+ }\n+ });\n+ }\n+\n+\n+ protected abstract exportExcel(folderPath: string, sql: string): void;\n+\n+ protected exportByNodeXlsx(folderPath: string, fields: FieldInfo[], rows: any) {\n+ const nodeXlsx = require('node-xlsx');\n+ fs.writeFileSync(`${folderPath}/${new Date().getTime()}.xlsx`, nodeXlsx.build([{\n+ name: \"sheet1\",\n+ data: [\n+ fields.map((field) => field.name),\n+ ...rows.map((row) => {\n+ const values = [];\n+ for (const key in row) {\n+ values.push(row[key]);\n+ }\n+ return values;\n+ })\n+ ]\n+ }]), \"binary\");\n+ Console.log(\"export success!\")\n+ }\n+\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/service/export/exportService.ts", "diff": "+export interface ExportService {\n+ export(sql: string): void;\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/service/export/impl/mysqlExportService.ts", "diff": "+import { FieldInfo } from \"mysql\";\n+import { Console } from \"../../../common/outputChannel\";\n+import { ConnectionManager } from \"../../connectionManager\";\n+import { AbstractExportService } from \"../abstractExportService\";\n+\n+export class MysqlExportService extends AbstractExportService {\n+\n+ protected async exportExcel(folderPath: string, sql: string) {\n+\n+ const connection = await ConnectionManager.getConnection(ConnectionManager.getLastConnectionOption())\n+ connection.query(sql, (err, rows, fields?: FieldInfo[]) => {\n+ if (err) {\n+ Console.log(err)\n+ return;\n+ }\n+ super.exportByNodeXlsx(folderPath, fields, rows);\n+ })\n+\n+ }\n+\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/view/result/query.ts", "new_path": "src/view/result/query.ts", "diff": "@@ -6,6 +6,8 @@ import { QueryUnit } from \"../../service/queryUnit\";\nimport { ViewManager } from \"../viewManager\";\nimport { DataResponse } from \"./queryResponse\";\nimport { Global } from \"../../common/global\";\n+import { ExportService } from \"../../service/export/exportService\";\n+import { MysqlExportService } from \"../../service/export/impl/mysqlExportService\";\nexport class QueryParam<T> {\n/**\n@@ -18,6 +20,8 @@ export class QueryParam<T> {\nexport class QueryPage {\n+ private static exportService: ExportService = new MysqlExportService()\n+\npublic static async send(queryParam: QueryParam<any>) {\nswitch (queryParam.type) {\n@@ -44,6 +48,9 @@ export class QueryPage {\ncase OperateType.execute:\nQueryUnit.runQuery(params.sql);\nbreak;\n+ case OperateType.export:\n+ this.exportService.export(params.sql)\n+ break;\n}\n}\n});\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
support export data
141,908
29.04.2020 23:12:03
-28,800
466d0c852992bf217ce6a38539368b52e74104e2
update to 1.9.5
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"1.9.4\",\n+ \"version\": \"1.9.5\",\n\"publisher\": \"cweijan\",\n\"icon\": \"logo.png\",\n\"engines\": {\n\"mockjs\": \"^1.1.0\",\n\"mysql\": \"^2.18.1\",\n\"mysqldump\": \"^3.1.0\",\n- \"node-xlsx\": \"^0.15.0\",\n\"portfinder\": \"^1.0.26\",\n\"sql-formatter\": \"^2.3.3\",\n\"tunnel-ssh\": \"^4.1.4\"\n" }, { "change_type": "MODIFY", "old_path": "resources/webview/pages/result/components/toolbar.html", "new_path": "resources/webview/pages/result/components/toolbar.html", "diff": "<el-table-column fixed=\"left\" label=\"Operations\" width=\"130\" v-if=\"result.primaryKey\" align=\"center\">\n<template slot-scope=\"scope\">\n<div v-if=\"scope.row.isFilter\" style=\"text-align: center;\">\n- <el-button @click=\"exportData()\" type=\"primary\" size=\"small\" icon=\"el-icon-orange\" circle title=\"Export\"></el-button>\n+ <!-- <el-button @click=\"exportData()\" type=\"primary\" size=\"small\" icon=\"el-icon-orange\" circle title=\"Export\"></el-button> -->\n<el-popover placement=\"bottom\" title=\"Select columns to show\" width=\"200\" trigger=\"click\">\n<el-checkbox-group v-model=\"toolbar.showColumns\">\n<el-checkbox v-for=\"(column,index) in result.fields\" :label=\"column.name\" :key=\"index\">\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 1.9.5
141,908
30.04.2020 12:22:30
-28,800
478a18b3ab7f72afc8f0f44f65b6522d96f77f81
support show buffer data
[ { "change_type": "MODIFY", "old_path": "resources/webview/pages/result/index.html", "new_path": "resources/webview/pages/result/index.html", "diff": "},\ndataformat0(origin) {\nif (origin == null) return null;\n- // bit\n-\nif (origin.hasOwnProperty('type')) {\n- return origin.data[0];\n+ return String.fromCharCode.apply(null, new Uint16Array(origin.data))\n}\nif (Date.parse(origin)) {\nreturn origin.toString().replace(\"T\", \" \").replace(/\\.\\d+Z$/, \"\")\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
support show buffer data
141,908
30.04.2020 12:24:57
-28,800
05bc6c4a4dbee52d3f630a01f7b9a6c143847490
support binary type
[ { "change_type": "MODIFY", "old_path": "resources/webview/pages/result/index.html", "new_path": "resources/webview/pages/result/index.html", "diff": "case \"varchar\": case \"char\": case \"date\": case \"time\": case \"timestamp\": case \"datetime\": case \"set\": case \"json\":\nreturn `'${value}'`\ndefault:\n- if (type.indexOf(\"text\") != -1 || type.indexOf(\"blob\") != -1) { return `'${value}'` }\n+ if (type.indexOf(\"text\") != -1 || type.indexOf(\"blob\") != -1 || type.indexOf(\"binary\") != -1) { return `'${value}'` }\n}\nreturn value;\n},\n" }, { "change_type": "MODIFY", "old_path": "src/service/mock/mockRunner.ts", "new_path": "src/service/mock/mockRunner.ts", "diff": "@@ -108,7 +108,7 @@ export class MockRunner {\ncase \"varchar\": case \"char\": case \"date\": case \"time\": case \"timestamp\": case \"datetime\": case \"set\": case \"json\":\nreturn `'${value}'`\ndefault:\n- if (type.indexOf(\"text\") != -1 || type.indexOf(\"blob\") != -1) { return `'${value}'` }\n+ if (type.indexOf(\"text\") != -1 || type.indexOf(\"blob\") != -1 || type.indexOf(\"binary\") != -1) { return `'${value}'` }\n}\nreturn value;\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
support binary type
141,908
30.04.2020 21:19:52
-28,800
eeb11f882092e51c81c83c8eddc3c7fa057b5819
add new keyword
[ { "change_type": "MODIFY", "old_path": "src/provider/Complection/chain/keywordChain.ts", "new_path": "src/provider/Complection/chain/keywordChain.ts", "diff": "@@ -3,7 +3,7 @@ import { ComplectionChain, ComplectionContext } from \"../complectionContext\";\nexport class KeywordChain implements ComplectionChain {\n- private keywordList: string[] = [\"JOIN\", \"AND\", \"OR\", \"SELECT\", \"SET\", \"UPDATE\", \"DELETE\", \"TABLE\", \"INSERT\", \"INTO\", \"VALUES\", \"FROM\", \"WHERE\", \"GROUP BY\", \"ORDER BY\", \"HAVING\", \"LIMIT\", \"ALTER\", \"CREATE\", \"DROP\", \"FUNCTION\", \"CASE\", \"PROCEDURE\", \"TRIGGER\", \"INDEX\", \"CHANGE\", \"COLUMN\", \"ADD\", 'SHOW', \"PRIVILEGES\", \"IDENTIFIED\", \"VIEW\", \"CURSOR\", \"EXPLAIN\", \"rollback\", , \"COMMENT\", \"rollback\", \"commit\", \"begin\", \"DELIMITER\", \"CALL\"];\n+ private keywordList: string[] = [\"JOIN\", \"AND\", \"OR\", \"SELECT\", \"SET\", \"UPDATE\", \"DELETE\", \"TABLE\", \"INSERT\", \"INTO\", \"VALUES\", \"FROM\", \"WHERE\", \"GROUP BY\", \"ORDER BY\", \"HAVING\", \"LIMIT\", \"ALTER\", \"CREATE\", \"DROP\", \"FUNCTION\", \"CASE\", \"PROCEDURE\", \"TRIGGER\", \"INDEX\", \"CHANGE\", \"COLUMN\", \"ADD\", 'SHOW', \"PRIVILEGES\", \"IDENTIFIED\", \"VIEW\", \"CURSOR\", \"EXPLAIN\", \"rollback\", , \"COMMENT\", \"rollback\", \"commit\", \"begin\", \"DELIMITER\", \"CALL\", \"REFERENCES\"];\nprivate keywordComplectionItems: vscode.CompletionItem[] = [];\nconstructor() {\n" }, { "change_type": "MODIFY", "old_path": "src/provider/Complection/chain/tableCreatingChain.ts", "new_path": "src/provider/Complection/chain/tableCreatingChain.ts", "diff": "@@ -3,8 +3,8 @@ import { ComplectionChain, ComplectionContext } from \"../complectionContext\";\nexport class TableCreateChain implements ComplectionChain {\n- private tableKeywordList: string[] = [\"AUTO_INCREMENT\", \"NULL\", \"NOT\", \"PRIMARY\", \"CURRENT_TIME\",\n- \"DEFAULT\", \"COMMENT\", \"UNIQUE\", \"KEY\", \"FOREIGN\", \"CASCADE\", \"RESTRICT\", \"UNSIGNED\"];\n+ private tableKeywordList: string[] = [\"AUTO_INCREMENT\", \"NULL\", \"NOT\", \"PRIMARY\", \"CURRENT_TIME\", \"REFERENCES\",\n+ \"DEFAULT\", \"COMMENT\", \"UNIQUE\", \"KEY\", \"FOREIGN\", \"CASCADE\", \"RESTRICT\", \"UNSIGNED\", \"CURRENT_TIMESTAMP\"];\nprivate tableKeywordComplectionItems: vscode.CompletionItem[] = [];\nconstructor() {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
add new keyword
141,908
30.04.2020 21:36:36
-28,800
19b1f8da0d2eb896f6dcdbd8d4eb83a5e76c2efa
keyword column wrap quote
[ { "change_type": "MODIFY", "old_path": "resources/webview/pages/result/index.html", "new_path": "resources/webview/pages/result/index.html", "diff": "for (const key in this.update.currentNew) {\nconst newEle = this.update.currentNew[key];\nif (newEle) {\n- columns += `${key},`;\n+ columns += `${this.wrap(key)},`;\nvalues += `${this.wrapQuote(key, newEle)},`;\n}\n}\nconst oldEle = this.update.current[key];\nconst newEle = this.update.currentNew[key];\nif (oldEle != newEle) {\n- change += `${key}=${this.wrapQuote(key, newEle)},`\n+ change += `${this.wrap(key)}=${this.wrapQuote(key, newEle)},`\n}\n}\nif (change) {\n}\nreturn origin;\n},\n+ wrap(origin) {\n+ if (origin == null) { return origin; }\n+\n+ if (origin.match(/\\b[-\\.]\\b/ig)\n+ || origin.match(/^(if|key|desc|length)$/i)) {\n+ return `\\`${origin}\\``;\n+ }\n+\n+ return origin;\n+ },\ndataformat(origin) {\nif (origin == undefined || origin == null) {\n" }, { "change_type": "MODIFY", "old_path": "src/common/util.ts", "new_path": "src/common/util.ts", "diff": "@@ -26,7 +26,7 @@ export class Util {\nif (origin == null) { return origin; }\nif (origin.match(/\\b[-\\.]\\b/ig)\n- || origin.match(/^(if|key|name|user|desc|length)$/i)) {\n+ || origin.match(/^(if|key|desc|length)$/i)) {\nreturn `\\`${origin}\\``;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/model/main/tableNode.ts", "new_path": "src/model/main/tableNode.ts", "diff": "@@ -131,7 +131,7 @@ ADD\nthis\n.getChildren()\n.then((children: Node[]) => {\n- const childrenNames = children.map((child: any) => \"\\n \" + child.column.name);\n+ const childrenNames = children.map((child: any) => \"\\n \" + Util.wrap(child.column.name));\nconst childrenValues = children.map((child: any) => \"\\n $\" + child.column.name);\nlet sql = `insert into \\n ${Util.wrap(this.database)}.${Util.wrap(this.table)} `;\nsql += `(${childrenNames.toString().replace(/,/g, \", \")}\\n )\\n`;\n@@ -151,7 +151,7 @@ ADD\n.then((children: Node[]) => {\nconst keysNames = children.filter((child: any) => child.column.key).map((child: any) => child.column.name);\n- const where = keysNames.map((name: string) => `${name} = ${name}`);\n+ const where = keysNames.map((name: string) => `${Util.wrap(name)} = \\$${name}`);\nlet sql = `delete from \\n ${Util.wrap(this.database)}.${Util.wrap(this.table)} \\n`;\nsql += `where \\n ${where.toString().replace(/,/g, \"\\n and\")}`;\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
keyword column wrap quote
141,908
30.04.2020 21:51:12
-28,800
56dcf4c88dfc665c8e23f4b7278edf617b8dd933
change connection when single db
[ { "change_type": "MODIFY", "old_path": "src/model/database/connectionNode.ts", "new_path": "src/model/database/connectionNode.ts", "diff": "@@ -98,13 +98,18 @@ export class ConnectionNode extends Node {\nconst key = `${lcp.getConnectId()}`;\nawait FileManager.show(`${key}.sql`);\nconst dbNameList = DatabaseCache.getDatabaseListOfConnection(key).filter((databaseNode) => !(databaseNode instanceof UserGroup)).map((databaseNode) => databaseNode.database);\n- await vscode.window.showQuickPick(dbNameList, { placeHolder: \"active database\" }).then(async (dbName) => {\n+ let dbName;\n+ if (dbNameList.length == 1) {\n+ dbName = dbNameList[0]\n+ }\n+ if (dbNameList.length > 1) {\n+ dbName = await vscode.window.showQuickPick(dbNameList, { placeHolder: \"active database\" })\n+ }\nif (dbName) {\nawait ConnectionManager.getConnection({\n...lcp, database: dbName, getConnectId: lcp.getConnectId\n} as Node, true);\n}\n- });\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/model/nodeUtil.ts", "new_path": "src/model/nodeUtil.ts", "diff": "@@ -3,7 +3,7 @@ import { ConnectionManager } from \"../service/connectionManager\";\nexport abstract class NodeUtil {\npublic static of(node: any): Node {\n- if (node && !node.getConnectId) {\n+ if (node && !(node instanceof Node)) {\nnode.__proto__ = Node.prototype\n}\nreturn node;\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
change connection when single db
141,908
30.04.2020 22:33:07
-28,800
1de1ba70d494c98df80695faf8aa1cc6998756e3
notice when connect fail
[ { "change_type": "MODIFY", "old_path": "src/model/database/connectionNode.ts", "new_path": "src/model/database/connectionNode.ts", "diff": "@@ -12,6 +12,7 @@ import { Node } from \"../interface/node\";\nimport { InfoNode } from \"../other/infoNode\";\nimport { DatabaseNode } from \"./databaseNode\";\nimport { UserGroup } from \"./userGroup\";\n+import { Connection } from \"mysql\";\nexport class ConnectionNode extends Node {\n@@ -29,7 +30,14 @@ export class ConnectionNode extends Node {\nreturn databaseNodes;\n}\n- return QueryUnit.queryPromise<any[]>(await ConnectionManager.getConnection(this), \"show databases\")\n+ let connection: Connection;\n+ try {\n+ connection = await ConnectionManager.getConnection(this);\n+ } catch (err) {\n+ return [new InfoNode(err)];\n+ }\n+\n+ return QueryUnit.queryPromise<any[]>(connection, \"show databases\")\n.then((databases) => {\ndatabaseNodes = databases.filter((db) => {\nif (this.database) {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
notice when connect fail
141,908
30.04.2020 23:38:39
-28,800
12b5a08b9b6c7690ac04898ba553b135503a24e8
support load next page data
[ { "change_type": "MODIFY", "old_path": "resources/webview/pages/result/index.html", "new_path": "resources/webview/pages/result/index.html", "diff": "database: null,\ntable: null\n},\n+ page: {\n+ pageNum: 1,\n+ pageSize: -1,\n+ isEnd: false,\n+ lock: false\n+ },\ntable: {\nsearch: '',\nloading: true,\nreturn origin;\n},\n+ nextPage() {\n+ if (this.page.isEnd || this.page.lock) return;\n+ console.log('next')\n+ vscode.postMessage({\n+ type: 'next',\n+ sql: this.result.sql,\n+ pageNum: ++this.page.pageNum,\n+ pageSize: this.page.pageSize\n+ });\n+ this.page.lock = true\n+ },\ndataformat(origin) {\nif (origin == undefined || origin == null) {\nvue.table.widthItem = {}\nvue.result = data;\nvue.table.loading = false\n+ vue.page.pageNum = 1\n+ vue.page.isEnd = false\n+ vue.page.lock = false\n+ vue.page.pageSize = data.pageSize\nif (!data.sql.match(/\\bwhere\\b/ig)) {\n// clear filter\nvue.toolbar.filter = {}\ncase \"DATA\":\nhandlerData(response)\nbreak;\n+ case \"NEXT_PAGE\":\n+ if (response.data && response.data.length > 0) {\n+ vue.result.data.push(...response.data)\n+ } else {\n+ vue.page.isEnd = true;\n+ }\n+ vue.page.lock = false\n+ break;\ncase \"DML\":\ncase \"DDL\":\nhandlerCommon(response)\n}\n});\nvscode.postMessage({ type: 'init' })\n- setInterval(() => {\n- // vue.updateWidth()\n- }, 100)\n+ window.addEventListener('scroll', function () {\n+ if ((document.body.offsetHeight - document.documentElement.scrollTop - document.documentElement.clientHeight) <= 200) {\n+ vue.nextPage()\n+ }\n+ });\n</script>\n</html>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/common/constants.ts", "new_path": "src/common/constants.ts", "diff": "@@ -13,14 +13,9 @@ export class Pattern {\npublic static MULTI_PATTERN = /\\b(TRIGGER|PROCEDURE|FUNCTION)\\b/ig\n}\n-export class OperateType {\n- public static execute = 'execute';\n- public static export = 'export';\n- public static init = 'init';\n- public static previous = 2;\n- public static next = 3;\n- public static save = 4;\n- public static delete = 5;\n+export enum OperateType {\n+ execute = 'execute', export = 'export',\n+ next = 'next', init = 'init'\n}\nexport enum CacheKey {\n@@ -64,7 +59,8 @@ export enum MessageType {\nDDL = 'DDL',\nERROR = \"ERROR\",\nRUN = \"RUN\",\n- MESSAGE = \"MESSAGE\"\n+ MESSAGE = \"MESSAGE\",\n+ NEXT_PAGE = \"NEXT_PAGE\"\n}\nexport enum Template {\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/service/page/impl/mysqlPageSerivce.ts", "diff": "+import { AbstractPageSerivce } from \"../pageService\";\n+\n+export class MysqlPageSerivce extends AbstractPageSerivce {\n+\n+ protected buildPageSql(sql: string, start: number, limit: number): string {\n+\n+ const paginationSql = `LIMIT ${start},${limit}`;\n+ if (sql.match(/\\blimit\\b/i)) {\n+ return sql.replace(/\\blimit\\b.+/ig, paginationSql)\n+ }\n+\n+ return `${sql} ${paginationSql}`\n+\n+ }\n+\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/service/page/pageService.ts", "diff": "+\n+export interface PageService {\n+ /**\n+ * build page sql\n+ * @param sql\n+ * @param page\n+ * @param pageSize\n+ * @return paginationSql\n+ */\n+ build(sql: string, page: number, pageSize: number): string;\n+}\n+\n+export abstract class AbstractPageSerivce implements PageService {\n+\n+ public build(sql: string, page: number, pageSize: number): string {\n+\n+ if (!sql) {\n+ throw new Error(\"Not support empty sql!\");\n+ }\n+\n+ if (!pageSize) {\n+ pageSize = 100;\n+ }\n+\n+ let start = 0;\n+ if (page) {\n+ start = (page - 1) * pageSize;\n+ }\n+\n+ return this.buildPageSql(sql, start, pageSize)\n+ }\n+\n+ protected abstract buildPageSql(sql: string, start: number, limit: number): string;\n+\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/service/queryUnit.ts", "new_path": "src/service/queryUnit.ts", "diff": "@@ -107,7 +107,7 @@ export class QueryUnit {\nreturn;\n}\nif (Array.isArray(data)) {\n- QueryPage.send({ type: MessageType.DATA, connection: connectionNode, res: { sql, costTime, data, fields } as DataResponse });\n+ QueryPage.send({ type: MessageType.DATA, connection: connectionNode, res: { sql, costTime, data, fields, pageSize: 100 } as DataResponse });\nreturn;\n}\nQueryPage.send({ type: MessageType.MESSAGE, res: { message: `Execute sql success : ${sql}`, costTime, success: true } as MessageResponse });\n" }, { "change_type": "MODIFY", "old_path": "src/view/result/query.ts", "new_path": "src/view/result/query.ts", "diff": "+import * as mysql from \"mysql\";\nimport { MessageType, OperateType, ConfigKey } from \"../../common/constants\";\nimport { Node } from \"../../model/interface/node\";\nimport { ColumnNode } from \"../../model/other/columnNode\";\n@@ -8,6 +9,9 @@ import { DataResponse } from \"./queryResponse\";\nimport { Global } from \"../../common/global\";\nimport { ExportService } from \"../../service/export/exportService\";\nimport { MysqlExportService } from \"../../service/export/impl/mysqlExportService\";\n+import { PageService } from \"../../service/page/pageService\";\n+import { MysqlPageSerivce } from \"../../service/page/impl/mysqlPageSerivce\";\n+import { ConnectionManager } from \"../../service/connectionManager\";\nexport class QueryParam<T> {\n/**\n@@ -21,6 +25,7 @@ export class QueryParam<T> {\nexport class QueryPage {\nprivate static exportService: ExportService = new MysqlExportService()\n+ private static pageService: PageService = new MysqlPageSerivce()\npublic static async send(queryParam: QueryParam<any>) {\n@@ -48,6 +53,13 @@ export class QueryPage {\ncase OperateType.execute:\nQueryUnit.runQuery(params.sql);\nbreak;\n+ case OperateType.next:\n+ const sql = this.pageService.build(params.sql, params.pageNum, params.pageSize)\n+ const connection = await ConnectionManager.getConnection(ConnectionManager.getLastConnectionOption())\n+ QueryUnit.queryPromise(connection, sql).then((rows) => {\n+ QueryPage.send({ type: MessageType.NEXT_PAGE, res: { sql, data: rows } as DataResponse });\n+ })\n+ break;\ncase OperateType.export:\nthis.exportService.export(params.sql)\nbreak;\n" }, { "change_type": "MODIFY", "old_path": "src/view/result/queryResponse.ts", "new_path": "src/view/result/queryResponse.ts", "diff": "@@ -18,6 +18,7 @@ export class DataResponse {\npublic table: string | null;\npublic data: any[];\npublic fields: mysql.FieldInfo[];\n+ public pageSize: number;\n}\nexport class ErrorResponse {\npublic sql: string;\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
support load next page data
141,908
01.05.2020 00:24:24
-28,800
bd6c95d87da73992cbb626fd54f7e2af3cb31a83
support create new sql file
[ { "change_type": "MODIFY", "old_path": "src/extension.ts", "new_path": "src/extension.ts", "diff": "@@ -21,11 +21,12 @@ import { Console } from \"./common/outputChannel\";\n// Don't change last order, it will occur circular reference\nimport { ServiceManager } from \"./service/serviceManager\";\nimport { QueryUnit } from \"./service/queryUnit\";\n+import { FileManager } from \"./common/filesManager\";\nexport function activate(context: vscode.ExtensionContext) {\nconst serviceManager = new ServiceManager(context)\n-\n+ ConnectionNode.init()\ncontext.subscriptions.push(\n...serviceManager.init(),\n...initCommand({\n@@ -96,11 +97,7 @@ export function activate(context: vscode.ExtensionContext) {\nif (databaseOrConnectionNode) {\ndatabaseOrConnectionNode.newQuery();\n} else {\n- // TODO\n- // await vscode.window.showTextDocument(\n- // await vscode.workspace.openTextDocument(await FileManager.record(`sql/${new Date().getTime()}.sql`, null, FileModel.WRITE))\n- // );\n- ConnectionNode.tryOpenQuery();\n+ FileManager.show(`sql/${new Date().getTime()}.sql`)\n}\n},\n\"mysql.template.sql\": (tableNode: TableNode, run: boolean) => {\n" }, { "change_type": "MODIFY", "old_path": "src/model/database/connectionNode.ts", "new_path": "src/model/database/connectionNode.ts", "diff": "@@ -98,6 +98,8 @@ export class ConnectionNode extends Node {\n});\n}\n+ public static init() { }\n+\npublic static async tryOpenQuery() {\nconst lcp = ConnectionManager.getLastConnectionOption();\nif (!lcp) {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
support create new sql file
141,908
01.05.2020 00:25:08
-28,800
71a07da1a079b9358c9fc77d5de99c81950af240
update to 1.9.6
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"1.9.5\",\n+ \"version\": \"1.9.6\",\n\"publisher\": \"cweijan\",\n\"icon\": \"logo.png\",\n\"engines\": {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 1.9.6
141,908
01.05.2020 00:53:41
-28,800
bcb3412556ed2c6793fd37f0e428a04fb88f9be5
highlight active database
[ { "change_type": "ADD", "old_path": null, "new_path": "resources/icon/database-active.svg", "diff": "+<?xml version=\"1.0\" standalone=\"no\"?><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg t=\"1588265263529\" class=\"icon\" viewBox=\"0 0 1238 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2164\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"241.796875\" height=\"200\"><defs><style type=\"text/css\"></style></defs><path d=\"M1236.232258 263.432258v474.012903c0 72.670968-137.909677 132.129032-308.025806 132.129033-124.696774 0-231.225806-31.380645-279.948387-76.8-18.167742-16.516129-28.077419-35.509677-28.07742-55.329033V263.432258C620.180645 190.76129 758.090323 131.303226 929.032258 131.303226c169.290323 0 307.2 59.458065 307.2 132.129032z\" fill=\"#3973F4\" p-id=\"2165\"></path><path d=\"M621.006452 260.129032a307.2 128 0 1 0 614.4 0 307.2 128 0 1 0-614.4 0Z\" fill=\"#4988FD\" p-id=\"2166\"></path><path d=\"M1236.232258 418.683871v30.554839C1197.419355 506.219355 1075.2 547.509677 928.206452 547.509677c-146.167742 0-269.212903-41.290323-308.025807-98.270967v-31.380645c10.735484 65.23871 146.993548 117.264516 308.025807 117.264516 162.683871 0 297.290323-51.2 308.025806-116.43871zM1236.232258 584.670968v30.554838C1197.419355 672.206452 1075.2 713.496774 928.206452 713.496774c-146.167742 0-269.212903-41.290323-308.025807-98.270968v-31.380645c10.735484 65.23871 146.993548 117.264516 308.025807 117.264516 162.683871 0 297.290323-51.2 308.025806-116.438709z\" fill=\"#2767F4\" p-id=\"2167\"></path><path d=\"M853.883871 188.283871v649.909677c0 99.922581-189.935484 181.677419-423.63871 181.67742-170.941935 0-317.935484-42.941935-384.825806-105.703226-24.774194-23.122581-38.812903-48.722581-38.812903-75.974194V188.283871c0-99.922581 189.935484-181.677419 423.638709-181.677419 233.703226 0.825806 423.63871 81.754839 423.63871 181.677419z\" fill=\"#4988FD\" p-id=\"2168\"></path><path d=\"M8.258065 184.154839a421.987097 175.896774 0 1 0 843.974193 0 421.987097 175.896774 0 1 0-843.974193 0Z\" fill=\"#6097FD\" p-id=\"2169\"></path><path d=\"M853.883871 402.167742v42.116129c-53.677419 78.451613-221.316129 134.606452-423.63871 134.606452-200.670968 0-369.96129-56.154839-423.638709-134.606452v-42.941936c14.03871 89.187097 201.496774 161.032258 423.638709 161.032259 222.967742 0 407.948387-71.019355 423.63871-160.206452zM853.883871 629.264516v42.116129c-53.677419 78.451613-221.316129 134.606452-423.63871 134.606452-200.670968 0-369.96129-56.154839-423.638709-134.606452v-42.941935c14.03871 89.187097 201.496774 161.032258 423.638709 161.032258 222.967742 0 407.948387-71.019355 423.63871-160.206452z\" fill=\"#3973F4\" p-id=\"2170\"></path><path d=\"M51.2 391.432258a28.903226 24.774194 90 1 0 49.548387 0 28.903226 24.774194 90 1 0-49.548387 0Z\" fill=\"#FFFFFF\" p-id=\"2171\"></path><path d=\"M130.477419 427.767742a28.903226 24.774194 90 1 0 49.548387 0 28.903226 24.774194 90 1 0-49.548387 0Z\" fill=\"#21D3AC\" p-id=\"2172\"></path><path d=\"M51.2 616.051613a28.903226 24.774194 90 1 0 49.548387 0 28.903226 24.774194 90 1 0-49.548387 0Z\" fill=\"#FFFFFF\" p-id=\"2173\"></path><path d=\"M130.477419 652.387097a28.903226 24.774194 90 1 0 49.548387 0 28.903226 24.774194 90 1 0-49.548387 0Z\" fill=\"#21D3AC\" p-id=\"2174\"></path><path d=\"M51.2 835.716129a28.903226 24.774194 90 1 0 49.548387 0 28.903226 24.774194 90 1 0-49.548387 0Z\" fill=\"#FFFFFF\" p-id=\"2175\"></path><path d=\"M130.477419 871.225806a28.903226 24.774194 90 1 0 49.548387 0 28.903226 24.774194 90 1 0-49.548387 0Z\" fill=\"#21D3AC\" p-id=\"2176\"></path></svg>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/extension.ts", "new_path": "src/extension.ts", "diff": "@@ -22,6 +22,7 @@ import { Console } from \"./common/outputChannel\";\nimport { ServiceManager } from \"./service/serviceManager\";\nimport { QueryUnit } from \"./service/queryUnit\";\nimport { FileManager } from \"./common/filesManager\";\n+import { DbTreeDataProvider } from \"./provider/treeDataProvider\";\nexport function activate(context: vscode.ExtensionContext) {\n@@ -95,10 +96,11 @@ export function activate(context: vscode.ExtensionContext) {\n},\n\"mysql.query.switch\": async (databaseOrConnectionNode: DatabaseNode | ConnectionNode) => {\nif (databaseOrConnectionNode) {\n- databaseOrConnectionNode.newQuery();\n+ await databaseOrConnectionNode.newQuery();\n} else {\nFileManager.show(`sql/${new Date().getTime()}.sql`)\n}\n+ DbTreeDataProvider.refresh()\n},\n\"mysql.template.sql\": (tableNode: TableNode, run: boolean) => {\ntableNode.selectSqlTemplate(run);\n" }, { "change_type": "MODIFY", "old_path": "src/model/database/connectionNode.ts", "new_path": "src/model/database/connectionNode.ts", "diff": "@@ -25,11 +25,6 @@ export class ConnectionNode extends Node {\npublic async getChildren(isRresh: boolean = false): Promise<Node[]> {\n- let databaseNodes = DatabaseCache.getDatabaseListOfConnection(this.id);\n- if (databaseNodes && !isRresh) {\n- return databaseNodes;\n- }\n-\nlet connection: Connection;\ntry {\nconnection = await ConnectionManager.getConnection(this);\n@@ -39,7 +34,7 @@ export class ConnectionNode extends Node {\nreturn QueryUnit.queryPromise<any[]>(connection, \"show databases\")\n.then((databases) => {\n- databaseNodes = databases.filter((db) => {\n+ const databaseNodes = databases.filter((db) => {\nif (this.database) {\nreturn db.Database == this.database;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/model/database/databaseNode.ts", "new_path": "src/model/database/databaseNode.ts", "diff": "@@ -27,6 +27,11 @@ export class DatabaseNode extends Node implements CopyAble {\nthis.id = `${info.getConnectId()}_${name}`\nthis.info = NodeUtil.of({ ...info, database: name } as Node)\nthis.init(this.info)\n+ const lcp = ConnectionManager.getLastConnectionOption();\n+ if (lcp.getConnectId() == this.getConnectId() && lcp.database == this.database) {\n+ this.iconPath = path.join(Constants.RES_PATH, \"icon/database-active.svg\");\n+ this.description = `Actived`\n+ }\n}\npublic async getChildren(isRresh: boolean = false): Promise<Node[]> {\n" }, { "change_type": "MODIFY", "old_path": "src/service/connectionManager.ts", "new_path": "src/service/connectionManager.ts", "diff": "@@ -22,7 +22,7 @@ export class ConnectionManager {\nprivate static activeConnection: { [key: string]: ConnectionWrapper } = {};\nprivate static tunnelService = new SSHTunnelService();\n- public static getLastConnectionOption() {\n+ public static getLastConnectionOption(): Node {\nif (vscode.window.activeTextEditor) {\nconst fileName = vscode.window.activeTextEditor.document.fileName;\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
highlight active database
141,908
01.05.2020 01:08:50
-28,800
b7e3a4843363993e8c937b58d5269b2615adb5b4
change table and column node comment show
[ { "change_type": "MODIFY", "old_path": "src/model/main/tableNode.ts", "new_path": "src/model/main/tableNode.ts", "diff": "@@ -18,7 +18,8 @@ export class TableNode extends Node implements CopyAble {\npublic primaryKey: string;\nconstructor(public readonly table: string, readonly comment: string, readonly info: Node) {\n- super(`${table} ${comment}`)\n+ super(`${table}`)\n+ this.description = comment\nthis.id = `${info.getConnectId()}_${info.database}_${table}`\nthis.init(info)\nthis.command = {\n" }, { "change_type": "MODIFY", "old_path": "src/model/other/columnNode.ts", "new_path": "src/model/other/columnNode.ts", "diff": "@@ -12,15 +12,14 @@ const wrap = Util.wrap;\nexport class ColumnNode extends Node implements CopyAble {\n- public comment: string;\npublic type: string;\npublic contextValue: string = ModelType.COLUMN;\nconstructor(private readonly table: string, readonly column: any, readonly info: Node) {\nsuper(column.name)\nthis.init(info)\nthis.type = `${this.column.type}`\n- this.comment = `${this.column.comment}`\n- this.label = `${this.column.name} : ${this.column.type} ${this.getIndex(this.column.key)} ${this.column.comment}`\n+ this.description = `${this.column.comment}`\n+ this.label = `${this.column.name} : ${this.column.type} ${this.getIndex(this.column.key)}`\nthis.collapsibleState = vscode.TreeItemCollapsibleState.None\nthis.iconPath = path.join(Constants.RES_PATH, this.column.key === \"PRI\" ? \"icon/b_primary.png\" : \"icon/b_props.png\"),\nthis.command = {\n" }, { "change_type": "MODIFY", "old_path": "src/provider/Complection/chain/columnChain.ts", "new_path": "src/provider/Complection/chain/columnChain.ts", "diff": "@@ -72,9 +72,7 @@ export class ColumnChain implements ComplectionChain {\n}\nreturn columnNodes.map<vscode.CompletionItem>((columnNode) => {\n- const completionItem = new vscode.CompletionItem(columnNode.label);\n- completionItem.detail = columnNode.type;\n- completionItem.documentation = columnNode.comment;\n+ const completionItem = new vscode.CompletionItem(columnNode.description ? `${columnNode.label} ${columnNode.description}` : columnNode.label);\ncompletionItem.insertText = columnNode.column.name\ncompletionItem.kind = vscode.CompletionItemKind.Field;\nreturn completionItem;\n" }, { "change_type": "MODIFY", "old_path": "src/provider/Complection/chain/tableChain.ts", "new_path": "src/provider/Complection/chain/tableChain.ts", "diff": "@@ -60,7 +60,7 @@ export class TableChain implements ComplectionChain {\nif (!tableNodes) { return [] }\nreturn tableNodes.map<vscode.CompletionItem>((tableNode: TableNode) => {\n- const completionItem = new vscode.CompletionItem(tableNode.label);\n+ const completionItem = new vscode.CompletionItem(tableNode.comment ? `${tableNode.table} ${tableNode.comment}` : tableNode.table);\ncompletionItem.insertText = Util.wrap(tableNode.table);\nswitch (tableNode.contextValue) {\ncase ModelType.TABLE:\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
change table and column node comment show
141,908
01.05.2020 01:32:37
-28,800
d5f6c34d6cbaa42f0fd4e22790bab31ee00f65c8
highlight active database when change query file
[ { "change_type": "MODIFY", "old_path": "src/extension.ts", "new_path": "src/extension.ts", "diff": "@@ -22,7 +22,7 @@ import { Console } from \"./common/outputChannel\";\nimport { ServiceManager } from \"./service/serviceManager\";\nimport { QueryUnit } from \"./service/queryUnit\";\nimport { FileManager } from \"./common/filesManager\";\n-import { DbTreeDataProvider } from \"./provider/treeDataProvider\";\n+import { ConnectionManager } from \"./service/connectionManager\";\nexport function activate(context: vscode.ExtensionContext) {\n@@ -30,6 +30,12 @@ export function activate(context: vscode.ExtensionContext) {\nConnectionNode.init()\ncontext.subscriptions.push(\n...serviceManager.init(),\n+ vscode.window.onDidChangeActiveTextEditor((e) => {\n+ const fileNode = ConnectionManager.getByActiveFile()\n+ if (fileNode) {\n+ ConnectionManager.getConnection(fileNode, this)\n+ }\n+ }),\n...initCommand({\n\"mysql.history.open\": () => serviceManager.historyService.showHistory(),\n[CommandKey.Refresh]: () => { serviceManager.provider.init(); },\n@@ -100,7 +106,6 @@ export function activate(context: vscode.ExtensionContext) {\n} else {\nFileManager.show(`sql/${new Date().getTime()}.sql`)\n}\n- DbTreeDataProvider.refresh()\n},\n\"mysql.template.sql\": (tableNode: TableNode, run: boolean) => {\ntableNode.selectSqlTemplate(run);\n" }, { "change_type": "MODIFY", "old_path": "src/model/database/connectionNode.ts", "new_path": "src/model/database/connectionNode.ts", "diff": "@@ -58,8 +58,23 @@ export class ConnectionNode extends Node {\n}\npublic async newQuery() {\n- ConnectionManager.getConnection(this, true);\n- ConnectionNode.tryOpenQuery()\n+\n+ const key = `${this.getConnectId()}`;\n+ await FileManager.show(`${key}.sql`);\n+ const dbNameList = DatabaseCache.getDatabaseListOfConnection(key).filter((databaseNode) => !(databaseNode instanceof UserGroup)).map((databaseNode) => databaseNode.database);\n+ let dbName;\n+ if (dbNameList.length == 1) {\n+ dbName = dbNameList[0]\n+ }\n+ if (dbNameList.length > 1) {\n+ dbName = await vscode.window.showQuickPick(dbNameList, { placeHolder: \"active database\" })\n+ }\n+ if (dbName) {\n+ await ConnectionManager.getConnection({\n+ ...this, database: dbName\n+ } as Node, true);\n+ }\n+\n}\npublic createDatabase() {\n@@ -95,27 +110,5 @@ export class ConnectionNode extends Node {\npublic static init() { }\n- public static async tryOpenQuery() {\n- const lcp = ConnectionManager.getLastConnectionOption();\n- if (!lcp) {\n- Console.log(\"Not active connection found!\");\n- } else {\n- const key = `${lcp.getConnectId()}`;\n- await FileManager.show(`${key}.sql`);\n- const dbNameList = DatabaseCache.getDatabaseListOfConnection(key).filter((databaseNode) => !(databaseNode instanceof UserGroup)).map((databaseNode) => databaseNode.database);\n- let dbName;\n- if (dbNameList.length == 1) {\n- dbName = dbNameList[0]\n- }\n- if (dbNameList.length > 1) {\n- dbName = await vscode.window.showQuickPick(dbNameList, { placeHolder: \"active database\" })\n- }\n- if (dbName) {\n- await ConnectionManager.getConnection({\n- ...lcp, database: dbName, getConnectId: lcp.getConnectId\n- } as Node, true);\n- }\n- }\n- }\n}\n" }, { "change_type": "MODIFY", "old_path": "src/service/connectionManager.ts", "new_path": "src/service/connectionManager.ts", "diff": "@@ -10,6 +10,7 @@ import { SSHConfig } from \"../model/interface/sshConfig\";\nimport { DatabaseCache } from \"./common/databaseCache\";\nimport { NodeUtil } from \"../model/nodeUtil\";\nimport { SSHTunnelService } from \"./common/sshTunnelService\";\n+import { DbTreeDataProvider } from \"../provider/treeDataProvider\";\ninterface ConnectionWrapper {\nconnection: mysql.Connection;\n@@ -24,6 +25,13 @@ export class ConnectionManager {\npublic static getLastConnectionOption(): Node {\n+ const fileNode = this.getByActiveFile()\n+ if (fileNode) { return fileNode }\n+\n+ return this.lastConnectionNode;\n+ }\n+\n+ public static getByActiveFile(): Node {\nif (vscode.window.activeTextEditor) {\nconst fileName = vscode.window.activeTextEditor.document.fileName;\nif (fileName.includes('cweijan.vscode-mysql-client')) {\n@@ -44,8 +52,7 @@ export class ConnectionManager {\n}\n}\n}\n-\n- return this.lastConnectionNode;\n+ return null;\n}\npublic static getActiveConnectByKey(key: string): ConnectionWrapper {\n@@ -76,6 +83,9 @@ export class ConnectionManager {\nif (changeActive) {\nthis.lastConnectionNode = connectionNode;\nGlobal.updateStatusBarItems(connectionNode);\n+ setTimeout(() => {\n+ DbTreeDataProvider.refresh()\n+ }, 100);\n}\nconst key = connectionNode.getConnectId();\nconst connection = this.activeConnection[key];\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
highlight active database when change query file
141,908
01.05.2020 20:14:20
-28,800
89c5d2f65e7278a5da8090ab1d034c40678ee49c
init monitor page
[ { "change_type": "MODIFY", "old_path": "resources/webview/pages/status/index.html", "new_path": "resources/webview/pages/status/index.html", "diff": "<div id=\"container\">\n<el-tabs v-model=\"activePanel\" @tab-click=\"changePannel\">\n<el-tab-pane label=\"dashBoard\" name=\"dashBoard\">\n+ <el-row style=\"height:45vh\">\n+ <el-col :span=\"12\">\n+ Queries:\n+ <div id=\"queries\"></div>\n+ </el-col>\n+ <el-col :span=\"12\">\n+ Server Sessions:\n<div id=\"sessions\"></div>\n+ </el-col>\n+ </el-row>\n+ <el-row>\n+ <el-col :span=\"12\">\n+ Traffic:\n+ <div id=\"traffic\"></div>\n+ </el-col>\n+ <el-col :span=\"12\">\n+ <div class=\"grid-content bg-purple-light\"></div>\n+ </el-col>\n+ </el-row>\n+\n</el-tab-pane>\n<el-tab-pane label=\"processList\" name=\"processList\">\n<el-table :data=\"process.list\" style=\"width: 100%\">\nlock: false\n},\ndashBoard: {\n- sessions: [],\n- sessionChart: null,\n- lock: false,\n- }\n+ sessions: { data: [], lock: false, chart: null },\n+ queries: { data: [], lock: false, chart: null },\n+ traffic: { data: [], lock: false, chart: null },\n+ },\n}, methods: {\nsendLoadProcessList() {\npostMessage({ type: 'processList' })\n},\nsendLoadDashBoard() {\n- if (this.dashBoard.lock) return;\n- this.dashBoard.lock = true;\n+ if (this.dashBoard.sessions.lock) return;\n+ this.dashBoard.sessions.lock = true;\npostMessage({ type: 'dashBoard' })\n},\nchangePannel() {\n}\n})\n- window.addEventListener('message', ({ data }) => {\n- switch (data.type) {\n- case \"processList\":\n- vue.process.fields = data.fields\n- vue.process.list = data.list\n- break;\n- case \"dashBoard\":\n- vue.dashBoard.sessions.push(...data.session)\n- if (!vue.dashBoard.sessionChart) {\n- const sessionChart = new G2.Chart({\n- container: 'sessions',\n- autoFit: false,\n- width: 600,\n+ function createChart(id, data) {\n+ const chart = new G2.Chart({\n+ container: id,\n+ autoFit: true,\nheight: 300\n})\n- sessionChart.data(vue.dashBoard.sessions);\n- sessionChart.line().position('now*value')\n+ chart.data(data);\n+ chart.line().position('now*value')\n.color('type')\n.size(2);\n- sessionChart.render();\n- vue.dashBoard.sessionChart = sessionChart\n+ chart.render();\n+ return chart;\n+ }\n+\n+ function loadChart(id, chartOption, data) {\n+ chartOption.data.push(...data)\n+ if (!chartOption.chart) {\n+ const chart = new G2.Chart({\n+ container: id,\n+ autoFit: true,\n+ height: 300\n+ })\n+ chart.data(chartOption.data);\n+ chart.line().position('now*value')\n+ .color('type')\n+ .size(2);\n+ chart.render();\n+ chartOption.chart = chart\n} else {\n- if (vue.dashBoard.sessions.length >= 30) {\n- vue.dashBoard.sessions.shift()\n- vue.dashBoard.sessions.shift()\n- vue.dashBoard.sessions.shift()\n+ if (chartOption.data.length >= data.length * 10) {\n+ for (let index = 0; index < data.length; index++) {\n+ chartOption.data.shift()\n+ }\n+ }\n+ chartOption.chart.changeData(chartOption.data);\n}\n- vue.dashBoard.sessionChart.changeData(vue.dashBoard.sessions);\n+ chartOption.lock = false\n}\n- vue.dashBoard.lock = false\n+\n+ window.addEventListener('message', ({ data }) => {\n+ switch (data.type) {\n+ case \"processList\":\n+ vue.process.fields = data.fields\n+ vue.process.list = data.list\n+ break;\n+ case \"dashBoard\":\n+ loadChart('sessions', vue.dashBoard.sessions, data.sessions)\n+ loadChart('queries', vue.dashBoard.queries, data.queries)\n+ loadChart('traffic', vue.dashBoard.traffic, data.traffic)\nbreak;\n}\n})\n}, 1000);\nsetInterval(() => {\nvue.sendLoadDashBoard()\n- }, 3000);\n+ }, 1000);\n</script>\n</body>\n" }, { "change_type": "MODIFY", "old_path": "src/view/status/abstractStatusService.ts", "new_path": "src/view/status/abstractStatusService.ts", "diff": "@@ -40,10 +40,14 @@ export interface ProcessListResponse {\nlist: any[]\n}\n-export interface DashBoardResponse {\n- session: Array<{\n- now: any,\n- type: string\n+export interface DashBoardItem {\n+ now: any;\n+ type: string;\nvalue: number\n- }>\n+}\n+\n+export interface DashBoardResponse {\n+ sessions: DashBoardItem[],\n+ queries: DashBoardItem[],\n+ traffic: DashBoardItem[],\n}\n" }, { "change_type": "MODIFY", "old_path": "src/view/status/impl/mysqlStatusService.ts", "new_path": "src/view/status/impl/mysqlStatusService.ts", "diff": "@@ -2,12 +2,29 @@ import { FieldInfo } from \"mysql\";\nimport { Console } from \"../../../common/outputChannel\";\nimport { ConnectionNode } from \"../../../model/database/connectionNode\";\nimport { ConnectionManager } from \"../../../service/connectionManager\";\n-import { AbstractStatusService, DashBoardResponse, ProcessListResponse } from \"../abstractStatusService\";\n+import { AbstractStatusService, DashBoardResponse, ProcessListResponse, DashBoardItem } from \"../abstractStatusService\";\nimport { QueryUnit } from \"../../../service/queryUnit\";\nimport format = require('date-format');\n+interface QueryResponse {\n+ Variable_name: string,\n+ Value: string\n+}\n+\nexport class MysqlStatusService extends AbstractStatusService {\n+ private responseToObj(resArray: QueryResponse[]): any {\n+ const response = {}\n+ for (const res of resArray) {\n+ let value: any = parseInt(res.Value)\n+ if (isNaN(value)) {\n+ value = res.Value\n+ }\n+ response[res.Variable_name] = value\n+ }\n+ return response;\n+ }\n+\nprotected async onProcessList(connectionNode: ConnectionNode): Promise<ProcessListResponse> {\nconst connection = await ConnectionManager.getConnection(connectionNode)\nreturn new Promise((resovle, rej) => {\n@@ -28,24 +45,51 @@ export class MysqlStatusService extends AbstractStatusService {\nprotected async onDashBoard(connectionNode: ConnectionNode): Promise<DashBoardResponse> {\nconst connection = await ConnectionManager.getConnection(connectionNode)\n- const now = format('MM:ss', new Date())\n+ const now = format('hh:mm:ss', new Date())\n- // session\n- const result = (await QueryUnit.queryPromise(connection, \"show global status like '%threads%'\")) as any[]\n- let count: number;\n- let running: number;\n- for (const row of result) {\n- if (row['Variable_name'] == 'Threads_connected') {\n- count = row['Value'] as number\n+ const status = this.responseToObj((await QueryUnit.queryPromise(connection, \"show global status \")) as QueryResponse[]);\n+\n+ const sessions = await this.buildSession(status, now);\n+ const queries = await this.buildQueries(status, now);\n+ const traffic = await this.buildTraffic(status, now);\n+\n+ return {\n+ sessions,\n+ queries,\n+ traffic\n+ };\n}\n- if (row['Variable_name'] == 'Threads_running') {\n- running = row['Value'] as number\n+\n+ private async buildTraffic(resposne, now: any): Promise<DashBoardItem[]> {\n+ return [\n+ { now, type: 'received', value: resposne.Bytes_received },\n+ { now, type: 'sent', value: resposne.Bytes_sent }\n+ ];\n}\n+\n+ private async buildSession(resposne, now: any): Promise<DashBoardItem[]> {\n+ return [\n+ { now, type: 'count', value: resposne.Threads_connected },\n+ { now, type: 'running', value: resposne.Threads_running },\n+ { now, type: 'sleep', value: resposne.Threads_connected - resposne.Threads_running }\n+ ];\n}\n- return {\n- session: [{now, type: 'count', value: count }, {now, type: 'running', value: running }, { now, type: 'sleep', value: count - running }]\n- };\n+ private async buildQueries(resposne, now: any): Promise<DashBoardItem[]> {\n+ return [\n+ { now, type: 'insert', value: resposne.Com_insert },\n+ { now, type: 'update', value: resposne.Com_update },\n+ { now, type: 'delete', value: resposne.Com_delete },\n+ { now, type: 'select', value: resposne.Com_select },\n+ { now, type: 'read', value: resposne.Innodb_rows_read },\n+ ];\n+\n}\n+\n+\n}\n+\n+\n+\n+\n" }, { "change_type": "MODIFY", "old_path": "tslint.json", "new_path": "tslint.json", "diff": "\"no-bitwise\": false,\n\"no-consecutive-blank-lines\": false,\n\"no-console\": false,\n- \"no-string-literal\": false,\n\"forin\": false,\n\"eofline\": false,\n\"ordered-imports\": false,\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
init monitor page
141,908
01.05.2020 20:39:31
-28,800
5a8042cc27334b2515f8309152f1320bb5442344
fix run mock fail
[ { "change_type": "MODIFY", "old_path": "src/model/main/tableNode.ts", "new_path": "src/model/main/tableNode.ts", "diff": "@@ -10,12 +10,12 @@ import { CopyAble } from \"../interface/copyAble\";\nimport { Node } from \"../interface/node\";\nimport { ColumnNode } from \"../other/columnNode\";\nimport { InfoNode } from \"../other/infoNode\";\n+import { MockRunner } from \"../../service/mock/mockRunner\";\nexport class TableNode extends Node implements CopyAble {\npublic iconPath: string = path.join(Constants.RES_PATH, \"icon/table.svg\");\npublic contextValue: string = ModelType.TABLE;\n- public primaryKey: string;\nconstructor(public readonly table: string, readonly comment: string, readonly info: Node) {\nsuper(`${table}`)\n@@ -38,7 +38,7 @@ export class TableNode extends Node implements CopyAble {\n.then((columns) => {\ncolumnNodes = columns.map<ColumnNode>((column) => {\nif (column && column.key == \"PRI\") {\n- this.primaryKey = column.name\n+ MockRunner.primaryKeyMap[this.getConnectId()] = column.name\n}\nreturn new ColumnNode(this.table, column, this.info);\n});\n@@ -180,8 +180,9 @@ ADD\nconst connection = await ConnectionManager.getConnection(this, false)\n- if (this.primaryKey) {\n- const count = await QueryUnit.queryPromise(connection, `select max(${this.primaryKey}) max from ${this.table}`);\n+ const primaryKey = MockRunner.primaryKeyMap[this.getConnectId()];\n+ if (primaryKey != null) {\n+ const count = await QueryUnit.queryPromise(connection, `select max(${primaryKey}) max from ${this.table}`);\nif (count && count[0]) { return count[0].max }\n}\n" }, { "change_type": "MODIFY", "old_path": "src/service/mock/mockRunner.ts", "new_path": "src/service/mock/mockRunner.ts", "diff": "@@ -16,12 +16,13 @@ import { Node } from '../../model/interface/node';\nexport class MockRunner {\nprivate readonly MOCK_INDEX = \"$mockIndex\";\n+ public static primaryKeyMap: { [key: string]: string } = {}\npublic async create(tableNode: TableNode) {\nconst columnList = (await tableNode.getChildren()) as ColumnNode[]\nconst mockModel: MockModel = {\nhost: tableNode.getHost(), port: tableNode.getPort(), user: tableNode.getUser(), database: tableNode.database, table: tableNode.table,\n- mockStartIndex: tableNode.primaryKey ? 'auto' : 1\n+ mockStartIndex: MockRunner.primaryKeyMap[tableNode.getConnectId()] ? 'auto' : 1\n, mockCount: 50, mock: {}, examples: \"http://mockjs.com/examples.html#DPD\"\n}\nfor (const columnNode of columnList) {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix run mock fail
141,908
02.05.2020 14:06:16
-28,800
d9e9ba82499926b80f618cea15593fe990846ce4
update dashboard layout
[ { "change_type": "MODIFY", "old_path": "resources/webview/pages/status/index.html", "new_path": "resources/webview/pages/status/index.html", "diff": "<el-tabs v-model=\"activePanel\" @tab-click=\"changePannel\">\n<el-tab-pane label=\"dashBoard\" name=\"dashBoard\">\n<el-row style=\"height:45vh\">\n- <el-col :span=\"12\">\n+ <el-col :span=\"24\">\nQueries:\n<div id=\"queries\"></div>\n</el-col>\n- <el-col :span=\"12\">\n- Server Sessions:\n- <div id=\"sessions\"></div>\n- </el-col>\n</el-row>\n<el-row>\n<el-col :span=\"12\">\n<div id=\"traffic\"></div>\n</el-col>\n<el-col :span=\"12\">\n- <div class=\"grid-content bg-purple-light\"></div>\n+ Server Sessions:\n+ <div id=\"sessions\"></div>\n</el-col>\n</el-row>\nchart.render();\nchartOption.chart = chart\n} else {\n- if (chartOption.data.length >= data.length * 10) {\n+ if (chartOption.data.length >= data.length * 100) {\nfor (let index = 0; index < data.length; index++) {\nchartOption.data.shift()\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update dashboard layout
141,899
05.05.2020 20:14:19
18,000
4d44c952c1716501e0726dd8281f7bd452c1c6f9
correct typo in header, "mock date"
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -17,7 +17,7 @@ MySQL Client For Visual Studio Code\n- [Connect](#connect)\n- [View Tables](#view-tables)\n- [Execute Sql](#execute-sql)\n- - [Generate Mock Date](#generate-mock-date)\n+ - [Generate Mock Data](#generate-mock-data)\n- [History](#history)\n- [Backup/Import](#backupimport)\n- [Setting](#setting)\n@@ -45,7 +45,7 @@ MySQL Client For Visual Studio Code\n* Click Run Button or Press `F9` to Execute.\n![run](images/run.jpg)\n-## Generate Mock Date\n+## Generate Mock Data\n- Now you not need spend time to writing test data\n![mockData](images/mockData.png)\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
correct typo in header, "mock date"
141,899
05.05.2020 20:20:32
18,000
28661ae8438b4acf4323259046889d62d345ea32
Clean up the grammatical phrasing in a few sentences
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "MySQL Client For Visual Studio Code\n-> This plugin inspired for [MySQL](https://github.com/formulahendry/vscode-mysql)\n+> This plugin was inspired by [MySQL](https://github.com/formulahendry/vscode-mysql).\n>\n-> Give [project](https://github.com/cweijan/vscode-mysql) star keep me motivated to keep updating\n+> Give [project](https://github.com/cweijan/vscode-mysql) a star to keep me motivated to keep updating.\n-**Note: This plugin is not support MySql 8.0!**\n+**Note: This plugin does not support MySql 8.0!**\n**Features**\n@@ -26,7 +26,7 @@ MySQL Client For Visual Studio Code\n## Connect\n1. Open MySQL Panel, then click the `+` button.\n-2. Input you connect info then click connect.\n+2. Input your connect info then click connect.\n![connection](images/connection.jpg)\n@@ -41,12 +41,12 @@ MySQL Client For Visual Studio Code\n* In the MySQL Panel, click the `New Query` button.\n![newquery](images/newquery.jpg)\n* This changes the active database.\n-* Now You can enjoy Intelli SQL code within the editor.\n+* Now you can enjoy Intellisense for SQL code within the editor.\n* Click Run Button or Press `F9` to Execute.\n![run](images/run.jpg)\n## Generate Mock Data\n-- Now you not need spend time to writing test data\n+- Now you do not need spend time writing test data.\n![mockData](images/mockData.png)\n## History\n@@ -74,6 +74,6 @@ MySQL Client For Visual Studio Code\n```\n## Suprise\n-* You can find suprise when right click on node.\n+* Find a suprise when you right click on a node.\n![suprise](images/surprise.jpg)\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
Clean up the grammatical phrasing in a few sentences
141,908
06.05.2020 22:17:43
-28,800
c9e470bcfb22bd67f4ea59fd2390c21b87a50925
support open in new panel
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"title\": \"Show Table Source\",\n\"category\": \"MySQL\"\n},\n+ {\n+ \"command\": \"mysql.table.show\",\n+ \"title\": \"Open In New Panel\",\n+ \"category\": \"MySQL\"\n+ },\n{\n\"command\": \"mysql.column.update\",\n\"title\": \"Modify Column\",\n\"when\": \"view == github.cweijan.mysql && viewItem == table\",\n\"group\": \"1_inline@0\"\n},\n+ {\n+ \"command\": \"mysql.table.show\",\n+ \"when\": \"view == github.cweijan.mysql && viewItem == table\",\n+ \"group\": \"1_inline@2\"\n+ },\n{\n\"command\": \"mysql.column.add\",\n\"when\": \"view == github.cweijan.mysql && viewItem == table\",\n" }, { "change_type": "MODIFY", "old_path": "resources/webview/pages/result/components/toolPanel.html", "new_path": "resources/webview/pages/result/components/toolPanel.html", "diff": "<div class=\"hint\">\n<!-- sql input -->\n<el-row style=\"margin-bottom: 10px;\">\n- <el-input type=\"textarea\" :autosize=\"{ minRows:3, maxRows:5}\" v-model=\"toolbar.sql\" style=\"width:90vw\" ></el-input>\n+ <el-input type=\"textarea\" :autosize=\"{ minRows:3, maxRows:5}\" v-model=\"toolbar.sql\" style=\"width:90vw\">\n+ </el-input>\n</el-row>\n<!-- tool panel -->\n<el-row>\n<el-button type=\"info\" icon=\"el-icon-circle-plus-outline\" size=\"mini\" circle @click=\"insertRequest\">\n</el-button>\n<span>CostTime: </span><span v-text=\"toolbar.costTime\"></span>ms\n- <span v-if=\"result.table\">, Row: {{result.data.length}}, Col: {{columnCount}}</span>\n+ <span v-if=\"result.table\">, Row: {{result.data.length-1}}, Col: {{columnCount}}</span>\n</el-col>\n</el-row>\n<!-- info panel -->\n" }, { "change_type": "MODIFY", "old_path": "src/extension.ts", "new_path": "src/extension.ts", "diff": "@@ -81,6 +81,9 @@ export function activate(context: vscode.ExtensionContext) {\n\"mysql.table.source\": (tableNode: TableNode) => {\nif (tableNode) { tableNode.showSource(); }\n},\n+ \"mysql.table.show\": (tableNode: TableNode) => {\n+ if (tableNode) { tableNode.openInNew(); }\n+ },\n\"mysql.column.changeName\": (columnNode: ColumnNode) => {\ncolumnNode.changeColumnName();\n},\n" }, { "change_type": "MODIFY", "old_path": "src/model/main/tableNode.ts", "new_path": "src/model/main/tableNode.ts", "diff": "import * as path from \"path\";\n+import * as mysql from \"mysql\";\nimport * as vscode from \"vscode\";\n-import { Constants, ModelType, Template } from \"../../common/constants\";\n+import { Constants, ModelType, Template, MessageType } from \"../../common/constants\";\nimport { Util } from \"../../common/util\";\nimport { DbTreeDataProvider } from \"../../provider/treeDataProvider\";\nimport { DatabaseCache } from \"../../service/common/databaseCache\";\n@@ -11,6 +12,8 @@ import { Node } from \"../interface/node\";\nimport { ColumnNode } from \"../other/columnNode\";\nimport { InfoNode } from \"../other/infoNode\";\nimport { MockRunner } from \"../../service/mock/mockRunner\";\n+import { QueryPage } from \"../../view/result/query\";\n+import { DataResponse } from \"../../view/result/queryResponse\";\nexport class TableNode extends Node implements CopyAble {\n@@ -114,12 +117,21 @@ ADD\n}\n+ public async openInNew() {\n+ const sql = `SELECT * FROM ${Util.wrap(this.database)}.${Util.wrap(this.table)} LIMIT ${Constants.DEFAULT_SIZE};`;\n+ const connection = await ConnectionManager.getConnection(this);\n+ const executeTime = new Date().getTime();\n+ connection.query(sql, (err: mysql.MysqlError, data, fields?: mysql.FieldInfo[]) => {\n+ const costTime = new Date().getTime() - executeTime;\n+ QueryPage.send({ singlePage: false, type: MessageType.DATA, connection: this, res: { sql, costTime, data, fields, pageSize: Constants.DEFAULT_SIZE } as DataResponse });\n+ })\n+\n+ }\npublic async selectSqlTemplate(run: boolean) {\nconst sql = `SELECT * FROM ${Util.wrap(this.database)}.${Util.wrap(this.table)} LIMIT ${Constants.DEFAULT_SIZE};`;\nif (run) {\n- ConnectionManager.getConnection(this, true);\nQueryUnit.runQuery(sql, this);\n} else {\nQueryUnit.showSQLTextDocument(sql, Template.table);\n" }, { "change_type": "MODIFY", "old_path": "src/service/queryUnit.ts", "new_path": "src/service/queryUnit.ts", "diff": "@@ -3,7 +3,7 @@ import * as fs from \"fs\";\nimport * as mysql from \"mysql\";\nimport { Connection } from \"mysql\";\nimport * as vscode from \"vscode\";\n-import { CommandKey, ConfigKey, Cursor, MessageType, Pattern } from \"../common/constants\";\n+import { CommandKey, ConfigKey, Cursor, MessageType, Pattern, Constants } from \"../common/constants\";\nimport { Global } from \"../common/global\";\nimport { Console } from \"../common/outputChannel\";\nimport { FileManager, FileModel } from \"../common/filesManager\";\n@@ -107,7 +107,7 @@ export class QueryUnit {\nreturn;\n}\nif (Array.isArray(data)) {\n- QueryPage.send({ type: MessageType.DATA, connection: connectionNode, res: { sql, costTime, data, fields, pageSize: 100 } as DataResponse });\n+ QueryPage.send({ type: MessageType.DATA, connection: connectionNode, res: { sql, costTime, data, fields, pageSize: Constants.DEFAULT_SIZE } as DataResponse });\nreturn;\n}\nQueryPage.send({ type: MessageType.MESSAGE, res: { message: `Execute sql success : ${sql}`, costTime, success: true } as MessageResponse });\n" }, { "change_type": "MODIFY", "old_path": "src/view/result/query.ts", "new_path": "src/view/result/query.ts", "diff": "@@ -18,6 +18,7 @@ export class QueryParam<T> {\n* using in loadColumnList.\n*/\npublic connection?: Node;\n+ public singlePage?: boolean;\npublic type: MessageType;\npublic res: T;\n}\n@@ -29,6 +30,10 @@ export class QueryPage {\npublic static async send(queryParam: QueryParam<any>) {\n+ if (typeof queryParam.singlePage == 'undefined') {\n+ queryParam.singlePage = true;\n+ }\n+\nswitch (queryParam.type) {\ncase MessageType.DATA:\nawait this.loadColumnList(queryParam);\n@@ -43,6 +48,7 @@ export class QueryPage {\n}\nViewManager.createWebviewPanel({\n+ singlePage: queryParam.singlePage,\nsplitView: !Global.getConfig(ConfigKey.QUERY_FULL_SCREEN),\npath: \"pages/result/index\", title: \"Query\",\ninitListener: (webviewPanel) => {\n" }, { "change_type": "MODIFY", "old_path": "src/view/viewManager.ts", "new_path": "src/view/viewManager.ts", "diff": "@@ -51,6 +51,10 @@ export class ViewManager {\nif (typeof (viewOption.singlePage) == 'undefined') { viewOption.singlePage = true }\nif (typeof (viewOption.killHidden) == 'undefined') { viewOption.killHidden = true }\n+ if (!viewOption.singlePage) {\n+ viewOption.title = viewOption.title + new Date().getTime()\n+ }\n+\nconst currentStatus = this.viewStatu[viewOption.title]\nif (viewOption.singlePage && currentStatus) {\nif (viewOption.killHidden && currentStatus.instance.visible == false) {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
support open in new panel
141,901
09.05.2020 16:17:29
-7,200
55ad84fd80062cd348714cd0fffa23ef0d860684
Fix can't drop database with dash in its name
[ { "change_type": "MODIFY", "old_path": "src/model/database/databaseNode.ts", "new_path": "src/model/database/databaseNode.ts", "diff": "@@ -53,7 +53,7 @@ export class DatabaseNode extends Node implements CopyAble {\nvscode.window.showInputBox({ prompt: `Are you want to Delete Database ${this.database} ? `, placeHolder: 'Input database name to confirm.' }).then(async (inputContent) => {\nif (inputContent && inputContent.toLowerCase() == this.database.toLowerCase()) {\n- QueryUnit.queryPromise(await ConnectionManager.getConnection(this), `DROP DATABASE ${this.database}`).then(() => {\n+ QueryUnit.queryPromise(await ConnectionManager.getConnection(this), `DROP DATABASE \\`${this.database}\\``).then(() => {\nDatabaseCache.clearDatabaseCache(`${this.getConnectId()}`)\nDbTreeDataProvider.refresh();\nvscode.window.showInformationMessage(`Delete database ${this.database} success!`)\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
Fix can't drop database with dash in its name
141,908
11.05.2020 16:42:28
-28,800
d0748a9e51152e30acd5689b5a07f9ab72cca979
fix load not select sql page data
[ { "change_type": "MODIFY", "old_path": "resources/webview/pages/result/index.html", "new_path": "resources/webview/pages/result/index.html", "diff": "},\nnextPage() {\nif (this.page.isEnd || this.page.lock) return;\n+\n+ if (!this.result.sql.match(/^\\s*select/i)) {\n+ return;\n+ }\n+\nvscode.postMessage({\ntype: 'next',\nsql: this.result.sql,\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix load not select sql page data
141,908
14.05.2020 15:39:32
-28,800
a99495f8614f818eff9f9adc24ba41c69bd7c3ed
scroll editor to end when open history
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -21,7 +21,7 @@ MySQL Client For Visual Studio Code\n- [History](#history)\n- [Backup/Import](#backupimport)\n- [Setting](#setting)\n- - [Suprise](#suprise)\n+ - [Other](#other)\n## Connect\n@@ -73,7 +73,7 @@ MySQL Client For Visual Studio Code\n}\n```\n-## Suprise\n+## Other\n* Find a suprise when you right click on a node.\n![suprise](images/surprise.jpg)\n" }, { "change_type": "MODIFY", "old_path": "src/common/filesManager.ts", "new_path": "src/common/filesManager.ts", "diff": "@@ -9,7 +9,7 @@ export class FileManager {\nthis.storagePath = context.globalStoragePath;\n}\n- public static show(fileName: string) {\n+ public static show(fileName: string): Promise<vscode.TextEditor> {\nif (!this.storagePath) { vscode.window.showErrorMessage(\"FileManager is not init!\") }\nif (!fileName) { return; }\nconst recordPath = `${this.storagePath}/${fileName}`;\n" }, { "change_type": "MODIFY", "old_path": "src/service/common/historyRecorder.ts", "new_path": "src/service/common/historyRecorder.ts", "diff": "+import { TextEditor, Selection } from \"vscode\";\nimport { FileManager } from \"../../common/filesManager\";\nexport class HistoryRecorder {\npublic showHistory() {\n- FileManager.show('history.sql')\n+ FileManager.show('history.sql').then((textEditor: TextEditor) => {\n+ const lineCount = textEditor.document.lineCount;\n+ const range = textEditor.document.lineAt(lineCount - 1).range;\n+ textEditor.selection = new Selection(range.end, range.end);\n+ textEditor.revealRange(range);\n+ })\n}\npublic recordHistory(sql: string, costTime: number) {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
scroll editor to end when open history
141,908
14.05.2020 15:48:00
-28,800
86e42d96bfe4569dc3dafdd6db0a09a7492585f2
change active connection when query
[ { "change_type": "MODIFY", "old_path": "src/service/queryUnit.ts", "new_path": "src/service/queryUnit.ts", "diff": "@@ -42,7 +42,7 @@ export class QueryUnit {\nif (!connectionNode) {\nconnectionNode = ConnectionManager.getLastConnectionOption();\n}\n- const connection = await ConnectionManager.getConnection(connectionNode);\n+ const connection = await ConnectionManager.getConnection(connectionNode, true);\nif (!connection) {\nvscode.window.showWarningMessage(\"No MySQL Server or Database selected\");\nreturn;\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
change active connection when query
141,908
14.05.2020 15:48:40
-28,800
0d1e0ebad7b370b6ea7391a0c556673e462fa586
change active text
[ { "change_type": "MODIFY", "old_path": "src/model/database/databaseNode.ts", "new_path": "src/model/database/databaseNode.ts", "diff": "@@ -30,7 +30,7 @@ export class DatabaseNode extends Node implements CopyAble {\nconst lcp = ConnectionManager.getLastConnectionOption(false);\nif (lcp.getConnectId() == this.getConnectId() && lcp.database == this.database) {\nthis.iconPath = path.join(Constants.RES_PATH, \"icon/database-active.svg\");\n- this.description = `Actived`\n+ this.description = `Active`\n}\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
change active text
141,908
14.05.2020 15:57:04
-28,800
3e9dd4e1d911a69248a2c940ddd54c76cb86c1b4
update mock tips
[ { "change_type": "MODIFY", "old_path": "images/mockData.png", "new_path": "images/mockData.png", "diff": "Binary files a/images/mockData.png and b/images/mockData.png differ\n" }, { "change_type": "MODIFY", "old_path": "src/service/mock/mockRunner.ts", "new_path": "src/service/mock/mockRunner.ts", "diff": "@@ -23,7 +23,7 @@ export class MockRunner {\nconst mockModel: MockModel = {\nhost: tableNode.getHost(), port: tableNode.getPort(), user: tableNode.getUser(), database: tableNode.database, table: tableNode.table,\nmockStartIndex: MockRunner.primaryKeyMap[tableNode.getConnectId()] ? 'auto' : 1\n- , mockCount: 50, mock: {}, examples: \"http://mockjs.com/examples.html#DPD\"\n+ , mockCount: 50, examples: \"http://mockjs.com/examples.html#DPD\", mock: {}\n}\nfor (const columnNode of columnList) {\nmockModel.mock[columnNode.column.name] = {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update mock tips
141,908
14.05.2020 16:15:07
-28,800
7ab25d65ae97e13abc10063ad09a2ad4e1c5748f
detech common column mock value
[ { "change_type": "MODIFY", "old_path": "src/model/main/tableNode.ts", "new_path": "src/model/main/tableNode.ts", "diff": "@@ -14,6 +14,7 @@ import { InfoNode } from \"../other/infoNode\";\nimport { MockRunner } from \"../../service/mock/mockRunner\";\nimport { QueryPage } from \"../../view/result/query\";\nimport { DataResponse } from \"../../view/result/queryResponse\";\n+import { ColumnMeta } from \"../other/columnMeta\";\nexport class TableNode extends Node implements CopyAble {\n@@ -37,7 +38,7 @@ export class TableNode extends Node implements CopyAble {\nif (columnNodes && !isRresh) {\nreturn columnNodes;\n}\n- return QueryUnit.queryPromise<any[]>(await ConnectionManager.getConnection(this), `SELECT COLUMN_NAME name,DATA_TYPE simpleType,COLUMN_TYPE type,COLUMN_COMMENT comment,COLUMN_KEY \\`key\\`,IS_NULLABLE nullable,CHARACTER_MAXIMUM_LENGTH maxLength FROM information_schema.columns WHERE table_schema = '${this.database}' AND table_name = '${this.table}';`)\n+ return QueryUnit.queryPromise<ColumnMeta[]>(await ConnectionManager.getConnection(this), `SELECT COLUMN_NAME name,DATA_TYPE simpleType,COLUMN_TYPE type,COLUMN_COMMENT comment,COLUMN_KEY \\`key\\`,IS_NULLABLE nullable,CHARACTER_MAXIMUM_LENGTH maxLength FROM information_schema.columns WHERE table_schema = '${this.database}' AND table_name = '${this.table}';`)\n.then((columns) => {\ncolumnNodes = columns.map<ColumnNode>((column) => {\nif (column && column.key == \"PRI\") {\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/model/other/columnMeta.ts", "diff": "+/**\n+ * column meta info\n+ */\n+export interface ColumnMeta {\n+ /**\n+ * column name.\n+ */\n+ name: string;\n+ /**\n+ * column type without length example: varcahr.\n+ */\n+ simpleType: string;\n+ /**\n+ * column type with length, example:varchar(255).\n+ */\n+ type: string;\n+ /**\n+ * column comment.\n+ */\n+ comment: string;\n+ /**\n+ * indexed key.\n+ */\n+ key: string;\n+ /**\n+ * \"YES\" or \"NO\" .\n+ */\n+ nullable: string;\n+ /**\n+ * man length or this column value.\n+ */\n+ maxLength: string;\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/model/other/columnNode.ts", "new_path": "src/model/other/columnNode.ts", "diff": "@@ -8,13 +8,14 @@ import { ConnectionManager } from \"../../service/connectionManager\";\nimport { DbTreeDataProvider } from \"../../provider/treeDataProvider\";\nimport { CopyAble } from \"../interface/copyAble\";\nimport { Util } from \"../../common/util\";\n+import { ColumnMeta } from \"./columnMeta\";\nconst wrap = Util.wrap;\nexport class ColumnNode extends Node implements CopyAble {\npublic type: string;\npublic contextValue: string = ModelType.COLUMN;\n- constructor(private readonly table: string, readonly column: any, readonly info: Node) {\n+ constructor(private readonly table: string, readonly column: ColumnMeta, readonly info: Node) {\nsuper(column.name)\nthis.init(info)\nthis.type = `${this.column.type}`\n" }, { "change_type": "MODIFY", "old_path": "src/service/mock/mockRunner.ts", "new_path": "src/service/mock/mockRunner.ts", "diff": "@@ -12,6 +12,7 @@ import { MessageResponse } from \"../../view/result/queryResponse\";\nimport { FileManager, FileModel } from '../../common/filesManager';\nimport { MockModel } from './mockModel';\nimport { Node } from '../../model/interface/node';\n+import { ColumnMeta } from '../../model/other/columnMeta';\nexport class MockRunner {\n@@ -28,7 +29,7 @@ export class MockRunner {\nfor (const columnNode of columnList) {\nmockModel.mock[columnNode.column.name] = {\ntype: columnNode.column.simpleType,\n- value: this.getValueByType(columnNode.column)\n+ value: this.getMockValue(columnNode.column)\n}\n}\n@@ -115,12 +116,39 @@ export class MockRunner {\n}\n// refrence : http://mockjs.com/examples.html\n- private getValueByType(column: any): string {\n+ private getMockValue(column: ColumnMeta): string {\n+\n+ const valueByName = this.getValueByName(column.name)\n+ if (valueByName) {\n+ return valueByName;\n+ }\n+\n+ return this.getValueByType(column);\n+ }\n+ private getValueByName(name: string) {\n+\n+ name = name.toLowerCase()\n+ if (name == \"create_time\" || name == \"created_time\" || name == \"update_time\" || name == \"updated_time\") {\n+ return \"@now('yyyy-MM-dd HH:mm:ss')\"\n+ }\n+\n+ if (name == \"created_by\" || name == \"updated_by\" ) {\n+ return \"vscode-mysql-mock\"\n+ }\n+\n+ if (name == \"revision\" || name == \"version\" ) {\n+ return \"1\"\n+ }\n+\n+ return null;\n+ }\n+\n+ private getValueByType(column: ColumnMeta): string {\nconst type = column.simpleType.toLowerCase()\n- const match = column.type.match(/.+?\\((\\d+)\\)/);\n+ const numericMatch = column.type.match(/.+?\\((\\d+)\\)/);\nlet length = 1024\n- if (match) {\n- length = 1 << (match[1] - 1)\n+ if (numericMatch) {\n+ length = 1 << (parseInt(numericMatch[1]) - 1)\n}\nif (column.key == \"PRI\") {\nreturn this.MOCK_INDEX;\n" }, { "change_type": "MODIFY", "old_path": "src/view/result/queryResponse.ts", "new_path": "src/view/result/queryResponse.ts", "diff": "import * as mysql from \"mysql\";\n+import { ColumnMeta } from \"../../model/other/columnMeta\";\nexport class RunResponse {\npublic sql: string;\n@@ -13,7 +14,7 @@ export class DataResponse {\npublic sql: string;\npublic costTime: number;\npublic primaryKey: string;\n- public columnList: Column[];\n+ public columnList: ColumnMeta[];\npublic database?: string;\npublic table: string | null;\npublic data: any[];\n@@ -32,14 +33,3 @@ export class DMLResponse {\npublic message?: string;\npublic affectedRows: number;\n}\n-\n-export class Column {\n-\n- // \"YES\" and \"NO\"\n- public nullable: string;\n- public type: string;\n- public comment: string;\n- public key: string;\n- public maxLength: number;\n-\n-}\n\\ No newline at end of file\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
detech common column mock value
141,908
14.05.2020 18:49:54
-28,800
ca28244659d22efc1d192fa51b234b9bd5310bb7
update result page
[ { "change_type": "MODIFY", "old_path": "resources/webview/css/result.css", "new_path": "resources/webview/css/result.css", "diff": "@@ -60,6 +60,18 @@ body {\n}\n.el-textarea__inner,.el-input__inner,\n-.el-table, .el-table tr, .el-table th{\n+.el-table, .el-table tr, .el-table th,\n+.el-dialog__header,.el-el-dialog__body,.el-dialog__footer\n+{\nbackground-color: #F8F8F8;\n}\n+\n+.el-table__row--striped td{\n+ background-color: #FFF0EF !important;\n+}\n+\n+\n+.el-table th.is-leaf{\n+ border: 1px solid #eae7e7;\n+ border-radius: 3px;\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "resources/webview/pages/result/components/toolPanel.html", "new_path": "resources/webview/pages/result/components/toolPanel.html", "diff": "<!-- tool panel -->\n<el-row>\n<w>\n- <el-input v-model=\"table.search\" style=\"width:200px\" placeholder=\"Type to search\" />\n+ <el-input v-model=\"table.search\" style=\"width:200px\" placeholder=\"Input to filter load data\" />\n</w>\n<w>\n<el-button type=\"primary\" @click='execute(toolbar.sql);info.visible = false;'>Execute</el-button>\n" }, { "change_type": "MODIFY", "old_path": "resources/webview/pages/result/index.html", "new_path": "resources/webview/pages/result/index.html", "diff": "<div id=\"app\">\n<include path=\"components/toolPanel.html\" />\n<!-- talbe result -->\n- <div :style=\"'width:' + table.width + 'px;'\" v-if=\"result.data\">\n<el-table id=\"dataTable\" v-loading='table.loading' size='small' @sort-change=\"sort\"\n- :row-class-name=\"tableRowClassName\" ref=\"dataTable\"\n+ :row-class-name=\"tableRowClassName\" ref=\"dataTable\" :height=\"remainHeight\" width=\"100vh\" stripe\n:data=\"result.data.filter(data => !table.search || JSON.stringify(data).toLowerCase().includes(table.search.toLowerCase()))\"\nborder @row-dblclick=\"row=>openEdit(row)\">\n<!-- tool bar -->\n<!-- data -->\n<include path=\"components/dataTable.html\" />\n</el-table>\n- </div>\n<include path=\"components/editDialog.html\" />\n</div>\n</body>\ntable: {\nsearch: '',\nloading: true,\n- width: null,\nwidthItem: {}\n},\ntoolbar: {\nprimary: null\n}\n},\n+ mounted() {\n+ setTimeout(() => {\n+ const table = document.querySelector('.el-table__fixed-body-wrapper');\n+ table.addEventListener('scroll', (event) => {\n+ console.log(table.scrollHeight - table.scrollTop - document.documentElement.clientHeight)\n+ if ((table.scrollHeight - table.scrollTop - document.documentElement.clientHeight ) <= 200) {\n+ vue.nextPage()\n+ }\n+ });\n+ }, 1000);\n+ },\nmethods: {\nexportData() {\nthis.$confirm('Export without limit?', 'Export', {\n}\nreturn '';\n},\n- updateWidth() {\n- let width = 0;\n- for (const key in this.table.widthItem) {\n- width = width + parseInt(this.table.widthItem[key])\n- }\n- if (this.result.primaryKey) {\n- width += 60;\n- }\n- this.table.width = width + 100;\n-\n- },\ncomputeWidth(key, index, keyIndex, value) {\nif (this.table.widthItem[keyIndex]) return this.table.widthItem[keyIndex];\nif (!index) index = 0\nvar nextDynamic = this.computeWidth(key, ++index, keyIndex)\nif (dynamic < nextDynamic) dynamic = nextDynamic;\nthis.table.widthItem[keyIndex] = dynamic;\n- this.updateWidth()\nreturn dynamic;\n},\ncelledit(row, column, cell, event) {\n}\nreturn 'Edit For ' + this.result.table + ' : ' + this.result.primaryKey + '=' + this.update.primary\n},\n+ remainHeight() {\n+ return screen.height - 300;\n+ }\n}\n})\n}\n});\nvscode.postMessage({ type: 'init' })\n- window.addEventListener('scroll', function () {\n- if ((document.body.offsetHeight - document.documentElement.scrollTop - document.documentElement.clientHeight) <= 200) {\n- vue.nextPage()\n- }\n- });\n</script>\n</html>\n\\ No newline at end of file\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update result page
141,908
16.05.2020 00:42:45
-28,800
a02042ee430230330858ce95d7e6ce62213036c6
update result layout
[ { "change_type": "MODIFY", "old_path": "resources/webview/css/result.css", "new_path": "resources/webview/css/result.css", "diff": "@@ -55,8 +55,8 @@ body {\n-.el-table .edit-row {\n- background: oldlace;\n+.el-table .edit-row td{\n+ background: oldlace !important;\n}\n.el-textarea__inner,\n@@ -66,8 +66,8 @@ body {\nbackground-color: #F8F8F8;\n}\n-.el-table__row--striped td{\n- background-color: #f0fdf0 !important;\n+.el-table--striped .el-table__body tr.el-table__row--striped td{\n+ background-color: #f0fdf0 ;\n}\n" }, { "change_type": "MODIFY", "old_path": "resources/webview/pages/result/components/toolPanel.html", "new_path": "resources/webview/pages/result/components/toolPanel.html", "diff": "</el-row>\n<!-- tool panel -->\n<el-row>\n- <el-col :span=\"8\">\n- <el-input v-model=\"table.search\" placeholder=\"Input to searching loaded data\" />\n- </el-col>\n- <el-col :span=\"12\" style=\"margin-left: 20px;\">\n<el-button type=\"primary\" @click='execute(toolbar.sql);info.visible = false;'>Execute</el-button>\n<span v-if=\"result.table\">\n{{result.table}}\n</span>\n- </el-col>\n- </el-row>\n- <el-row v-if=\"result.table\">\n- <el-col>\n- <el-button type=\"info\" icon=\"el-icon-circle-plus-outline\" size=\"mini\" circle @click=\"insertRequest\">\n- </el-button>\n<span>CostTime: </span><span v-text=\"toolbar.costTime\"></span>ms\n<span v-if=\"result.table\">, Row: {{result.data.length-1}}, Col: {{columnCount}}</span>\n- </el-col>\n</el-row>\n<!-- info panel -->\n<div v-if=\"info.visible \">\n" }, { "change_type": "MODIFY", "old_path": "resources/webview/pages/result/components/toolbar.html", "new_path": "resources/webview/pages/result/components/toolbar.html", "diff": "-<el-table-column fixed=\"left\" label=\"Operations\" width=\"130\" v-if=\"result.primaryKey\" align=\"center\">\n+<el-table-column fixed=\"left\" width=\"200\" align=\"center\">\n+ <template slot=\"header\" slot-scope=\"scope\">\n+ <el-input v-model=\"table.search\" placeholder=\"Input To Search Data\" />\n+ </template>\n<template slot-scope=\"scope\">\n<div v-if=\"scope.row.isFilter\" style=\"text-align: center;\">\n<!-- <el-button @click=\"exportData()\" type=\"primary\" size=\"small\" icon=\"el-icon-orange\" circle title=\"Export\"></el-button> -->\n+ <el-button type=\"info\" icon=\"el-icon-circle-plus-outline\" size=\"small\" circle @click=\"insertRequest\">\n+ </el-button>\n<el-popover placement=\"bottom\" title=\"Select columns to show\" width=\"200\" trigger=\"click\">\n<el-checkbox-group v-model=\"toolbar.showColumns\">\n<el-checkbox v-for=\"(column,index) in result.fields\" :label=\"column.name\" :key=\"index\">\ncircle>\n</el-button>\n</div>\n- <div v-if=\"scope.row[result.primaryKey]\">\n+ <div v-if=\"result.primaryKey && scope.row[result.primaryKey]\">\n<el-button @click=\"openEdit(scope.row)\" type=\"primary\" size=\"small\" icon=\"el-icon-edit\" title=\"edit\" circle>\n</el-button>\n- <el-button @click=\"openEdit(scope.row);update.currentNew[result.primaryKey]=null;update.primary=null;\" type=\"info\" size=\"small\" title=\"copy\" icon=\"el-icon-document-copy\"\n- circle>\n+ <el-button @click=\"openEdit(scope.row);update.currentNew[result.primaryKey]=null;update.primary=null;\"\n+ type=\"info\" size=\"small\" title=\"copy\" icon=\"el-icon-document-copy\" circle>\n</el-button>\n<el-button @click=\"deleteConfirm(scope.row[result.primaryKey])\" title=\"delete\" type=\"danger\" size=\"small\"\nicon=\"el-icon-delete\" circle>\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update result layout
141,908
17.05.2020 18:01:53
-28,800
e6be19a7c43b6c7f55f9459176160803e0e5eac2
update webview api
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "{\n\"name\": \"vscode-mysql-client2\",\n- \"version\": \"1.9.4\",\n+ \"version\": \"2.1.0\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n\"@types/node\": \"*\"\n}\n},\n- \"@types/xlsx\": {\n- \"version\": \"0.0.36\",\n- \"resolved\": \"https://registry.npm.taobao.org/@types/xlsx/download/@types/xlsx-0.0.36.tgz\",\n- \"integrity\": \"sha1-tQYgA+XFN0q08I/dO/adpNQBOvg=\",\n- \"dev\": true,\n- \"requires\": {\n- \"xlsx\": \"*\"\n- }\n- },\n- \"adler-32\": {\n- \"version\": \"1.2.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/adler-32/download/adler-32-1.2.0.tgz\",\n- \"integrity\": \"sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU=\",\n- \"requires\": {\n- \"exit-on-epipe\": \"~1.0.1\",\n- \"printj\": \"~1.1.0\"\n- }\n- },\n- \"agent-base\": {\n- \"version\": \"4.3.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/agent-base/download/agent-base-4.3.0.tgz?cache=0&sync_timestamp=1579811507521&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fagent-base%2Fdownload%2Fagent-base-4.3.0.tgz\",\n- \"integrity\": \"sha1-gWXwHENgCbzK0LHRIvBe13Dvxu4=\",\n- \"dev\": true,\n- \"requires\": {\n- \"es6-promisify\": \"^5.0.0\"\n- }\n- },\n- \"ajv\": {\n- \"version\": \"6.12.2\",\n- \"resolved\": \"https://registry.npm.taobao.org/ajv/download/ajv-6.12.2.tgz\",\n- \"integrity\": \"sha1-xinF7O0XuvMUQ3kY0tqIyZ1ZWM0=\",\n- \"dev\": true,\n- \"requires\": {\n- \"fast-deep-equal\": \"^3.1.1\",\n- \"fast-json-stable-stringify\": \"^2.0.0\",\n- \"json-schema-traverse\": \"^0.4.1\",\n- \"uri-js\": \"^4.2.2\"\n- }\n+ \"@types/vscode\": {\n+ \"version\": \"1.38.0\",\n+ \"resolved\": \"https://registry.npm.taobao.org/@types/vscode/download/@types/vscode-1.38.0.tgz\",\n+ \"integrity\": \"sha1-HlOVNAbvZiNU4uYkUcPHHJ/xmm0=\",\n+ \"dev\": true\n},\n\"ansi-styles\": {\n\"version\": \"3.2.1\",\n\"safer-buffer\": \"~2.1.0\"\n}\n},\n- \"assert-plus\": {\n- \"version\": \"1.0.0\",\n- \"resolved\": \"https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz\",\n- \"integrity\": \"sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=\",\n- \"dev\": true\n- },\n\"async\": {\n\"version\": \"2.6.3\",\n\"resolved\": \"https://registry.npmjs.org/async/-/async-2.6.3.tgz\",\n\"resolved\": \"https://registry.npmjs.org/async-lock/-/async-lock-1.2.2.tgz\",\n\"integrity\": \"sha512-uczz62z2fMWOFbyo6rG4NlV2SdxugJT6sZA2QcfB1XaSjEiOh8CuOb/TttyMnYQCda6nkWecJe465tGQDPJiKw==\"\n},\n- \"asynckit\": {\n- \"version\": \"0.4.0\",\n- \"resolved\": \"https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz\",\n- \"integrity\": \"sha1-x57Zf380y48robyXkLzDZkdLS3k=\",\n- \"dev\": true\n- },\n- \"aws-sign2\": {\n- \"version\": \"0.7.0\",\n- \"resolved\": \"https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz\",\n- \"integrity\": \"sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=\",\n- \"dev\": true\n- },\n- \"aws4\": {\n- \"version\": \"1.9.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/aws4/download/aws4-1.9.1.tgz\",\n- \"integrity\": \"sha1-fjPY99RJs/ZzzXLeuavcVS2+Uo4=\",\n- \"dev\": true\n- },\n\"balanced-match\": {\n\"version\": \"1.0.0\",\n\"resolved\": \"https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz\",\n\"integrity\": \"sha1-ibTRmasr7kneFk6gK4nORi1xt2c=\",\n\"dev\": true\n},\n- \"bcrypt-pbkdf\": {\n- \"version\": \"1.0.2\",\n- \"resolved\": \"https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz\",\n- \"integrity\": \"sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=\",\n- \"dev\": true,\n- \"requires\": {\n- \"tweetnacl\": \"^0.14.3\"\n- }\n- },\n\"bignumber.js\": {\n\"version\": \"9.0.0\",\n\"resolved\": \"https://registry.npm.taobao.org/bignumber.js/download/bignumber.js-9.0.0.tgz\",\n\"concat-map\": \"0.0.1\"\n}\n},\n- \"browser-stdout\": {\n- \"version\": \"1.3.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/browser-stdout/download/browser-stdout-1.3.1.tgz\",\n- \"integrity\": \"sha1-uqVZ7hTO1zRSIputcyZGfGH6vWA=\",\n- \"dev\": true\n- },\n- \"buffer-from\": {\n- \"version\": \"1.1.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/buffer-from/download/buffer-from-1.1.1.tgz\",\n- \"integrity\": \"sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=\"\n- },\n\"builtin-modules\": {\n\"version\": \"1.1.1\",\n\"resolved\": \"https://registry.npm.taobao.org/builtin-modules/download/builtin-modules-1.1.1.tgz\",\n\"integrity\": \"sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=\",\n\"dev\": true\n},\n- \"caseless\": {\n- \"version\": \"0.12.0\",\n- \"resolved\": \"https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz\",\n- \"integrity\": \"sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=\",\n- \"dev\": true\n- },\n- \"cfb\": {\n- \"version\": \"1.1.4\",\n- \"resolved\": \"https://registry.npm.taobao.org/cfb/download/cfb-1.1.4.tgz?cache=0&sync_timestamp=1584079392655&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcfb%2Fdownload%2Fcfb-1.1.4.tgz\",\n- \"integrity\": \"sha1-gf017eTJGdjwliqUWC4d+vcFHio=\",\n- \"requires\": {\n- \"adler-32\": \"~1.2.0\",\n- \"commander\": \"^2.16.0\",\n- \"crc-32\": \"~1.2.0\",\n- \"printj\": \"~1.1.2\"\n- },\n- \"dependencies\": {\n- \"commander\": {\n- \"version\": \"2.20.3\",\n- \"resolved\": \"https://registry.npm.taobao.org/commander/download/commander-2.20.3.tgz?cache=0&sync_timestamp=1587781810870&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.20.3.tgz\",\n- \"integrity\": \"sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=\"\n- }\n- }\n- },\n\"chalk\": {\n\"version\": \"2.4.2\",\n\"resolved\": \"https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz\",\n\"supports-color\": \"^5.3.0\"\n}\n},\n- \"codepage\": {\n- \"version\": \"1.14.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/codepage/download/codepage-1.14.0.tgz\",\n- \"integrity\": \"sha1-jL4lSBMjVZ19MHVxsP/5HnodL5k=\",\n- \"requires\": {\n- \"commander\": \"~2.14.1\",\n- \"exit-on-epipe\": \"~1.0.1\"\n- },\n- \"dependencies\": {\n- \"commander\": {\n- \"version\": \"2.14.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/commander/download/commander-2.14.1.tgz?cache=0&sync_timestamp=1587781810870&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.14.1.tgz\",\n- \"integrity\": \"sha1-IjUSPjevjKPGXfRbAm29NXsBuao=\"\n- }\n- }\n- },\n\"color-convert\": {\n\"version\": \"1.9.3\",\n\"resolved\": \"https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz?cache=0&sync_timestamp=1566248870121&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcolor-convert%2Fdownload%2Fcolor-convert-1.9.3.tgz\",\n\"integrity\": \"sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=\",\n\"dev\": true\n},\n- \"combined-stream\": {\n- \"version\": \"1.0.8\",\n- \"resolved\": \"https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz\",\n- \"integrity\": \"sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=\",\n- \"dev\": true,\n- \"requires\": {\n- \"delayed-stream\": \"~1.0.0\"\n- }\n- },\n\"commander\": {\n\"version\": \"2.15.1\",\n\"resolved\": \"https://registry.npm.taobao.org/commander/download/commander-2.15.1.tgz\",\n\"resolved\": \"https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz\",\n\"integrity\": \"sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=\"\n},\n- \"crc-32\": {\n- \"version\": \"1.2.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/crc-32/download/crc-32-1.2.0.tgz\",\n- \"integrity\": \"sha1-yy224puIUI4y2d0OwWk+e0Ghggg=\",\n- \"requires\": {\n- \"exit-on-epipe\": \"~1.0.1\",\n- \"printj\": \"~1.1.0\"\n- }\n- },\n- \"dashdash\": {\n- \"version\": \"1.14.1\",\n- \"resolved\": \"https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz\",\n- \"integrity\": \"sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=\",\n- \"dev\": true,\n- \"requires\": {\n- \"assert-plus\": \"^1.0.0\"\n- }\n- },\n\"date-format\": {\n\"version\": \"3.0.0\",\n\"resolved\": \"https://registry.npm.taobao.org/date-format/download/date-format-3.0.0.tgz?cache=0&sync_timestamp=1572558653136&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdate-format%2Fdownload%2Fdate-format-3.0.0.tgz\",\n\"integrity\": \"sha1-64eANlx9KxURB4+0keZHl4DzrZU=\"\n},\n- \"debug\": {\n- \"version\": \"3.1.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz\",\n- \"integrity\": \"sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=\",\n- \"dev\": true,\n- \"requires\": {\n- \"ms\": \"2.0.0\"\n- }\n- },\n\"deepmerge\": {\n\"version\": \"3.3.0\",\n\"resolved\": \"https://registry.npm.taobao.org/deepmerge/download/deepmerge-3.3.0.tgz\",\n\"integrity\": \"sha1-08R/1vOpPVF7FEJrBiihewEl9fc=\"\n},\n- \"delayed-stream\": {\n- \"version\": \"1.0.0\",\n- \"resolved\": \"https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz\",\n- \"integrity\": \"sha1-3zrhmayt+31ECqrgsp4icrJOxhk=\",\n- \"dev\": true\n- },\n\"denque\": {\n\"version\": \"1.4.1\",\n\"resolved\": \"https://registry.npm.taobao.org/denque/download/denque-1.4.1.tgz\",\n\"integrity\": \"sha1-Z0T/dkHBSMP4ppwwflEjXB9KN88=\"\n},\n- \"diff\": {\n- \"version\": \"3.5.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/diff/download/diff-3.5.0.tgz?cache=0&sync_timestamp=1578890967183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdiff%2Fdownload%2Fdiff-3.5.0.tgz\",\n- \"integrity\": \"sha1-gAwN0eCov7yVg1wgKtIg/jF+WhI=\",\n- \"dev\": true\n- },\n- \"ecc-jsbn\": {\n- \"version\": \"0.1.2\",\n- \"resolved\": \"https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz\",\n- \"integrity\": \"sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=\",\n- \"dev\": true,\n- \"requires\": {\n- \"jsbn\": \"~0.1.0\",\n- \"safer-buffer\": \"^2.1.0\"\n- }\n- },\n- \"es6-promise\": {\n- \"version\": \"4.2.8\",\n- \"resolved\": \"https://registry.npm.taobao.org/es6-promise/download/es6-promise-4.2.8.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes6-promise%2Fdownload%2Fes6-promise-4.2.8.tgz\",\n- \"integrity\": \"sha1-TrIVlMlyvEBVPSduUQU5FD21Pgo=\",\n- \"dev\": true\n- },\n- \"es6-promisify\": {\n- \"version\": \"5.0.0\",\n- \"resolved\": \"https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz\",\n- \"integrity\": \"sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=\",\n- \"dev\": true,\n- \"requires\": {\n- \"es6-promise\": \"^4.0.3\"\n- }\n- },\n\"escape-string-regexp\": {\n\"version\": \"1.0.5\",\n\"resolved\": \"https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz\",\n\"integrity\": \"sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=\",\n\"dev\": true\n},\n- \"exit-on-epipe\": {\n- \"version\": \"1.0.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz\",\n- \"integrity\": \"sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI=\"\n- },\n- \"extend\": {\n- \"version\": \"3.0.2\",\n- \"resolved\": \"https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz\",\n- \"integrity\": \"sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=\",\n- \"dev\": true\n- },\n- \"extsprintf\": {\n- \"version\": \"1.3.0\",\n- \"resolved\": \"https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz\",\n- \"integrity\": \"sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=\",\n- \"dev\": true\n- },\n- \"fast-deep-equal\": {\n- \"version\": \"3.1.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.1.tgz\",\n- \"integrity\": \"sha1-VFFFB3xQFJHjOxXsQIwpQ3bpSuQ=\",\n- \"dev\": true\n- },\n- \"fast-json-stable-stringify\": {\n- \"version\": \"2.1.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz?cache=0&sync_timestamp=1576340291001&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-json-stable-stringify%2Fdownload%2Ffast-json-stable-stringify-2.1.0.tgz\",\n- \"integrity\": \"sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM=\",\n- \"dev\": true\n- },\n- \"forever-agent\": {\n- \"version\": \"0.6.1\",\n- \"resolved\": \"https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz\",\n- \"integrity\": \"sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=\",\n- \"dev\": true\n- },\n- \"form-data\": {\n- \"version\": \"2.3.3\",\n- \"resolved\": \"https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz\",\n- \"integrity\": \"sha1-3M5SwF9kTymManq5Nr1yTO/786Y=\",\n- \"dev\": true,\n- \"requires\": {\n- \"asynckit\": \"^0.4.0\",\n- \"combined-stream\": \"^1.0.6\",\n- \"mime-types\": \"^2.1.12\"\n- }\n- },\n- \"frac\": {\n- \"version\": \"1.1.2\",\n- \"resolved\": \"https://registry.npm.taobao.org/frac/download/frac-1.1.2.tgz\",\n- \"integrity\": \"sha1-PXT39keMiKG1AgMG10fcYxPHTQs=\"\n- },\n\"fs.realpath\": {\n\"version\": \"1.0.0\",\n\"resolved\": \"https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz\",\n\"is-property\": \"^1.0.2\"\n}\n},\n- \"getpass\": {\n- \"version\": \"0.1.7\",\n- \"resolved\": \"https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz\",\n- \"integrity\": \"sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=\",\n- \"dev\": true,\n- \"requires\": {\n- \"assert-plus\": \"^1.0.0\"\n- }\n- },\n\"glob\": {\n\"version\": \"7.1.2\",\n\"resolved\": \"https://registry.npmjs.org/glob/-/glob-7.1.2.tgz\",\n\"path-is-absolute\": \"^1.0.0\"\n}\n},\n- \"growl\": {\n- \"version\": \"1.10.5\",\n- \"resolved\": \"https://registry.npm.taobao.org/growl/download/growl-1.10.5.tgz\",\n- \"integrity\": \"sha1-8nNdwig2dPpnR4sQGBBZNVw2nl4=\",\n- \"dev\": true\n- },\n- \"har-schema\": {\n- \"version\": \"2.0.0\",\n- \"resolved\": \"https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz\",\n- \"integrity\": \"sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=\",\n- \"dev\": true\n- },\n- \"har-validator\": {\n- \"version\": \"5.1.3\",\n- \"resolved\": \"https://registry.npm.taobao.org/har-validator/download/har-validator-5.1.3.tgz\",\n- \"integrity\": \"sha1-HvievT5JllV2de7ZiTEQ3DUPoIA=\",\n- \"dev\": true,\n- \"requires\": {\n- \"ajv\": \"^6.5.5\",\n- \"har-schema\": \"^2.0.0\"\n- }\n- },\n- \"has-flag\": {\n- \"version\": \"3.0.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz\",\n- \"integrity\": \"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=\",\n- \"dev\": true\n- },\n- \"he\": {\n- \"version\": \"1.1.1\",\n- \"resolved\": \"https://registry.npmjs.org/he/-/he-1.1.1.tgz\",\n- \"integrity\": \"sha1-k0EP0hsAlzUVH4howvJx80J+I/0=\",\n- \"dev\": true\n- },\n- \"http-proxy-agent\": {\n- \"version\": \"2.1.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/http-proxy-agent/download/http-proxy-agent-2.1.0.tgz\",\n- \"integrity\": \"sha1-5IIb7vWyFCogJr1zkm/lN2McVAU=\",\n- \"dev\": true,\n- \"requires\": {\n- \"agent-base\": \"4\",\n- \"debug\": \"3.1.0\"\n- }\n- },\n- \"http-signature\": {\n- \"version\": \"1.2.0\",\n- \"resolved\": \"https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz\",\n- \"integrity\": \"sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=\",\n- \"dev\": true,\n- \"requires\": {\n- \"assert-plus\": \"^1.0.0\",\n- \"jsprim\": \"^1.2.2\",\n- \"sshpk\": \"^1.7.0\"\n- }\n- },\n- \"https-proxy-agent\": {\n- \"version\": \"2.2.4\",\n- \"resolved\": \"https://registry.npm.taobao.org/https-proxy-agent/download/https-proxy-agent-2.2.4.tgz?cache=0&sync_timestamp=1581106803611&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhttps-proxy-agent%2Fdownload%2Fhttps-proxy-agent-2.2.4.tgz\",\n- \"integrity\": \"sha1-TuenN6vZJniik9mzShr00NCMeHs=\",\n- \"dev\": true,\n- \"requires\": {\n- \"agent-base\": \"^4.3.0\",\n- \"debug\": \"^3.1.0\"\n- }\n- },\n\"iconv-lite\": {\n\"version\": \"0.5.1\",\n\"resolved\": \"https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.5.1.tgz?cache=0&sync_timestamp=1579333981154&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ficonv-lite%2Fdownload%2Ficonv-lite-0.5.1.tgz\",\n\"resolved\": \"https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz\",\n\"integrity\": \"sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=\"\n},\n- \"is-typedarray\": {\n- \"version\": \"1.0.0\",\n- \"resolved\": \"https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz\",\n- \"integrity\": \"sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=\",\n- \"dev\": true\n- },\n\"isarray\": {\n\"version\": \"1.0.0\",\n\"resolved\": \"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz\",\n\"integrity\": \"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=\"\n},\n- \"isstream\": {\n- \"version\": \"0.1.2\",\n- \"resolved\": \"https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz\",\n- \"integrity\": \"sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=\",\n- \"dev\": true\n- },\n\"js-tokens\": {\n\"version\": \"4.0.0\",\n\"resolved\": \"https://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz?cache=0&sync_timestamp=1586796260005&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjs-tokens%2Fdownload%2Fjs-tokens-4.0.0.tgz\",\n\"esprima\": \"^4.0.0\"\n}\n},\n- \"jsbn\": {\n- \"version\": \"0.1.1\",\n- \"resolved\": \"https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz\",\n- \"integrity\": \"sha1-peZUwuWi3rXyAdls77yoDA7y9RM=\",\n- \"dev\": true\n- },\n- \"json-schema\": {\n- \"version\": \"0.2.3\",\n- \"resolved\": \"https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz\",\n- \"integrity\": \"sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=\",\n- \"dev\": true\n- },\n- \"json-schema-traverse\": {\n- \"version\": \"0.4.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz\",\n- \"integrity\": \"sha1-afaofZUTq4u4/mO9sJecRI5oRmA=\",\n- \"dev\": true\n- },\n- \"json-stringify-safe\": {\n- \"version\": \"5.0.1\",\n- \"resolved\": \"https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz\",\n- \"integrity\": \"sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=\",\n- \"dev\": true\n- },\n- \"jsprim\": {\n- \"version\": \"1.4.1\",\n- \"resolved\": \"https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz\",\n- \"integrity\": \"sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=\",\n- \"dev\": true,\n- \"requires\": {\n- \"assert-plus\": \"1.0.0\",\n- \"extsprintf\": \"1.3.0\",\n- \"json-schema\": \"0.2.3\",\n- \"verror\": \"1.10.0\"\n- }\n- },\n\"lodash\": {\n\"version\": \"4.17.15\",\n\"resolved\": \"https://registry.npm.taobao.org/lodash/download/lodash-4.17.15.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.15.tgz\",\n\"yallist\": \"^3.0.2\"\n}\n},\n- \"mime-db\": {\n- \"version\": \"1.43.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/mime-db/download/mime-db-1.43.0.tgz?cache=0&sync_timestamp=1578281104943&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime-db%2Fdownload%2Fmime-db-1.43.0.tgz\",\n- \"integrity\": \"sha1-ChLgUCZQ5HPXNVNQUOfI9OtPrlg=\",\n- \"dev\": true\n- },\n- \"mime-types\": {\n- \"version\": \"2.1.26\",\n- \"resolved\": \"https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.26.tgz?cache=0&sync_timestamp=1578282585871&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime-types%2Fdownload%2Fmime-types-2.1.26.tgz\",\n- \"integrity\": \"sha1-nJIfwJt+FJpl39wNpNIJlyALCgY=\",\n- \"dev\": true,\n- \"requires\": {\n- \"mime-db\": \"1.43.0\"\n- }\n- },\n\"minimatch\": {\n\"version\": \"3.0.4\",\n\"resolved\": \"https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz\",\n\"minimist\": \"0.0.8\"\n}\n},\n- \"mocha\": {\n- \"version\": \"5.2.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/mocha/download/mocha-5.2.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmocha%2Fdownload%2Fmocha-5.2.0.tgz\",\n- \"integrity\": \"sha1-bYrlCPWRZ/lA8rWzxKYSrlDJCuY=\",\n- \"dev\": true,\n- \"requires\": {\n- \"browser-stdout\": \"1.3.1\",\n- \"commander\": \"2.15.1\",\n- \"debug\": \"3.1.0\",\n- \"diff\": \"3.5.0\",\n- \"escape-string-regexp\": \"1.0.5\",\n- \"glob\": \"7.1.2\",\n- \"growl\": \"1.10.5\",\n- \"he\": \"1.1.1\",\n- \"minimatch\": \"3.0.4\",\n- \"mkdirp\": \"0.5.1\",\n- \"supports-color\": \"5.4.0\"\n- },\n- \"dependencies\": {\n- \"supports-color\": {\n- \"version\": \"5.4.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/supports-color/download/supports-color-5.4.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-5.4.0.tgz\",\n- \"integrity\": \"sha1-HGszdALCE3YF7+GfEP7DkPb6q1Q=\",\n- \"dev\": true,\n- \"requires\": {\n- \"has-flag\": \"^3.0.0\"\n- }\n- }\n- }\n- },\n\"mockjs\": {\n\"version\": \"1.1.0\",\n\"resolved\": \"https://registry.npm.taobao.org/mockjs/download/mockjs-1.1.0.tgz\",\n}\n}\n},\n- \"node-xlsx\": {\n- \"version\": \"0.15.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/node-xlsx/download/node-xlsx-0.15.0.tgz\",\n- \"integrity\": \"sha1-HxsNetzlxwboa/2WpaoABb+KncM=\",\n- \"requires\": {\n- \"buffer-from\": \"^1.1.0\",\n- \"xlsx\": \"^0.14.1\"\n- },\n- \"dependencies\": {\n- \"commander\": {\n- \"version\": \"2.17.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1587781810870&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.17.1.tgz\",\n- \"integrity\": \"sha1-vXerfebelCBc6sxy8XFtKfIKd78=\"\n- },\n- \"xlsx\": {\n- \"version\": \"0.14.5\",\n- \"resolved\": \"https://registry.npm.taobao.org/xlsx/download/xlsx-0.14.5.tgz?cache=0&sync_timestamp=1584260308730&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxlsx%2Fdownload%2Fxlsx-0.14.5.tgz\",\n- \"integrity\": \"sha1-NjfpFNeRvcpzgoFuFz99cl7Q4NI=\",\n- \"requires\": {\n- \"adler-32\": \"~1.2.0\",\n- \"cfb\": \"^1.1.2\",\n- \"codepage\": \"~1.14.0\",\n- \"commander\": \"~2.17.1\",\n- \"crc-32\": \"~1.2.0\",\n- \"exit-on-epipe\": \"~1.0.1\",\n- \"ssf\": \"~0.10.2\"\n- }\n- }\n- }\n- },\n- \"oauth-sign\": {\n- \"version\": \"0.9.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz\",\n- \"integrity\": \"sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU=\",\n- \"dev\": true\n- },\n\"once\": {\n\"version\": \"1.4.0\",\n\"resolved\": \"https://registry.npmjs.org/once/-/once-1.4.0.tgz\",\n\"integrity\": \"sha1-1i27VnlAXXLEc37FhgDp3c8G0kw=\",\n\"dev\": true\n},\n- \"performance-now\": {\n- \"version\": \"2.1.0\",\n- \"resolved\": \"https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz\",\n- \"integrity\": \"sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=\",\n- \"dev\": true\n- },\n\"portfinder\": {\n\"version\": \"1.0.26\",\n\"resolved\": \"https://registry.npmjs.org/portfinder/-/portfinder-1.0.26.tgz\",\n}\n}\n},\n- \"printj\": {\n- \"version\": \"1.1.2\",\n- \"resolved\": \"https://registry.npm.taobao.org/printj/download/printj-1.1.2.tgz\",\n- \"integrity\": \"sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI=\"\n- },\n\"process-nextick-args\": {\n\"version\": \"2.0.1\",\n\"resolved\": \"https://registry.npm.taobao.org/process-nextick-args/download/process-nextick-args-2.0.1.tgz\",\n\"resolved\": \"https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz\",\n\"integrity\": \"sha1-8FKijacOYYkX7wqKw0wa5aaChrM=\"\n},\n- \"psl\": {\n- \"version\": \"1.8.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz\",\n- \"integrity\": \"sha1-kyb4vPsBOtzABf3/BWrM4CDlHCQ=\",\n- \"dev\": true\n- },\n- \"punycode\": {\n- \"version\": \"2.1.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz\",\n- \"integrity\": \"sha1-tYsBCsQMIsVldhbI0sLALHv0eew=\",\n- \"dev\": true\n- },\n- \"qs\": {\n- \"version\": \"6.5.2\",\n- \"resolved\": \"https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz\",\n- \"integrity\": \"sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=\",\n- \"dev\": true\n- },\n- \"querystringify\": {\n- \"version\": \"2.1.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/querystringify/download/querystringify-2.1.1.tgz\",\n- \"integrity\": \"sha1-YOWl/WSn+L+k0qsu1v30yFutFU4=\",\n- \"dev\": true\n- },\n\"readable-stream\": {\n\"version\": \"2.3.7\",\n\"resolved\": \"https://registry.npm.taobao.org/readable-stream/download/readable-stream-2.3.7.tgz?cache=0&sync_timestamp=1581624324274&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freadable-stream%2Fdownload%2Freadable-stream-2.3.7.tgz\",\n\"util-deprecate\": \"~1.0.1\"\n}\n},\n- \"request\": {\n- \"version\": \"2.88.2\",\n- \"resolved\": \"https://registry.npm.taobao.org/request/download/request-2.88.2.tgz\",\n- \"integrity\": \"sha1-1zyRhzHLWofaBH4gcjQUb2ZNErM=\",\n- \"dev\": true,\n- \"requires\": {\n- \"aws-sign2\": \"~0.7.0\",\n- \"aws4\": \"^1.8.0\",\n- \"caseless\": \"~0.12.0\",\n- \"combined-stream\": \"~1.0.6\",\n- \"extend\": \"~3.0.2\",\n- \"forever-agent\": \"~0.6.1\",\n- \"form-data\": \"~2.3.2\",\n- \"har-validator\": \"~5.1.3\",\n- \"http-signature\": \"~1.2.0\",\n- \"is-typedarray\": \"~1.0.0\",\n- \"isstream\": \"~0.1.2\",\n- \"json-stringify-safe\": \"~5.0.1\",\n- \"mime-types\": \"~2.1.19\",\n- \"oauth-sign\": \"~0.9.0\",\n- \"performance-now\": \"^2.1.0\",\n- \"qs\": \"~6.5.2\",\n- \"safe-buffer\": \"^5.1.2\",\n- \"tough-cookie\": \"~2.5.0\",\n- \"tunnel-agent\": \"^0.6.0\",\n- \"uuid\": \"^3.3.2\"\n- },\n- \"dependencies\": {\n- \"safe-buffer\": {\n- \"version\": \"5.2.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.0.tgz\",\n- \"integrity\": \"sha1-t02uxJsRSPiMZLaNSbHoFcHy9Rk=\",\n- \"dev\": true\n- }\n- }\n- },\n- \"requires-port\": {\n- \"version\": \"1.0.0\",\n- \"resolved\": \"https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz\",\n- \"integrity\": \"sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=\",\n- \"dev\": true\n- },\n\"resolve\": {\n\"version\": \"1.16.0\",\n\"resolved\": \"https://registry.npm.taobao.org/resolve/download/resolve-1.16.0.tgz?cache=0&sync_timestamp=1586994575637&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.16.0.tgz\",\n\"resolved\": \"https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz\",\n\"integrity\": \"sha1-1WgS4cAXpuTnw+Ojeh2m143TyT4=\"\n},\n- \"source-map\": {\n- \"version\": \"0.6.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz\",\n- \"integrity\": \"sha1-dHIq8y6WFOnCh6jQu95IteLxomM=\",\n- \"dev\": true\n- },\n- \"source-map-support\": {\n- \"version\": \"0.5.17\",\n- \"resolved\": \"https://registry.npm.taobao.org/source-map-support/download/source-map-support-0.5.17.tgz\",\n- \"integrity\": \"sha1-Kf4bPJi529UGStqJBS7o/wcMtGw=\",\n- \"dev\": true,\n- \"requires\": {\n- \"buffer-from\": \"^1.0.0\",\n- \"source-map\": \"^0.6.0\"\n- }\n- },\n\"sprintf-js\": {\n\"version\": \"1.0.3\",\n\"resolved\": \"https://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.0.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsprintf-js%2Fdownload%2Fsprintf-js-1.0.3.tgz\",\n\"resolved\": \"https://registry.npm.taobao.org/sqlstring/download/sqlstring-2.3.1.tgz?cache=0&sync_timestamp=1587004209757&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsqlstring%2Fdownload%2Fsqlstring-2.3.1.tgz\",\n\"integrity\": \"sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A=\"\n},\n- \"ssf\": {\n- \"version\": \"0.10.3\",\n- \"resolved\": \"https://registry.npm.taobao.org/ssf/download/ssf-0.10.3.tgz\",\n- \"integrity\": \"sha1-jq4fwpyQpVLnkhII+BiS1vd6yys=\",\n- \"requires\": {\n- \"frac\": \"~1.1.2\"\n- }\n- },\n- \"sshpk\": {\n- \"version\": \"1.16.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz\",\n- \"integrity\": \"sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=\",\n- \"dev\": true,\n- \"requires\": {\n- \"asn1\": \"~0.2.3\",\n- \"assert-plus\": \"^1.0.0\",\n- \"bcrypt-pbkdf\": \"^1.0.0\",\n- \"dashdash\": \"^1.12.0\",\n- \"ecc-jsbn\": \"~0.1.1\",\n- \"getpass\": \"^0.1.1\",\n- \"jsbn\": \"~0.1.0\",\n- \"safer-buffer\": \"^2.0.2\",\n- \"tweetnacl\": \"~0.14.0\"\n- }\n- },\n\"streamsearch\": {\n\"version\": \"0.1.2\",\n\"resolved\": \"https://registry.npm.taobao.org/streamsearch/download/streamsearch-0.1.2.tgz\",\n}\n}\n},\n- \"tough-cookie\": {\n- \"version\": \"2.5.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz?cache=0&sync_timestamp=1584646121003&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftough-cookie%2Fdownload%2Ftough-cookie-2.5.0.tgz\",\n- \"integrity\": \"sha1-zZ+yoKodWhK0c72fuW+j3P9lreI=\",\n- \"dev\": true,\n- \"requires\": {\n- \"psl\": \"^1.1.28\",\n- \"punycode\": \"^2.1.1\"\n- }\n- },\n\"tslib\": {\n\"version\": \"1.11.1\",\n\"resolved\": \"https://registry.npm.taobao.org/tslib/download/tslib-1.11.1.tgz\",\n\"tslib\": \"^1.8.1\"\n}\n},\n- \"tunnel-agent\": {\n- \"version\": \"0.6.0\",\n- \"resolved\": \"https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz\",\n- \"integrity\": \"sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=\",\n- \"dev\": true,\n- \"requires\": {\n- \"safe-buffer\": \"^5.0.1\"\n- }\n- },\n\"tunnel-ssh\": {\n\"version\": \"4.1.4\",\n\"resolved\": \"https://registry.npm.taobao.org/tunnel-ssh/download/tunnel-ssh-4.1.4.tgz\",\n}\n}\n},\n- \"tweetnacl\": {\n- \"version\": \"0.14.5\",\n- \"resolved\": \"https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz\",\n- \"integrity\": \"sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=\",\n- \"dev\": true\n- },\n\"typescript\": {\n\"version\": \"3.8.3\",\n\"resolved\": \"https://registry.npm.taobao.org/typescript/download/typescript-3.8.3.tgz\",\n\"integrity\": \"sha1-QJ64VE6gM1cRIFhp7EWKsQnuEGE=\",\n\"dev\": true\n},\n- \"uri-js\": {\n- \"version\": \"4.2.2\",\n- \"resolved\": \"https://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz\",\n- \"integrity\": \"sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=\",\n- \"dev\": true,\n- \"requires\": {\n- \"punycode\": \"^2.1.0\"\n- }\n- },\n- \"url-parse\": {\n- \"version\": \"1.4.7\",\n- \"resolved\": \"https://registry.npm.taobao.org/url-parse/download/url-parse-1.4.7.tgz\",\n- \"integrity\": \"sha1-qKg1NejACjFuQDpdtKwbm4U64ng=\",\n- \"dev\": true,\n- \"requires\": {\n- \"querystringify\": \"^2.1.1\",\n- \"requires-port\": \"^1.0.0\"\n- }\n- },\n\"util-deprecate\": {\n\"version\": \"1.0.2\",\n\"resolved\": \"https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz\",\n\"integrity\": \"sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=\"\n},\n- \"uuid\": {\n- \"version\": \"3.4.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/uuid/download/uuid-3.4.0.tgz\",\n- \"integrity\": \"sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4=\",\n- \"dev\": true\n- },\n- \"verror\": {\n- \"version\": \"1.10.0\",\n- \"resolved\": \"https://registry.npmjs.org/verror/-/verror-1.10.0.tgz\",\n- \"integrity\": \"sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=\",\n- \"dev\": true,\n- \"requires\": {\n- \"assert-plus\": \"^1.0.0\",\n- \"core-util-is\": \"1.0.2\",\n- \"extsprintf\": \"^1.2.0\"\n- }\n- },\n- \"vscode\": {\n- \"version\": \"1.1.36\",\n- \"resolved\": \"https://registry.npm.taobao.org/vscode/download/vscode-1.1.36.tgz\",\n- \"integrity\": \"sha1-XhoNG/SXfQx7xRWamhPVsQTUsbY=\",\n- \"dev\": true,\n- \"requires\": {\n- \"glob\": \"^7.1.2\",\n- \"mocha\": \"^5.2.0\",\n- \"request\": \"^2.88.0\",\n- \"semver\": \"^5.4.1\",\n- \"source-map-support\": \"^0.5.0\",\n- \"url-parse\": \"^1.4.4\",\n- \"vscode-test\": \"^0.4.1\"\n- }\n- },\n- \"vscode-test\": {\n- \"version\": \"0.4.3\",\n- \"resolved\": \"https://registry.npm.taobao.org/vscode-test/download/vscode-test-0.4.3.tgz\",\n- \"integrity\": \"sha1-Rh6/JfxLyT132YKu1VZlii4rkLg=\",\n- \"dev\": true,\n- \"requires\": {\n- \"http-proxy-agent\": \"^2.1.0\",\n- \"https-proxy-agent\": \"^2.2.1\"\n- }\n- },\n- \"wmf\": {\n- \"version\": \"1.0.2\",\n- \"resolved\": \"https://registry.npm.taobao.org/wmf/download/wmf-1.0.2.tgz\",\n- \"integrity\": \"sha1-fRnWIQcaCMK9xrfmiKnENSmMwto=\"\n- },\n\"wrappy\": {\n\"version\": \"1.0.2\",\n\"resolved\": \"https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz\",\n\"integrity\": \"sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=\",\n\"dev\": true\n},\n- \"xlsx\": {\n- \"version\": \"0.15.6\",\n- \"resolved\": \"https://registry.npm.taobao.org/xlsx/download/xlsx-0.15.6.tgz?cache=0&sync_timestamp=1584260308730&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxlsx%2Fdownload%2Fxlsx-0.15.6.tgz\",\n- \"integrity\": \"sha1-Rh+EHW2eoag3XizSRr8jrs4IodU=\",\n- \"requires\": {\n- \"adler-32\": \"~1.2.0\",\n- \"cfb\": \"^1.1.4\",\n- \"codepage\": \"~1.14.0\",\n- \"commander\": \"~2.17.1\",\n- \"crc-32\": \"~1.2.0\",\n- \"exit-on-epipe\": \"~1.0.1\",\n- \"ssf\": \"~0.10.3\",\n- \"wmf\": \"~1.0.1\"\n- },\n- \"dependencies\": {\n- \"commander\": {\n- \"version\": \"2.17.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1587781810870&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.17.1.tgz\",\n- \"integrity\": \"sha1-vXerfebelCBc6sxy8XFtKfIKd78=\"\n- }\n- }\n- },\n\"yallist\": {\n\"version\": \"3.1.1\",\n\"resolved\": \"https://registry.npm.taobao.org/yallist/download/yallist-3.1.1.tgz\",\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"publisher\": \"cweijan\",\n\"icon\": \"logo.png\",\n\"engines\": {\n- \"vscode\": \"^1.35.0\"\n+ \"vscode\": \"^1.38.0\"\n},\n\"categories\": [\n\"Programming Languages\",\n\"@types/mysql\": \"^2.15.10\",\n\"@types/node\": \"^7.10.10\",\n\"@types/ssh2\": \"^0.5.43\",\n+ \"@types/vscode\": \"1.38.0\",\n\"tslint\": \"^5.8.0\",\n- \"typescript\": \"^3.8.3\",\n- \"vscode\": \"^1.1.36\"\n+ \"typescript\": \"^3.8.3\"\n},\n\"dependencies\": {\n\"async-lock\": \"^1.2.2\",\n" }, { "change_type": "MODIFY", "old_path": "src/view/viewManager.ts", "new_path": "src/view/viewManager.ts", "diff": "@@ -86,7 +86,7 @@ export class ViewManager {\n},\n{ enableScripts: true, retainContextWhenHidden: true },\n);\n- webviewPanel.webview.html = this.buildInclude(this.buildPath(data), path.resolve(targetPath, \"..\"));\n+ webviewPanel.webview.html = this.buildInclude(this.buildPath(data, webviewPanel.webview), path.resolve(targetPath, \"..\"));\nthis.viewStatu[viewOption.title] = {\ncreating: true,\ninstance: webviewPanel,\n@@ -131,8 +131,8 @@ export class ViewManager {\nreturn data;\n}\n- private static buildPath(data: string): string {\n- return data.replace(/(\"|')\\/?(css|js)\\b/gi, \"$1\" + vscode.Uri.file(`${this.webviewPath}/`).with({ scheme: 'vscode-resource' }).toString() + \"/$2\");\n+ private static buildPath(data: string, webview: vscode.Webview): string {\n+ return data.replace(/(\"|')\\/?(css|js)\\b/gi, \"$1\" + webview.asWebviewUri(vscode.Uri.file(`${this.webviewPath}/`)) + \"/$2\");\n}\n}\n\\ No newline at end of file\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update webview api
141,908
19.05.2020 11:50:54
-28,800
40a105ae71b8dc593a67d4d1fcdbd297400a591f
fix read mock fail
[ { "change_type": "MODIFY", "old_path": "src/service/mock/mockRunner.ts", "new_path": "src/service/mock/mockRunner.ts", "diff": "@@ -35,16 +35,19 @@ export class MockRunner {\nconst mockPath = `mock/${tableNode.database}/${tableNode.table}/mock.json`;\nconst mockFullPath = `${FileManager.storagePath}/${mockPath}`;\n+ let targetModel = mockModel;\n+\n+ try {\nif (existsSync(mockFullPath)) {\nconst existsMockModel = JSON.parse(readFileSync(mockFullPath, 'utf8')) as MockModel;\nif (Object.keys(existsMockModel.mock).length != columnList.length) {\nexistsMockModel.mock = mockModel.mock\n- await FileManager.record(mockPath, JSON.stringify(existsMockModel, null, 4), FileModel.WRITE);\n}\n-\n- } else {\n- await FileManager.record(mockPath, JSON.stringify(mockModel, null, 4), FileModel.WRITE);\n+ targetModel = existsMockModel\n}\n+ } catch (err) { }\n+\n+ await FileManager.record(mockPath, JSON.stringify(targetModel, null, 4), FileModel.WRITE);\nawait vscode.window.showTextDocument(\nawait vscode.workspace.openTextDocument(mockFullPath)\n);\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix read mock fail
141,908
20.05.2020 11:28:17
-28,800
07fed6f33017309d46bfd521c4f7d5e7ce7b3e2e
fix connect by ssh tunnel fail
[ { "change_type": "MODIFY", "old_path": "src/service/common/sshTunnelService.ts", "new_path": "src/service/common/sshTunnelService.ts", "diff": "@@ -49,7 +49,7 @@ export class SSHTunnelService {\ndelete this.tunelMark[key]\nerrorCallback(error)\n}\n- resolve({ ...connectionNode, port } as Node)\n+ resolve({ ...connectionNode, host: \"127.0.0.1\", port } as Node)\n});\nlocalTunnel.on('error', (err) => {\nConsole.log('Ssh tunel occur error : ' + err);\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix connect by ssh tunnel fail
141,908
20.05.2020 12:13:31
-28,800
2759644fca510e3197242177083ea9cd0b93c86f
close tunnel when connect fail
[ { "change_type": "MODIFY", "old_path": "src/service/connectionManager.ts", "new_path": "src/service/connectionManager.ts", "diff": "@@ -99,6 +99,7 @@ export class ConnectionManager {\nresolve(this.activeConnection[key].connection);\n} else {\nthis.activeConnection[key] = null;\n+ this.tunnelService.closeTunnel(key)\nConsole.log(`${err.stack}\\n${err.message}`);\nreject(err.message);\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
close tunnel when connect fail
141,908
21.05.2020 12:44:02
-28,800
e073d6efa345960fe9cd72c7336537ec7d4fe24a
hide users for no root user
[ { "change_type": "MODIFY", "old_path": "src/model/database/connectionNode.ts", "new_path": "src/model/database/connectionNode.ts", "diff": "@@ -47,7 +47,11 @@ export class ConnectionNode extends Node {\n}).map<DatabaseNode>((database) => {\nreturn new DatabaseNode(database.Database, this);\n});\n+\n+ if (this.user.toLocaleLowerCase() == \"root\") {\ndatabaseNodes.unshift(new UserGroup(\"USER\", this));\n+ }\n+\nDatabaseCache.setDataBaseListOfConnection(this.id, databaseNodes);\nreturn databaseNodes;\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
hide users for no root user
141,908
21.05.2020 12:49:37
-28,800
2a0559cbbbc7b7da87d193efce5cb2a94e7d49c4
fix db node null point
[ { "change_type": "MODIFY", "old_path": "src/model/database/databaseNode.ts", "new_path": "src/model/database/databaseNode.ts", "diff": "@@ -28,7 +28,7 @@ export class DatabaseNode extends Node implements CopyAble {\nthis.info = NodeUtil.of({ ...info, database: name } as Node)\nthis.init(this.info)\nconst lcp = ConnectionManager.getLastConnectionOption(false);\n- if (lcp.getConnectId() == this.getConnectId() && lcp.database == this.database) {\n+ if (lcp && lcp.getConnectId() == this.getConnectId() && lcp.database == this.database) {\nthis.iconPath = path.join(Constants.RES_PATH, \"icon/database-active.svg\");\nthis.description = `Active`\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix db node null point
141,908
21.05.2020 13:34:23
-28,800
bf8fdf4cb44c3b46b66eb9b3f2042e1178967ce6
fix get active node null point
[ { "change_type": "MODIFY", "old_path": "src/service/connectionManager.ts", "new_path": "src/service/connectionManager.ts", "diff": "@@ -138,7 +138,10 @@ export class ConnectionManager {\n}\n}\nif (host != null && port != null && user != null) {\n- return NodeUtil.of({ host, port: parseInt(port), user, database })\n+ const node = NodeUtil.of({ host, port: parseInt(port), user, database });\n+ if (this.getActiveConnectByKey(node.getConnectId())) {\n+ return node;\n+ }\n}\n}\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix get active node null point
141,908
21.05.2020 13:50:41
-28,800
e1038862d93d5c5245204533f54b97a18715f364
fix connect using ssh tunnel bug
[ { "change_type": "MODIFY", "old_path": "src/service/common/sshTunnelService.ts", "new_path": "src/service/common/sshTunnelService.ts", "diff": "@@ -20,7 +20,7 @@ export class SSHTunnelService {\nconst ssh = connectionNode.ssh\nconst key = connectionNode.getConnectId();\nif (this.tunelMark[key]) {\n- resolve({ ...connectionNode, port: this.tunelMark[key].tunnelPort } as Node)\n+ resolve({ ...connectionNode, host: \"127.0.0.1\", port: this.tunelMark[key].tunnelPort } as Node)\nreturn;\n}\nconst port = await portfinder.getPortPromise();\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix connect using ssh tunnel bug
141,908
21.05.2020 15:04:14
-28,800
6100e5194e6b10ba71ce836ee59841aacf7658a4
add setting to enable lazy mode
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -68,6 +68,9 @@ MySQL Client For Visual Studio Code\n// open query result as full screen.\n\"vscode-mysql.fullQueryScreen\":false,\n+ // Load database meta info when connected, If your machine's performance is low, turn it off.\n+ \"vscode-mysql.fullQueryScreen\":true,\n+\n// set max tables show of each database.\n\"vscode-mysql.maxTableCount\": 500\n}\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"default\": false,\n\"description\": \"Support delimiter when import sql.\"\n},\n+ \"vscode-mysql.loadMetaOnConnect\": {\n+ \"type\": \"boolean\",\n+ \"default\": true,\n+ \"description\": \"Load database meta info when connected, If your machine's performance is low, turn it off.\"\n+ },\n\"vscode-mysql.fullQueryScreen\": {\n\"type\": \"boolean\",\n\"default\": false,\n" }, { "change_type": "MODIFY", "old_path": "src/common/constants.ts", "new_path": "src/common/constants.ts", "diff": "@@ -26,6 +26,7 @@ export enum CacheKey {\nexport enum ConfigKey {\nMAX_TABLE_COUNT = \"maxTableCount\",\nENABLE_DELIMITER = \"enableDelimiter\",\n+ LOAD_META_ON_CONNECT = \"loadMetaOnConnect\",\nQUERY_FULL_SCREEN = \"fullQueryScreen\",\n}\n" }, { "change_type": "MODIFY", "old_path": "src/provider/Complection/chain/tableChain.ts", "new_path": "src/provider/Complection/chain/tableChain.ts", "diff": "@@ -6,22 +6,23 @@ import { TableNode } from \"../../../model/main/tableNode\";\nimport { ComplectionChain, ComplectionContext } from \"../complectionContext\";\nimport { Util } from \"../../../common/util\";\nimport { ConnectionManager } from \"../../../service/connectionManager\";\n+import { TableGroup } from \"../../../model/main/tableGroup\";\nexport class TableChain implements ComplectionChain {\n- public getComplection(complectionContext: ComplectionContext): vscode.CompletionItem[] {\n+ public async getComplection(complectionContext: ComplectionContext): Promise<vscode.CompletionItem[]> {\nif (complectionContext.preChart == \".\") {\n- const temp = this.generateTableComplectionItem(complectionContext.preWord);\n+ const temp = await this.generateTableComplectionItem(complectionContext.preWord);\nif (temp.length == 0) {\nreturn null;\n} else {\n- return this.generateTableComplectionItem(complectionContext.preWord);\n+ return await this.generateTableComplectionItem(complectionContext.preWord);\n}\n}\nif (complectionContext.preWord && complectionContext.preWord.match(/\\b(into|from|update|table|join)\\b/ig)) {\n- return this.generateTableComplectionItem();\n+ return await this.generateTableComplectionItem();\n}\nreturn null;\n}\n@@ -30,7 +31,7 @@ export class TableChain implements ComplectionChain {\nreturn true;\n}\n- private generateTableComplectionItem(inputWord?: string): vscode.CompletionItem[] {\n+ private async generateTableComplectionItem(inputWord?: string): Promise<vscode.CompletionItem[]> {\nlet tableNodes: Node[] = [];\nconst tableNames: string[] = [];\n@@ -41,11 +42,14 @@ export class TableChain implements ComplectionChain {\n}\nif (inputWord) {\nconst connectcionid = lcp.getConnectId();\n- DatabaseCache.getDatabaseListOfConnection(connectcionid).forEach((databaseNode) => {\n+ for (const databaseNode of DatabaseCache.getDatabaseListOfConnection(connectcionid)) {\nif (databaseNode.database === inputWord) {\ntableNodes = DatabaseCache.getTableListOfDatabase(databaseNode.id);\n+ if (tableNodes == null || tableNodes.length == 0) {\n+ tableNodes = await new TableGroup(databaseNode.info).getChildren()\n+ }\n+ }\n}\n- });\n} else {\nconst databaseid = `${lcp.getConnectId()}_${lcp.database}`;\nconst tableList = DatabaseCache.getTableListOfDatabase(databaseid);\n" }, { "change_type": "MODIFY", "old_path": "src/provider/treeDataProvider.ts", "new_path": "src/provider/treeDataProvider.ts", "diff": "-import * as path from \"path\";\nimport * as vscode from \"vscode\";\n-import { CacheKey } from \"../common/constants\";\n+import { CacheKey, ConfigKey } from \"../common/constants\";\nimport { ConnectionManager } from \"../service/connectionManager\";\nimport { DatabaseCache } from \"../service/common/databaseCache\";\nimport { ConnectionNode } from \"../model/database/connectionNode\";\nimport { DatabaseNode } from \"../model/database/databaseNode\";\nimport { Node } from \"../model/interface/node\";\nimport { UserGroup } from \"../model/database/userGroup\";\n+import { Global } from \"../common/global\";\nexport class DbTreeDataProvider implements vscode.TreeDataProvider<Node> {\n@@ -16,8 +16,10 @@ export class DbTreeDataProvider implements vscode.TreeDataProvider<Node> {\nconstructor(private context: vscode.ExtensionContext) {\nDbTreeDataProvider.instance = this\n+ if (Global.getConfig<boolean>(ConfigKey.LOAD_META_ON_CONNECT)) {\nthis.init()\n}\n+ }\n/**\n* reload treeview context\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
add setting to enable lazy mode
141,908
21.05.2020 15:05:15
-28,800
12d86274060759b93821fca3c662f0fc89d7f175
update to 2.1.5
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.1.4\",\n+ \"version\": \"2.1.5\",\n\"publisher\": \"cweijan\",\n\"icon\": \"logo.png\",\n\"engines\": {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 2.1.5
141,901
22.05.2020 18:45:36
-7,200
f2d96adc32999ab33dc2f8d8fc85db3af5eec62a
Fix wrong dump file path on Ubuntu
[ { "change_type": "MODIFY", "old_path": "src/service/dump/mysqlDumpService.ts", "new_path": "src/service/dump/mysqlDumpService.ts", "diff": "@@ -6,6 +6,7 @@ import { TableNode } from \"../../model/main/tableNode\";\nimport { NodeUtil } from \"../../model/nodeUtil\";\nimport { AbstractDumpService } from \"./abstractDumpService\";\nimport format = require('date-format');\n+import path = require('path');\nexport class MysqlDumpService extends AbstractDumpService {\nprotected dumpData(node: Node, exportPath: string, withData: boolean): void {\n@@ -30,7 +31,7 @@ export class MysqlDumpService extends AbstractDumpService {\n}\n},\n},\n- dumpToFile: `${exportPath}\\\\${node.database}${tableName ? \"_\" + tableName : ''}_${format('yyyy-MM-dd_hhmmss', new Date())}.sql`,\n+ dumpToFile: path.join(exportPath, `${node.database}${tableName ? \"_\" + tableName : ''}_${format('yyyy-MM-dd_hhmmss', new Date())}.sql`),\n};\nif (!withData) {\noption.dump.data = false;\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
Fix wrong dump file path on Ubuntu
141,908
27.05.2020 15:21:33
-28,800
852c4c4ffa4cda783a37ea49c2b596b50b001e70
auto detech query page
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -65,9 +65,6 @@ MySQL Client For Visual Studio Code\n// enable delimiter when import data\n\"vscode-mysql.enableDelimiter\": false,\n- // open query result as full screen.\n- \"vscode-mysql.fullQueryScreen\":false,\n-\n// Load database meta info when connected, If your machine's performance is low, turn it off.\n\"vscode-mysql.loadMetaOnConnect\":true,\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.1.7\",\n+ \"version\": \"2.1.8\",\n\"publisher\": \"cweijan\",\n\"icon\": \"logo.png\",\n\"engines\": {\n\"type\": \"boolean\",\n\"default\": true,\n\"description\": \"Load database meta info when connected, If your machine's performance is low, turn it off.\"\n- },\n- \"vscode-mysql.fullQueryScreen\": {\n- \"type\": \"boolean\",\n- \"default\": false,\n- \"description\": \"Show query result full screen.\"\n}\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/common/constants.ts", "new_path": "src/common/constants.ts", "diff": "@@ -27,7 +27,6 @@ export enum ConfigKey {\nMAX_TABLE_COUNT = \"maxTableCount\",\nENABLE_DELIMITER = \"enableDelimiter\",\nLOAD_META_ON_CONNECT = \"loadMetaOnConnect\",\n- QUERY_FULL_SCREEN = \"fullQueryScreen\",\n}\n" }, { "change_type": "MODIFY", "old_path": "src/view/result/query.ts", "new_path": "src/view/result/query.ts", "diff": "@@ -12,6 +12,8 @@ import { MysqlExportService } from \"../../service/export/impl/mysqlExportService\nimport { PageService } from \"../../service/page/pageService\";\nimport { MysqlPageSerivce } from \"../../service/page/impl/mysqlPageSerivce\";\nimport { ConnectionManager } from \"../../service/connectionManager\";\n+import { window } from \"vscode\";\n+import { extname } from \"path\";\nexport class QueryParam<T> {\n/**\n@@ -49,7 +51,7 @@ export class QueryPage {\nViewManager.createWebviewPanel({\nsinglePage: queryParam.singlePage,\n- splitView: !Global.getConfig(ConfigKey.QUERY_FULL_SCREEN),\n+ splitView: this.isActiveSql(),\npath: \"pages/result/index\", title: \"Query\",\ninitListener: (webviewPanel) => {\nwebviewPanel.webview.postMessage(queryParam);\n@@ -75,6 +77,15 @@ export class QueryPage {\n}\n+ private static isActiveSql(): boolean {\n+\n+ if (!window.activeTextEditor || !window.activeTextEditor.document) return false;\n+\n+ const extName = extname(window.activeTextEditor.document.fileName)\n+\n+ return extName == '.sql';\n+ }\n+\nprivate static async loadColumnList(queryParam: QueryParam<DataResponse>) {\nconst fields = queryParam.res.fields;\nconst conn = queryParam.connection;\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
auto detech query page
141,908
30.05.2020 02:40:42
-28,800
78313e9ce9669e57954d6356d08771082e22dfee
update to 2.1.9
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.1.8\",\n+ \"version\": \"2.1.9\",\n\"publisher\": \"cweijan\",\n\"icon\": \"logo.png\",\n\"engines\": {\n" }, { "change_type": "MODIFY", "old_path": "src/view/viewManager.ts", "new_path": "src/view/viewManager.ts", "diff": "@@ -60,13 +60,13 @@ export class ViewManager {\nif (viewOption.killHidden && currentStatus.instance.visible == false) {\ncurrentStatus.instance.dispose()\n} else {\n+ done()\nif (currentStatus.creating) {\ncurrentStatus.initListener = viewOption.initListener\n} else if (viewOption.initListener) {\nviewOption.initListener(currentStatus.instance)\n}\nif (viewOption.receiveListener) { currentStatus.receiveListener = viewOption.receiveListener }\n- done()\nreturn Promise.resolve(currentStatus.instance);\n}\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 2.1.9
141,908
06.06.2020 15:03:37
-28,800
799b9a9b1048660cf4bccf5d0c04396dccafe2e9
add node support
[ { "change_type": "MODIFY", "old_path": "webpack.config.js", "new_path": "webpack.config.js", "diff": "@@ -3,6 +3,7 @@ const path = require('path');\nconst { CleanWebpackPlugin } = require('clean-webpack-plugin')\nmodule.exports = {\n+ target: \"node\",\nnode: {\nfs: 'empty', net: 'empty', tls: 'empty',\nchild_process: 'empty', dns: 'empty',\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
add node support
141,908
07.06.2020 14:09:39
-28,800
b5b972a3749938d8e1da713270aa1c1892eeac7a
fix debug No effect
[ { "change_type": "MODIFY", "old_path": "webpack.config.js", "new_path": "webpack.config.js", "diff": "@@ -15,7 +15,9 @@ module.exports = [\noutput: {\npath: path.resolve(__dirname, 'out'),\nfilename: 'extension.js',\n- libraryTarget: 'commonjs2'\n+ libraryTarget: 'commonjs2',\n+ // config source map sources url\n+ devtoolModuleFilenameTemplate: '[absoluteResourcePath]',\n},\nexternals: {\nvscode: 'commonjs vscode'\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix debug No effect
141,908
07.06.2020 14:23:34
-28,800
778453b8ebcd64853c67b5354db66dec13163a3e
fix page loading bug
[ { "change_type": "MODIFY", "old_path": "src/view/result/query.ts", "new_path": "src/view/result/query.ts", "diff": "@@ -79,7 +79,7 @@ export class QueryPage {\nprivate static isActiveSql(): boolean {\n- if (!window.activeTextEditor || !window.activeTextEditor.document) return false;\n+ if (!window.activeTextEditor || !window.activeTextEditor.document) { return false; }\nconst extName = extname(window.activeTextEditor.document.fileName)\n" }, { "change_type": "MODIFY", "old_path": "src/vue/connect/App.vue", "new_path": "src/vue/connect/App.vue", "diff": "},\nmounted() {\nwindow.addEventListener('message', ({ data }) => {\n+ if(!data)return;\nswitch (data.type) {\ncase 'EDIT':\nvue.connectionOption = data.node\nvue.error = true;\nvue.errorMessage = data.err;\nbreak;\n- // default:\n- // document.write(\"Connect success!\")\n- // break;\n+ default:\n+ document.write(\"Connect success!\")\n+ break;\n}\n})\npostMessage({ type: 'init' })\n" }, { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "</template>\n<script>\n- const vscode = acquireVsCodeApi();\n+ const vscode = typeof (acquireVsCodeApi) != \"undefined\" ? acquireVsCodeApi() : null;\n+ const postMessage = (message) => { if (vscode) { vscode.postMessage(message) } }\nexport default {\nname: \"App\",\ndata() {\n// this.$message({ type: 'success', message: `EXECUTE ${res.sql} SUCCESS, affectedRows:${res.affectedRows}` });\n}\n- window.addEventListener('message', event => {\n- const response = event.data.res;\n+ window.addEventListener('message', ({data}) => {\n+ if(!data)return;\n+ const response = data.res;\nthis.table.loading = false;\nif (response && response.costTime) {\nthis.toolbar.costTime = response.costTime\n}\n- switch (event.data.type) {\n+ switch (data.type) {\ncase \"RUN\":\nthis.toolbar.sql = response.sql;\nthis.table.loading = true;\nthis.refresh()\nbreak;\ndefault:\n- this.$message(JSON.stringify(event.data));\n+ this.$message(JSON.stringify(data));\n}\n});\n- vscode.postMessage({ type: 'init' })\n+ postMessage({ type: 'init' })\n},\nmethods: {\nexportData() {\ncancelButtonText: 'No',\ntype: 'warning'\n}).then(() => {\n- vscode.postMessage({\n+ postMessage({\ntype: 'export',\nsql: this.result.sql.replace(/\\blimit\\b.+/ig, '')\n});\n}).catch(() => {\n- vscode.postMessage({\n+ postMessage({\ntype: 'export',\nsql: this.result.sql\n});\n},\nexecute(sql) {\nif (!sql) return;\n- vscode.postMessage({\n+ postMessage({\ntype: 'execute',\nsql: sql.replace(/ +/ig, \" \")\n});\nreturn;\n}\n- vscode.postMessage({\n+ postMessage({\ntype: 'next',\nsql: this.result.sql,\npageNum: ++this.page.pageNum,\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix page loading bug
141,908
07.06.2020 14:58:48
-28,800
68899f594914516c239839ee0955e4def8112767
trim dependency
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "\"tslib\": \"^1.10.0\"\n}\n},\n- \"@babel/code-frame\": {\n- \"version\": \"7.8.3\",\n- \"resolved\": \"https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.8.3.tgz?cache=0&sync_timestamp=1578953126105&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcode-frame%2Fdownload%2F%40babel%2Fcode-frame-7.8.3.tgz\",\n- \"integrity\": \"sha1-M+JZA9dIEYFTThLsCiXxa2/PQZ4=\",\n- \"dev\": true,\n- \"requires\": {\n- \"@babel/highlight\": \"^7.8.3\"\n- }\n- },\n- \"@babel/helper-validator-identifier\": {\n- \"version\": \"7.9.5\",\n- \"resolved\": \"https://registry.npm.taobao.org/@babel/helper-validator-identifier/download/@babel/helper-validator-identifier-7.9.5.tgz\",\n- \"integrity\": \"sha1-kJd6jm+/a0MafcMXUu7iM78FLYA=\",\n- \"dev\": true\n- },\n- \"@babel/highlight\": {\n- \"version\": \"7.9.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/@babel/highlight/download/@babel/highlight-7.9.0.tgz\",\n- \"integrity\": \"sha1-TptFzLgreWBycbKXmtgse2gWMHk=\",\n- \"dev\": true,\n- \"requires\": {\n- \"@babel/helper-validator-identifier\": \"^7.9.0\",\n- \"chalk\": \"^2.0.0\",\n- \"js-tokens\": \"^4.0.0\"\n- }\n- },\n\"@types/anymatch\": {\n\"version\": \"1.3.1\",\n\"resolved\": \"https://registry.npm.taobao.org/@types/anymatch/download/@types/anymatch-1.3.1.tgz\",\n\"integrity\": \"sha1-M2utwb7sudrMOL6izzKt9ieoQho=\",\n\"dev\": true\n},\n- \"@types/async-lock\": {\n- \"version\": \"1.1.2\",\n- \"resolved\": \"https://registry.npmjs.org/@types/async-lock/-/async-lock-1.1.2.tgz\",\n- \"integrity\": \"sha512-j9n4bb6RhgFIydBe0+kpjnBPYumDaDyU8zvbWykyVMkku+c2CSu31MZkLeaBfqIwU+XCxlDpYDfyMQRkM0AkeQ==\",\n- \"dev\": true\n- },\n\"@types/d3-timer\": {\n\"version\": \"1.0.9\",\n\"resolved\": \"https://registry.npm.taobao.org/@types/d3-timer/download/@types/d3-timer-1.0.9.tgz?cache=0&sync_timestamp=1588200792956&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fd3-timer%2Fdownload%2F%40types%2Fd3-timer-1.0.9.tgz\",\n\"integrity\": \"sha1-aALmJk79GMeQobDVF/DyYnvyyUo=\",\n\"dev\": true\n},\n- \"argparse\": {\n- \"version\": \"1.0.10\",\n- \"resolved\": \"https://registry.npm.taobao.org/argparse/download/argparse-1.0.10.tgz\",\n- \"integrity\": \"sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=\",\n- \"dev\": true,\n- \"requires\": {\n- \"sprintf-js\": \"~1.0.2\"\n- }\n- },\n\"arr-diff\": {\n\"version\": \"4.0.0\",\n\"resolved\": \"https://registry.npm.taobao.org/arr-diff/download/arr-diff-4.0.0.tgz\",\n\"dev\": true,\n\"optional\": true\n},\n- \"async-lock\": {\n- \"version\": \"1.2.2\",\n- \"resolved\": \"https://registry.npmjs.org/async-lock/-/async-lock-1.2.2.tgz\",\n- \"integrity\": \"sha512-uczz62z2fMWOFbyo6rG4NlV2SdxugJT6sZA2QcfB1XaSjEiOh8CuOb/TttyMnYQCda6nkWecJe465tGQDPJiKw==\"\n- },\n\"async-validator\": {\n\"version\": \"1.8.5\",\n\"resolved\": \"https://registry.npm.taobao.org/async-validator/download/async-validator-1.8.5.tgz\",\n\"integrity\": \"sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=\",\n\"dev\": true\n},\n- \"builtin-modules\": {\n- \"version\": \"1.1.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/builtin-modules/download/builtin-modules-1.1.1.tgz\",\n- \"integrity\": \"sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=\",\n- \"dev\": true\n- },\n\"builtin-status-codes\": {\n\"version\": \"3.0.0\",\n\"resolved\": \"https://registry.npm.taobao.org/builtin-status-codes/download/builtin-status-codes-3.0.0.tgz\",\n\"resolved\": \"https://registry.npm.taobao.org/gl-matrix/download/gl-matrix-3.3.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fgl-matrix%2Fdownload%2Fgl-matrix-3.3.0.tgz\",\n\"integrity\": \"sha1-Iy7vYLHIswooy751ssr2xI/WNYs=\"\n},\n- \"glob\": {\n- \"version\": \"7.1.2\",\n- \"resolved\": \"https://registry.npmjs.org/glob/-/glob-7.1.2.tgz\",\n- \"integrity\": \"sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==\",\n- \"dev\": true,\n- \"requires\": {\n- \"fs.realpath\": \"^1.0.0\",\n- \"inflight\": \"^1.0.4\",\n- \"inherits\": \"2\",\n- \"minimatch\": \"^3.0.4\",\n- \"once\": \"^1.3.0\",\n- \"path-is-absolute\": \"^1.0.0\"\n- }\n- },\n\"glob-parent\": {\n\"version\": \"5.1.1\",\n\"resolved\": \"https://registry.npm.taobao.org/glob-parent/download/glob-parent-5.1.1.tgz\",\n\"integrity\": \"sha1-TkMekrEalzFjaqH5yNHMvP2reN8=\",\n\"dev\": true\n},\n- \"js-tokens\": {\n- \"version\": \"4.0.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz?cache=0&sync_timestamp=1586796260005&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjs-tokens%2Fdownload%2Fjs-tokens-4.0.0.tgz\",\n- \"integrity\": \"sha1-GSA/tZmR35jjoocFDUZHzerzJJk=\",\n- \"dev\": true\n- },\n- \"js-yaml\": {\n- \"version\": \"3.13.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/js-yaml/download/js-yaml-3.13.1.tgz\",\n- \"integrity\": \"sha1-r/FRswv9+o5J4F2iLnQV6d+jeEc=\",\n- \"dev\": true,\n- \"requires\": {\n- \"argparse\": \"^1.0.7\",\n- \"esprima\": \"^4.0.0\"\n- }\n- },\n\"json-parse-better-errors\": {\n\"version\": \"1.0.2\",\n\"resolved\": \"https://registry.npm.taobao.org/json-parse-better-errors/download/json-parse-better-errors-1.0.2.tgz\",\n\"integrity\": \"sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=\",\n\"dev\": true\n},\n- \"path-parse\": {\n- \"version\": \"1.0.6\",\n- \"resolved\": \"https://registry.npm.taobao.org/path-parse/download/path-parse-1.0.6.tgz\",\n- \"integrity\": \"sha1-1i27VnlAXXLEc37FhgDp3c8G0kw=\",\n- \"dev\": true\n- },\n\"pbkdf2\": {\n\"version\": \"3.1.1\",\n\"resolved\": \"https://registry.npm.taobao.org/pbkdf2/download/pbkdf2-3.1.1.tgz?cache=0&sync_timestamp=1591275684229&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpbkdf2%2Fdownload%2Fpbkdf2-3.1.1.tgz\",\n\"resolved\": \"https://registry.npm.taobao.org/resize-observer-polyfill/download/resize-observer-polyfill-1.5.1.tgz\",\n\"integrity\": \"sha1-DpAg3T0hAkRY1OvSfiPkAmmBBGQ=\"\n},\n- \"resolve\": {\n- \"version\": \"1.16.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/resolve/download/resolve-1.16.0.tgz?cache=0&sync_timestamp=1586994575637&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.16.0.tgz\",\n- \"integrity\": \"sha1-Bj3HBPo0E+E6wdDRdWp8v+ld0ac=\",\n- \"dev\": true,\n- \"requires\": {\n- \"path-parse\": \"^1.0.6\"\n- }\n- },\n\"resolve-cwd\": {\n\"version\": \"2.0.0\",\n\"resolved\": \"https://registry.npm.taobao.org/resolve-cwd/download/resolve-cwd-2.0.0.tgz\",\n\"extend-shallow\": \"^3.0.0\"\n}\n},\n- \"sprintf-js\": {\n- \"version\": \"1.0.3\",\n- \"resolved\": \"https://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.0.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsprintf-js%2Fdownload%2Fsprintf-js-1.0.3.tgz\",\n- \"integrity\": \"sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=\",\n- \"dev\": true\n- },\n\"sql-formatter\": {\n\"version\": \"2.3.3\",\n\"resolved\": \"https://registry.npm.taobao.org/sql-formatter/download/sql-formatter-2.3.3.tgz\",\n\"resolved\": \"https://registry.npm.taobao.org/tslib/download/tslib-1.11.1.tgz\",\n\"integrity\": \"sha1-6xXRKIJ/vuKEFUnhcfRe0zisfjU=\"\n},\n- \"tslint\": {\n- \"version\": \"5.20.1\",\n- \"resolved\": \"https://registry.npm.taobao.org/tslint/download/tslint-5.20.1.tgz\",\n- \"integrity\": \"sha1-5AHortoBUrxE3QfmFANPP4DGe30=\",\n- \"dev\": true,\n- \"requires\": {\n- \"@babel/code-frame\": \"^7.0.0\",\n- \"builtin-modules\": \"^1.1.1\",\n- \"chalk\": \"^2.3.0\",\n- \"commander\": \"^2.12.1\",\n- \"diff\": \"^4.0.1\",\n- \"glob\": \"^7.1.1\",\n- \"js-yaml\": \"^3.13.1\",\n- \"minimatch\": \"^3.0.4\",\n- \"mkdirp\": \"^0.5.1\",\n- \"resolve\": \"^1.3.2\",\n- \"semver\": \"^5.3.0\",\n- \"tslib\": \"^1.8.0\",\n- \"tsutils\": \"^2.29.0\"\n- },\n- \"dependencies\": {\n- \"commander\": {\n- \"version\": \"2.20.3\",\n- \"resolved\": \"https://registry.npm.taobao.org/commander/download/commander-2.20.3.tgz\",\n- \"integrity\": \"sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=\",\n- \"dev\": true\n- },\n- \"diff\": {\n- \"version\": \"4.0.2\",\n- \"resolved\": \"https://registry.npm.taobao.org/diff/download/diff-4.0.2.tgz?cache=0&sync_timestamp=1578890967183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdiff%2Fdownload%2Fdiff-4.0.2.tgz\",\n- \"integrity\": \"sha1-YPOuy4nV+uUgwRqhnvwruYKq3n0=\",\n- \"dev\": true\n- }\n- }\n- },\n- \"tsutils\": {\n- \"version\": \"2.29.0\",\n- \"resolved\": \"https://registry.npm.taobao.org/tsutils/download/tsutils-2.29.0.tgz\",\n- \"integrity\": \"sha1-MrSIUBRnrL7dS4VJhnOggSrKC5k=\",\n- \"dev\": true,\n- \"requires\": {\n- \"tslib\": \"^1.8.1\"\n- }\n- },\n\"tty-browserify\": {\n\"version\": \"0.0.0\",\n\"resolved\": \"https://registry.npm.taobao.org/tty-browserify/download/tty-browserify-0.0.0.tgz\",\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"tslint\": \"tslint -t verbose src/**/*.ts\"\n},\n\"devDependencies\": {\n- \"@types/async-lock\": \"^1.1.2\",\n\"@types/mockjs\": \"^1.0.2\",\n\"@types/mysql\": \"^2.15.10\",\n\"@types/node\": \"^7.10.10\",\n\"html-webpack-plugin\": \"^4.3.0\",\n\"style-loader\": \"^1.2.1\",\n\"ts-loader\": \"^7.0.5\",\n- \"tslint\": \"^5.8.0\",\n\"typescript\": \"^3.8.3\",\n\"url-loader\": \"^4.1.0\",\n\"vue-loader\": \"^15.9.2\",\n},\n\"dependencies\": {\n\"@antv/g2\": \"^4.0.9\",\n- \"async-lock\": \"^1.2.2\",\n\"date-format\": \"^3.0.0\",\n\"element-ui\": \"^2.13.2\",\n\"mockjs\": \"^1.1.0\",\n" }, { "change_type": "MODIFY", "old_path": "src/common/filesManager.ts", "new_path": "src/common/filesManager.ts", "diff": "@@ -46,9 +46,9 @@ export class FileManager {\n- private static check(path: string) {\n+ private static check(checkPath: string) {\n- if (!fs.existsSync(path)) { this.recursiseCreate(path) }\n+ if (!fs.existsSync(checkPath)) { this.recursiseCreate(checkPath) }\n}\n" }, { "change_type": "MODIFY", "old_path": "src/view/result/query.ts", "new_path": "src/view/result/query.ts", "diff": "-import * as mysql from \"mysql\";\nimport { MessageType, OperateType, ConfigKey } from \"../../common/constants\";\nimport { Node } from \"../../model/interface/node\";\nimport { ColumnNode } from \"../../model/other/columnNode\";\n@@ -6,7 +5,6 @@ import { DatabaseCache } from \"../../service/common/databaseCache\";\nimport { QueryUnit } from \"../../service/queryUnit\";\nimport { ViewManager } from \"../viewManager\";\nimport { DataResponse } from \"./queryResponse\";\n-import { Global } from \"../../common/global\";\nimport { ExportService } from \"../../service/export/exportService\";\nimport { MysqlExportService } from \"../../service/export/mysqlExportService\";\nimport { PageService } from \"../../service/page/pageService\";\n" }, { "change_type": "MODIFY", "old_path": "src/view/viewManager.ts", "new_path": "src/view/viewManager.ts", "diff": "-import * as AsyncLock from 'async-lock';\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport * as vscode from \"vscode\";\nimport { WebviewPanel } from \"vscode\";\nimport { Console } from \"../common/outputChannel\";\n-const lock = new AsyncLock()\nexport class ViewOption {\npublic path?: string;\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
trim dependency
141,908
07.06.2020 17:23:22
-28,800
78c9f2e0e2b64240211a46226a507abe378a4ecc
add export service
[ { "change_type": "MODIFY", "old_path": "package-lock.json", "new_path": "package-lock.json", "diff": "\"integrity\": \"sha1-Ux5Yuj9RudrLmmZGyk3r9bFMpHQ=\",\n\"dev\": true\n},\n+ \"adler-32\": {\n+ \"version\": \"1.2.0\",\n+ \"resolved\": \"https://registry.npm.taobao.org/adler-32/download/adler-32-1.2.0.tgz\",\n+ \"integrity\": \"sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU=\",\n+ \"requires\": {\n+ \"exit-on-epipe\": \"~1.0.1\",\n+ \"printj\": \"~1.1.0\"\n+ }\n+ },\n\"ajv\": {\n\"version\": \"6.12.2\",\n\"resolved\": \"https://registry.npm.taobao.org/ajv/download/ajv-6.12.2.tgz\",\n\"buffer-from\": {\n\"version\": \"1.1.1\",\n\"resolved\": \"https://registry.npm.taobao.org/buffer-from/download/buffer-from-1.1.1.tgz\",\n- \"integrity\": \"sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=\",\n- \"dev\": true\n+ \"integrity\": \"sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=\"\n},\n\"buffer-xor\": {\n\"version\": \"1.0.3\",\n\"redeyed\": \"~2.1.0\"\n}\n},\n+ \"cfb\": {\n+ \"version\": \"1.1.4\",\n+ \"resolved\": \"https://registry.npm.taobao.org/cfb/download/cfb-1.1.4.tgz?cache=0&sync_timestamp=1584079392655&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcfb%2Fdownload%2Fcfb-1.1.4.tgz\",\n+ \"integrity\": \"sha1-gf017eTJGdjwliqUWC4d+vcFHio=\",\n+ \"requires\": {\n+ \"adler-32\": \"~1.2.0\",\n+ \"commander\": \"^2.16.0\",\n+ \"crc-32\": \"~1.2.0\",\n+ \"printj\": \"~1.1.2\"\n+ },\n+ \"dependencies\": {\n+ \"commander\": {\n+ \"version\": \"2.20.3\",\n+ \"resolved\": \"https://registry.npm.taobao.org/commander/download/commander-2.20.3.tgz?cache=0&sync_timestamp=1587781810870&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.20.3.tgz\",\n+ \"integrity\": \"sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=\"\n+ }\n+ }\n+ },\n\"chalk\": {\n\"version\": \"2.4.2\",\n\"resolved\": \"https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz\",\n\"wrap-ansi\": \"^5.1.0\"\n}\n},\n+ \"codepage\": {\n+ \"version\": \"1.14.0\",\n+ \"resolved\": \"https://registry.npm.taobao.org/codepage/download/codepage-1.14.0.tgz\",\n+ \"integrity\": \"sha1-jL4lSBMjVZ19MHVxsP/5HnodL5k=\",\n+ \"requires\": {\n+ \"commander\": \"~2.14.1\",\n+ \"exit-on-epipe\": \"~1.0.1\"\n+ },\n+ \"dependencies\": {\n+ \"commander\": {\n+ \"version\": \"2.14.1\",\n+ \"resolved\": \"https://registry.npm.taobao.org/commander/download/commander-2.14.1.tgz?cache=0&sync_timestamp=1587781810870&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.14.1.tgz\",\n+ \"integrity\": \"sha1-IjUSPjevjKPGXfRbAm29NXsBuao=\"\n+ }\n+ }\n+ },\n\"collection-visit\": {\n\"version\": \"1.0.0\",\n\"resolved\": \"https://registry.npm.taobao.org/collection-visit/download/collection-visit-1.0.0.tgz\",\n\"resolved\": \"https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz\",\n\"integrity\": \"sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=\"\n},\n+ \"crc-32\": {\n+ \"version\": \"1.2.0\",\n+ \"resolved\": \"https://registry.npm.taobao.org/crc-32/download/crc-32-1.2.0.tgz\",\n+ \"integrity\": \"sha1-yy224puIUI4y2d0OwWk+e0Ghggg=\",\n+ \"requires\": {\n+ \"exit-on-epipe\": \"~1.0.1\",\n+ \"printj\": \"~1.1.0\"\n+ }\n+ },\n\"create-ecdh\": {\n\"version\": \"4.0.3\",\n\"resolved\": \"https://registry.npm.taobao.org/create-ecdh/download/create-ecdh-4.0.3.tgz\",\n\"strip-eof\": \"^1.0.0\"\n}\n},\n+ \"exit-on-epipe\": {\n+ \"version\": \"1.0.1\",\n+ \"resolved\": \"https://registry.npm.taobao.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz\",\n+ \"integrity\": \"sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI=\"\n+ },\n\"expand-brackets\": {\n\"version\": \"2.1.4\",\n\"resolved\": \"https://registry.npm.taobao.org/expand-brackets/download/expand-brackets-2.1.4.tgz\",\n\"integrity\": \"sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=\",\n\"dev\": true\n},\n+ \"frac\": {\n+ \"version\": \"1.1.2\",\n+ \"resolved\": \"https://registry.npm.taobao.org/frac/download/frac-1.1.2.tgz\",\n+ \"integrity\": \"sha1-PXT39keMiKG1AgMG10fcYxPHTQs=\"\n+ },\n\"fragment-cache\": {\n\"version\": \"0.2.1\",\n\"resolved\": \"https://registry.npm.taobao.org/fragment-cache/download/fragment-cache-0.2.1.tgz\",\n}\n}\n},\n+ \"node-xlsx\": {\n+ \"version\": \"0.15.0\",\n+ \"resolved\": \"https://registry.npm.taobao.org/node-xlsx/download/node-xlsx-0.15.0.tgz\",\n+ \"integrity\": \"sha1-HxsNetzlxwboa/2WpaoABb+KncM=\",\n+ \"requires\": {\n+ \"buffer-from\": \"^1.1.0\",\n+ \"xlsx\": \"^0.14.1\"\n+ }\n+ },\n\"normalize-path\": {\n\"version\": \"3.0.0\",\n\"resolved\": \"https://registry.npm.taobao.org/normalize-path/download/normalize-path-3.0.0.tgz\",\n\"utila\": \"~0.4\"\n}\n},\n+ \"printj\": {\n+ \"version\": \"1.1.2\",\n+ \"resolved\": \"https://registry.npm.taobao.org/printj/download/printj-1.1.2.tgz\",\n+ \"integrity\": \"sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI=\"\n+ },\n\"process\": {\n\"version\": \"0.11.10\",\n\"resolved\": \"https://registry.npm.taobao.org/process/download/process-0.11.10.tgz\",\n\"resolved\": \"https://registry.npm.taobao.org/sqlstring/download/sqlstring-2.3.1.tgz?cache=0&sync_timestamp=1587004209757&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsqlstring%2Fdownload%2Fsqlstring-2.3.1.tgz\",\n\"integrity\": \"sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A=\"\n},\n+ \"ssf\": {\n+ \"version\": \"0.10.3\",\n+ \"resolved\": \"https://registry.npm.taobao.org/ssf/download/ssf-0.10.3.tgz\",\n+ \"integrity\": \"sha1-jq4fwpyQpVLnkhII+BiS1vd6yys=\",\n+ \"requires\": {\n+ \"frac\": \"~1.1.2\"\n+ }\n+ },\n\"static-extend\": {\n\"version\": \"0.1.2\",\n\"resolved\": \"https://registry.npm.taobao.org/static-extend/download/static-extend-0.1.2.tgz\",\n\"integrity\": \"sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=\",\n\"dev\": true\n},\n+ \"xlsx\": {\n+ \"version\": \"0.14.5\",\n+ \"resolved\": \"https://registry.npm.taobao.org/xlsx/download/xlsx-0.14.5.tgz\",\n+ \"integrity\": \"sha1-NjfpFNeRvcpzgoFuFz99cl7Q4NI=\",\n+ \"requires\": {\n+ \"adler-32\": \"~1.2.0\",\n+ \"cfb\": \"^1.1.2\",\n+ \"codepage\": \"~1.14.0\",\n+ \"commander\": \"~2.17.1\",\n+ \"crc-32\": \"~1.2.0\",\n+ \"exit-on-epipe\": \"~1.0.1\",\n+ \"ssf\": \"~0.10.2\"\n+ },\n+ \"dependencies\": {\n+ \"commander\": {\n+ \"version\": \"2.17.1\",\n+ \"resolved\": \"https://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1587781810870&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.17.1.tgz\",\n+ \"integrity\": \"sha1-vXerfebelCBc6sxy8XFtKfIKd78=\"\n+ }\n+ }\n+ },\n\"xtend\": {\n\"version\": \"4.0.2\",\n\"resolved\": \"https://registry.npm.taobao.org/xtend/download/xtend-4.0.2.tgz\",\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"mockjs\": \"^1.1.0\",\n\"mysql\": \"^2.18.1\",\n\"mysqldump\": \"^3.1.0\",\n+ \"node-xlsx\": \"^0.15.0\",\n\"portfinder\": \"^1.0.26\",\n\"sql-formatter\": \"^2.3.3\",\n\"tunnel-ssh\": \"^4.1.4\",\n" }, { "change_type": "MODIFY", "old_path": "src/service/export/abstractExportService.ts", "new_path": "src/service/export/abstractExportService.ts", "diff": "@@ -17,21 +17,22 @@ export abstract class AbstractExportService implements ExportService {\nprotected abstract exportExcel(folderPath: string, sql: string): void;\nprotected exportByNodeXlsx(folderPath: string, fields: FieldInfo[], rows: any) {\n- // const nodeXlsx = require('node-xlsx');\n- // fs.writeFileSync(`${folderPath}/${new Date().getTime()}.xlsx`, nodeXlsx.build([{\n- // name: \"sheet1\",\n- // data: [\n- // fields.map((field) => field.name),\n- // ...rows.map((row) => {\n- // const values = [];\n- // for (const key in row) {\n- // values.push(row[key]);\n- // }\n- // return values;\n- // })\n- // ]\n- // }]), \"binary\");\n- // Console.log(\"export success!\")\n+ Console.log(\"start export data...\")\n+ const nodeXlsx = require('node-xlsx');\n+ fs.writeFileSync(`${folderPath}/${new Date().getTime()}.xlsx`, nodeXlsx.build([{\n+ name: \"sheet1\",\n+ data: [\n+ fields.map((field) => field.name),\n+ ...rows.map((row) => {\n+ const values = [];\n+ for (const key in row) {\n+ values.push(row[key]);\n+ }\n+ return values;\n+ })\n+ ]\n+ }]), \"binary\");\n+ Console.log(\"export success!\")\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "</template>\n<template slot-scope=\"scope\">\n<div v-if=\"scope.row.isFilter\" style=\"text-align: center;\">\n- <!-- <el-button @click=\"exportData()\" type=\"primary\" size=\"small\" icon=\"el-icon-orange\" circle title=\"Export\"></el-button> -->\n+ <el-button @click=\"exportData()\" type=\"primary\" size=\"small\" icon=\"el-icon-orange\" circle title=\"Export\"></el-button>\n<el-button type=\"info\" icon=\"el-icon-circle-plus-outline\" size=\"small\" circle\n@click=\"insertRequest\">\n</el-button>\n" }, { "change_type": "MODIFY", "old_path": "webpack.config.js", "new_path": "webpack.config.js", "diff": "@@ -62,7 +62,9 @@ module.exports = [\nminimize: isProd,\nsplitChunks: {\ncacheGroups: {\n- vendor: { name: \"vendor\", test: /[\\\\/]node_modules[\\\\/]/, chunks: \"all\", priority: 10 }\n+ nodeXlsx: { name: \"node-xlsx\", test: /[\\\\/]@node-xlsx[\\\\/]/, chunks: \"all\", priority: 11 },\n+ antv: { name: \"antv\", test: /[\\\\/]@antv[\\\\/]/, chunks: \"all\", priority: 10 },\n+ vendor: { name: \"vendor\", test: /[\\\\/]node_modules[\\\\/]/, chunks: \"all\", priority: -1 }\n}\n}\n},\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
add export service
141,908
10.06.2020 19:49:10
-28,800
3af3ee0b49da7a3f17ee064d4762dd66e1e8d404
fix view load bug
[ { "change_type": "MODIFY", "old_path": "src/view/viewManager.ts", "new_path": "src/view/viewManager.ts", "diff": "@@ -54,16 +54,18 @@ export class ViewManager {\nconst currentStatus = this.viewStatu[viewOption.title]\nif (viewOption.singlePage && currentStatus) {\n+ if (viewOption.killHidden && currentStatus.instance.visible == false) {\n+ currentStatus.instance.dispose()\n+ } else {\nif (currentStatus.creating) {\ncurrentStatus.initListener = viewOption.initListener\n- } else if (viewOption.killHidden && currentStatus.instance.visible == false) {\n- currentStatus.instance.dispose()\n} else if (viewOption.initListener) {\nviewOption.initListener(currentStatus.instance)\n}\nif (viewOption.receiveListener) { currentStatus.receiveListener = viewOption.receiveListener }\nreturn Promise.resolve(currentStatus.instance);\n}\n+ }\nthis.viewStatu[viewOption.title] = { creating: true, instance: null, initListener: viewOption.initListener, receiveListener: viewOption.receiveListener }\nconst targetPath = `${this.webviewPath}/${viewOption.path}.html`;\nfs.readFile(targetPath, 'utf8', async (err, data) => {\n@@ -83,7 +85,7 @@ export class ViewManager {\n);\nthis.viewStatu[viewOption.title].instance = webviewPanel\nconst contextPath = path.resolve(targetPath, \"..\");\n- webviewPanel.webview.html = this.buildInclude(this.buildPath(data, webviewPanel.webview, contextPath), contextPath);\n+ webviewPanel.webview.html = this.buildPath(data, webviewPanel.webview, contextPath);\nwebviewPanel.onDidDispose(() => {\nthis.viewStatu[viewOption.title] = null\n@@ -105,21 +107,6 @@ export class ViewManager {\n});\n}\n- private static buildInclude(data: string, fileFolderPath: string): string {\n-\n- const reg = new RegExp(`<include path=\"(.+?)\" (\\\\/)?>`, 'ig')\n- let match = reg.exec(data)\n- while (match != null) {\n- const includePath = match[1].startsWith(\"/\") ? this.webviewPath + match[1] : (fileFolderPath + \"/\" + match[1]);\n- const includeContent = fs.readFileSync(includePath, 'utf8')\n- if (includeContent) {\n- data = data.replace(match[0], includeContent)\n- }\n- match = reg.exec(data)\n- }\n-\n- return data;\n- }\nprivate static buildPath(data: string, webview: vscode.Webview, contextPath: string): string {\nreturn data.replace(/((src|href)=(\"|'))(.+?\\.(css|js))\\b/gi, \"$1\" + webview.asWebviewUri(vscode.Uri.file(`${contextPath}/`)) + \"/$4\");\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix view load bug
141,908
13.06.2020 11:01:28
-28,800
4703b60f839a17a1b5a162ad72303f2f437da9fb
add exclude db
[ { "change_type": "MODIFY", "old_path": "src/vue/connect/App.vue", "new_path": "src/vue/connect/App.vue", "diff": "password: '',\ndatabase: null,\nusingSSH: false,\n- excludeDatabases: 'mysql,performance_schema,information_schema',\n+ excludeDatabases: 'mysql,performance_schema,information_schema,sys',\ntimezone: '+00:00',\nssh: {\nhost: '',\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
add exclude db
141,908
24.06.2020 09:25:22
-28,800
ab96c8d658090bd0167f19689c786f55e31fd46a
trigger filter only when enter press
[ { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "<!-- data -->\n<el-table-column :label=\"field.name\" v-for=\"(field,index) in result.fields\" :key=\"index\" align=\"center\" sortable v-if=\"result.fields && field.name && toolbar.showColumns.includes(field.name.toLowerCase())\" :width=\"computeWidth(field.name,0,index,toolbar.filter[field.name])\">\n<template slot-scope=\"scope\">\n- <el-input v-if=\"scope.row.isFilter\" v-model=\"toolbar.filter[field.name]\" placeholder=\"filter\" @blur=\"filter($event,field.name)\" v-on:keyup.enter.native=\"filter($event,field.name)\">\n+ <el-input v-if=\"scope.row.isFilter\" v-model=\"toolbar.filter[field.name]\" placeholder=\"filter\" v-on:keyup.enter.native=\"filter($event,field.name)\">\n</el-input>\n<span v-if=\"!scope.row.isFilter\" v-html='dataformat(scope.row[field.name])'></span>\n</template>\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
trigger filter only when enter press
141,908
24.06.2020 09:50:04
-28,800
22db82e4467c83118c6aa2f81c2b75b3f676a75e
support config connection name
[ { "change_type": "MODIFY", "old_path": "src/model/database/connectionNode.ts", "new_path": "src/model/database/connectionNode.ts", "diff": "@@ -21,6 +21,9 @@ export class ConnectionNode extends Node {\nconstructor(readonly id: string, readonly parent: Node) {\nsuper(id)\nthis.init(parent)\n+ if (parent.name) {\n+ this.label = `${parent.name}_${id}`\n+ }\n}\npublic async getChildren(isRresh: boolean = false): Promise<Node[]> {\n" }, { "change_type": "MODIFY", "old_path": "src/model/interface/node.ts", "new_path": "src/model/interface/node.ts", "diff": "@@ -9,6 +9,7 @@ export abstract class Node extends vscode.TreeItem {\npublic user: string;\npublic password?: string;\npublic database?: string;\n+ public name?: string;\npublic timezone?: string;\npublic certPath?: string;\npublic excludeDatabases?: string;\n@@ -26,6 +27,7 @@ export abstract class Node extends vscode.TreeItem {\nthis.user = source.user\nthis.password = source.password\nthis.database = source.database\n+ this.name = source.name\nthis.timezone = source.timezone\nthis.certPath = source.certPath\nthis.ssh = source.ssh\n" }, { "change_type": "MODIFY", "old_path": "src/vue/connect/App.vue", "new_path": "src/vue/connect/App.vue", "diff": "</p>\n</blockquote>\n<el-row>\n+ <div>\n+ <div class=\"field field__input\">\n+ <strong>name:</strong>\n+ <input class=\"field__input\" placeholder=\"connection name, can be empty\" v-model=\"connectionOption.name\" />\n+ </div>\n+ </div>\n<div>\n<div class=\"field field__input\">\n<strong>host:</strong>\nif(!data)return;\nswitch (data.type) {\ncase 'EDIT':\n- vue.connectionOption = data.node\n+ this.connectionOption = data.node\nbreak;\ncase 'CONNECTION_ERROR':\n- vue.error = true;\n- vue.errorMessage = data.err;\n+ this.error = true;\n+ this.errorMessage = data.err;\nbreak;\ndefault:\ndocument.write(\"Connect success!\")\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
support config connection name
141,908
24.06.2020 09:57:09
-28,800
1a73fd9a7006b2536ccb569a1dac419ac1ebe57f
add copy host
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"dark\": \"resources/dark/refresh.svg\"\n}\n},\n+ {\n+ \"command\": \"mysql.host.copy\",\n+ \"title\": \"Copy Host\",\n+ \"category\": \"MySQL\"\n+ },\n{\n\"command\": \"mysql.name.copy\",\n\"title\": \"Copy Name\",\n\"when\": \"view == github.cweijan.mysql && viewItem == connection\",\n\"group\": \"1_mysql@2\"\n},\n+ {\n+ \"command\": \"mysql.host.copy\",\n+ \"when\": \"view == github.cweijan.mysql && viewItem == connection\",\n+ \"group\": \"1_mysql@3\"\n+ },\n{\n\"command\": \"mysql.database.add\",\n\"when\": \"view == github.cweijan.mysql && viewItem == connection\",\n" }, { "change_type": "MODIFY", "old_path": "src/extension.ts", "new_path": "src/extension.ts", "diff": "@@ -60,6 +60,9 @@ export function activate(context: vscode.ExtensionContext) {\n\"mysql.connection.edit\": (connectionNode: ConnectionNode) => {\nserviceManager.connectService.openConnect(serviceManager.provider, connectionNode)\n},\n+ \"mysql.host.copy\": (connectionNode: ConnectionNode) => {\n+ connectionNode.copyName();\n+ },\n\"mysql.database.add\": (connectionNode: ConnectionNode) => {\nconnectionNode.createDatabase();\n},\n" }, { "change_type": "MODIFY", "old_path": "src/model/database/connectionNode.ts", "new_path": "src/model/database/connectionNode.ts", "diff": "@@ -13,8 +13,9 @@ import { InfoNode } from \"../other/infoNode\";\nimport { DatabaseNode } from \"./databaseNode\";\nimport { UserGroup } from \"./userGroup\";\nimport { Connection } from \"mysql\";\n+import { CopyAble } from \"../interface/copyAble\";\n-export class ConnectionNode extends Node {\n+export class ConnectionNode extends Node implements CopyAble {\npublic iconPath: string = path.join(Constants.RES_PATH, \"icon/server.png\");\npublic contextValue: string = ModelType.CONNECTION;\n@@ -64,6 +65,10 @@ export class ConnectionNode extends Node {\n});\n}\n+ public copyName() {\n+ Util.copyToBoard(this.host)\n+ }\n+\npublic async newQuery() {\nconst key = `${this.getConnectId()}`;\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
add copy host
141,908
24.06.2020 10:10:49
-28,800
5a86765995991d21caae873c1f09f398ebe41e4f
update to 2.2.3
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.2.0\",\n+ \"version\": \"2.2.3\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 2.2.3
141,908
01.07.2020 17:32:10
-28,800
a48c1fec11b8c7c7417b554e320d37a3128426b2
support set value as null
[ { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "@@ -315,6 +315,9 @@ export default {\nthis.update.currentNew = {};\n},\nwrapQuote(columnName, value) {\n+ if(value==\"\"){\n+ return \"null\";\n+ }\nif (typeof value == \"string\") {\nvalue = value.replace(/'/g, \"\\\\'\");\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
support set value as null
141,908
01.07.2020 17:52:03
-28,800
e40705014d19e750c4e8e62605f70606b912e5fc
update to 2.2.6
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.2.4\",\n+ \"version\": \"2.2.6\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 2.2.6
141,908
04.07.2020 12:05:26
-28,800
d11be96b807fc6119e2e679885f6350846e0da12
2.2.7: fix bugs
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.2.6\",\n+ \"version\": \"2.2.7\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" }, { "change_type": "MODIFY", "old_path": "src/model/database/userGroup.ts", "new_path": "src/model/database/userGroup.ts", "diff": "@@ -46,8 +46,8 @@ export class UserNode extends Node implements CopyAble {\npublic contextValue = ModelType.USER;\npublic iconPath = path.join(Constants.RES_PATH, \"icon/user.svg\")\n- constructor(readonly name: string, readonly info: Node) {\n- super(name)\n+ constructor(readonly username: string, readonly info: Node) {\n+ super(username)\nthis.init(info)\nthis.command = {\ncommand: \"mysql.user.sql\",\n@@ -57,7 +57,7 @@ export class UserNode extends Node implements CopyAble {\n}\npublic copyName(): void {\n- Util.copyToBoard(this.name)\n+ Util.copyToBoard(this.username)\n}\npublic async getChildren(isRresh: boolean = false): Promise<Node[]> {\n@@ -65,23 +65,23 @@ export class UserNode extends Node implements CopyAble {\n}\npublic async selectSqlTemplate() {\n- const sql = `SELECT USER 0USER,HOST 1HOST,Super_priv,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_priv,Alter_priv FROM mysql.user where user='${this.name}';`;\n+ const sql = `SELECT USER 0USER,HOST 1HOST,Super_priv,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_priv,Alter_priv FROM mysql.user where user='${this.username}';`;\nQueryUnit.runQuery(sql, this);\n}\npublic drop() {\n- Util.confirm(`Are you want to drop user ${this.user} ?`, async () => {\n- QueryUnit.queryPromise(await ConnectionManager.getConnection(this), `DROP user ${this.name}`).then(() => {\n+ Util.confirm(`Are you want to drop user ${this.username} ?`, async () => {\n+ QueryUnit.queryPromise(await ConnectionManager.getConnection(this), `DROP user ${this.username}`).then(() => {\nDbTreeDataProvider.refresh();\n- vscode.window.showInformationMessage(`Drop user ${this.name} success!`);\n+ vscode.window.showInformationMessage(`Drop user ${this.username} success!`);\n});\n})\n}\npublic grandTemplate() {\nQueryUnit.showSQLTextDocument(`\n-GRANT ALL PRIVILEGES ON *.* to '${this.name}'@'%'\n+GRANT ALL PRIVILEGES ON *.* to '${this.username}'@'%'\n`.replace(/^\\s/, \"\"));\n}\n@@ -93,7 +93,7 @@ update\nset\npassword = PASSWORD(\"newPassword\")\nwhere\n- User = '${this.name}';\n+ User = '${this.username}';\nFLUSH PRIVILEGES;\n-- since mysql version 5.7, password column need change to authentication_string=PASSWORD(\"test\")`\n.replace(/^\\s/, \"\"));\n" }, { "change_type": "MODIFY", "old_path": "src/service/queryUnit.ts", "new_path": "src/service/queryUnit.ts", "diff": "@@ -151,19 +151,25 @@ export class QueryUnit {\ncontent = content.replace(new RegExp(delimiter, 'g'), \";\")\n}\nconst sqlList = content.match(/(?:[^;\"']+|[\"'][^\"']*[\"'])+/g);\n+ if (sqlList.length == 1) return sqlList[0];\n+\n+ const trimSqlList=[]\nconst docCursor = document.getText(Cursor.getRangeStartTo(current)).length;\nlet index = 0;\nfor (let i = 0; i < sqlList.length; i++) {\nconst sql = sqlList[i];\n+ const trimSql=sql.trim();\n+ if(trimSql){\n+ trimSqlList.push(trimSql)\n+ }\nindex += (sql.length + 1);\nif (docCursor < index) {\n- const trimSql = sql.trim();\nif (!trimSql && sqlList.length > 1) { return sqlList[i - 1]; }\nreturn trimSql;\n}\n}\n- return '';\n+ return trimSqlList[trimSqlList.length-1];\n}\nprivate static sqlDocument: vscode.TextEditor;\n" }, { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "@@ -255,7 +255,7 @@ export default {\nthis.result.sql.replace(/\\n/, \" \").replace(\";\", \" \") + \" \";\nlet existsCheck = new RegExp(\n- `(WHERE|AND)?\\\\s*${column}\\\\s*(=|is)\\\\s*.+?\\\\s`,\n+ `(WHERE|AND)?\\\\s*\\\\b${column}\\\\b\\\\s*(=|is)\\\\s*.+?\\\\s`,\n\"igm\"\n);\n@@ -282,7 +282,7 @@ export default {\n}\n} else {\n// empty value, clear filter\n- let beforeAndCheck = new RegExp(`${column}\\\\s*(=|is)\\\\s*.+?\\\\s*AND`, \"igm\");\n+ let beforeAndCheck = new RegExp(`\\\\b${column}\\\\b\\\\s*(=|is)\\\\s*.+?\\\\s*AND`, \"igm\");\nif (beforeAndCheck.exec(filterSql)) {\nfilterSql = filterSql.replace(beforeAndCheck, \"\");\n} else {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
2.2.7: fix bugs
141,908
07.07.2020 10:29:34
-28,800
b252e1e63afde066d9820d199dd242dbe9580c10
update to 2.2.8
[ { "change_type": "MODIFY", "old_path": "CHANGELOG.md", "new_path": "CHANGELOG.md", "diff": "# CHANGELOG\n+## 2.2.8 - 2020/7/7\n+- Add count button in view.\n+\n+## 2.2.4~2.2.7\n+- Fix bugs and adjust result view.\n+\n## 2.2.3 - 2020/6/24\n- Add copy host feature.\n- Support add name prefix to connection.\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.2.7\",\n+ \"version\": \"2.2.8\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" }, { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "</el-row>\n<!-- tool panel -->\n<el-row>\n- <el-button type=\"primary\" @click='execute(toolbar.sql);info.visible = false;'>Execute</el-button>\n+ <el-button type=\"primary\" @click='count(toolbar.sql);'>Count</el-button>\n+ <el-button type=\"primary\" @click='info.visible = false;execute(toolbar.sql);'>Execute</el-button>\n<el-tag>Table :</el-tag>\n<span v-if=\"result.table\">\n{{result.table}}\n@@ -459,6 +460,12 @@ export default {\nthis.execute(this.result.sql);\n}\n},\n+ count(sql){\n+ this.info.visible = false;\n+ let countSql=sql.replace(/select (.+?) from/i,\"SELECT count(*) FROM\")\n+ .replace(/\\blimit\\b.+$/gi, \"\");\n+ this.execute(countSql)\n+ },\nexecute(sql) {\nif (!sql) return;\npostMessage({\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 2.2.8
141,908
08.07.2020 21:23:29
-28,800
7aa14dca4bac312583503f55faf371cbda6eb168
add theme select, update to 2.3.0
[ { "change_type": "MODIFY", "old_path": "CHANGELOG.md", "new_path": "CHANGELOG.md", "diff": "# CHANGELOG\n+## 2.3.0 - 2020/7/8\n+- Add dark theme.\n+\n## 2.2.8 - 2020/7/7\n- Add count button in view.\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.2.8\",\n+ \"version\": \"2.3.0\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n\"type\": \"boolean\",\n\"default\": true,\n\"description\": \"Load database meta info when connected, If your machine's performance is low, turn it off.\"\n+ },\n+ \"vscode-mysql.resultTheme\": {\n+ \"type\": \"string\",\n+ \"default\": \"Default\",\n+ \"description\": \"Theme of result view.\"\n}\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/common/constants.ts", "new_path": "src/common/constants.ts", "diff": "@@ -15,7 +15,7 @@ export class Pattern {\nexport enum OperateType {\nexecute = 'execute', export = 'export',\n- next = 'next', init = 'init'\n+ next = 'next', init = 'init', changeTheme=\"changeTheme\"\n}\nexport enum CacheKey {\n@@ -27,6 +27,7 @@ export enum ConfigKey {\nMAX_TABLE_COUNT = \"maxTableCount\",\nENABLE_DELIMITER = \"enableDelimiter\",\nLOAD_META_ON_CONNECT = \"loadMetaOnConnect\",\n+ REULST_THEME = \"resultTheme\",\n}\n@@ -60,7 +61,8 @@ export enum MessageType {\nERROR = \"ERROR\",\nRUN = \"RUN\",\nMESSAGE = \"MESSAGE\",\n- NEXT_PAGE = \"NEXT_PAGE\"\n+ NEXT_PAGE = \"NEXT_PAGE\",\n+ THEME = \"theme\"\n}\nexport enum Template {\n" }, { "change_type": "MODIFY", "old_path": "src/common/global.ts", "new_path": "src/common/global.ts", "diff": "@@ -35,4 +35,13 @@ export class Global {\nreturn vscode.workspace.getConfiguration(Constants.CONFIG_PREFIX).get<T>(key);\n}\n+ /**\n+ * update mysql config for vscode.\n+ * @param name config name\n+ * @param value config value\n+ */\n+ public static async updateConfig(name: string, value: any) {\n+ await vscode.workspace.getConfiguration(Constants.CONFIG_PREFIX).update(name, value, true)\n+ }\n+\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/view/result/query.ts", "new_path": "src/view/result/query.ts", "diff": "import { extname, basename } from \"path\";\nimport { window } from \"vscode\";\n-import { MessageType, OperateType } from \"../../common/constants\";\n+import { MessageType, OperateType, ConfigKey } from \"../../common/constants\";\nimport { Node } from \"../../model/interface/node\";\nimport { ColumnNode } from \"../../model/other/columnNode\";\nimport { DatabaseCache } from \"../../service/common/databaseCache\";\n@@ -48,18 +48,27 @@ export class QueryPage {\nbreak;\n}\n+\n+ const themeMap = { \"Dark\": \"result-dark\", \"Default\": \"result\" }\n+ const themeName: string = Global.getConfig(ConfigKey.REULST_THEME)\n+ let path = themeMap[themeName]\n+ if (!path) {\n+ path = \"result\"\n+ }\n+\nViewManager.createWebviewPanel({\nsinglePage: queryParam.singlePage,\nsplitView: this.isActiveSql(),\n- path: \"result-dark\", title: \"Query\",\n+ path, title: \"Query\",\niconPath: Global.getExtPath(\"resources\", \"icon\", \"query.svg\"),\ninitListener: (webviewPanel) => {\nif (queryParam.res?.table) {\nwebviewPanel.title = queryParam.res.table\n}\nwebviewPanel.webview.postMessage(queryParam);\n+ webviewPanel.webview.postMessage({ type: MessageType.THEME, res: themeName } as QueryParam<string>);\n},\n- receiveListener: async (_, params) => {\n+ receiveListener: async (viewPanel, params) => {\nswitch (params.type) {\ncase OperateType.execute:\nQueryUnit.runQuery(params.sql);\n@@ -74,6 +83,11 @@ export class QueryPage {\ncase OperateType.export:\nthis.exportService.export(params.sql)\nbreak;\n+ case OperateType.changeTheme:\n+ await Global.updateConfig(ConfigKey.REULST_THEME, params.theme)\n+ viewPanel.dispose()\n+ QueryUnit.runQuery(params.sql)\n+ break;\n}\n}\n});\n" }, { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "<el-row>\n<el-button type=\"primary\" @click='count(toolbar.sql);'>Count</el-button>\n<el-button type=\"primary\" @click='info.visible = false;execute(toolbar.sql);'>Execute</el-button>\n+ <el-tag>Theme(Preview) :</el-tag>\n+ <el-select v-model=\"theme.select\" @change=\"changeTheme\">\n+ <el-option v-for=\"theme in theme.list\" :key=\"theme\" :label=\"theme\" :value=\"theme\">\n+ </el-option>\n+ </el-select>\n<el-tag>Table :</el-tag>\n<span v-if=\"result.table\">\n{{result.table}}\n@@ -102,6 +107,10 @@ export default {\nname: \"App\",\ndata() {\nreturn {\n+ theme: {\n+ list: [ \"Default\", \"Dark\"],\n+ select: \"Default\"\n+ },\nresult: {\ndata: [],\nsql: \"\",\n@@ -180,6 +189,10 @@ export default {\nwindow.addEventListener(\"message\", ({ data }) => {\nif (!data) return;\n+ if (data.type == \"theme\") {\n+ this.theme.select = data.res;\n+ return;\n+ }\nconst response = data.res;\nthis.table.loading = false;\nif (response && response.costTime) {\n@@ -230,6 +243,13 @@ export default {\npostMessage({ type: \"init\" });\n},\nmethods: {\n+ changeTheme(theme) {\n+ postMessage({\n+ type: \"changeTheme\",\n+ theme,\n+ sql: this.result.sql\n+ });\n+ },\nexportData() {\nthis.$confirm(\"Export without limit?\", \"Export\", {\nconfirmButtonText: \"Yes\",\n@@ -261,13 +281,13 @@ export default {\n);\nif (inputvalue) {\n- const condition=inputvalue.toLowerCase()==\"null\"?`${column} is null`:`${column}='${inputvalue}'`;\n+ const condition =\n+ inputvalue.toLowerCase() == \"null\"\n+ ? `${column} is null`\n+ : `${column}='${inputvalue}'`;\nif (existsCheck.exec(filterSql)) {\n// condition present\n- filterSql = filterSql.replace(\n- existsCheck,\n- `$1 ${condition} `\n- );\n+ filterSql = filterSql.replace(existsCheck, `$1 ${condition} `);\n} else if (filterSql.match(/\\bwhere\\b/gi)) {\n//have where\nfilterSql = filterSql.replace(\n@@ -283,7 +303,10 @@ export default {\n}\n} else {\n// empty value, clear filter\n- let beforeAndCheck = new RegExp(`\\\\b${column}\\\\b\\\\s*(=|is)\\\\s*.+?\\\\s*AND`, \"igm\");\n+ let beforeAndCheck = new RegExp(\n+ `\\\\b${column}\\\\b\\\\s*(=|is)\\\\s*.+?\\\\s*AND`,\n+ \"igm\"\n+ );\nif (beforeAndCheck.exec(filterSql)) {\nfilterSql = filterSql.replace(beforeAndCheck, \"\");\n} else {\n@@ -385,7 +408,10 @@ export default {\nconst updateSql = `UPDATE ${this.result.table} SET ${change.replace(\n/,$/,\n\"\"\n- )} WHERE ${this.result.primaryKey}=${this.wrapQuote(this.result.primaryKey,this.update.primary)}`;\n+ )} WHERE ${this.result.primaryKey}=${this.wrapQuote(\n+ this.result.primaryKey,\n+ this.update.primary\n+ )}`;\nthis.execute(updateSql);\n} else {\nthis.$message(\"Not any change, update fail!\");\n@@ -417,7 +443,9 @@ export default {\ntype: \"warning\"\n})\n.then(() => {\n- const deleteSql = `DELETE FROM ${this.result.table} WHERE ${this.result.primaryKey}=${this.wrapQuote(this.result.primaryKey,primaryValue)}`;\n+ const deleteSql = `DELETE FROM ${this.result.table} WHERE ${\n+ this.result.primaryKey\n+ }=${this.wrapQuote(this.result.primaryKey, primaryValue)}`;\nthis.execute(deleteSql);\n})\n.catch(() => {\n@@ -462,9 +490,10 @@ export default {\n},\ncount(sql) {\nthis.info.visible = false;\n- let countSql=sql.replace(/select (.+?) from/i,\"SELECT count(*) FROM\")\n+ let countSql = sql\n+ .replace(/select (.+?) from/i, \"SELECT count(*) FROM\")\n.replace(/\\blimit\\b.+$/gi, \"\");\n- this.execute(countSql)\n+ this.execute(countSql);\n},\nexecute(sql) {\nif (!sql) return;\n@@ -660,5 +689,4 @@ body {\nborder-radius: 8px;\nbackground-color: #ccc;\n}\n-\n</style>\n\\ No newline at end of file\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
add theme select, update to 2.3.0
141,908
10.07.2020 17:26:23
-28,800
0eb42810ce851bd59210d533a610d0c29df5f3df
fix view path error
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.3.1\",\n+ \"version\": \"2.3.2\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" }, { "change_type": "MODIFY", "old_path": "src/view/viewManager.ts", "new_path": "src/view/viewManager.ts", "diff": "@@ -113,7 +113,7 @@ export class ViewManager {\n}\nprivate static buildPath(data: string, webview: vscode.Webview, contextPath: string): string {\n- return data.replace(/((src|href)=(\"|'))(.+?\\.(css|js))\\b/gi, \"$1\" + webview.asWebviewUri(vscode.Uri.file(`${contextPath}/`)) + \"/$4\");\n+ return data.replace(/((src|href)=(\"|'))(.+?\\.(css|js))\\b/gi, \"$1\" + webview.asWebviewUri(vscode.Uri.file(`${contextPath}/`)) + \"$4\");\n}\n}\n\\ No newline at end of file\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix view path error
141,908
13.07.2020 15:26:58
-28,800
e65d473a98657869b775f6fe6bc3dd7bfc17f307
history not record repeat sql
[ { "change_type": "MODIFY", "old_path": "src/service/common/historyRecorder.ts", "new_path": "src/service/common/historyRecorder.ts", "diff": "@@ -2,6 +2,8 @@ import { TextEditor, Selection } from \"vscode\";\nimport { FileManager } from \"../../common/filesManager\";\nexport class HistoryRecorder {\n+ private preSql:string;\n+\npublic showHistory() {\nFileManager.show('history.sql').then((textEditor: TextEditor) => {\nconst lineCount = textEditor.document.lineCount;\n@@ -12,7 +14,8 @@ export class HistoryRecorder {\n}\npublic recordHistory(sql: string, costTime: number) {\n- if (!sql) { return; }\n+ if (!sql || sql==this.preSql) { return; }\n+ this.preSql=sql;\nFileManager.record('history.sql', `/* ${this.getNowDate()} [${costTime} ms] */ ${sql.replace(/[\\r\\n]/g, \" \")}\\n`);\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
history not record repeat sql
141,908
14.07.2020 11:13:25
-28,800
26cade031d33e0ba0ca3f75592bf12f338a34e4b
change default charset to utf8mb4
[ { "change_type": "MODIFY", "old_path": "src/model/database/connectionNode.ts", "new_path": "src/model/database/connectionNode.ts", "diff": "@@ -92,7 +92,7 @@ export class ConnectionNode extends Node implements CopyAble {\npublic createDatabase() {\nvscode.window.showInputBox({ placeHolder: 'Input you want to create new database name.' }).then(async (inputContent) => {\nif (!inputContent) { return; }\n- QueryUnit.queryPromise(await ConnectionManager.getConnection(this), `create database \\`${inputContent}\\` default character set = 'utf8' `).then(() => {\n+ QueryUnit.queryPromise(await ConnectionManager.getConnection(this), `create database \\`${inputContent}\\` default character set = 'utf8mb4' `).then(() => {\nDatabaseCache.clearDatabaseCache(this.id);\nDbTreeDataProvider.refresh();\nvscode.window.showInformationMessage(`create database ${inputContent} success!`);\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
change default charset to utf8mb4
141,908
14.07.2020 11:24:17
-28,800
c32bf87f5feeb07baec54ac7956361d743494b7c
Add count sql.
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"title\": \"Show Table Source\",\n\"category\": \"MySQL\"\n},\n+ {\n+ \"command\": \"mysql.count.sql\",\n+ \"title\": \"Show Count\",\n+ \"category\": \"MySQL\"\n+ },\n{\n\"command\": \"mysql.table.show\",\n\"title\": \"Open In New Panel\",\n\"when\": \"view == github.cweijan.mysql && viewItem == table\",\n\"group\": \"1_inline@2\"\n},\n+ {\n+ \"command\": \"mysql.count.sql\",\n+ \"when\": \"view == github.cweijan.mysql && viewItem == table\",\n+ \"group\": \"1_inline@3\"\n+ },\n{\n\"command\": \"mysql.column.add\",\n\"when\": \"view == github.cweijan.mysql && viewItem == table\",\n" }, { "change_type": "MODIFY", "old_path": "src/extension.ts", "new_path": "src/extension.ts", "diff": "@@ -113,6 +113,9 @@ export function activate(context: vscode.ExtensionContext) {\nFileManager.show(`sql/${new Date().getTime()}.sql`)\n}\n},\n+ \"mysql.count.sql\": (tableNode: TableNode) => {\n+ tableNode.countSql()\n+ },\n\"mysql.template.sql\": (tableNode: TableNode, run: boolean) => {\ntableNode.selectSqlTemplate(run);\n},\n" }, { "change_type": "MODIFY", "old_path": "src/model/main/tableNode.ts", "new_path": "src/model/main/tableNode.ts", "diff": "@@ -129,6 +129,10 @@ ADD\n}\n+ public async countSql() {\n+ QueryUnit.runQuery(`SELECT count(*) FROM ${Util.wrap(this.database)}.${Util.wrap(this.table)};`, this);\n+ }\n+\npublic async selectSqlTemplate(run: boolean) {\nconst sql = `SELECT * FROM ${Util.wrap(this.database)}.${Util.wrap(this.table)} LIMIT ${Constants.DEFAULT_SIZE};`;\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
Add count sql.
141,908
14.07.2020 12:40:52
-28,800
420f929da268f0d9bf56b8690abf74859c21bbd6
support query in new panel
[ { "change_type": "MODIFY", "old_path": "src/view/result/query.ts", "new_path": "src/view/result/query.ts", "diff": "@@ -28,6 +28,7 @@ export class QueryPage {\nprivate static exportService: ExportService = new MysqlExportService()\nprivate static pageService: PageService = new MysqlPageSerivce()\n+ private static hodlder: Map<string, string> = new Map()\npublic static async send(queryParam: QueryParam<any>) {\n@@ -55,11 +56,20 @@ export class QueryPage {\nif (!path) {\npath = \"result\"\n}\n+ let title = queryParam.singlePage ? \"Query\" : \"Query\" + new Date().getTime();\n+ const olderTitle = this.hodlder.get(queryParam.res.sql);\n+ if (olderTitle) {\n+ title = olderTitle\n+ queryParam.singlePage = false\n+ if(queryParam.type==MessageType.DATA){\n+ this.hodlder.delete(queryParam.res.sql)\n+ }\n+ }\nViewManager.createWebviewPanel({\n- singlePage: queryParam.singlePage,\n+ singlePage: true,\nsplitView: this.isActiveSql(),\n- path, title: \"Query\",\n+ path, title,\niconPath: Global.getExtPath(\"resources\", \"icon\", \"query.svg\"),\ninitListener: (webviewPanel) => {\nif (queryParam.res?.table) {\n@@ -71,6 +81,9 @@ export class QueryPage {\nreceiveListener: async (viewPanel, params) => {\nswitch (params.type) {\ncase OperateType.execute:\n+ if (!queryParam.singlePage) {\n+ this.hodlder.set(params.sql, title)\n+ }\nQueryUnit.runQuery(params.sql);\nbreak;\ncase OperateType.next:\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
support query in new panel
141,908
14.07.2020 12:42:01
-28,800
f36bf661a0f24623fd541356efc9313f81b66cea
update to 2.3.3
[ { "change_type": "MODIFY", "old_path": "CHANGELOG.md", "new_path": "CHANGELOG.md", "diff": "# CHANGELOG\n+## 2.3.3 - 2020/7/14\n+- Not record repeat history.\n+- Support query in new panel.\n+- Add count query to content menu of table node.\n+\n## 2.3.0 - 2020/7/10\n- Update result view.\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.3.2\",\n+ \"version\": \"2.3.3\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 2.3.3
141,908
14.07.2020 14:29:57
-28,800
ca5e9152826779d1580d58cdd417a5dea63838f9
add database truncate
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"category\": \"MySQL\"\n},\n{\n- \"command\": \"mysql.deleteDatabase\",\n+ \"command\": \"mysql.db.drop\",\n\"title\": \"Drop Database\",\n\"category\": \"MySQL\"\n},\n\"title\": \"Truncate Table\",\n\"category\": \"MySQL\"\n},\n+ {\n+ \"command\": \"mysql.db.truncate\",\n+ \"title\": \"Truncate Database\",\n+ \"category\": \"MySQL\"\n+ },\n{\n\"command\": \"mysql.table.drop\",\n\"title\": \"Drop table\",\n\"group\": \"3_mysql@1\"\n},\n{\n- \"command\": \"mysql.deleteDatabase\",\n+ \"command\": \"mysql.db.truncate\",\n+ \"when\": \"view == github.cweijan.mysql && viewItem == database\",\n+ \"group\": \"4_mysql@4\"\n+ },\n+ {\n+ \"command\": \"mysql.db.drop\",\n\"when\": \"view == github.cweijan.mysql && viewItem == database\",\n\"group\": \"4_mysql@5\"\n},\n" }, { "change_type": "MODIFY", "old_path": "src/extension.ts", "new_path": "src/extension.ts", "diff": "@@ -66,7 +66,7 @@ export function activate(context: vscode.ExtensionContext) {\n\"mysql.database.add\": (connectionNode: ConnectionNode) => {\nconnectionNode.createDatabase();\n},\n- \"mysql.deleteDatabase\": (databaseNode: DatabaseNode) => {\n+ \"mysql.db.drop\": (databaseNode: DatabaseNode) => {\ndatabaseNode.dropDatatabase();\n},\n\"mysql.changeTableName\": (tableNode: TableNode) => {\n@@ -78,6 +78,9 @@ export function activate(context: vscode.ExtensionContext) {\n\"mysql.table.truncate\": (tableNode: TableNode) => {\ntableNode.truncateTable();\n},\n+ \"mysql.db.truncate\": (databaseNode: DatabaseNode) => {\n+ databaseNode.truncateDb();\n+ },\n\"mysql.table.drop\": (tableNode: TableNode) => {\ntableNode.dropTable();\n},\n" }, { "change_type": "MODIFY", "old_path": "src/model/database/databaseNode.ts", "new_path": "src/model/database/databaseNode.ts", "diff": "@@ -50,7 +50,7 @@ export class DatabaseNode extends Node implements CopyAble {\npublic dropDatatabase() {\n- vscode.window.showInputBox({ prompt: `Are you want to Delete Database ${this.database} ? `, placeHolder: 'Input database name to confirm.' }).then(async (inputContent) => {\n+ vscode.window.showInputBox({ prompt: `Are you want to drop database ${this.database} ? `, placeHolder: 'Input database name to confirm.' }).then(async (inputContent) => {\nif (inputContent && inputContent.toLowerCase() == this.database.toLowerCase()) {\nQueryUnit.queryPromise(await ConnectionManager.getConnection(this), `DROP DATABASE \\`${this.database}\\``).then(() => {\nDatabaseCache.clearDatabaseCache(`${this.getConnectId()}`)\n@@ -65,6 +65,23 @@ export class DatabaseNode extends Node implements CopyAble {\n}\n+ public async truncateDb(){\n+\n+\n+ vscode.window.showInputBox({ prompt: `Dangerous: Are you want to truncate database ${this.database} ? `, placeHolder: 'Input database name to confirm.' }).then(async (inputContent) => {\n+ if (inputContent && inputContent.toLowerCase() == this.database.toLowerCase()) {\n+ const connection = await ConnectionManager.getConnection(this);\n+ QueryUnit.queryPromise(connection, `SELECT Concat('TRUNCATE TABLE ',table_schema,'.',TABLE_NAME, ';') trun FROM INFORMATION_SCHEMA.TABLES where table_schema ='${this.database}';`).then(async (res:any) => {\n+ await QueryUnit.runBatch(connection,res.map(data=>data.trun))\n+ vscode.window.showInformationMessage(`Truncate database ${this.database} success!`)\n+ })\n+ } else {\n+ vscode.window.showInformationMessage(`Cancel truncate database ${this.database}!`)\n+ }\n+ })\n+\n+ }\n+\npublic async newQuery() {\nFileManager.show(`${this.id}.sql`)\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
add database truncate
141,908
15.07.2020 14:25:56
-28,800
21eb47b47d90ef6ea35d59bc0b41fc93b962ae08
update edit dialog in result view
[ { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "</el-table-column>\n</el-table>\n<el-dialog ref=\"editDialog\" :title=\"editorTilte\" :visible.sync=\"editor.visible\" width=\"90%\" top=\"3vh\" size=\"small\">\n- <el-form ref=\"infoForm\" :model=\"update.currentNew\">\n+ <el-form ref=\"infoForm\" :model=\"update.currentNew\" :inline=\"true\">\n<el-form-item :prop=\"column.name\" :key=\"column.name\" v-for=\"column in result.columnList\" size=\"mini\">\n<template>\n<span>\n{{column.name}} : {{column.type}} : <span style=\"color: red;\">{{column.key}}{{column.nullable=='YES'?'':' Required'}}</span>&nbsp;\n{{column.comment?column.comment:''}}\n</span>\n- <el-input v-model=\"update.currentNew[column.name]\"></el-input>\n+ <el-date-picker v-if=\"column.type=='date'\" value-format=\"yyyy-MM-dd\" v-model=\"update.currentNew[column.name]\"></el-date-picker>\n+ <el-time-picker v-else-if=\"column.type=='time'\" value-format=\"HH:mm:ss\" v-model=\"update.currentNew[column.name]\"></el-time-picker>\n+ <el-date-picker v-else-if=\"column.type=='datetime'\" value-format=\"yyyy-MM-dd HH:mm:ss\" type=\"datetime\" v-model=\"update.currentNew[column.name]\"></el-date-picker>\n+ <el-input v-else=\"column.type\" v-model=\"update.currentNew[column.name]\"></el-input>\n</template>\n</el-form-item>\n</el-form>\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update edit dialog in result view
141,908
15.07.2020 14:26:03
-28,800
0483e3fd3b3ebc048d7eb6edebe811107f4f71dd
update to 2.3.6
[ { "change_type": "MODIFY", "old_path": "CHANGELOG.md", "new_path": "CHANGELOG.md", "diff": "# CHANGELOG\n+## 2.3.6 - 2020/7/15\n+- Support edit date in result view.\n+\n## 2.3.5 - 2020/7/14\n- Not record repeat history.\n- Support query in new panel.\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.3.5\",\n+ \"version\": \"2.3.6\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 2.3.6
141,908
20.07.2020 09:20:09
-28,800
c86d59215f01009f52619607d47629742ea0cab5
Support config default limit of query.
[ { "change_type": "MODIFY", "old_path": "CHANGELOG.md", "new_path": "CHANGELOG.md", "diff": "# CHANGELOG\n+## 2.3.7 - 2020/7/20\n+- Support config default limit of query.\n+\n## 2.3.6 - 2020/7/15\n- Support edit date in result view.\n" }, { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -60,18 +60,9 @@ MySQL Client For Visual Studio Code\n## Setting\n-```jsonc\n-{\n- // enable delimiter when import data\n- \"vscode-mysql.enableDelimiter\": false,\n-\n- // Load database meta info when connected, If your machine's performance is low, turn it off.\n- \"vscode-mysql.loadMetaOnConnect\":true,\n-\n- // set max tables show of each database.\n- \"vscode-mysql.maxTableCount\": 500\n-}\n-```\n+OpenSetting -> extensions -> Mysql\n+\n+![Setting](images/setting.png)\n## Other\n* Find a suprise when you right click on a node.\n" }, { "change_type": "ADD", "old_path": "images/setting.png", "new_path": "images/setting.png", "diff": "Binary files /dev/null and b/images/setting.png differ\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.3.6\",\n+ \"version\": \"2.3.7\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n\"default\": true,\n\"description\": \"Load database meta info when connected, If your machine's performance is low, turn it off.\"\n},\n+ \"vscode-mysql.defaultLimit\": {\n+ \"type\": \"integer\",\n+ \"default\": \"100\",\n+ \"description\": \"Default limit of query sql.\"\n+ },\n\"vscode-mysql.resultTheme\": {\n\"type\": \"string\",\n\"default\": \"Default\",\n" }, { "change_type": "MODIFY", "old_path": "src/common/constants.ts", "new_path": "src/common/constants.ts", "diff": "@@ -4,7 +4,6 @@ import * as path from \"path\";\nexport class Constants {\npublic static CONFIG_PREFIX = \"vscode-mysql\"\npublic static RES_PATH = path.join(vscode.extensions.getExtension('cweijan.vscode-mysql-client2').extensionPath, \"resources\");\n- public static DEFAULT_SIZE = 100;\n}\nexport class Pattern {\n@@ -28,7 +27,7 @@ export enum ConfigKey {\nENABLE_DELIMITER = \"enableDelimiter\",\nLOAD_META_ON_CONNECT = \"loadMetaOnConnect\",\nREULST_THEME = \"resultTheme\",\n-\n+ DEFAULT_LIMIT = \"defaultLimit\",\n}\nexport enum CommandKey {\n" }, { "change_type": "MODIFY", "old_path": "src/model/main/tableNode.ts", "new_path": "src/model/main/tableNode.ts", "diff": "import * as path from \"path\";\nimport * as mysql from \"mysql\";\nimport * as vscode from \"vscode\";\n-import { Constants, ModelType, Template, MessageType } from \"../../common/constants\";\n+import { Constants, ModelType, Template, MessageType, ConfigKey } from \"../../common/constants\";\nimport { Util } from \"../../common/util\";\nimport { DbTreeDataProvider } from \"../../provider/treeDataProvider\";\nimport { DatabaseCache } from \"../../service/common/databaseCache\";\n@@ -15,6 +15,7 @@ import { MockRunner } from \"../../service/mock/mockRunner\";\nimport { QueryPage } from \"../../view/result/query\";\nimport { DataResponse } from \"../../view/result/queryResponse\";\nimport { ColumnMeta } from \"../other/columnMeta\";\n+import { Global } from \"../../common/global\";\nexport class TableNode extends Node implements CopyAble {\n@@ -119,12 +120,13 @@ ADD\n}\npublic async openInNew() {\n- const sql = `SELECT * FROM ${Util.wrap(this.database)}.${Util.wrap(this.table)} LIMIT ${Constants.DEFAULT_SIZE};`;\n+ const pageSize=Global.getConfig(ConfigKey.DEFAULT_LIMIT);\n+ const sql = `SELECT * FROM ${Util.wrap(this.database)}.${Util.wrap(this.table)} LIMIT ${pageSize};`;\nconst connection = await ConnectionManager.getConnection(this);\nconst executeTime = new Date().getTime();\nconnection.query(sql, (err: mysql.MysqlError, data, fields?: mysql.FieldInfo[]) => {\nconst costTime = new Date().getTime() - executeTime;\n- QueryPage.send({ singlePage: false, type: MessageType.DATA, connection: this, res: { sql, costTime, data, fields, pageSize: Constants.DEFAULT_SIZE } as DataResponse });\n+ QueryPage.send({ singlePage: false, type: MessageType.DATA, connection: this, res: { sql, costTime, data, fields, pageSize: pageSize } as DataResponse });\n})\n}\n@@ -134,7 +136,7 @@ ADD\n}\npublic async selectSqlTemplate(run: boolean) {\n- const sql = `SELECT * FROM ${Util.wrap(this.database)}.${Util.wrap(this.table)} LIMIT ${Constants.DEFAULT_SIZE};`;\n+ const sql = `SELECT * FROM ${Util.wrap(this.database)}.${Util.wrap(this.table)} LIMIT ${Global.getConfig(ConfigKey.DEFAULT_LIMIT)};`;\nif (run) {\nQueryUnit.runQuery(sql, this);\n" }, { "change_type": "MODIFY", "old_path": "src/service/queryUnit.ts", "new_path": "src/service/queryUnit.ts", "diff": "@@ -107,7 +107,7 @@ export class QueryUnit {\nreturn;\n}\nif (Array.isArray(data)) {\n- QueryPage.send({ type: MessageType.DATA, connection: connectionNode, res: { sql, costTime, data, fields, pageSize: Constants.DEFAULT_SIZE } as DataResponse });\n+ QueryPage.send({ type: MessageType.DATA, connection: connectionNode, res: { sql, costTime, data, fields, pageSize: Global.getConfig(ConfigKey.DEFAULT_LIMIT) } as DataResponse });\nreturn;\n}\nQueryPage.send({ type: MessageType.MESSAGE, res: { message: `Execute sql success : ${sql}`, costTime, success: true } as MessageResponse });\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
Support config default limit of query.
141,908
20.07.2020 09:35:23
-28,800
f8b656d52d2b2586bfc21986ad1b90da0e39939d
change default size
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "},\n\"vscode-mysql.defaultLimit\": {\n\"type\": \"integer\",\n- \"default\": \"100\",\n+ \"default\": 30,\n\"description\": \"Default limit of query sql.\"\n},\n\"vscode-mysql.resultTheme\": {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
change default size
141,920
25.07.2020 14:38:31
14,400
d5d95380d1f718234f0fee8dcd916aa9906ea84c
Update README.md MySQL 8.0 _does_ work, but currently the `mysqljs/mysql` dependency doesn't support the newer authentication methods.
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -9,7 +9,16 @@ MySQL Client For Visual Studio Code\n>\n> Give [project](https://github.com/cweijan/vscode-mysql) a star to keep me motivated to keep updating.\n-**Note: This plugin does not support MySql 8.0!**\n+## Regarding MySQL 8.0 support\n+\n+While this plugin can connect to a MySQL 8.0 server, the newer authentication methods are not supported.\n+\n+To change a user's authentication method to the older one supported by this plugin, run the following query:\n+\n+```sql\n+alter user my_user@'%' identified with mysql_native_password by \"myPassword\";\n+```\n+\n**Features**\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
Update README.md MySQL 8.0 _does_ work, but currently the `mysqljs/mysql` dependency doesn't support the newer authentication methods.
141,908
30.07.2020 09:51:35
-28,800
6ef9ab3f8f5acac8005d7b43bfb3def5414c9355
fix update keyword column fail
[ { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "@@ -385,7 +385,7 @@ export default {\nfor (const key in this.update.currentNew) {\nconst newEle = this.update.currentNew[key];\nif (newEle != null) {\n- columns += `${this.wrap(key)},`;\n+ columns += `\\`${this.wrap(key)}\\`,`;\nvalues += `${this.wrapQuote(key, newEle)},`;\n}\n}\n@@ -405,7 +405,7 @@ export default {\nconst oldEle = this.update.current[key];\nconst newEle = this.update.currentNew[key];\nif (oldEle != newEle) {\n- change += `${this.wrap(key)}=${this.wrapQuote(key, newEle)},`;\n+ change += `\\`${this.wrap(key)}\\`=${this.wrapQuote(key, newEle)},`;\n}\n}\nif (change) {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix update keyword column fail
141,908
30.07.2020 09:58:01
-28,800
73ed921a284f12e25e8bd2835058a875edb71d37
change active show full
[ { "change_type": "MODIFY", "old_path": "src/provider/treeDataProvider.ts", "new_path": "src/provider/treeDataProvider.ts", "diff": "@@ -94,9 +94,10 @@ export class DbTreeDataProvider implements vscode.TreeDataProvider<Node> {\nconst dbIdList: string[] = [];\nconst dbIdMap = new Map<string, DatabaseNode>();\n+ const numbers=(await this.getConnectionNodes()).length>1\nfor (const dbNode of DatabaseCache.getDatabaseNodeList()) {\nif (dbNode instanceof UserGroup) { continue }\n- const id = dbIdList.includes(dbNode.database) ? dbNode.id : dbNode.database\n+ const id = numbers ? dbNode.id : dbNode.database\ndbIdList.push(id)\ndbIdMap.set(id, dbNode)\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
change active show full
141,908
30.07.2020 09:58:19
-28,800
0343e8ad2a6cdbf02fa6e6679bad4d2a683e3cb6
update to 2.3.9
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.3.8\",\n+ \"version\": \"2.3.9\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 2.3.9
141,908
02.08.2020 21:03:44
-28,800
6b305a19f706413410396e2021fdb11c35934823
update active icon
[ { "change_type": "ADD", "old_path": null, "new_path": "resources/icon/connection-active.svg", "diff": "+<svg id=\"Layer_1\" enable-background=\"new 0 0 494.9 494.9\" height=\"512\" viewBox=\"0 0 494.9 494.9\" width=\"512\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m286.95 59.76v.24c-.29 30.58-55.51 55.74-126.57 59.13 2.628 109.632-44.28 211.411-124.99 281.01-21.47-10.46-34.44-24.05-34.44-38.9v-301.48c0-33 64.02-59.76 143-59.76s143 26.76 143 59.76z\" fill=\"#8ab2ff\"/><path d=\"m493.95 209.76v225.48c0 45.064-110.019 70.211-196.63 55.41-34.099-5.713-89.37-23.337-89.37-55.41v-225.48c0-37.135 75.016-59.76 143-59.76 78.98 0 143 26.76 143 59.76z\" fill=\"#8ab2ff\"/><path d=\"m350.95 150c78.98 0 143 26.76 143 59.76 0 33.01-64.02 59.77-143 59.77s-143-26.76-143-59.77c0-36.446 73.446-59.76 143-59.76z\" fill=\"#a6c4ff\"/><path d=\"m286.95 59.76v.24c-.31 32.9-64.21 59.53-143 59.53-78.954 0-143-26.748-143-59.77 0-33 64.02-59.76 143-59.76s143 26.76 143 59.76z\" fill=\"#a6c4ff\"/><path d=\"m493.95 209.76v225.48c0 47.823-124.141 73.518-213.9 51.91 63.997-57.043 103.152-132.832 99.68-218.83 65.18-5.57 114.22-29.67 114.22-58.56z\" fill=\"#7da7fa\"/><path d=\"m493.95 291.09v25.1c-57.67 48.151-228.356 48.13-286 0v-25.1c10.552 25.909 80.273 49.693 165.57 44.66 65.81-3.87 112.15-24.32 120.43-44.66z\" fill=\"#779fee\"/><path d=\"m286.95 60v96.31c-29.635 6.208-79 23.273-79 53.45v204.93c-52.871 11.096-125.99 8.162-172.56-14.55 80.065-69.044 127.637-170.606 124.99-281.01 71.06-3.39 126.28-28.55 126.57-59.13z\" fill=\"#7da7fa\"/><g fill=\"#779fee\"><path d=\"m493.95 366.38v25.11c-57.805 48.264-228.292 48.183-286 0v-25.11c8.88 21.82 61.52 43.76 135.01 45.25 82.241 1.567 141.523-21.995 150.99-45.25z\"/><path d=\"m230.29 177.68c-7.552 4.948-15.142 11.538-19.23 19.63-19.645 3.035-44.5 5.81-64.54 5.81-45.339 0-112.64-8.777-145.57-37.19v-27.41c5.88 28.508 81.977 51.192 154.66 48.42 23.58-.88 53.03-4.88 74.68-9.26z\"/><path d=\"m207.95 257.34v16.23c-66.801 11.036-165.396 3.549-207-32.35v-27.44c6.846 33.617 110.966 60.303 207 43.56z\"/><path d=\"m207.95 332.63v16.23c-39.712 6.592-84.828 6.387-123.57-.1-27.151-4.537-62.503-14.184-83.43-32.24v-27.43c6.914 33.797 111.471 60.278 207 43.54z\"/></g></svg>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/model/database/connectionNode.ts", "new_path": "src/model/database/connectionNode.ts", "diff": "@@ -25,6 +25,11 @@ export class ConnectionNode extends Node implements CopyAble {\nif (parent.name) {\nthis.label = `${parent.name}_${id}`\n}\n+ const lcp = ConnectionManager.getLastConnectionOption(false);\n+ if (lcp && lcp.getConnectId() == this.getConnectId()) {\n+ this.iconPath = path.join(Constants.RES_PATH, \"icon/connection-active.svg\");\n+ this.description = `Active`\n+ }\n}\npublic async getChildren(isRresh: boolean = false): Promise<Node[]> {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update active icon
141,908
02.08.2020 21:40:38
-28,800
ab650291ad2a04ee152b9226a838f9264d0207e0
add default value show
[ { "change_type": "MODIFY", "old_path": "src/model/main/tableNode.ts", "new_path": "src/model/main/tableNode.ts", "diff": "@@ -39,7 +39,7 @@ export class TableNode extends Node implements CopyAble {\nif (columnNodes && !isRresh) {\nreturn columnNodes;\n}\n- return QueryUnit.queryPromise<ColumnMeta[]>(await ConnectionManager.getConnection(this), `SELECT COLUMN_NAME name,DATA_TYPE simpleType,COLUMN_TYPE type,COLUMN_COMMENT comment,COLUMN_KEY \\`key\\`,IS_NULLABLE nullable,CHARACTER_MAXIMUM_LENGTH maxLength FROM information_schema.columns WHERE table_schema = '${this.database}' AND table_name = '${this.table}';`)\n+ return QueryUnit.queryPromise<ColumnMeta[]>(await ConnectionManager.getConnection(this), `SELECT COLUMN_NAME name,DATA_TYPE simpleType,COLUMN_TYPE type,COLUMN_COMMENT comment,COLUMN_KEY \\`key\\`,IS_NULLABLE nullable,CHARACTER_MAXIMUM_LENGTH maxLength,COLUMN_DEFAULT defaultValue FROM information_schema.columns WHERE table_schema = '${this.database}' AND table_name = '${this.table}';`)\n.then((columns) => {\ncolumnNodes = columns.map<ColumnNode>((column) => {\nif (column && column.key == \"PRI\") {\n" }, { "change_type": "MODIFY", "old_path": "src/model/other/columnMeta.ts", "new_path": "src/model/other/columnMeta.ts", "diff": "@@ -30,4 +30,8 @@ export interface ColumnMeta {\n* man length or this column value.\n*/\nmaxLength: string;\n+ /**\n+ * default value or column.\n+ */\n+ defaultValue:any;\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "<el-form-item :prop=\"column.name\" :key=\"column.name\" v-for=\"column in result.columnList\" size=\"mini\">\n<template>\n<span>\n- {{column.name}} : {{column.type}} : <span style=\"color: red;\">{{column.key}}{{column.nullable=='YES'?'':' Required'}}</span>&nbsp;\n- {{column.comment?column.comment:''}}\n+ {{column.name}} : {{column.type}} &nbsp;\n+ <span style=\"color: red;\">{{column.key}}{{column.nullable=='YES'?'':' NOT NULL'}}</span>&nbsp;\n+ <span>{{column.defaultValue?` Default : ${column.defaultValue}`:\"\"}}</span>\n</span>\n<el-date-picker v-if=\"column.type=='date'\" value-format=\"yyyy-MM-dd\" v-model=\"update.currentNew[column.name]\"></el-date-picker>\n<el-time-picker v-else-if=\"column.type=='time'\" value-format=\"HH:mm:ss\" v-model=\"update.currentNew[column.name]\"></el-time-picker>\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
add default value show
141,908
02.08.2020 22:02:46
-28,800
ddae208855b1ef39114a18b5c59b749ecfffbeda
update edit panel
[ { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "<span style=\"color: red;\">{{column.key}}{{column.nullable=='YES'?'':' NOT NULL'}}</span>&nbsp;\n<span>{{column.defaultValue?` Default : ${column.defaultValue}`:\"\"}}</span>\n</span>\n- <el-date-picker v-if=\"column.type=='date'\" value-format=\"yyyy-MM-dd\" v-model=\"update.currentNew[column.name]\"></el-date-picker>\n- <el-time-picker v-else-if=\"column.type=='time'\" value-format=\"HH:mm:ss\" v-model=\"update.currentNew[column.name]\"></el-time-picker>\n- <el-date-picker v-else-if=\"column.type=='datetime'\" value-format=\"yyyy-MM-dd HH:mm:ss\" type=\"datetime\" v-model=\"update.currentNew[column.name]\"></el-date-picker>\n+ <template v-if=\"column.type=='date'\">\n+ <br/>\n+ <el-date-picker value-format=\"yyyy-MM-dd\" v-model=\"update.currentNew[column.name]\"></el-date-picker>\n+ </template>\n+ <template v-else-if=\"column.type=='time'\">\n+ <br/>\n+ <el-time-picker value-format=\"HH:mm:ss\" v-model=\"update.currentNew[column.name]\"></el-time-picker>\n+ </template>\n+ <template v-else-if=\"column.type=='datetime'\" >\n+ <br/>\n+ <el-date-picker value-format=\"yyyy-MM-dd HH:mm:ss\" type=\"datetime\" v-model=\"update.currentNew[column.name]\"></el-date-picker>\n+ </template>\n<el-input v-else=\"column.type\" v-model=\"update.currentNew[column.name]\"></el-input>\n</template>\n</el-form-item>\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update edit panel
141,908
02.08.2020 22:03:34
-28,800
fffcba78c59438426b28e859275273542672d89e
update to 2.3.10
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.3.9\",\n+ \"version\": \"2.3.10\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 2.3.10
141,908
02.08.2020 22:16:00
-28,800
3e34144dc6e03eb38239b07b7041c188034edbcd
support show auto_increment
[ { "change_type": "MODIFY", "old_path": "src/model/main/tableNode.ts", "new_path": "src/model/main/tableNode.ts", "diff": "@@ -39,7 +39,7 @@ export class TableNode extends Node implements CopyAble {\nif (columnNodes && !isRresh) {\nreturn columnNodes;\n}\n- return QueryUnit.queryPromise<ColumnMeta[]>(await ConnectionManager.getConnection(this), `SELECT COLUMN_NAME name,DATA_TYPE simpleType,COLUMN_TYPE type,COLUMN_COMMENT comment,COLUMN_KEY \\`key\\`,IS_NULLABLE nullable,CHARACTER_MAXIMUM_LENGTH maxLength,COLUMN_DEFAULT defaultValue FROM information_schema.columns WHERE table_schema = '${this.database}' AND table_name = '${this.table}';`)\n+ return QueryUnit.queryPromise<ColumnMeta[]>(await ConnectionManager.getConnection(this), `SELECT COLUMN_NAME name,DATA_TYPE simpleType,COLUMN_TYPE type,COLUMN_COMMENT comment,COLUMN_KEY \\`key\\`,IS_NULLABLE nullable,CHARACTER_MAXIMUM_LENGTH maxLength,COLUMN_DEFAULT defaultValue,EXTRA extra FROM information_schema.columns WHERE table_schema = '${this.database}' AND table_name = '${this.table}';`)\n.then((columns) => {\ncolumnNodes = columns.map<ColumnNode>((column) => {\nif (column && column.key == \"PRI\") {\n" }, { "change_type": "MODIFY", "old_path": "src/model/other/columnMeta.ts", "new_path": "src/model/other/columnMeta.ts", "diff": "@@ -34,4 +34,8 @@ export interface ColumnMeta {\n* default value or column.\n*/\ndefaultValue:any;\n+ /**\n+ * extra info, auto_increment\n+ */\n+ extra:any;\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "{{column.name}} : {{column.type}} &nbsp;\n<span style=\"color: red;\">{{column.key}}{{column.nullable=='YES'?'':' NOT NULL'}}</span>&nbsp;\n<span>{{column.defaultValue?` Default : ${column.defaultValue}`:\"\"}}</span>\n+ <span>{{column.extra==\"auto_increment\"?` AUTO_INCREMENT`:\"\"}}</span>\n</span>\n<template v-if=\"column.type=='date'\">\n<br/>\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
support show auto_increment
141,908
02.08.2020 22:54:20
-28,800
3597eceae61e87db37bd7be8d825affdf341095d
add type tooltip
[ { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "<el-table-column fixed=\"left\" type=\"index\" :index=\"0\" width=\"50\" align=\"center\">\n</el-table-column>\n<!-- data -->\n- <el-table-column :label=\"field.name\" v-for=\"(field,index) in result.fields\" :key=\"index\" align=\"center\" sortable v-if=\"result.fields && field.name && toolbar.showColumns.includes(field.name.toLowerCase())\" :width=\"computeWidth(field.name,0,index,toolbar.filter[field.name])\">\n+ <el-table-column v-if=\"result.fields && field.name && toolbar.showColumns.includes(field.name.toLowerCase())\" v-for=\"(field,index) in result.fields\" :key=\"index\" :label=\"field.name\" align=\"center\" sortable :width=\"computeWidth(field.name,0,index,toolbar.filter[field.name])\" title='test'>\n+ <template slot=\"header\" slot-scope=\"scope\">\n+ <el-tooltip class=\"item\" effect=\"dark\" :content=\"getTypeByColumn(scope.column.label)\" placement=\"left-start\">\n+ <span>{{scope.column.label}}</span>\n+ </el-tooltip>\n+ </template>\n<template slot-scope=\"scope\">\n<el-input v-if=\"scope.row.isFilter\" v-model=\"toolbar.filter[field.name]\" placeholder=\"Filter\" v-on:keyup.enter.native=\"filter($event,field.name)\">\n</el-input>\n@@ -610,7 +615,7 @@ export default {\n},\n// show call when change table\nreset() {\n- console.log( this.result.fields.length)\n+ console.log(this.result.fields.length);\nthis.clear();\n// table\nthis.table.widthItem = {};\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
add type tooltip
141,908
02.08.2020 23:02:21
-28,800
6c60e89f6a08d9320f0bdef6fd03d079664c82e5
fix cannot paste
[ { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "@@ -261,6 +261,12 @@ export default {\n}\n});\npostMessage({ type: \"init\" });\n+ window.addEventListener(\"keyup\", event => {\n+ if (event.key == \"c\" && event.ctrlKey) {\n+ console.log(document.activeElement.value);\n+ document.execCommand(\"copy\");\n+ }\n+ });\n},\nmethods: {\nchangeTheme(theme) {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix cannot paste
141,908
02.08.2020 23:03:09
-28,800
14375cea47f506fb9a0c189f7b0399429ecdd7e7
update to 2.3.11
[ { "change_type": "MODIFY", "old_path": "CHANGELOG.md", "new_path": "CHANGELOG.md", "diff": "# CHANGELOG\n+## 2.3.11 - 2020/8/2\n+- Hight light active connection.\n+- Show more info when open edit panel.\n+- Add column type tooltip in result panel.\n+- Fix copy fail.\n+\n## 2.3.7 - 2020/7/20\n- Support config default limit of query.\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.3.10\",\n+ \"version\": \"2.3.11\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 2.3.11
141,908
02.08.2020 23:55:19
-28,800
9dd70b51d6675baaaa761d5f42a1692298686292
fix freeze when execute sql
[ { "change_type": "MODIFY", "old_path": "src/service/queryUnit.ts", "new_path": "src/service/queryUnit.ts", "diff": "@@ -107,6 +107,10 @@ export class QueryUnit {\nreturn;\n}\nif (Array.isArray(data)) {\n+ if (data[1] && data[1].__proto__.constructor.name == \"OkPacket\") {\n+ QueryPage.send({ type: MessageType.MESSAGE, res: { message: `Execute sql success : ${sql}`, costTime, success: true } as MessageResponse });\n+ return;\n+ }\nQueryPage.send({ type: MessageType.DATA, connection: connectionNode, res: { sql, costTime, data, fields, pageSize: Global.getConfig(ConfigKey.DEFAULT_LIMIT) } as DataResponse });\nreturn;\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix freeze when execute sql
141,908
03.08.2020 11:12:18
-28,800
bb64217482710300f024110e2a07f7c5434b93c0
add connection name as parent name
[ { "change_type": "MODIFY", "old_path": "src/model/database/connectionNode.ts", "new_path": "src/model/database/connectionNode.ts", "diff": "@@ -24,6 +24,7 @@ export class ConnectionNode extends Node implements CopyAble {\nthis.init(parent)\nif (parent.name) {\nthis.label = `${parent.name}_${id}`\n+ this.name = parent.name\n}\nconst lcp = ConnectionManager.getLastConnectionOption(false);\nif (lcp && lcp.getConnectId() == this.getConnectId()) {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
add connection name as parent name
141,908
03.08.2020 15:42:08
-28,800
0b40b1f33a2874a1cf8520c8fe05fe86e1d915ce
auto add limit for select
[ { "change_type": "MODIFY", "old_path": "src/service/queryUnit.ts", "new_path": "src/service/queryUnit.ts", "diff": "@@ -31,8 +31,9 @@ export class QueryUnit {\n});\n}\n- private static ddlPattern = /^(alter|create|drop)/ig;\n- private static dmlPattern = /^(insert|update|delete)/ig;\n+ private static ddlPattern = /^\\s*(alter|create|drop)/ig;\n+ private static dmlPattern = /^\\s*(insert|update|delete)/ig;\n+ private static selectPattern = /^\\s*\\bselect\\b.+/ig;\nprotected static delimiterHodler = new DelimiterHolder()\npublic static async runQuery(sql?: string, connectionNode?: Node): Promise<null> {\nif (!sql && !vscode.window.activeTextEditor) {\n@@ -75,6 +76,11 @@ export class QueryUnit {\nconst isMulti = sql.match(Pattern.MULTI_PATTERN);\nif (!isMulti) {\n+\n+ if(sql.match(this.selectPattern) && !sql.match(/\\blimit\\b/) && !sql.match(/;\\s*$/)){\n+ sql+=` LIMIT ${Global.getConfig(ConfigKey.DEFAULT_LIMIT)}`;\n+ }\n+\nconst sqlList: string[] = sql.match(/(?:[^;\"']+|[\"'][^\"']*[\"'])+/g).filter((s) => (s.trim() != '' && s.trim() != ';'))\nif (sqlList.length > 1) {\nconst success = await this.runBatch(connection, sqlList)\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
auto add limit for select
141,908
03.08.2020 16:40:01
-28,800
7390c9e638c4a2e86bebb57fe5b7d420ecbb836c
init delete icon
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "{\n\"command\": \"mysql.table.drop\",\n\"title\": \"Drop table\",\n- \"category\": \"MySQL\"\n+ \"category\": \"MySQL\",\n+ \"icon\": \"resources/icon/criss-cross.svg\"\n},\n{\n\"command\": \"mysql.mock.run\",\n{\n\"command\": \"mysql.changeTableName\",\n\"when\": \"view == github.cweijan.mysql && viewItem == table\",\n- \"group\": \"inline\"\n+ \"group\": \"inline@0\"\n+ },\n+ {\n+ \"command\": \"mysql.table.drop\",\n+ \"when\": \"view == github.cweijan.mysql && viewItem == table && false\",\n+ \"group\": \"inline@1\"\n},\n{\n\"command\": \"mysql.name.copy\",\n" }, { "change_type": "ADD", "old_path": null, "new_path": "resources/icon/criss-cross.svg", "diff": "+<svg height=\"512pt\" viewBox=\"0 0 512 512\" width=\"512pt\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m256 0c-141.164062 0-256 114.835938-256 256s114.835938 256 256 256 256-114.835938 256-256-114.835938-256-256-256zm0 0\" fill=\"#f44336\"/><path d=\"m350.273438 320.105469c8.339843 8.34375 8.339843 21.824219 0 30.167969-4.160157 4.160156-9.621094 6.25-15.085938 6.25-5.460938 0-10.921875-2.089844-15.082031-6.25l-64.105469-64.109376-64.105469 64.109376c-4.160156 4.160156-9.621093 6.25-15.082031 6.25-5.464844 0-10.925781-2.089844-15.085938-6.25-8.339843-8.34375-8.339843-21.824219 0-30.167969l64.109376-64.105469-64.109376-64.105469c-8.339843-8.34375-8.339843-21.824219 0-30.167969 8.34375-8.339843 21.824219-8.339843 30.167969 0l64.105469 64.109376 64.105469-64.109376c8.34375-8.339843 21.824219-8.339843 30.167969 0 8.339843 8.34375 8.339843 21.824219 0 30.167969l-64.109376 64.105469zm0 0\" fill=\"#fafafa\"/></svg>\n\\ No newline at end of file\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
init delete icon
141,908
03.08.2020 17:10:35
-28,800
6110db00bc202b695ff192621d8a21a83de7d02b
enhance dump speed.
[ { "change_type": "MODIFY", "old_path": "src/service/dump/mysqlDumpService.ts", "new_path": "src/service/dump/mysqlDumpService.ts", "diff": "@@ -10,15 +10,21 @@ import path = require('path');\nexport class MysqlDumpService extends AbstractDumpService {\nprotected dumpData(node: Node, exportPath: string, withData: boolean): void {\n- Console.log(`Doing backup ${node.host}_${node.database}...`);\n+\n+ const port = node.usingSSH ? NodeUtil.getTunnelPort(node.getConnectId()) : node.port;\nconst tableName = node instanceof TableNode ? node.table : null;\n+ const dumpFilePath = path.join(exportPath, `${node.database}${tableName ? \"_\" + tableName : ''}_${format('yyyy-MM-dd_hhmmss', new Date())}.sql`);\n+\n+ Console.log(`${format('yyyy-MM-dd hh:mm:ss', new Date())} : Doing backup ${node.host}_${node.database}...`);\n+ Console.log(`You can run command \\`mysqldump -h ${node.host} -P ${port} -u ${node.user} -p --database ${node.database} > ${dumpFilePath}\\` to speed up dump.`);\n+\nconst option: Options = {\nconnection: {\nhost: node.host,\nuser: node.user,\npassword: node.password,\ndatabase: node.database,\n- port: node.usingSSH ? NodeUtil.getTunnelPort(node.getConnectId()) : node.port,\n+ port: port,\n},\ndump: {\ntables: tableName ? [tableName] : [],\n@@ -31,17 +37,22 @@ export class MysqlDumpService extends AbstractDumpService {\n}\n},\n},\n- dumpToFile: path.join(exportPath, `${node.database}${tableName ? \"_\" + tableName : ''}_${format('yyyy-MM-dd_hhmmss', new Date())}.sql`),\n+ dumpToFile: dumpFilePath,\n};\nif (!withData) {\noption.dump.data = false;\n+ } else {\n+ option.dump.data = {\n+ format: false,\n+ maxRowsPerInsertStatement:5000\n+ }\n}\nmysqldump(option).then(() => {\nvscode.window.showInformationMessage(`Backup ${node.getHost()}_${node.database} success!`);\n}).catch((err) => {\nvscode.window.showErrorMessage(`Backup ${node.getHost()}_${node.database} fail!\\n${err}`);\n}).then(() => {\n- Console.log(\"backup end.\");\n+ Console.log(`${format('yyyy-MM-dd hh:mm:ss', new Date())} : backup end.`);\n})\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
enhance dump speed.
141,908
03.08.2020 17:13:34
-28,800
443a365c7fb2be1e3ad7d7b5445ebdb3b67a393d
update to 2.3.13
[ { "change_type": "MODIFY", "old_path": "CHANGELOG.md", "new_path": "CHANGELOG.md", "diff": "# CHANGELOG\n+## 2.3.13 - 2020/8/3\n+- Enhance dump performance.\n+\n## 2.3.12 - 2020/8/3\n- Auto add limit for select statement.\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.3.12\",\n+ \"version\": \"2.3.13\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 2.3.13
141,908
03.08.2020 19:01:15
-28,800
19b678d35d6e0b404bdac75cd7687682121b5c27
refactor data import and support source command
[ { "change_type": "MODIFY", "old_path": "src/common/outputChannel.ts", "new_path": "src/common/outputChannel.ts", "diff": "\"user strict\";\nimport * as vscode from \"vscode\";\n+import format = require('date-format');\nexport class Console {\npublic static log(value: any) {\n@@ -7,7 +8,8 @@ export class Console {\nthis.outputChannel = vscode.window.createOutputChannel(\"MySQL\");\n}\nthis.outputChannel.show(true);\n- this.outputChannel.appendLine(value + \"\");\n+ const begin = format('yyyy-MM-dd hh:mm:ss', new Date());\n+ this.outputChannel.appendLine(`${begin} : ${value}`);\nthis.outputChannel.appendLine(\"-----------------------------------------------------------------------------------------\");\n}\n" }, { "change_type": "MODIFY", "old_path": "src/extension.ts", "new_path": "src/extension.ts", "diff": "@@ -127,7 +127,9 @@ export function activate(context: vscode.ExtensionContext) {\n},\n\"mysql.data.import\": (node: DatabaseNode | ConnectionNode) => {\nvscode.window.showOpenDialog({ filters: { Sql: ['sql'] }, canSelectMany: false, openLabel: \"Select sql file to import\", canSelectFiles: true, canSelectFolders: false }).then((filePath) => {\n- if (filePath) { node.importData(filePath[0].fsPath); }\n+ if (filePath) {\n+ serviceManager.importService.import(filePath[0].fsPath, node)\n+ }\n});\n},\n\"mysql.data.export\": (node: DatabaseNode | TableNode) => {\n" }, { "change_type": "MODIFY", "old_path": "src/model/database/databaseNode.ts", "new_path": "src/model/database/databaseNode.ts", "diff": "@@ -2,7 +2,6 @@ import * as path from \"path\";\nimport * as vscode from \"vscode\";\nimport { Constants, ModelType } from \"../../common/constants\";\nimport { FileManager } from '../../common/filesManager';\n-import { Console } from \"../../common/outputChannel\";\nimport { Util } from '../../common/util';\nimport { ConnectionManager } from \"../../service/connectionManager\";\nimport { DatabaseCache } from \"../../service/common/databaseCache\";\n@@ -41,13 +40,6 @@ export class DatabaseNode extends Node implements CopyAble {\nnew TriggerGroup(this.info)];\n}\n- public importData(fsPath: string) {\n- Console.log(`Doing import ${this.getConnectId()}...`);\n- ConnectionManager.getConnection(this).then((connection) => {\n- QueryUnit.runFile(connection, fsPath);\n- });\n- }\n-\npublic dropDatatabase() {\nvscode.window.showInputBox({ prompt: `Are you want to drop database ${this.database} ? `, placeHolder: 'Input database name to confirm.' }).then(async (inputContent) => {\n@@ -71,7 +63,7 @@ export class DatabaseNode extends Node implements CopyAble {\nvscode.window.showInputBox({ prompt: `Dangerous: Are you want to truncate database ${this.database} ? `, placeHolder: 'Input database name to confirm.' }).then(async (inputContent) => {\nif (inputContent && inputContent.toLowerCase() == this.database.toLowerCase()) {\nconst connection = await ConnectionManager.getConnection(this);\n- QueryUnit.queryPromise(connection, `SELECT Concat('TRUNCATE TABLE \\`',table_schema,'\\`.\\`',TABLE_NAME, '\\`;') trun FROM INFORMATION_SCHEMA.TABLES where table_schema ='${this.database}';`).then(async (res:any) => {\n+ QueryUnit.queryPromise(connection, `SELECT Concat('TRUNCATE TABLE \\`',table_schema,'\\`.\\`',TABLE_NAME, '\\`;') trun FROM INFORMATION_SCHEMA.TABLES where table_schema ='${this.database}' and TABLE_TYPE<>'VIEW';`).then(async (res: any) => {\nawait QueryUnit.runBatch(connection, res.map(data => data.trun))\nvscode.window.showInformationMessage(`Truncate database ${this.database} success!`)\n})\n" }, { "change_type": "MODIFY", "old_path": "src/provider/Complection/chain/keywordChain.ts", "new_path": "src/provider/Complection/chain/keywordChain.ts", "diff": "@@ -7,7 +7,7 @@ export class KeywordChain implements ComplectionChain {\n\"GROUP BY\", \"ORDER BY\", \"HAVING\", \"LIMIT\", \"ALTER\", \"CREATE\", \"DROP\", \"FUNCTION\", \"CASE\", \"PROCEDURE\", \"TRIGGER\", \"INDEX\", \"CHANGE\", \"COLUMN\", \"BETWEEN\",\n\"ADD\", 'SHOW', \"PRIVILEGES\", \"IDENTIFIED\", \"VIEW\", \"CURSOR\", \"EXPLAIN\", \"ROLLBACK\", \"COMMENT\", \"COMMIT\", \"BEGIN\", \"DELIMITER\", \"CALL\", \"REPLACE\",\n\"REFERENCES\", \"USING\", \"END\", \"BEFORE\", \"AFTER\", \"GRANT\", \"RETURNS\", \"IN\", \"SOME\", \"ANY\", \"SOME\", \"ASC\", \"DESC\", \"UNIQUE\", \"UNION\", \"ALL\", \"ON\",\n- \"OUTER\", \"INNER\", \"EXEC\", \"EXISTS\", \"NOT\", \"FOREIGN\", \"FULL\", \"LIKE\", \"IN\", \"PRIMARY\", \"KEY\", \"RIGHT\", \"LEFT\", \"TRUNCATE\", \"IGNORE\", \"DISTINCT\"];\n+ \"OUTER\", \"INNER\", \"EXEC\", \"EXISTS\", \"NOT\", \"FOREIGN\", \"FULL\", \"LIKE\", \"IN\", \"PRIMARY\", \"KEY\", \"RIGHT\", \"LEFT\", \"TRUNCATE\", \"IGNORE\", \"DISTINCT\",\"SOURCE\"];\nprivate keywordComplectionItems: vscode.CompletionItem[] = [];\nconstructor() {\n" }, { "change_type": "MODIFY", "old_path": "src/service/common/databaseCache.ts", "new_path": "src/service/common/databaseCache.ts", "diff": "@@ -173,6 +173,15 @@ export class DatabaseCache {\nreturn result;\n}\n+ public static getDatabase(connectId: string, dbName: string): DatabaseNode {\n+ const dbList = this.connectionNodeMapDatabaseNode[connectId];\n+ if (!dbList) { return null; }\n+ for (const dbNode of dbList) {\n+ if (dbNode.database == dbName) { return dbNode; }\n+ }\n+ return null;\n+ }\n+\npublic static getTable(databaseid: string, tableName: string): TableNode {\nconst tableList = this.databaseNodeMapTableNode[databaseid + \"_\" + ModelType.TABLE_GROUP];\nif (!tableList) { return null; }\n" }, { "change_type": "MODIFY", "old_path": "src/service/dump/mysqlDumpService.ts", "new_path": "src/service/dump/mysqlDumpService.ts", "diff": "@@ -15,8 +15,8 @@ export class MysqlDumpService extends AbstractDumpService {\nconst tableName = node instanceof TableNode ? node.table : null;\nconst dumpFilePath = path.join(exportPath, `${node.database}${tableName ? \"_\" + tableName : ''}_${format('yyyy-MM-dd_hhmmss', new Date())}.sql`);\n- Console.log(`${format('yyyy-MM-dd hh:mm:ss', new Date())} : Doing backup ${node.host}_${node.database}...`);\n- Console.log(`You can run command \\`mysqldump -h ${node.host} -P ${port} -u ${node.user} -p --database ${node.database} > ${dumpFilePath}\\` to speed up dump.`);\n+ Console.log(`Doing backup ${node.host}_${node.database}...\n+Origin command : \\`mysqldump -h ${node.host} -P ${port} -u ${node.user} -p --database ${node.database} > ${dumpFilePath}\\`.`);\nconst option: Options = {\nconnection: {\n@@ -52,7 +52,7 @@ export class MysqlDumpService extends AbstractDumpService {\n}).catch((err) => {\nvscode.window.showErrorMessage(`Backup ${node.getHost()}_${node.database} fail!\\n${err}`);\n}).then(() => {\n- Console.log(`${format('yyyy-MM-dd hh:mm:ss', new Date())} : backup end.`);\n+ Console.log(`backup end.`);\n})\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/service/import/importService.ts", "diff": "+import { Node } from \"../../model/interface/node\";\n+\n+export interface ImportService {\n+\n+ import(importPath: string, node: Node):void ;\n+\n+}\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/service/import/mysqlImportService.ts", "diff": "+import { Node } from \"../../model/interface/node\";\n+import { exec } from \"child_process\";\n+import { Console } from \"../../common/outputChannel\";\n+import { NodeUtil } from \"../../model/nodeUtil\";\n+import { ImportService } from \"./importService\";\n+import { DatabaseCache } from \"../common/databaseCache\";\n+\n+\n+export class MysqlImportService implements ImportService {\n+\n+ public import(importPath: string, node: Node): void {\n+\n+ NodeUtil.of(node)\n+ node = DatabaseCache.getDatabase(node.getConnectId(),node.database)\n+\n+ const port = node.usingSSH ? NodeUtil.getTunnelPort(node.getConnectId()) : node.port;\n+ const command = `mysql -h ${node.host} -P ${port} -u ${node.user} ${node.password ? `-p${node.password}` : \"\"} ${node.database} < ${importPath}`\n+ Console.log(`\n+ Ensure you has been install mysql.\\n\n+ Executing: \\`${command.replace(/-p.+? /, \"-p****** \")}\\``);\n+ exec(command, err => {\n+ if (err) {\n+ Console.log(err);\n+ } else {\n+ Console.log(`Import Success!`);\n+ }\n+ })\n+ }\n+\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/service/queryUnit.ts", "new_path": "src/service/queryUnit.ts", "diff": "@@ -12,6 +12,7 @@ import { QueryPage } from \"../view/result/query\";\nimport { DataResponse, DMLResponse, ErrorResponse, MessageResponse, RunResponse } from \"../view/result/queryResponse\";\nimport { ConnectionManager } from \"./connectionManager\";\nimport { DelimiterHolder } from \"./common/delimiterHolder\";\n+import { ServiceManager } from \"./serviceManager\";\nexport class QueryUnit {\n@@ -34,6 +35,7 @@ export class QueryUnit {\nprivate static ddlPattern = /^\\s*(alter|create|drop)/ig;\nprivate static dmlPattern = /^\\s*(insert|update|delete)/ig;\nprivate static selectPattern = /^\\s*\\bselect\\b.+/ig;\n+ private static importPattern = /^\\s*\\bsource\\b\\s+(.+)/i;\nprotected static delimiterHodler = new DelimiterHolder()\npublic static async runQuery(sql?: string, connectionNode?: Node): Promise<null> {\nif (!sql && !vscode.window.activeTextEditor) {\n@@ -70,6 +72,13 @@ export class QueryUnit {\nQueryPage.send({ type: MessageType.MESSAGE, res: { message: `change delimiter success`, success: true } as MessageResponse });\nreturn;\n}\n+\n+ const importMatch=sql.match(this.importPattern);\n+ if(importMatch){\n+ ServiceManager.instance.importService.import(importMatch[1], ConnectionManager.getLastConnectionOption())\n+ return;\n+ }\n+\nif (isDDL == null && isDML == null && sql) {\nQueryPage.send({ type: MessageType.RUN, res: { sql } as RunResponse });\n}\n" }, { "change_type": "MODIFY", "old_path": "src/service/serviceManager.ts", "new_path": "src/service/serviceManager.ts", "diff": "@@ -19,18 +19,22 @@ import { HistoryRecorder } from \"./common/historyRecorder\";\nimport { StatusService } from \"../view/status/statusService\";\nimport { MysqlStatusService } from \"../view/status/mysqlStatusService\";\nimport { Global } from \"../common/global\";\n+import { ImportService } from \"./import/importService\";\n+import { MysqlImportService } from \"./import/mysqlImportService\";\nexport class ServiceManager {\n+ public static instance:ServiceManager;\npublic mockRunner: MockRunner;\npublic provider: DbTreeDataProvider;\npublic historyService: HistoryRecorder;\npublic connectService: AbstractConnectService;\npublic settingService: SettingService;\npublic statusService: StatusService;\n+ public importService: ImportService;\npublic dumpService: AbstractDumpService;\n- private isInit = false;\nprivate type: DatabaseType = DatabaseType.mysql;\n+ private isInit = false;\nconstructor(private readonly context: ExtensionContext) {\nGlobal.context = context;\n@@ -56,6 +60,7 @@ export class ServiceManager {\n}\nres.push(this.initTreeView())\n+ ServiceManager.instance=this;\nthis.isInit = true\nreturn res\n}\n@@ -80,6 +85,7 @@ export class ServiceManager {\nthis.dumpService = new MysqlDumpService();\nthis.connectService = new MysqlConnectService();\nthis.statusService = new MysqlStatusService()\n+ this.importService = new MysqlImportService();\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "syntaxes/mysql.tmLanguage.json", "new_path": "syntaxes/mysql.tmLanguage.json", "diff": "\"scopeName\": \"source.sql\",\n\"patterns\": [\n{\n- \"match\": \"(?i)\\\\b(ignore|INNER|FULL|RIGHT|LEFT|DEFAULT|long|double|AUTO_INCREMENT|TRIGGER|DEFINER|FOR|EACH|CURSOR|VIEW|IDENTIFIED|PRIVILEGES|FLUSH|SHOW|INDEX|CHANGE|COMMENT|COLUMN|ADD|UNIQUE|EXPLAIN|USER|ALL|DELIMITER|OPTIMIZE|ANALYZE|REPAIR|CHARSET|ENGINE|FOREIGN|CASCADE|RESTRICT|UNSIGNED)\\\\b\",\n+ \"match\": \"(?i)\\\\b(ignore|source|INNER|FULL|RIGHT|LEFT|DEFAULT|long|double|AUTO_INCREMENT|TRIGGER|DEFINER|FOR|EACH|CURSOR|VIEW|IDENTIFIED|PRIVILEGES|FLUSH|SHOW|INDEX|CHANGE|COMMENT|COLUMN|ADD|UNIQUE|EXPLAIN|USER|ALL|DELIMITER|OPTIMIZE|ANALYZE|REPAIR|CHARSET|ENGINE|FOREIGN|CASCADE|RESTRICT|UNSIGNED)\\\\b\",\n\"name\": \"keyword.mysql\"\n},\n{\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
refactor data import and support source command
141,908
04.08.2020 18:54:10
-28,800
d7f5f4b950861a995c0937daf6c0b612c1b4d771
init diagram
[ { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramGroup.ts", "new_path": "src/model/diagram/diagramGroup.ts", "diff": "@@ -7,10 +7,35 @@ import { InfoNode } from \"../other/infoNode\";\nimport { Node } from \"../interface/node\";\nimport { DiagramNode } from \"./diagramNode\";\nimport { ViewManager } from \"../../view/viewManager\";\n+import { TableNode } from \"../main/tableNode\";\n+import { ColumnNode } from \"../other/columnNode\";\n+export class DiagramGroup extends Node {\n+ public openAdd() {\n+ ViewManager.createWebviewPanel({\n+ path: \"diagram\", title: \"diagram\",\n+ splitView: false, eventHandler: (handler) => {\n+ handler.on(\"init\",async () => {\n+ handler.emit('load', await this.getData())\n+ })\n+ }\n+ })\n+ }\n+\n+ public contextValue = ModelType.DIAGRAM_GROUP;\n+ public iconPath = path.join(Constants.RES_PATH, \"icon/diagram.svg\")\n+ constructor(readonly info: Node) {\n+ super(\"DIAGRAM\")\n+ this.id = `${this.getConnectId()}_${info.database}_${ModelType.DIAGRAM_GROUP}`;\n+ this.init(info)\n+ }\n-function getData() {\n- // create the model for the E-R diagram\n+ public async getChildren(isRresh: boolean = false): Promise<Node[]> {\n+ return []\n+ }\n+\n+\n+ public async getData() {\nvar colors = {\nred: \"#be4b15\",\ngreen: \"#52ce60\",\n@@ -22,166 +47,26 @@ function getData() {\npurple: \"#d689ff\",\norange: \"#fdb400\"\n};\n- var nodeDataArray = [\n- {\n- key: \"Products\",\n- items: [\n- {\n- name: \"ProductID\",\n- iskey: true,\n- figure: \"Decision\",\n- color: colors.red\n- },\n- {\n- name: \"ProductName\",\n- iskey: false,\n- figure: \"Hexagon\",\n- color: colors.blue\n- },\n- {\n- name: \"SupplierID\",\n- iskey: false,\n- figure: \"Decision\",\n- color: \"purple\"\n- },\n- {\n- name: \"CategoryID\",\n- iskey: false,\n- figure: \"Decision\",\n- color: \"purple\"\n- }\n- ]\n- },\n- {\n- key: \"Suppliers\",\n- items: [\n- {\n- name: \"SupplierID\",\n- iskey: true,\n- figure: \"Decision\",\n- color: colors.red\n- },\n- {\n- name: \"CompanyName\",\n- iskey: false,\n- figure: \"Hexagon\",\n- color: colors.blue\n- },\n- {\n- name: \"ContactName\",\n- iskey: false,\n- figure: \"Hexagon\",\n- color: colors.blue\n- },\n- {\n- name: \"Address\",\n- iskey: false,\n- figure: \"Hexagon\",\n- color: colors.blue\n- }\n- ]\n- },\n- {\n- key: \"Categories\",\n- items: [\n- {\n- name: \"CategoryID\",\n- iskey: true,\n- figure: \"Decision\",\n- color: colors.red\n- },\n- {\n- name: \"CategoryName\",\n- iskey: false,\n- figure: \"Hexagon\",\n- color: colors.blue\n- },\n- {\n- name: \"Description\",\n- iskey: false,\n- figure: \"Hexagon\",\n- color: colors.blue\n- },\n- {\n- name: \"Picture\",\n- iskey: false,\n- figure: \"TriangleUp\",\n- color: colors.pink\n- }\n- ]\n- },\n- {\n- key: \"Order Details\",\n- items: [\n- {\n- name: \"OrderID\",\n- iskey: true,\n- figure: \"Decision\",\n- color: colors.red\n- },\n- {\n- name: \"ProductID\",\n- iskey: true,\n+ const nodeDataArray = await Promise.all(DatabaseCache.getTableListOfDatabase(`${this.getConnectId()}_${this.database}`).map(async (node: TableNode) => {\n+ return {\n+ key: node.table,\n+ items: (await node.getChildren()).map((columnNode: ColumnNode) => {\n+ return {\n+ name: `${columnNode.column.name} : ${columnNode.type}`,\n+ iskey: columnNode.isPrimaryKey,\nfigure: \"Decision\",\n- color: colors.red\n- },\n- {\n- name: \"UnitPrice\",\n- iskey: false,\n- figure: \"Circle\",\n- color: colors.green\n- },\n- {\n- name: \"Quantity\",\n- iskey: false,\n- figure: \"Circle\",\n- color: colors.green\n- },\n- {\n- name: \"Discount\",\n- iskey: false,\n- figure: \"Circle\",\n- color: colors.green\n+ color: colors[columnNode.type] ? colors[columnNode.column.simpleType] : '#be4b15'\n}\n- ]\n+ })\n}\n- ];\n- var linkDataArray = [\n- { from: \"Products\", to: \"Suppliers\" },\n- { from: \"Products\", to: \"Categories\" },\n- { from: \"Order Details\", to: \"Products\" }\n- ];\n+ }))\nreturn {\ncopiesArrays: true,\ncopiesArrayObjects: true,\n- nodeDataArray: nodeDataArray,\n- linkDataArray: linkDataArray\n- };\n- }\n-\n-export class DiagramGroup extends Node {\n- openAdd() {\n- ViewManager.createWebviewPanel({\n- path: \"diagram\", title: \"diagram\",\n- splitView: false, eventHandler(handler) {\n- handler.on(\"init\", () => {\n- handler.emit('load',getData())\n- })\n- }\n- })\n- }\n-\n- public contextValue = ModelType.DIAGRAM_GROUP;\n- public iconPath = \"D:\\\\download\\\\increase.svg\"\n- // public iconPath = path.join(Constants.RES_PATH, \"icon/diagram.svg\")\n- constructor(readonly info: Node) {\n- super(\"DIAGRAM\")\n- this.id = `${info.getConnectId()}_${info.database}_${ModelType.DIAGRAM_GROUP}`;\n- this.init(info)\n- }\n+ linkDataArray: [],\n+ nodeDataArray\n- public async getChildren(isRresh: boolean = false): Promise<Node[]> {\n- return []\n+ };\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramNode.ts", "new_path": "src/model/diagram/diagramNode.ts", "diff": "@@ -7,6 +7,7 @@ import { DatabaseCache } from \"../../service/common/databaseCache\";\nimport { QueryUnit } from \"../../service/queryUnit\";\nimport { DbTreeDataProvider } from \"../../provider/treeDataProvider\";\nimport { Node } from \"../interface/node\";\n+import { ViewManager } from \"../../view/viewManager\";\nexport class DiagramNode extends Node {\n@@ -23,6 +24,19 @@ export class DiagramNode extends Node {\n}\n}\n+ public open() {\n+ const content = \"read from disk\";\n+ ViewManager.createWebviewPanel({\n+ path: \"diagram\", title: \"diagram\",\n+ splitView: false, eventHandler(handler) {\n+ handler.on(\"init\", () => {\n+ handler.emit('load', JSON.parse(content))\n+ })\n+ }\n+ })\n+ }\n+\n+\npublic async getChildren(isRresh: boolean = false): Promise<Node[]> {\nreturn [];\n}\n" }, { "change_type": "MODIFY", "old_path": "src/model/main/functionGroup.ts", "new_path": "src/model/main/functionGroup.ts", "diff": "@@ -19,7 +19,7 @@ export class FunctionGroup extends Node {\npublic async getChildren(isRresh: boolean = false): Promise<Node[]> {\n- let tableNodes = DatabaseCache.getTableListOfDatabase(this.id);\n+ let tableNodes = DatabaseCache.getChildListOfDatabase(this.id);\nif (tableNodes && !isRresh) {\nreturn tableNodes;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/model/main/procedureGroup.ts", "new_path": "src/model/main/procedureGroup.ts", "diff": "@@ -19,7 +19,7 @@ export class ProcedureGroup extends Node {\npublic async getChildren(isRresh: boolean = false): Promise<Node[]> {\n- let tableNodes = DatabaseCache.getTableListOfDatabase(this.id);\n+ let tableNodes = DatabaseCache.getChildListOfDatabase(this.id);\nif (tableNodes && !isRresh) {\nreturn tableNodes;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/model/main/tableGroup.ts", "new_path": "src/model/main/tableGroup.ts", "diff": "@@ -19,7 +19,7 @@ export class TableGroup extends Node {\npublic async getChildren(isRresh: boolean = false): Promise<Node[]> {\n- let tableNodes = DatabaseCache.getTableListOfDatabase(this.id);\n+ let tableNodes = DatabaseCache.getChildListOfDatabase(this.id);\nif (tableNodes && !isRresh) {\nreturn tableNodes;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/model/main/triggerGroup.ts", "new_path": "src/model/main/triggerGroup.ts", "diff": "@@ -20,7 +20,7 @@ export class TriggerGroup extends Node {\npublic async getChildren(isRresh: boolean = false): Promise<Node[]> {\n- let tableNodes = DatabaseCache.getTableListOfDatabase(this.id);\n+ let tableNodes = DatabaseCache.getChildListOfDatabase(this.id);\nif (tableNodes && !isRresh) {\nreturn tableNodes;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/model/main/viewGroup.ts", "new_path": "src/model/main/viewGroup.ts", "diff": "@@ -20,7 +20,7 @@ export class ViewGroup extends Node {\npublic async getChildren(isRresh: boolean = false): Promise<Node[]> {\n- let tableNodes = DatabaseCache.getTableListOfDatabase(this.id);\n+ let tableNodes = DatabaseCache.getChildListOfDatabase(this.id);\nif (tableNodes && !isRresh) {\nreturn tableNodes;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/model/other/columnNode.ts", "new_path": "src/model/other/columnNode.ts", "diff": "@@ -15,6 +15,7 @@ const wrap = Util.wrap;\nexport class ColumnNode extends Node implements CopyAble {\npublic type: string;\npublic contextValue: string = ModelType.COLUMN;\n+ public isPrimaryKey = false;\nconstructor(private readonly table: string, readonly column: ColumnMeta, readonly info: Node) {\nsuper(column.name)\nthis.init(info)\n@@ -37,7 +38,9 @@ export class ColumnNode extends Node implements CopyAble {\nswitch (columnKey) {\ncase 'UNI': return \"UniqueKey\";\ncase 'MUL': return \"IndexKey\";\n- case 'PRI': return \"PrimaryKey\";\n+ case 'PRI':\n+ this.isPrimaryKey = true\n+ return \"PrimaryKey\";\n}\nreturn '';\n}\n" }, { "change_type": "MODIFY", "old_path": "src/provider/Complection/chain/tableChain.ts", "new_path": "src/provider/Complection/chain/tableChain.ts", "diff": "@@ -44,7 +44,7 @@ export class TableChain implements ComplectionChain {\nconst connectcionid = lcp.getConnectId();\nfor (const databaseNode of DatabaseCache.getDatabaseListOfConnection(connectcionid)) {\nif (databaseNode.database === inputWord) {\n- tableNodes = DatabaseCache.getTableListOfDatabase(databaseNode.id);\n+ tableNodes = DatabaseCache.getChildListOfDatabase(databaseNode.id);\nif (tableNodes == null || tableNodes.length == 0) {\ntableNodes = await new TableGroup(databaseNode.info).getChildren()\n}\n@@ -52,7 +52,7 @@ export class TableChain implements ComplectionChain {\n}\n} else {\nconst databaseid = `${lcp.getConnectId()}_${lcp.database}`;\n- const tableList = DatabaseCache.getTableListOfDatabase(databaseid);\n+ const tableList = DatabaseCache.getChildListOfDatabase(databaseid);\nif (tableList == null) { return []; }\ntableNodes = tableList.filter((tableNode: TableNode) => {\nconst included = tableNames.includes(tableNode.table);\n" }, { "change_type": "MODIFY", "old_path": "src/service/common/databaseCache.ts", "new_path": "src/service/common/databaseCache.ts", "diff": "@@ -163,7 +163,7 @@ export class DatabaseCache {\n* @param databaseid\n*/\nprivate static tableTypeList = [ModelType.TABLE_GROUP, ModelType.VIEW_GROUP, ModelType.FUNCTION_GROUP, ModelType.TRIGGER_GROUP, ModelType.PROCEDURE_GROUP];\n- public static getTableListOfDatabase(databaseid: string): Node[] {\n+ public static getChildListOfDatabase(databaseid: string): Node[] {\nlet result = [];\nthis.tableTypeList.forEach((tableType) => {\nconst tableList = this.databaseNodeMapTableNode[databaseid + \"_\" + tableType];\n@@ -173,6 +173,12 @@ export class DatabaseCache {\nreturn result;\n}\n+\n+ public static getTableListOfDatabase(databaseid: string): Node[] {\n+ const tableList = this.databaseNodeMapTableNode[databaseid + \"_\" + ModelType.TABLE_GROUP];\n+ return tableList;\n+ }\n+\npublic static getDatabase(connectId: string, dbName: string): DatabaseNode {\nconst dbList = this.connectionNodeMapDatabaseNode[connectId];\nif (!dbList) { return null; }\n" }, { "change_type": "MODIFY", "old_path": "src/service/mock/mockRunner.ts", "new_path": "src/service/mock/mockRunner.ts", "diff": "@@ -59,7 +59,7 @@ export class MockRunner {\nconst mockModel = JSON.parse(content) as MockModel;\nconst databaseid = `${mockModel.host}_${mockModel.port}_${mockModel.user}_${mockModel.database}`;\n- const tableList = DatabaseCache.getTableListOfDatabase(databaseid) as TableNode[]\n+ const tableList = DatabaseCache.getChildListOfDatabase(databaseid) as TableNode[]\nif (!tableList) {\nvscode.window.showErrorMessage(`Database ${mockModel.database} not found!`)\nreturn;\n" }, { "change_type": "MODIFY", "old_path": "src/vue/diagram/App.vue", "new_path": "src/vue/diagram/App.vue", "diff": "<template>\n<div id=\"container\">\n+ <el-input v-model=\"diagramName\" placeholder=\"Diagram Name\" style=\"width:200px\" />\n<el-button @click=\"save\">Save Diagram</el-button>\n- <div id=\"diagramPanel\" style=\"background-color: #ffeeee; border: solid 1px black; width: 100%; height: 700px\"></div>\n+ <div id=\"diagramPanel\" style=\"background-color: #ffffff; border: solid 1px black; width: 100%; height: 700px\"></div>\n</div>\n</template>\n@@ -163,7 +164,8 @@ export default {\nname: \"App\",\ndata() {\nreturn {\n- myDiagram: null\n+ myDiagram: null,\n+ diagramName: null\n};\n},\nmounted() {\n@@ -326,7 +328,7 @@ export default {\n},\nmethods: {\nsave: function() {\n- this.$message.success(\"Save Success!\")\n+ this.$message.success(\"Save Success!\");\nvscodeEvent.emit(\"save\", this.myDiagram.model.toJson());\n}\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
init diagram
141,908
04.08.2020 22:28:38
-28,800
59df9070343f9fc95033a98301dca5db1514a836
2.4.1: fix limit bug
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.4.0\",\n+ \"version\": \"2.4.1\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" }, { "change_type": "MODIFY", "old_path": "src/service/queryUnit.ts", "new_path": "src/service/queryUnit.ts", "diff": "@@ -86,7 +86,7 @@ export class QueryUnit {\nconst isMulti = sql.match(Pattern.MULTI_PATTERN);\nif (!isMulti) {\n- if(sql.match(this.selectPattern) && !sql.match(/\\blimit\\b/) && !sql.match(/;\\s*$/)){\n+ if(sql.match(this.selectPattern) && !sql.match(/\\blimit\\b/i) && !sql.match(/;\\s*$/)){\nsql+=` LIMIT ${Global.getConfig(ConfigKey.DEFAULT_LIMIT)}`;\n}\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
2.4.1: fix limit bug
141,908
06.08.2020 16:34:23
-28,800
5bb1c938031bd91837caf585529577e8cf3d57d3
init diagram logic
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"title\": \"Open Diagram\",\n\"category\": \"MySQL\"\n},\n+ {\n+ \"command\": \"mysql.diagram.drop\",\n+ \"title\": \"Drop Diagram\",\n+ \"category\": \"MySQL\",\n+ \"icon\": \"resources/icon/criss-cross.svg\"\n+ },\n{\n\"command\": \"mysql.connection.add\",\n\"title\": \"Add Connection\",\n\"when\": \"view == github.cweijan.mysql && viewItem == view\",\n\"group\": \"1_mysql@1\"\n},\n+ {\n+ \"command\": \"mysql.diagram.drop\",\n+ \"when\": \"view == github.cweijan.mysql && viewItem == diagram\",\n+ \"group\": \"inline@0\"\n+ },\n{\n\"command\": \"mysql.template.procedure\",\n\"when\": \"view == github.cweijan.mysql && viewItem == procedureGroup\",\n" }, { "change_type": "ADD", "old_path": null, "new_path": "resources/icon/diagram-node.svg", "diff": "+<?xml version=\"1.0\" standalone=\"no\"?><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg t=\"1596702414309\" class=\"icon\" viewBox=\"0 0 1057 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"6356\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"206.4453125\" height=\"200\"><defs><style type=\"text/css\"></style></defs><path d=\"M502.782324 1024a502.782324 502.782324 0 1 1 502.782324-502.782324 502.782324 502.782324 0 0 1-502.782324 502.782324z m0-921.767594a418.98527 418.98527 0 1 0 418.98527 418.98527 418.98527 418.98527 0 0 0-418.98527-418.566285z\" fill=\"#A6C5F6\" p-id=\"6357\"></path><path d=\"M269.826514 107.679214m-107.679214 0a107.679214 107.679214 0 1 0 215.358428 0 107.679214 107.679214 0 1 0-215.358428 0Z\" fill=\"#4E8CEE\" p-id=\"6358\"></path><path d=\"M502.363339 521.636661m-269.826514 0a269.826514 269.826514 0 1 0 539.653028 0 269.826514 269.826514 0 1 0-539.653028 0Z\" fill=\"#4E8CEE\" p-id=\"6359\"></path><path d=\"M268.569558 914.644845m-107.679214 0a107.679214 107.679214 0 1 0 215.358429 0 107.679214 107.679214 0 1 0-215.358429 0Z\" fill=\"#4E8CEE\" p-id=\"6360\"></path><path d=\"M949.839607 520.379705m-107.679214 0a107.679214 107.679214 0 1 0 215.358429 0 107.679214 107.679214 0 1 0-215.358429 0Z\" fill=\"#4E8CEE\" p-id=\"6361\"></path></svg>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/extension.ts", "new_path": "src/extension.ts", "diff": "@@ -50,8 +50,11 @@ export function activate(context: vscode.ExtensionContext) {\n\"mysql.diagram.add\": (diagramNode:DiagramGroup) => {\ndiagramNode.openAdd()\n},\n- \"mysql.diagram.open\": () => {\n- serviceManager.provider.activeDb();\n+ \"mysql.diagram.open\": (node:DiagramNode) => {\n+ node.open()\n+ },\n+ \"mysql.diagram.drop\": (node:DiagramNode) => {\n+ node.drop()\n},\n\"mysql.db.active\": () => {\nserviceManager.provider.activeDb();\n" }, { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramGroup.ts", "new_path": "src/model/diagram/diagramGroup.ts", "diff": "+import { existsSync, readdirSync } from \"fs\";\nimport * as path from \"path\";\n-import { Constants, ModelType, Template } from \"../../common/constants\";\n-import { ConnectionManager } from \"../../service/connectionManager\";\n+import { Constants, ModelType } from \"../../common/constants\";\n+import { FileManager, FileModel } from \"../../common/filesManager\";\n+import { DbTreeDataProvider } from \"../../provider/treeDataProvider\";\nimport { DatabaseCache } from \"../../service/common/databaseCache\";\n-import { QueryUnit } from \"../../service/queryUnit\";\n-import { InfoNode } from \"../other/infoNode\";\n-import { Node } from \"../interface/node\";\n-import { DiagramNode } from \"./diagramNode\";\nimport { ViewManager } from \"../../view/viewManager\";\n+import { Node } from \"../interface/node\";\nimport { TableNode } from \"../main/tableNode\";\nimport { ColumnNode } from \"../other/columnNode\";\n+import { DiagramNode } from \"./diagramNode\";\n+import { Global } from \"../../common/global\";\nexport class DiagramGroup extends Node {\npublic openAdd() {\nViewManager.createWebviewPanel({\npath: \"diagram\", title: \"diagram\",\n+ iconPath: Global.getExtPath(\"resources\", \"icon\", \"diagram.svg\"),\nsplitView: false, eventHandler: (handler) => {\nhandler.on(\"init\", async () => {\n- handler.emit('load', await this.getData())\n+ handler.emit('load', { content: await this.getData() })\n+ }).on(\"save\", ({ name, data }) => {\n+ const diagramPath = `diagram/${this.getConnectId()}_${this.database}/${name}.json`;\n+ FileManager.record(diagramPath, data, FileModel.WRITE)\n+ DbTreeDataProvider.refresh()\n})\n}\n})\n@@ -31,8 +37,12 @@ export class DiagramGroup extends Node {\n}\npublic async getChildren(isRresh: boolean = false): Promise<Node[]> {\n+ const path = `${FileManager.storagePath}/diagram/${this.getConnectId()}_${this.database}`;\n+ if (!existsSync(path)) {\nreturn []\n}\n+ return readdirSync(path).map(fileName => new DiagramNode(fileName.replace(/\\.[^/.]+$/, \"\"), this))\n+ }\npublic async getData() {\n" }, { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramNode.ts", "new_path": "src/model/diagram/diagramNode.ts", "diff": "+import { readFileSync, unlink, unlinkSync } from \"fs\";\nimport * as path from \"path\";\n-import * as vscode from \"vscode\";\n+import { TreeItemCollapsibleState } from \"vscode\";\nimport { Constants, ModelType } from \"../../common/constants\";\n+import { FileManager, FileModel } from \"../../common/filesManager\";\nimport { Util } from \"../../common/util\";\n-import { ConnectionManager } from \"../../service/connectionManager\";\n-import { DatabaseCache } from \"../../service/common/databaseCache\";\n-import { QueryUnit } from \"../../service/queryUnit\";\nimport { DbTreeDataProvider } from \"../../provider/treeDataProvider\";\n-import { Node } from \"../interface/node\";\nimport { ViewManager } from \"../../view/viewManager\";\n+import { Node } from \"../interface/node\";\n+import { Global } from \"../../common/global\";\nexport class DiagramNode extends Node {\npublic contextValue: string = ModelType.DIAGRAM;\n- public iconPath = path.join(Constants.RES_PATH, \"icon/function.svg\")\n- constructor(readonly name: string, readonly info: Node) {\n+ public iconPath = path.join(Constants.RES_PATH, \"icon/diagram-node.svg\")\n+ constructor(public name: string, readonly info: Node) {\nsuper(name)\n- this.id = `${info.getConnectId()}_${info.database}_${name}`\n+ this.id = `${info.getConnectId()}_${info.database}_diragram_${name}`\nthis.init(info)\n+ this.collapsibleState = TreeItemCollapsibleState.None\nthis.command = {\n- command: \"mysql.show.function\",\n- title: \"Show Function Create Source\",\n+ command: \"mysql.diagram.open\",\n+ title: \"Open Diagram\",\narguments: [this, true],\n}\n}\npublic open() {\n- const content = \"read from disk\";\n+ const content = JSON.parse(readFileSync(this.getFilePath(), 'utf8'));\nViewManager.createWebviewPanel({\npath: \"diagram\", title: \"diagram\",\n- splitView: false, eventHandler(handler) {\n+ iconPath: Global.getExtPath(\"resources\", \"icon\", \"diagram-node.svg\"),\n+ splitView: false, eventHandler: (handler) => {\nhandler.on(\"init\", () => {\n- handler.emit('load', JSON.parse(content))\n+ delete content.class\n+ handler.emit('load', { content, name: this.name })\n+ }).on(\"save\", ({ name, data }) => {\n+ unlinkSync(this.getFilePath())\n+ this.name = name\n+ const diagramPath = `diagram/${this.getConnectId()}_${this.database}/${name}.json`;\n+ FileManager.record(diagramPath, data, FileModel.WRITE)\n+ DbTreeDataProvider.refresh()\n})\n}\n})\n}\n- public async getChildren(isRresh: boolean = false): Promise<Node[]> {\n+ private getFilePath(): string {\n+ return `${FileManager.storagePath}/diagram/${this.getConnectId()}_${this.database}/${this.name}.json`;\n+ }\n+\n+ public async getChildren(): Promise<Node[]> {\nreturn [];\n}\npublic drop() {\n- Util.confirm(`Are you want to drop function ${this.name} ?`, async () => {\n-\n+ Util.confirm(`Are you want to drop diagram ${this.name} ?`, async () => {\n+ unlink(this.getFilePath())\n+ DbTreeDataProvider.refresh()\n})\n}\n" }, { "change_type": "MODIFY", "old_path": "src/vue/diagram/App.vue", "new_path": "src/vue/diagram/App.vue", "diff": "<script>\nimport { getVscodeEvent } from \"../util/vscode\";\n-function getData() {\n- // create the model for the E-R diagram\n- var colors = {\n- red: \"#be4b15\",\n- green: \"#52ce60\",\n- blue: \"#6ea5f8\",\n- lightred: \"#fd8852\",\n- lightblue: \"#afd4fe\",\n- lightgreen: \"#b9e986\",\n- pink: \"#faadc1\",\n- purple: \"#d689ff\",\n- orange: \"#fdb400\"\n- };\n- var nodeDataArray = [\n- {\n- key: \"Products\",\n- items: [\n- {\n- name: \"ProductID\",\n- iskey: true,\n- figure: \"Decision\",\n- color: colors.red\n- },\n- {\n- name: \"ProductName\",\n- iskey: false,\n- figure: \"Hexagon\",\n- color: colors.blue\n- },\n- {\n- name: \"SupplierID\",\n- iskey: false,\n- figure: \"Decision\",\n- color: \"purple\"\n- },\n- {\n- name: \"CategoryID\",\n- iskey: false,\n- figure: \"Decision\",\n- color: \"purple\"\n- }\n- ]\n- },\n- {\n- key: \"Suppliers\",\n- items: [\n- {\n- name: \"SupplierID\",\n- iskey: true,\n- figure: \"Decision\",\n- color: colors.red\n- },\n- {\n- name: \"CompanyName\",\n- iskey: false,\n- figure: \"Hexagon\",\n- color: colors.blue\n- },\n- {\n- name: \"ContactName\",\n- iskey: false,\n- figure: \"Hexagon\",\n- color: colors.blue\n- },\n- {\n- name: \"Address\",\n- iskey: false,\n- figure: \"Hexagon\",\n- color: colors.blue\n- }\n- ]\n- },\n- {\n- key: \"Categories\",\n- items: [\n- {\n- name: \"CategoryID\",\n- iskey: true,\n- figure: \"Decision\",\n- color: colors.red\n- },\n- {\n- name: \"CategoryName\",\n- iskey: false,\n- figure: \"Hexagon\",\n- color: colors.blue\n- },\n- {\n- name: \"Description\",\n- iskey: false,\n- figure: \"Hexagon\",\n- color: colors.blue\n- },\n- {\n- name: \"Picture\",\n- iskey: false,\n- figure: \"TriangleUp\",\n- color: colors.pink\n- }\n- ]\n- },\n- {\n- key: \"Order Details\",\n- items: [\n- {\n- name: \"OrderID\",\n- iskey: true,\n- figure: \"Decision\",\n- color: colors.red\n- },\n- {\n- name: \"ProductID\",\n- iskey: true,\n- figure: \"Decision\",\n- color: colors.red\n- },\n- {\n- name: \"UnitPrice\",\n- iskey: false,\n- figure: \"Circle\",\n- color: colors.green\n- },\n- {\n- name: \"Quantity\",\n- iskey: false,\n- figure: \"Circle\",\n- color: colors.green\n- },\n- {\n- name: \"Discount\",\n- iskey: false,\n- figure: \"Circle\",\n- color: colors.green\n- }\n- ]\n- }\n- ];\n- var linkDataArray = [\n- { from: \"Products\", to: \"Suppliers\" },\n- { from: \"Products\", to: \"Categories\" },\n- { from: \"Order Details\", to: \"Products\" }\n- ];\n- return {\n- copiesArrays: true,\n- copiesArrayObjects: true,\n- nodeDataArray: nodeDataArray,\n- linkDataArray: linkDataArray\n- };\n-}\nconst vscodeEvent = getVscodeEvent();\nexport default {\n@@ -323,13 +174,21 @@ export default {\n$(go.Shape, { stroke: \"#303B45\", strokeWidth: 2.5 }),\n$(go.Shape, { toArrow: \"Standard\", stroke: null })\n);\n- myDiagram.model = $(go.GraphLinksModel, data);\n+ this.diagramName=data.name\n+ myDiagram.model = $(go.GraphLinksModel, data.content);\n});\n},\nmethods: {\nsave: function() {\n+ if(!this.diagramName){\n+ this.$message.error(\"Diagram name cannot be null!\");\n+ return;\n+ }\nthis.$message.success(\"Save Success!\");\n- vscodeEvent.emit(\"save\", this.myDiagram.model.toJson());\n+ vscodeEvent.emit(\"save\",{\n+ name:this.diagramName,\n+ data: this.myDiagram.model.toJson()\n+ });\n}\n}\n};\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
init diagram logic
141,908
06.08.2020 18:28:00
-28,800
7a12380bd60f721cb9967701b1e59a3c8d9194e6
adjust diagram layout
[ { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramGroup.ts", "new_path": "src/model/diagram/diagramGroup.ts", "diff": "@@ -49,7 +49,7 @@ export class DiagramGroup extends Node {\nvar colors = {\nred: \"#be4b15\",\ngreen: \"#52ce60\",\n- blue: \"#6ea5f8\",\n+ int: \"#6ea5f8\",\nlightred: \"#fd8852\",\nlightblue: \"#afd4fe\",\nlightgreen: \"#b9e986\",\n@@ -65,7 +65,7 @@ export class DiagramGroup extends Node {\nname: `${columnNode.column.name} : ${columnNode.type}`,\niskey: columnNode.isPrimaryKey,\nfigure: \"Decision\",\n- color: colors[columnNode.type] ? colors[columnNode.column.simpleType] : '#be4b15'\n+ color: colors[columnNode.column.simpleType] ? colors[columnNode.column.simpleType] : '#be4b15'\n}\n})\n}\n" }, { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramNode.ts", "new_path": "src/model/diagram/diagramNode.ts", "diff": "@@ -57,7 +57,7 @@ export class DiagramNode extends Node {\npublic drop() {\nUtil.confirm(`Are you want to drop diagram ${this.name} ?`, async () => {\n- unlink(this.getFilePath())\n+ unlinkSync(this.getFilePath())\nDbTreeDataProvider.refresh()\n})\n" }, { "change_type": "MODIFY", "old_path": "src/vue/diagram/App.vue", "new_path": "src/vue/diagram/App.vue", "diff": "@@ -22,8 +22,9 @@ export default {\nmounted() {\nvscodeEvent.emit(\"init\");\nvscodeEvent.on(\"load\", data => {\n+ this.diagramName = data.name;\ndocument.getElementById(\"diagramPanel\").style.height =\n- window.innerHeight - 50 + \"px\";\n+ window.outerHeight - 135 + \"px\";\nvar $ = go.GraphObject.make; // for conciseness in defining templates\n@@ -37,8 +38,8 @@ export default {\n},\nallowDelete: true,\nallowCopy: true,\n- layout: $(go.ForceDirectedLayout),\n- \"undoManager.isEnabled\": true\n+ \"undoManager.isEnabled\": true,\n+ layout: $(go.GridLayout)\n}\n);\nthis.myDiagram = myDiagram;\n@@ -174,7 +175,6 @@ export default {\n$(go.Shape, { stroke: \"#303B45\", strokeWidth: 2.5 }),\n$(go.Shape, { toArrow: \"Standard\", stroke: null })\n);\n- this.diagramName=data.name\nmyDiagram.model = $(go.GraphLinksModel, data.content);\n});\n},\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
adjust diagram layout
141,908
06.08.2020 21:46:21
-28,800
5aa27ea4ac1775911d83a8108624152263b591b2
import vue router
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"portfinder\": \"^1.0.26\",\n\"sql-formatter\": \"^2.3.3\",\n\"tunnel-ssh\": \"^4.1.4\",\n- \"vue\": \"^2.6.11\"\n+ \"vue\": \"^2.6.11\",\n+ \"vue-router\": \"^3.4.1\"\n},\n\"__metadata\": {\n\"id\": \"38c08d09-caa0-4988-8ffb-bcbd51f86e55\",\n" }, { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramGroup.ts", "new_path": "src/model/diagram/diagramGroup.ts", "diff": "@@ -17,7 +17,9 @@ export class DiagramGroup extends Node {\npath: \"diagram\", title: \"diagram\",\niconPath: Global.getExtPath(\"resources\", \"icon\", \"diagram.svg\"),\nsplitView: false, eventHandler: (handler) => {\n- handler.on(\"init\", async () => {\n+ handler.on(\"init\", () => {\n+ handler.emit('route', 'diagram')\n+ }).on(\"diagram\", async () => {\nhandler.emit('load', { content: await this.getData() })\n}).on(\"save\", ({ name, data }) => {\nconst diagramPath = `diagram/${this.getConnectId()}_${this.database}/${name}.json`;\n" }, { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramNode.ts", "new_path": "src/model/diagram/diagramNode.ts", "diff": "@@ -33,6 +33,8 @@ export class DiagramNode extends Node {\nsplitView: false, eventHandler: (handler) => {\nhandler.on(\"init\", () => {\ndelete content.class\n+ handler.emit('route', 'diagram')\n+ }).on(\"diagram\", () => {\nhandler.emit('load', { content, name: this.name })\n}).on(\"save\", ({ name, data }) => {\nunlinkSync(this.getFilePath())\n" }, { "change_type": "MODIFY", "old_path": "src/vue/diagram/App.vue", "new_path": "src/vue/diagram/App.vue", "diff": "<template>\n- <div id=\"container\">\n- <el-input v-model=\"diagramName\" placeholder=\"Diagram Name\" style=\"width:200px\" />\n- <el-button @click=\"save\">Save Diagram</el-button>\n- <div id=\"diagramPanel\" style=\"background-color: #ffffff; border: solid 1px black; width: 100%; height: 700px\"></div>\n- </div>\n+ <router-view></router-view>\n</template>\n<script>\n@@ -13,183 +9,12 @@ const vscodeEvent = getVscodeEvent();\nexport default {\nname: \"App\",\n- data() {\n- return {\n- myDiagram: null,\n- diagramName: null\n- };\n- },\nmounted() {\n+ vscodeEvent.on(\"route\", path => this.$router.push(\"/\" + path));\nvscodeEvent.emit(\"init\");\n- vscodeEvent.on(\"load\", data => {\n- this.diagramName = data.name;\n- document.getElementById(\"diagramPanel\").style.height =\n- window.outerHeight - 135 + \"px\";\n-\n- var $ = go.GraphObject.make; // for conciseness in defining templates\n-\n- const myDiagram = $(\n- go.Diagram,\n- \"diagramPanel\", // must name or refer to the DIV HTML element\n- {\n- \"clickCreatingTool.archetypeNodeData\": {\n- key: \"Node\",\n- color: \"white\"\n- },\n- allowDelete: true,\n- allowCopy: true,\n- \"undoManager.isEnabled\": true,\n- layout: $(go.GridLayout)\n- }\n- );\n- this.myDiagram = myDiagram;\n-\n- function nodeClicked(e, obj) {\n- console.log(myDiagram.model.toJson());\n- }\n-\n- // defines a context menu to be referenced in the node template\n- var contextMenuTemplate = $(\n- go.Adornment,\n- \"Vertical\",\n- $(\"ContextMenuButton\", $(go.TextBlock, \"Show Source!\"), {\n- click: nodeClicked\n- })\n- );\n-\n- // the template for each attribute in a node's array of item data\n- var itemTempl = $(\n- go.Panel,\n- \"Horizontal\",\n- $(\n- go.Shape,\n- {\n- desiredSize: new go.Size(15, 15),\n- strokeJoin: \"round\",\n- strokeWidth: 3,\n- stroke: null,\n- margin: 2\n},\n- new go.Binding(\"figure\", \"figure\"),\n- new go.Binding(\"fill\", \"color\"),\n- new go.Binding(\"stroke\", \"color\")\n- ),\n- $(\n- go.TextBlock,\n- {\n- stroke: \"#333333\",\n- font: \"bold 14px sans-serif\"\n- },\n- new go.Binding(\"text\", \"name\")\n- )\n- );\n-\n- // define the Node template, representing an entity\n- myDiagram.nodeTemplate = $(\n- go.Node,\n- \"Auto\", // the whole node panel\n- {\n- contextMenu: contextMenuTemplate,\n- selectionAdorned: true,\n- resizable: true,\n- layoutConditions: go.Part.LayoutStandard & ~go.Part.LayoutNodeSized,\n- fromSpot: go.Spot.AllSides,\n- toSpot: go.Spot.AllSides,\n- isShadowed: true,\n- shadowOffset: new go.Point(3, 3),\n- shadowColor: \"#C5C1AA\"\n- },\n- new go.Binding(\"location\", \"location\").makeTwoWay(),\n- // whenever the PanelExpanderButton changes the visible property of the \"LIST\" panel,\n- // clear out any desiredSize set by the ResizingTool.\n- new go.Binding(\"desiredSize\", \"visible\", function(v) {\n- return new go.Size(NaN, NaN);\n- }).ofObject(\"LIST\"),\n- // define the node's outer shape, which will surround the Table\n- $(go.Shape, \"RoundedRectangle\", {\n- fill: \"#ffffff\",\n- stroke: \"#eeeeee\",\n- strokeWidth: 3,\n- fromLinkable: true,\n- toLinkable: true,\n- portId: \"\"\n- }),\n- $(\n- go.Panel,\n- \"Table\",\n- { margin: 8, stretch: go.GraphObject.Fill },\n- $(go.RowColumnDefinition, {\n- row: 0,\n- sizing: go.RowColumnDefinition.None\n- }),\n- // the table header\n- $(\n- go.TextBlock,\n- {\n- row: 0,\n- alignment: go.Spot.Center,\n- margin: new go.Margin(0, 24, 0, 2), // leave room for Button\n- font: \"bold 16px sans-serif\"\n- },\n- new go.Binding(\"text\", \"key\")\n- ),\n- // the collapse/expand button\n- $(\n- \"PanelExpanderButton\",\n- \"LIST\", // the name of the element whose visibility this button toggles\n- { row: 0, alignment: go.Spot.TopRight }\n- ),\n- // the list of Panels, each showing an attribute\n- $(\n- go.Panel,\n- \"Vertical\",\n- {\n- name: \"LIST\",\n- row: 1,\n- padding: 3,\n- alignment: go.Spot.TopLeft,\n- defaultAlignment: go.Spot.Left,\n- stretch: go.GraphObject.Horizontal,\n- itemTemplate: itemTempl\n- },\n- new go.Binding(\"itemArray\", \"items\")\n- )\n- ) // end Table Panel\n- ); // end Node\n-\n- // define the Link template, representing a relationship\n- // link config : https://gojs.net/latest/intro/links.html\n- myDiagram.linkTemplate = $(\n- go.Link, // the whole link panel\n- {\n- relinkableFrom: true,\n- relinkableTo: true,\n- toShortLength: 2,\n- selectionAdorned: true,\n- layerName: \"Foreground\",\n- reshapable: true,\n- routing: go.Link.AvoidsNodes,\n- corner: 5,\n- curve: go.Link.JumpOver\n- },\n- $(go.Shape, { stroke: \"#303B45\", strokeWidth: 2.5 }),\n- $(go.Shape, { toArrow: \"Standard\", stroke: null })\n- );\n- myDiagram.model = $(go.GraphLinksModel, data.content);\n- });\n- },\n- methods: {\n- save: function() {\n- if (!this.diagramName) {\n- this.$message.error(\"Diagram name cannot be null!\");\n- return;\n- }\n- this.$message.success(\"Save Success!\");\n- vscodeEvent.emit(\"save\", {\n- name: this.diagramName,\n- data: this.myDiagram.model.toJson()\n- });\n- }\n+ destroyed(){\n+ vscodeEvent.destroy()\n}\n};\n</script>\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/vue/diagram/Gojs/index.vue", "diff": "+<template>\n+ <div id=\"container\">\n+ <el-input v-model=\"diagramName\" placeholder=\"Diagram Name\" style=\"width:200px\" />\n+ <el-button @click=\"save\">Save Diagram</el-button>\n+ <div id=\"diagramPanel\" style=\"background-color: #ffffff; border: solid 1px black; width: 100%; height: 700px\"></div>\n+ </div>\n+</template>\n+\n+<script>\n+import { getVscodeEvent } from \"../../util/vscode\";\n+\n+const vscodeEvent = getVscodeEvent();\n+\n+export default {\n+ name: \"Gojs\",\n+ data() {\n+ return {\n+ myDiagram: null,\n+ diagramName: null\n+ };\n+ },\n+ destroyed(){\n+ vscodeEvent.destroy()\n+ },\n+ mounted() {\n+ vscodeEvent.emit(this.$route.name);\n+ vscodeEvent.on(\"load\", data => {\n+ this.diagramName = data.name;\n+ document.getElementById(\"diagramPanel\").style.height =\n+ window.outerHeight - 135 + \"px\";\n+\n+ var $ = go.GraphObject.make; // for conciseness in defining templates\n+\n+ const myDiagram = $(\n+ go.Diagram,\n+ \"diagramPanel\", // must name or refer to the DIV HTML element\n+ {\n+ \"clickCreatingTool.archetypeNodeData\": {\n+ key: \"Node\",\n+ color: \"white\"\n+ },\n+ allowDelete: true,\n+ allowCopy: true,\n+ \"undoManager.isEnabled\": true,\n+ layout: $(go.GridLayout)\n+ }\n+ );\n+ this.myDiagram = myDiagram;\n+\n+ function nodeClicked(e, obj) {\n+ console.log(myDiagram.model.toJson());\n+ }\n+\n+ // defines a context menu to be referenced in the node template\n+ var contextMenuTemplate = $(\n+ go.Adornment,\n+ \"Vertical\",\n+ $(\"ContextMenuButton\", $(go.TextBlock, \"Show Source!\"), {\n+ click: nodeClicked\n+ })\n+ );\n+\n+ // the template for each attribute in a node's array of item data\n+ var itemTempl = $(\n+ go.Panel,\n+ \"Horizontal\",\n+ $(\n+ go.Shape,\n+ {\n+ desiredSize: new go.Size(15, 15),\n+ strokeJoin: \"round\",\n+ strokeWidth: 3,\n+ stroke: null,\n+ margin: 2\n+ },\n+ new go.Binding(\"figure\", \"figure\"),\n+ new go.Binding(\"fill\", \"color\"),\n+ new go.Binding(\"stroke\", \"color\")\n+ ),\n+ $(\n+ go.TextBlock,\n+ {\n+ stroke: \"#333333\",\n+ font: \"bold 14px sans-serif\"\n+ },\n+ new go.Binding(\"text\", \"name\")\n+ )\n+ );\n+\n+ // define the Node template, representing an entity\n+ myDiagram.nodeTemplate = $(\n+ go.Node,\n+ \"Auto\", // the whole node panel\n+ {\n+ contextMenu: contextMenuTemplate,\n+ selectionAdorned: true,\n+ resizable: true,\n+ layoutConditions: go.Part.LayoutStandard & ~go.Part.LayoutNodeSized,\n+ fromSpot: go.Spot.AllSides,\n+ toSpot: go.Spot.AllSides,\n+ isShadowed: true,\n+ shadowOffset: new go.Point(3, 3),\n+ shadowColor: \"#C5C1AA\"\n+ },\n+ new go.Binding(\"location\", \"location\").makeTwoWay(),\n+ // whenever the PanelExpanderButton changes the visible property of the \"LIST\" panel,\n+ // clear out any desiredSize set by the ResizingTool.\n+ new go.Binding(\"desiredSize\", \"visible\", function(v) {\n+ return new go.Size(NaN, NaN);\n+ }).ofObject(\"LIST\"),\n+ // define the node's outer shape, which will surround the Table\n+ $(go.Shape, \"RoundedRectangle\", {\n+ fill: \"#ffffff\",\n+ stroke: \"#eeeeee\",\n+ strokeWidth: 3,\n+ fromLinkable: true,\n+ toLinkable: true,\n+ portId: \"\"\n+ }),\n+ $(\n+ go.Panel,\n+ \"Table\",\n+ { margin: 8, stretch: go.GraphObject.Fill },\n+ $(go.RowColumnDefinition, {\n+ row: 0,\n+ sizing: go.RowColumnDefinition.None\n+ }),\n+ // the table header\n+ $(\n+ go.TextBlock,\n+ {\n+ row: 0,\n+ alignment: go.Spot.Center,\n+ margin: new go.Margin(0, 24, 0, 2), // leave room for Button\n+ font: \"bold 16px sans-serif\"\n+ },\n+ new go.Binding(\"text\", \"key\")\n+ ),\n+ // the collapse/expand button\n+ $(\n+ \"PanelExpanderButton\",\n+ \"LIST\", // the name of the element whose visibility this button toggles\n+ { row: 0, alignment: go.Spot.TopRight }\n+ ),\n+ // the list of Panels, each showing an attribute\n+ $(\n+ go.Panel,\n+ \"Vertical\",\n+ {\n+ name: \"LIST\",\n+ row: 1,\n+ padding: 3,\n+ alignment: go.Spot.TopLeft,\n+ defaultAlignment: go.Spot.Left,\n+ stretch: go.GraphObject.Horizontal,\n+ itemTemplate: itemTempl\n+ },\n+ new go.Binding(\"itemArray\", \"items\")\n+ )\n+ ) // end Table Panel\n+ ); // end Node\n+\n+ // define the Link template, representing a relationship\n+ // link config : https://gojs.net/latest/intro/links.html\n+ myDiagram.linkTemplate = $(\n+ go.Link, // the whole link panel\n+ {\n+ relinkableFrom: true,\n+ relinkableTo: true,\n+ toShortLength: 2,\n+ selectionAdorned: true,\n+ layerName: \"Foreground\",\n+ reshapable: true,\n+ routing: go.Link.AvoidsNodes,\n+ corner: 5,\n+ curve: go.Link.JumpOver\n+ },\n+ $(go.Shape, { stroke: \"#303B45\", strokeWidth: 2.5 }),\n+ $(go.Shape, { toArrow: \"Standard\", stroke: null })\n+ );\n+ myDiagram.model = $(go.GraphLinksModel, data.content);\n+ });\n+ },\n+ methods: {\n+ save: function() {\n+ if (!this.diagramName) {\n+ this.$message.error(\"Diagram name cannot be null!\");\n+ return;\n+ }\n+ this.$message.success(\"Save Success!\");\n+ vscodeEvent.emit(\"save\", {\n+ name: this.diagramName,\n+ data: this.myDiagram.model.toJson()\n+ });\n+ }\n+ }\n+};\n+</script>\n+\n+<style>\n+</style>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/vue/diagram/main.js", "new_path": "src/vue/diagram/main.js", "diff": "import Vue from 'vue'\nimport App from './App'\nimport ElementUI from 'element-ui';\n+import VueRouter from 'vue-router'\n+\nimport 'element-ui/lib/theme-chalk/index.css';\nimport './go.js';\n+\n+Vue.use(VueRouter)\nVue.use(ElementUI);\n+import Gojs from \"./Gojs\";\n+\nVue.config.productionTip = false\n-/* eslint-disable no-new */\n+const router = new VueRouter({\n+ routes: [\n+ { path: '/diagram', component: Gojs ,name:'diagram'},\n+ ]\n+})\n+\nnew Vue({\nel: '#app',\ncomponents: { App },\n+ router,\ntemplate: '<App/>'\n})\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
import vue router
141,908
06.08.2020 23:19:31
-28,800
35743104472b0d8ec12cfc66150bef094db7ff3e
support select tables
[ { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramGroup.ts", "new_path": "src/model/diagram/diagramGroup.ts", "diff": "@@ -18,9 +18,9 @@ export class DiagramGroup extends Node {\niconPath: Global.getExtPath(\"resources\", \"icon\", \"diagram.svg\"),\nsplitView: false, eventHandler: (handler) => {\nhandler.on(\"init\", () => {\n- handler.emit('route', 'diagram')\n- }).on(\"diagram\", async () => {\n- handler.emit('load', { content: await this.getData() })\n+ handler.emit('route', 'selector')\n+ }).on(\"selector\", async () => {\n+ handler.emit(\"selector-load\", await this.getTableInfos())\n}).on(\"save\", ({ name, data }) => {\nconst diagramPath = `diagram/${this.getConnectId()}_${this.database}/${name}.json`;\nFileManager.record(diagramPath, data, FileModel.WRITE)\n@@ -48,6 +48,18 @@ export class DiagramGroup extends Node {\npublic async getData() {\n+ const nodeDataArray = await this.getTableInfos()\n+ return {\n+ copiesArrays: true,\n+ copiesArrayObjects: true,\n+ linkDataArray: [],\n+ nodeDataArray\n+\n+ };\n+ }\n+\n+\n+ public async getTableInfos() {\nvar colors = {\nred: \"#be4b15\",\ngreen: \"#52ce60\",\n@@ -59,7 +71,7 @@ export class DiagramGroup extends Node {\npurple: \"#d689ff\",\norange: \"#fdb400\"\n};\n- const nodeDataArray = await Promise.all(DatabaseCache.getTableListOfDatabase(`${this.getConnectId()}_${this.database}`).map(async (node: TableNode) => {\n+ return await Promise.all(DatabaseCache.getTableListOfDatabase(`${this.getConnectId()}_${this.database}`).map(async (node: TableNode) => {\nreturn {\nkey: node.table,\nitems: (await node.getChildren()).map((columnNode: ColumnNode) => {\n@@ -68,17 +80,13 @@ export class DiagramGroup extends Node {\niskey: columnNode.isPrimaryKey,\nfigure: \"Decision\",\ncolor: colors[columnNode.column.simpleType] ? colors[columnNode.column.simpleType] : '#be4b15'\n- }\n+ };\n})\n- }\n- }))\n- return {\n- copiesArrays: true,\n- copiesArrayObjects: true,\n- linkDataArray: [],\n- nodeDataArray\n-\n};\n+ }));\n}\n}\n+\n+\n+\n" }, { "change_type": "MODIFY", "old_path": "src/vue/diagram/App.vue", "new_path": "src/vue/diagram/App.vue", "diff": "@@ -10,11 +10,17 @@ const vscodeEvent = getVscodeEvent();\nexport default {\nname: \"App\",\nmounted() {\n- vscodeEvent.on(\"route\", path => this.$router.push(\"/\" + path));\n+ vscodeEvent.on(\"route\", path => {\n+ if (this.$route.name == path) {\n+ vscodeEvent.emit(this.$route.name);\n+ } else {\n+ this.$router.push(\"/\" + path);\n+ }\n+ });\nvscodeEvent.emit(\"init\");\n},\ndestroyed() {\n- vscodeEvent.destroy()\n+ vscodeEvent.destroy();\n}\n};\n</script>\n" }, { "change_type": "MODIFY", "old_path": "src/vue/diagram/Gojs/index.vue", "new_path": "src/vue/diagram/Gojs/index.vue", "diff": "<script>\nimport { getVscodeEvent } from \"../../util/vscode\";\n-\n-const vscodeEvent = getVscodeEvent();\n+let vscodeEvent;\nexport default {\nname: \"Gojs\",\n@@ -20,17 +19,30 @@ export default {\n};\n},\ndestroyed() {\n- vscodeEvent.destroy()\n+ vscodeEvent.destroy();\n},\nmounted() {\n+ vscodeEvent = getVscodeEvent();\n+ if (this.$route.query.new) {\n+ const gojsData = JSON.parse(localStorage.getItem(\"gojs-data\"));\n+ this.handler({ name: null, content: gojsData });\n+ } else {\n+ vscodeEvent.on(\"load\", this.handler);\n+ }\nvscodeEvent.emit(this.$route.name);\n- vscodeEvent.on(\"load\", data => {\n+ },\n+ methods: {\n+ handler(data) {\nthis.diagramName = data.name;\n+ var $ = go.GraphObject.make; // for conciseness in defining templates\n+\n+ if (this.myDiagram) {\n+ this.myDiagram.model = $(go.GraphLinksModel, data.content);\n+ return;\n+ }\ndocument.getElementById(\"diagramPanel\").style.height =\nwindow.outerHeight - 135 + \"px\";\n- var $ = go.GraphObject.make; // for conciseness in defining templates\n-\nconst myDiagram = $(\ngo.Diagram,\n\"diagramPanel\", // must name or refer to the DIV HTML element\n@@ -41,8 +53,8 @@ export default {\n},\nallowDelete: true,\nallowCopy: true,\n- \"undoManager.isEnabled\": true,\n- layout: $(go.GridLayout)\n+ \"undoManager.isEnabled\": true\n+ // layout: $(go.GridLayout)\n}\n);\nthis.myDiagram = myDiagram;\n@@ -179,9 +191,7 @@ export default {\n$(go.Shape, { toArrow: \"Standard\", stroke: null })\n);\nmyDiagram.model = $(go.GraphLinksModel, data.content);\n- });\n},\n- methods: {\nsave: function() {\nif (!this.diagramName) {\nthis.$message.error(\"Diagram name cannot be null!\");\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/vue/diagram/Selector/index.vue", "diff": "+<template>\n+ <div>\n+ <p style=\"text-align: center; margin: 0 0 20px\">Select Tables To Render</p>\n+ <div style=\"text-align: center\">\n+ <el-transfer style=\"text-align: left; display: inline-block;\" v-model=\"tables\" filterable :titles=\"['Tables', 'Target']\" :button-texts=\"['To left', 'To right']\" :format=\"{ noChecked: '${total}',hasChecked: '${checked}/${total}' }\" :data=\"data\">\n+ <div slot=\"left-footer\"></div>\n+ <template slot=\"right-footer\">\n+ <el-button style=\"margin-left:70px\" type=\"primary\" @click=\"confirm\">Confirm</el-button>\n+ </template>\n+ </el-transfer>\n+ </div>\n+ </div>\n+</template>\n+\n+<script>\n+import { getVscodeEvent } from \"../../util/vscode\";\n+let vscodeEvent;\n+export default {\n+ name: \"Selector\",\n+ data() {\n+ return {\n+ nodeDataArray: [],\n+ data: [],\n+ tables: []\n+ };\n+ },\n+ destroyed() {\n+ vscodeEvent.destroy();\n+ },\n+ mounted() {\n+ vscodeEvent = getVscodeEvent();\n+ vscodeEvent.on(\"selector-load\", nodeDataArray => {\n+ this.data = nodeDataArray.map(table => {\n+ return { ...table, label: table.key };\n+ });\n+ this.nodeDataArray = nodeDataArray;\n+ });\n+ vscodeEvent.emit(this.$route.name);\n+ },\n+ methods: {\n+ confirm() {\n+ if (this.tables.length == 0) {\n+ this.$message.error(\"You choose at least one table!\");\n+ return;\n+ }\n+ localStorage.setItem(\n+ \"gojs-data\",\n+ JSON.stringify({\n+ nodeDataArray: this.nodeDataArray.filter(nodeData =>\n+ this.tables.includes(nodeData.key)\n+ ),\n+ copiesArrays: true,\n+ copiesArrayObjects: true,\n+ linkDataArray: []\n+ })\n+ );\n+ this.$router.push({ path: `/diagram`, query: { new: true } });\n+ }\n+ }\n+};\n+</script>\n+\n+<style >\n+.el-transfer-panel {\n+ width: 250px !important;\n+ height: 700px !important;\n+}\n+.el-transfer-panel__list {\n+ height: 550px !important;\n+}\n+</style>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/vue/diagram/main.js", "new_path": "src/vue/diagram/main.js", "diff": "@@ -10,12 +10,14 @@ Vue.use(VueRouter)\nVue.use(ElementUI);\nimport Gojs from \"./Gojs\";\n+import Selector from \"./Selector\";\nVue.config.productionTip = false\nconst router = new VueRouter({\nroutes: [\n{ path: '/diagram', component: Gojs ,name:'diagram'},\n+ { path: '/selector', component: Selector ,name:'selector'},\n]\n})\n" }, { "change_type": "MODIFY", "old_path": "src/vue/util/vscode.js", "new_path": "src/vue/util/vscode.js", "diff": "@@ -13,15 +13,15 @@ export const getVscodeEvent = () => {\n}\nreturn {\non(event, data) {\n- this.init();\n+ this.tryInit();\nevents[event] = data\nreturn this;\n},\nemit(event, data) {\n- this.init();\n+ this.tryInit();\npostMessage({ type: event, content: data })\n},\n- init() {\n+ tryInit() {\nif (init) return;\ninit = true;\nwindow.addEventListener('message', receive)\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
support select tables
141,908
07.08.2020 00:23:07
-28,800
e4f135830b601255e94bec765ef6c2b799301edd
extra connect page
[ { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramGroup.ts", "new_path": "src/model/diagram/diagramGroup.ts", "diff": "@@ -14,7 +14,7 @@ import { Global } from \"../../common/global\";\nexport class DiagramGroup extends Node {\npublic openAdd() {\nViewManager.createWebviewPanel({\n- path: \"diagram\", title: \"diagram\",\n+ path: \"diagram\", title: \"new\",\niconPath: Global.getExtPath(\"resources\", \"icon\", \"diagram.svg\"),\nsplitView: false, eventHandler: (handler) => {\nhandler.on(\"init\", () => {\n" }, { "change_type": "MODIFY", "old_path": "src/view/connect/abstractConnectService.ts", "new_path": "src/view/connect/abstractConnectService.ts", "diff": "@@ -11,7 +11,7 @@ export abstract class AbstractConnectService {\nprotected abstract connect(connectionNode: Node): Promise<any> | any;\npublic async openConnect(provider: DbTreeDataProvider, connectionNode?: ConnectionNode) {\n- let node;\n+ let node: any;\nif (connectionNode) {\nnode = { ...connectionNode }\nif (node.ssh) {\n@@ -19,30 +19,24 @@ export abstract class AbstractConnectService {\n}\n}\nViewManager.createWebviewPanel({\n- path: \"connect\", title: \"connect\",\n+ path: \"app\", title: \"connect\",\nsplitView: false, iconPath: Global.getExtPath(\"resources\", \"icon\", \"add.svg\"),\n- initListener: (webviewPanel) => {\n- if (node) {\n- webviewPanel.webview.postMessage({\n- type: \"EDIT\",\n- node\n- });\n- }\n- },\n- receiveListener: async (webviewPanel, params) => {\n- if (params.type === 'CONNECT_TO_SQL_SERVER') {\n- const connectNode = Util.trim(NodeUtil.of(params.connectionOption))\n+ eventHandler: (handler) => {\n+ handler.on(\"init\", () => {\n+ handler.emit('route', 'connect')\n+ }).on(\"route-connect\", async () => {\n+ if (node) handler.emit(\"edit\", node)\n+ }).on(\"connecting\", async (data) => {\n+ const connectionOption = data.connectionOption\n+ const connectNode = Util.trim(NodeUtil.of(connectionOption))\ntry {\nawait this.connect(connectNode)\nprovider.addConnection(connectNode)\n- webviewPanel.dispose();\n+ handler.panel.dispose();\n} catch (err) {\n- webviewPanel.webview.postMessage({\n- type: 'CONNECTION_ERROR',\n- err,\n- });\n- }\n+ handler.emit(\"error\", err)\n}\n+ })\n}\n});\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/vue/App.vue", "diff": "+<template>\n+ <router-view></router-view>\n+</template>\n+\n+<script>\n+import { getVscodeEvent } from \"./util/vscode\";\n+\n+const vscodeEvent = getVscodeEvent();\n+\n+export default {\n+ name: \"App\",\n+ mounted() {\n+ vscodeEvent.on(\"route\", path => {\n+ if (this.$route.name == path) {\n+ vscodeEvent.emit(\"route-\" + this.$route.name);\n+ } else {\n+ this.$router.push(\"/\" + path);\n+ }\n+ });\n+ vscodeEvent.emit(\"init\");\n+ },\n+ destroyed() {\n+ vscodeEvent.destroy();\n+ }\n+};\n+</script>\n+\n+<style>\n+</style>\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "src/vue/connect/App.vue", "new_path": null, "diff": "-<template>\n- <div class=\"container\" id='app'>\n- <h1>Connect to MySQL server</h1>\n- <blockquote class=\"panel\" id=\"error\" v-if=\"error\">\n- <p class=\"panel__text\">\n- Connection error! <span id=\"errorMessage\" v-text=\"errorMessage\"></span><br />\n- </p>\n- </blockquote>\n- <el-row>\n- <div>\n- <div class=\"field field__input\">\n- <strong>name:</strong>\n- <input class=\"field__input\" placeholder=\"connection name, can be empty\" v-model=\"connectionOption.name\" />\n- </div>\n- </div>\n- <div>\n- <div class=\"field field__input\">\n- <strong>host:</strong>\n- <input class=\"field__input\" v-model=\"connectionOption.host\" />\n- </div>\n- </div>\n- <div>\n- <div class=\"field field__input\">\n- <strong>port:</strong>\n- <input class=\"field__input\" v-model=\"connectionOption.port\" />\n- </div>\n- </div>\n- <div>\n- <div class=\"field field__input\">\n- <strong>username:</strong>\n- <input class=\"field__input\" v-model=\"connectionOption.user\" />\n- </div>\n- </div>\n- <div>\n- <div class=\"field field__input\">\n- <strong>password:</strong>\n- <input class=\"field__input\" type=\"password\" v-model=\"connectionOption.password\" />\n- </div>\n- </div>\n- <div>\n- <div class=\"field field__input\">\n- <strong>database:</strong>\n- <input class=\"field__input\" placeholder=\"database, can be empty\"\n- v-model=\"connectionOption.database\" />\n- </div>\n- </div>\n- <div>\n- <div class=\"field field__input\">\n- <strong>excludeDatabases:</strong>\n- <input class=\"field__input\" v-model=\"connectionOption.excludeDatabases\" />\n- </div>\n- </div>\n- <div>\n- <div class=\"field field__input\">\n- <strong>timezone:</strong>\n- <input class=\"field__input\" placeholder=\"+HH:MM\" v-model=\"connectionOption.timezone\" />\n- </div>\n- </div>\n- </el-row>\n- <el-row>\n- <div class=\"field field__input\">\n- usingSSH:\n- <el-switch v-model=\"connectionOption.usingSSH\"></el-switch>\n- </div>\n- <div v-if=\"connectionOption.usingSSH\">\n- <div class=\"field field__input\">\n- <strong>ssh-host:</strong>\n- <input class=\"field__input\" v-model=\"connectionOption.ssh.host\" />\n- </div>\n- <div class=\"field field__input\">\n- <strong>ssh-port:</strong>\n- <input class=\"field__input\" v-model=\"connectionOption.ssh.port\" />\n- </div>\n- <div class=\"field field__input\">\n- <strong>ssh-username:</strong>\n- <input class=\"field__input\" v-model=\"connectionOption.ssh.username\" />\n- </div>\n- <div>\n- <div class=\"field field__input\">\n- <strong>type:</strong>\n- <select v-model=\"type\">\n- <option value=\"password\">password</option>\n- <option value=\"privateKey\">privateKey</option>\n- </select>\n- </div>\n- </div>\n- <div v-if=\"type=='password'\">\n- <div class=\"field field__input\">\n- <strong>password:</strong>\n- <input class=\"field__input\" type=\"password\" v-model=\"connectionOption.ssh.password\" />\n- </div>\n- </div>\n- <div v-if=\"type=='privateKey'\">\n- <div>\n- <div class=\"field field__input\">\n- <strong>privateKeyPath:</strong>\n- <input class=\"field__input\" placeholder=\"input your private key path\"\n- v-model=\"connectionOption.ssh.privateKeyPath\" />\n- </div>\n- </div>\n- <div>\n- <div class=\"field field__input\">\n- <strong>passphrase:</strong>\n- <input class=\"field__input\" type=\"passphrase\" v-model=\"connectionOption.ssh.passphrase\" />\n- </div>\n- </div>\n- </div>\n- </div>\n- </el-row>\n-\n- <div id=\"fields\" data-type=\"none\"></div>\n-\n- <button class=\"button button--primary\" @click=\"tryConnect\">Connect</button>\n-\n- </div>\n-</template>\n-\n-<script>\n- const vscode = typeof (acquireVsCodeApi) != \"undefined\" ? acquireVsCodeApi() : null;\n- const postMessage = (message) => { if (vscode) { vscode.postMessage(message) } }\n- export default {\n- name: \"App\",\n- data() {\n- return {\n- connectionOption: {\n- host: '127.0.0.1',\n- port: '3306',\n- user: 'root',\n- password: '',\n- database: null,\n- usingSSH: false,\n- excludeDatabases: 'mysql,performance_schema,information_schema,sys',\n- timezone: '+00:00',\n- ssh: {\n- host: '',\n- port: 22,\n- username: 'root',\n- }\n- },\n- type: 'password',\n- databaseType: 'mysql',\n- error: false,\n- errorMessage: ''\n- }\n- },\n- mounted() {\n- window.addEventListener('message', ({ data }) => {\n- if(!data)return;\n- switch (data.type) {\n- case 'EDIT':\n- this.connectionOption = data.node\n- break;\n- case 'CONNECTION_ERROR':\n- this.error = true;\n- this.errorMessage = data.err;\n- break;\n- default:\n- document.write(\"Connect success!\")\n- break;\n- }\n- })\n- postMessage({ type: 'init' })\n- },\n- methods: {\n- tryConnect: function () {\n- vscode.postMessage({\n- type: 'CONNECT_TO_SQL_SERVER',\n- databaseType: this.databaseType,\n- connectionOption: this.connectionOption\n- });\n- }\n- }\n- }\n-\n-</script>\n-\n-<style>\n- .container {\n- margin: auto;\n- padding-left: 24px;\n- padding-right: 24px;\n- max-width: 1000px;\n- box-sizing: border-box;\n- }\n-\n- .tab {\n- border-bottom: 1px solid var(--vscode-dropdown-border);\n- display: flex;\n- padding: 0;\n- }\n-\n- .tab__item {\n- list-style: none;\n- cursor: pointer;\n- font-size: 13px;\n- padding: 7px 8px;\n- color: var(--vscode-foreground);\n- border-bottom: 1px solid transparent;\n- margin: 0 0 -1px 0;\n- }\n-\n- .tab__item:hover {\n- color: var(--vscode-panelTitle-activeForeground);\n- }\n-\n- .tab__item--active {\n- color: var(--vscode-panelTitle-activeForeground);\n- border-bottom-color: var(--vscode-panelTitle-activeForeground);\n- }\n-\n- .field {\n- padding: 1em 0;\n- }\n-\n- .field--checkbox {\n- display: flex;\n- justify-content: flex-end;\n- flex-direction: row-reverse;\n- align-items: center;\n- }\n-\n- .field__label {\n- display: block;\n- margin: 2px 0;\n- cursor: pointer;\n- }\n-\n- .field--checkbox .field__label {\n- margin: 2px 4px;\n- }\n-\n- .field input {\n- width: 50vw;\n- }\n-\n- .field__input {\n- background: var(--vscode-input-background);\n- border: 1px solid var(--vscode-dropdown-border);\n- color: var(--vscode-input-foreground);\n- padding: 4px;\n- margin: 2px 0;\n- }\n-\n- .field__input:focus {\n- border-color: var(--vscode-focusBorder);\n- outline: 0;\n- }\n-\n- .button {\n- width: auto;\n- padding: 2px 14px;\n- border: 0;\n- display: inline-block;\n- cursor: pointer;\n- }\n-\n- .button--primary {\n- color: var(--vscode-button-foreground);\n- background-color: var(--vscode-button-background);\n- }\n-\n- .button--primary:hover {\n- background-color: var(--vscode-button-hoverBackground);\n- }\n-\n- .panel {\n- margin: 0 7px 0 5px;\n- padding: 0 16px 0 10px;\n- border-left-width: 5px;\n- border-left-style: solid;\n- background: var(--vscode-textBlockQuote-background);\n- border-color: var(--vscode-inputValidation-errorBorder);\n- }\n-\n- .panel__text {\n- line-height: 2;\n- }\n-</style>\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/vue/connect/index.vue", "diff": "+<template>\n+ <div class=\"container\" id='app'>\n+ <h1>Connect to MySQL server</h1>\n+ <blockquote class=\"panel\" id=\"error\" v-if=\"error\">\n+ <p class=\"panel__text\">\n+ Connection error! <span id=\"errorMessage\" v-text=\"errorMessage\"></span><br />\n+ </p>\n+ </blockquote>\n+ <el-row>\n+ <div>\n+ <div class=\"field field__input\">\n+ <strong>name:</strong>\n+ <input class=\"field__input\" placeholder=\"connection name, can be empty\" v-model=\"connectionOption.name\" />\n+ </div>\n+ </div>\n+ <div>\n+ <div class=\"field field__input\">\n+ <strong>host:</strong>\n+ <input class=\"field__input\" v-model=\"connectionOption.host\" />\n+ </div>\n+ </div>\n+ <div>\n+ <div class=\"field field__input\">\n+ <strong>port:</strong>\n+ <input class=\"field__input\" v-model=\"connectionOption.port\" />\n+ </div>\n+ </div>\n+ <div>\n+ <div class=\"field field__input\">\n+ <strong>username:</strong>\n+ <input class=\"field__input\" v-model=\"connectionOption.user\" />\n+ </div>\n+ </div>\n+ <div>\n+ <div class=\"field field__input\">\n+ <strong>password:</strong>\n+ <input class=\"field__input\" type=\"password\" v-model=\"connectionOption.password\" />\n+ </div>\n+ </div>\n+ <div>\n+ <div class=\"field field__input\">\n+ <strong>database:</strong>\n+ <input class=\"field__input\" placeholder=\"database, can be empty\" v-model=\"connectionOption.database\" />\n+ </div>\n+ </div>\n+ <div>\n+ <div class=\"field field__input\">\n+ <strong>excludeDatabases:</strong>\n+ <input class=\"field__input\" v-model=\"connectionOption.excludeDatabases\" />\n+ </div>\n+ </div>\n+ <div>\n+ <div class=\"field field__input\">\n+ <strong>timezone:</strong>\n+ <input class=\"field__input\" placeholder=\"+HH:MM\" v-model=\"connectionOption.timezone\" />\n+ </div>\n+ </div>\n+ </el-row>\n+ <el-row>\n+ <div class=\"field field__input\">\n+ usingSSH:\n+ <el-switch v-model=\"connectionOption.usingSSH\"></el-switch>\n+ </div>\n+ <div v-if=\"connectionOption.usingSSH\">\n+ <div class=\"field field__input\">\n+ <strong>ssh-host:</strong>\n+ <input class=\"field__input\" v-model=\"connectionOption.ssh.host\" />\n+ </div>\n+ <div class=\"field field__input\">\n+ <strong>ssh-port:</strong>\n+ <input class=\"field__input\" v-model=\"connectionOption.ssh.port\" />\n+ </div>\n+ <div class=\"field field__input\">\n+ <strong>ssh-username:</strong>\n+ <input class=\"field__input\" v-model=\"connectionOption.ssh.username\" />\n+ </div>\n+ <div>\n+ <div class=\"field field__input\">\n+ <strong>type:</strong>\n+ <select v-model=\"type\">\n+ <option value=\"password\">password</option>\n+ <option value=\"privateKey\">privateKey</option>\n+ </select>\n+ </div>\n+ </div>\n+ <div v-if=\"type=='password'\">\n+ <div class=\"field field__input\">\n+ <strong>password:</strong>\n+ <input class=\"field__input\" type=\"password\" v-model=\"connectionOption.ssh.password\" />\n+ </div>\n+ </div>\n+ <div v-if=\"type=='privateKey'\">\n+ <div>\n+ <div class=\"field field__input\">\n+ <strong>privateKeyPath:</strong>\n+ <input class=\"field__input\" placeholder=\"input your private key path\" v-model=\"connectionOption.ssh.privateKeyPath\" />\n+ </div>\n+ </div>\n+ <div>\n+ <div class=\"field field__input\">\n+ <strong>passphrase:</strong>\n+ <input class=\"field__input\" type=\"passphrase\" v-model=\"connectionOption.ssh.passphrase\" />\n+ </div>\n+ </div>\n+ </div>\n+ </div>\n+ </el-row>\n+\n+ <div id=\"fields\" data-type=\"none\"></div>\n+\n+ <button class=\"button button--primary\" @click=\"tryConnect\">Connect</button>\n+\n+ </div>\n+</template>\n+\n+<script>\n+import { getVscodeEvent } from \"../util/vscode\";\n+let vscodeEvent;\n+export default {\n+ name: \"connect\",\n+ data() {\n+ return {\n+ connectionOption: {\n+ host: \"127.0.0.1\",\n+ port: \"3306\",\n+ user: \"root\",\n+ password: \"\",\n+ database: null,\n+ usingSSH: false,\n+ excludeDatabases: \"mysql,performance_schema,information_schema,sys\",\n+ timezone: \"+00:00\",\n+ ssh: {\n+ host: \"\",\n+ port: 22,\n+ username: \"root\"\n+ }\n+ },\n+ type: \"password\",\n+ databaseType: \"mysql\",\n+ error: false,\n+ errorMessage: \"\"\n+ };\n+ },\n+ mounted() {\n+ vscodeEvent = getVscodeEvent();\n+ vscodeEvent\n+ .on(\"edit\", node => {\n+ this.connectionOption = node;\n+ })\n+ .on(\"error\", err => {\n+ this.error = true;\n+ this.errorMessage = err;\n+ });\n+ vscodeEvent.emit(\"route-\" + this.$route.name);\n+ },\n+ methods: {\n+ tryConnect() {\n+ vscodeEvent.emit(\"connecting\", {\n+ databaseType: this.databaseType,\n+ connectionOption: this.connectionOption\n+ });\n+ }\n+ }\n+};\n+</script>\n+\n+<style>\n+.container {\n+ margin: auto;\n+ padding-left: 24px;\n+ padding-right: 24px;\n+ max-width: 1000px;\n+ box-sizing: border-box;\n+}\n+\n+.tab {\n+ border-bottom: 1px solid var(--vscode-dropdown-border);\n+ display: flex;\n+ padding: 0;\n+}\n+\n+.tab__item {\n+ list-style: none;\n+ cursor: pointer;\n+ font-size: 13px;\n+ padding: 7px 8px;\n+ color: var(--vscode-foreground);\n+ border-bottom: 1px solid transparent;\n+ margin: 0 0 -1px 0;\n+}\n+\n+.tab__item:hover {\n+ color: var(--vscode-panelTitle-activeForeground);\n+}\n+\n+.tab__item--active {\n+ color: var(--vscode-panelTitle-activeForeground);\n+ border-bottom-color: var(--vscode-panelTitle-activeForeground);\n+}\n+\n+.field {\n+ padding: 1em 0;\n+}\n+\n+.field--checkbox {\n+ display: flex;\n+ justify-content: flex-end;\n+ flex-direction: row-reverse;\n+ align-items: center;\n+}\n+\n+.field__label {\n+ display: block;\n+ margin: 2px 0;\n+ cursor: pointer;\n+}\n+\n+.field--checkbox .field__label {\n+ margin: 2px 4px;\n+}\n+\n+.field input {\n+ width: 50vw;\n+}\n+\n+.field__input {\n+ background: var(--vscode-input-background);\n+ border: 1px solid var(--vscode-dropdown-border);\n+ color: var(--vscode-input-foreground);\n+ padding: 4px;\n+ margin: 2px 0;\n+}\n+\n+.field__input:focus {\n+ border-color: var(--vscode-focusBorder);\n+ outline: 0;\n+}\n+\n+.button {\n+ width: auto;\n+ padding: 2px 14px;\n+ border: 0;\n+ display: inline-block;\n+ cursor: pointer;\n+}\n+\n+.button--primary {\n+ color: var(--vscode-button-foreground);\n+ background-color: var(--vscode-button-background);\n+}\n+\n+.button--primary:hover {\n+ background-color: var(--vscode-button-hoverBackground);\n+}\n+\n+.panel {\n+ margin: 0 7px 0 5px;\n+ padding: 0 16px 0 10px;\n+ border-left-width: 5px;\n+ border-left-style: solid;\n+ background: var(--vscode-textBlockQuote-background);\n+ border-color: var(--vscode-inputValidation-errorBorder);\n+}\n+\n+.panel__text {\n+ line-height: 2;\n+}\n+</style>\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/vue/main.js", "diff": "+import Vue from 'vue'\n+import App from './App'\n+import ElementUI from 'element-ui';\n+import VueRouter from 'vue-router'\n+\n+import 'element-ui/lib/theme-chalk/index.css';\n+\n+Vue.use(VueRouter)\n+Vue.use(ElementUI);\n+\n+import connect from \"./connect\";\n+\n+Vue.config.productionTip = false\n+\n+const router = new VueRouter({\n+ routes: [\n+ { path: '/connect', component: connect, name: 'connect' },\n+ ]\n+})\n+\n+new Vue({\n+ el: '#app',\n+ components: { App },\n+ router,\n+ template: '<App/>'\n+})\n" }, { "change_type": "MODIFY", "old_path": "webpack.config.js", "new_path": "webpack.config.js", "diff": "@@ -35,16 +35,16 @@ module.exports = [\nentry: {\nquery: './src/vue/result/main.js',\nqueryDark: './src/vue/result/main-dark.js',\n- connect: './src/vue/connect/main.js',\n+ app: './src/vue/main.js',\ndiagram: './src/vue/diagram/main.js',\nstatus: './src/vue/status/main.js'\n},\nplugins: [\nnew VueLoaderPlugin(),\n+ new HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['app'], filename: 'webview/app.html' }),\nnew HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['query'], filename: 'webview/result.html' }),\nnew HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['queryDark'], filename: 'webview/result-dark.html' }),\nnew HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['diagram'], filename: 'webview/diagram.html' }),\n- new HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['connect'], filename: 'webview/connect.html' }),\nnew HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['status'], filename: 'webview/status.html' }),\n],\noutput: {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
extra connect page
141,908
07.08.2020 10:33:23
-28,800
b41485b2592c3e1c69b1509cda9c4a3f362eaa7b
merge diagram and connect
[ { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramGroup.ts", "new_path": "src/model/diagram/diagramGroup.ts", "diff": "@@ -14,12 +14,12 @@ import { Global } from \"../../common/global\";\nexport class DiagramGroup extends Node {\npublic openAdd() {\nViewManager.createWebviewPanel({\n- path: \"diagram\", title: \"new\",\n+ path: \"app\", title: \"new\",\niconPath: Global.getExtPath(\"resources\", \"icon\", \"diagram.svg\"),\nsplitView: false, eventHandler: (handler) => {\nhandler.on(\"init\", () => {\nhandler.emit('route', 'selector')\n- }).on(\"selector\", async () => {\n+ }).on(\"route-selector\", async () => {\nhandler.emit(\"selector-load\", await this.getTableInfos())\n}).on(\"save\", ({ name, data }) => {\nconst diagramPath = `diagram/${this.getConnectId()}_${this.database}/${name}.json`;\n" }, { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramNode.ts", "new_path": "src/model/diagram/diagramNode.ts", "diff": "@@ -28,13 +28,13 @@ export class DiagramNode extends Node {\npublic open() {\nconst content = JSON.parse(readFileSync(this.getFilePath(), 'utf8'));\nViewManager.createWebviewPanel({\n- path: \"diagram\", title: \"diagram\",\n+ path: \"app\", title: \"diagram\",\niconPath: Global.getExtPath(\"resources\", \"icon\", \"diagram-node.svg\"),\nsplitView: false, eventHandler: (handler) => {\nhandler.on(\"init\", () => {\ndelete content.class\nhandler.emit('route', 'diagram')\n- }).on(\"diagram\", () => {\n+ }).on(\"route-diagram\", () => {\nhandler.emit('load', { content, name: this.name })\n}).on(\"save\", ({ name, data }) => {\nunlinkSync(this.getFilePath())\n" }, { "change_type": "MODIFY", "old_path": "src/vue/connect/index.vue", "new_path": "src/vue/connect/index.vue", "diff": "@@ -153,6 +153,9 @@ export default {\n});\nvscodeEvent.emit(\"route-\" + this.$route.name);\n},\n+ destroyed(){\n+ vscodeEvent.destroy()\n+ },\nmethods: {\ntryConnect() {\nvscodeEvent.emit(\"connecting\", {\n" }, { "change_type": "DELETE", "old_path": "src/vue/connect/main.js", "new_path": null, "diff": "-import Vue from 'vue'\n-import App from './App'\n-import ElementUI from 'element-ui';\n-import 'element-ui/lib/theme-chalk/index.css';\n-Vue.use(ElementUI);\n-\n-Vue.config.productionTip = false\n-\n-/* eslint-disable no-new */\n-new Vue({\n- el: '#app',\n- components: { App },\n- template: '<App/>'\n-})\n" }, { "change_type": "DELETE", "old_path": "src/vue/diagram/App.vue", "new_path": null, "diff": "-<template>\n- <router-view></router-view>\n-</template>\n-\n-<script>\n-import { getVscodeEvent } from \"../util/vscode\";\n-\n-const vscodeEvent = getVscodeEvent();\n-\n-export default {\n- name: \"App\",\n- mounted() {\n- vscodeEvent.on(\"route\", path => {\n- if (this.$route.name == path) {\n- vscodeEvent.emit(this.$route.name);\n- } else {\n- this.$router.push(\"/\" + path);\n- }\n- });\n- vscodeEvent.emit(\"init\");\n- },\n- destroyed() {\n- vscodeEvent.destroy();\n- }\n-};\n-</script>\n-\n-<style>\n-</style>\n\\ No newline at end of file\n" }, { "change_type": "RENAME", "old_path": "src/vue/diagram/go.js", "new_path": "src/vue/diagram/Gojs/go.js", "diff": "" }, { "change_type": "MODIFY", "old_path": "src/vue/diagram/Gojs/index.vue", "new_path": "src/vue/diagram/Gojs/index.vue", "diff": "</template>\n<script>\n+import './go.js';\nimport { getVscodeEvent } from \"../../util/vscode\";\nlet vscodeEvent;\n@@ -29,7 +30,7 @@ export default {\n} else {\nvscodeEvent.on(\"load\", this.handler);\n}\n- vscodeEvent.emit(this.$route.name);\n+ vscodeEvent.emit(\"route-\" + this.$route.name);\n},\nmethods: {\nhandler(data) {\n" }, { "change_type": "MODIFY", "old_path": "src/vue/diagram/Selector/index.vue", "new_path": "src/vue/diagram/Selector/index.vue", "diff": "@@ -35,7 +35,7 @@ export default {\n});\nthis.nodeDataArray = nodeDataArray;\n});\n- vscodeEvent.emit(this.$route.name);\n+ vscodeEvent.emit(\"route-\" + this.$route.name);\n},\nmethods: {\nconfirm() {\n" }, { "change_type": "DELETE", "old_path": "src/vue/diagram/main.js", "new_path": null, "diff": "-import Vue from 'vue'\n-import App from './App'\n-import ElementUI from 'element-ui';\n-import VueRouter from 'vue-router'\n-\n-import 'element-ui/lib/theme-chalk/index.css';\n-import './go.js';\n-\n-Vue.use(VueRouter)\n-Vue.use(ElementUI);\n-\n-import Gojs from \"./Gojs\";\n-import Selector from \"./Selector\";\n-\n-Vue.config.productionTip = false\n-\n-const router = new VueRouter({\n- routes: [\n- { path: '/diagram', component: Gojs ,name:'diagram'},\n- { path: '/selector', component: Selector ,name:'selector'},\n- ]\n-})\n-\n-new Vue({\n- el: '#app',\n- components: { App },\n- router,\n- template: '<App/>'\n-})\n" }, { "change_type": "MODIFY", "old_path": "src/vue/main.js", "new_path": "src/vue/main.js", "diff": "@@ -8,13 +8,18 @@ import 'element-ui/lib/theme-chalk/index.css';\nVue.use(VueRouter)\nVue.use(ElementUI);\n+Vue.config.productionTip = false\n+\nimport connect from \"./connect\";\n+import Gojs from \"./diagram/Gojs\";\n+import Selector from \"./diagram/Selector\";\n-Vue.config.productionTip = false\nconst router = new VueRouter({\nroutes: [\n{ path: '/connect', component: connect, name: 'connect' },\n+ { path: '/diagram', component: Gojs ,name:'diagram'},\n+ { path: '/selector', component: Selector ,name:'selector'},\n]\n})\n" }, { "change_type": "MODIFY", "old_path": "webpack.config.js", "new_path": "webpack.config.js", "diff": "@@ -36,7 +36,6 @@ module.exports = [\nquery: './src/vue/result/main.js',\nqueryDark: './src/vue/result/main-dark.js',\napp: './src/vue/main.js',\n- diagram: './src/vue/diagram/main.js',\nstatus: './src/vue/status/main.js'\n},\nplugins: [\n@@ -44,7 +43,6 @@ module.exports = [\nnew HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['app'], filename: 'webview/app.html' }),\nnew HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['query'], filename: 'webview/result.html' }),\nnew HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['queryDark'], filename: 'webview/result-dark.html' }),\n- new HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['diagram'], filename: 'webview/diagram.html' }),\nnew HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['status'], filename: 'webview/status.html' }),\n],\noutput: {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
merge diagram and connect
141,908
07.08.2020 10:56:46
-28,800
1f0269152b40057180a631d64004064ae927a719
merge status and other
[ { "change_type": "MODIFY", "old_path": "src/view/status/abstractStatusService.ts", "new_path": "src/view/status/abstractStatusService.ts", "diff": "@@ -10,11 +10,14 @@ export abstract class AbstractStatusService implements StatusService {\npublic show(connectionNode: ConnectionNode): void | Promise<void> {\nViewManager.createWebviewPanel({\n- path: \"status\",\n+ path: \"app\",\nsplitView: false, title: \"Server Status\",\niconPath: Global.getExtPath(\"resources\", \"icon\", \"state.svg\"),\neventHandler: (handler) => {\n- handler.on(\"processList\", async () => {\n+ handler.on(\"init\",()=>{\n+ handler.emit('route', 'status')\n+ })\n+ .on(\"processList\", async () => {\nconst processList = await this.onProcessList(connectionNode)\nhandler.emit(\"processList\", { ...processList })\n}).on(\"dashBoard\", async () => {\n" }, { "change_type": "MODIFY", "old_path": "src/vue/connect/index.vue", "new_path": "src/vue/connect/index.vue", "diff": "@@ -167,7 +167,7 @@ export default {\n};\n</script>\n-<style>\n+<style scoped>\n.container {\nmargin: auto;\npadding-left: 24px;\n" }, { "change_type": "MODIFY", "old_path": "src/vue/diagram/Gojs/index.vue", "new_path": "src/vue/diagram/Gojs/index.vue", "diff": "@@ -208,5 +208,5 @@ export default {\n};\n</script>\n-<style>\n+<style scoped>\n</style>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/vue/diagram/Selector/index.vue", "new_path": "src/vue/diagram/Selector/index.vue", "diff": "@@ -60,7 +60,7 @@ export default {\n};\n</script>\n-<style >\n+<style scoped>\n.el-transfer-panel {\nwidth: 250px !important;\nheight: 700px !important;\n" }, { "change_type": "RENAME", "old_path": "src/vue/common.html", "new_path": "src/vue/index.html", "diff": "" }, { "change_type": "MODIFY", "old_path": "src/vue/main.js", "new_path": "src/vue/main.js", "diff": "@@ -11,6 +11,7 @@ Vue.use(ElementUI);\nVue.config.productionTip = false\nimport connect from \"./connect\";\n+import status from \"./status\";\nimport Gojs from \"./diagram/Gojs\";\nimport Selector from \"./diagram/Selector\";\n@@ -18,6 +19,7 @@ import Selector from \"./diagram/Selector\";\nconst router = new VueRouter({\nroutes: [\n{ path: '/connect', component: connect, name: 'connect' },\n+ { path: '/status', component: status, name: 'status' },\n{ path: '/diagram', component: Gojs ,name:'diagram'},\n{ path: '/selector', component: Selector ,name:'selector'},\n]\n" }, { "change_type": "RENAME", "old_path": "src/vue/status/App.vue", "new_path": "src/vue/status/index.vue", "diff": "<template>\n- <div id='app'>\n+ <div class='status-container'>\n<el-tabs v-model=\"activePanel\" @tab-click=\"changePannel\">\n<el-tab-pane label=\"dashBoard\" name=\"dashBoard\">\n<el-row style=\"height:45vh\">\n@@ -40,7 +40,7 @@ import { getVscodeEvent } from \"../util/vscode\";\nlet vscodeEvent;\nexport default {\n- name: \"App\",\n+ name: \"status\",\ndata() {\nreturn {\nactivePanel: \"dashBoard\",\n@@ -56,6 +56,9 @@ export default {\n}\n};\n},\n+ destroyed(){\n+ vscodeEvent.destroy()\n+ },\nmounted() {\nvscodeEvent = getVscodeEvent();\nfunction createChart(id, data) {\n@@ -158,10 +161,11 @@ export default {\n};\n</script>\n-<style>\n-body {\n+<style scoped>\n+.status-container {\n+ padding: 20px;\n/* background-color: var(--vscode-editor-background); */\n- background-color: #f7f7f7;\n+ background-color: #f7f7f7 !important;\nfont-family: \"Helvetica Neue\", Helvetica, \"PingFang SC\", \"Hiragino Sans GB\",\n\"Microsoft YaHei\", Arial, sans-serif;\n}\n" }, { "change_type": "DELETE", "old_path": "src/vue/status/main.js", "new_path": null, "diff": "-import Vue from 'vue'\n-import App from './App'\n-import ElementUI from 'element-ui';\n-import 'element-ui/lib/theme-chalk/index.css';\n-Vue.use(ElementUI);\n-\n-Vue.config.productionTip = false\n-\n-/* eslint-disable no-new */\n-new Vue({\n- el: '#app',\n- components: { App },\n- template: '<App/>'\n-})\n" }, { "change_type": "MODIFY", "old_path": "webpack.config.js", "new_path": "webpack.config.js", "diff": "@@ -33,17 +33,15 @@ module.exports = [\n},\n{\nentry: {\n- query: './src/vue/result/main.js',\n- queryDark: './src/vue/result/main-dark.js',\napp: './src/vue/main.js',\n- status: './src/vue/status/main.js'\n+ query: './src/vue/result/main.js',\n+ queryDark: './src/vue/result/main-dark.js'\n},\nplugins: [\nnew VueLoaderPlugin(),\n- new HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['app'], filename: 'webview/app.html' }),\n- new HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['query'], filename: 'webview/result.html' }),\n- new HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['queryDark'], filename: 'webview/result-dark.html' }),\n- new HtmlWebpackPlugin({ inject: true, template: './src/vue/common.html', chunks: ['status'], filename: 'webview/status.html' }),\n+ new HtmlWebpackPlugin({ inject: true, template: './src/vue/index.html', chunks: ['app'], filename: 'webview/app.html' }),\n+ new HtmlWebpackPlugin({ inject: true, template: './src/vue/index.html', chunks: ['query'], filename: 'webview/result.html' }),\n+ new HtmlWebpackPlugin({ inject: true, template: './src/vue/index.html', chunks: ['queryDark'], filename: 'webview/result-dark.html' }),\n],\noutput: {\npath: path.resolve(__dirname, 'out'),\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
merge status and other
141,908
07.08.2020 13:58:48
-28,800
6bb479abd2c80b746cb0d034af13f29d906757ca
init overview
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "},\n\"category\": \"MySQL\"\n},\n+ {\n+ \"command\": \"mysql.db.overview\",\n+ \"title\": \"Overview\",\n+ \"category\": \"MySQL\"\n+ },\n{\n\"command\": \"mysql.db.drop\",\n\"title\": \"Drop Database\",\n\"when\": \"view == github.cweijan.mysql && viewItem == database\",\n\"group\": \"3_mysql@1\"\n},\n+ {\n+ \"command\": \"mysql.db.overview\",\n+ \"when\": \"view == github.cweijan.mysql && viewItem == database\",\n+ \"group\": \"3_mysql@2\"\n+ },\n{\n\"command\": \"mysql.db.truncate\",\n\"when\": \"view == github.cweijan.mysql && viewItem == database\",\n\"mysqldump\": \"^3.1.0\",\n\"node-xlsx\": \"^0.15.0\",\n\"portfinder\": \"^1.0.26\",\n+ \"pretty-bytes\": \"^5.3.0\",\n\"sql-formatter\": \"^2.3.3\",\n\"tunnel-ssh\": \"^4.1.4\",\n\"vue\": \"^2.6.11\",\n" }, { "change_type": "MODIFY", "old_path": "src/extension.ts", "new_path": "src/extension.ts", "diff": "@@ -80,6 +80,9 @@ export function activate(context: vscode.ExtensionContext) {\n\"mysql.db.drop\": (databaseNode: DatabaseNode) => {\ndatabaseNode.dropDatatabase();\n},\n+ \"mysql.db.overview\": (databaseNode: DatabaseNode) => {\n+ databaseNode.openOverview();\n+ },\n\"mysql.changeTableName\": (tableNode: TableNode) => {\ntableNode.changeTableName();\n},\n" }, { "change_type": "MODIFY", "old_path": "src/model/database/databaseNode.ts", "new_path": "src/model/database/databaseNode.ts", "diff": "@@ -16,6 +16,8 @@ import { TriggerGroup } from \"../main/triggerGroup\";\nimport { ViewGroup } from \"../main/viewGroup\";\nimport { NodeUtil } from '../nodeUtil';\nimport { DiagramGroup } from \"../diagram/diagramGroup\";\n+import { OverviewService } from \"../../view/overview/overviewService\";\n+import { ServiceManager } from \"../../service/serviceManager\";\nexport class DatabaseNode extends Node implements CopyAble {\n@@ -42,6 +44,10 @@ export class DatabaseNode extends Node implements CopyAble {\nnew TriggerGroup(this.info)];\n}\n+ public openOverview() {\n+ ServiceManager.instance.overviewService.openOverview(this)\n+ }\n+\npublic dropDatatabase() {\nvscode.window.showInputBox({ prompt: `Are you want to drop database ${this.database} ? `, placeHolder: 'Input database name to confirm.' }).then(async (inputContent) => {\n" }, { "change_type": "MODIFY", "old_path": "src/service/serviceManager.ts", "new_path": "src/service/serviceManager.ts", "diff": "@@ -21,6 +21,7 @@ import { MysqlStatusService } from \"../view/status/mysqlStatusService\";\nimport { Global } from \"../common/global\";\nimport { ImportService } from \"./import/importService\";\nimport { MysqlImportService } from \"./import/mysqlImportService\";\n+import { OverviewService } from \"../view/overview/overviewService\";\nexport class ServiceManager {\n@@ -30,6 +31,7 @@ export class ServiceManager {\npublic historyService: HistoryRecorder;\npublic connectService: AbstractConnectService;\npublic settingService: SettingService;\n+ public overviewService: OverviewService;\npublic statusService: StatusService;\npublic importService: ImportService;\npublic dumpService: AbstractDumpService;\n@@ -82,6 +84,7 @@ export class ServiceManager {\nprivate initMysqlService() {\nthis.settingService = new MysqlSettingService();\n+ this.overviewService = new OverviewService();\nthis.dumpService = new MysqlDumpService();\nthis.connectService = new MysqlConnectService();\nthis.statusService = new MysqlStatusService()\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/view/overview/overviewService.ts", "diff": "+import { ViewManager } from \"../viewManager\";\n+import { Node } from \"../../model/interface/node\";\n+import { QueryUnit } from \"../../service/queryUnit\";\n+import { ConnectionManager } from \"../../service/connectionManager\";\n+\n+export class OverviewService {\n+\n+ public openOverview(node: Node) {\n+ ViewManager.createWebviewPanel({\n+ path: \"app\", splitView: false, title: \"overview\", singlePage: true,\n+ eventHandler: async (handler) => {\n+ handler.on(\"init\", () => {\n+ handler.emit(\"route\", 'overview')\n+ }).on(\"route-overview\", async () => {\n+ handler.emit(\"overview-data\", {\n+ ...node,\n+ infos: await QueryUnit.queryPromise(await ConnectionManager.getConnection(node), `select table_name, table_comment, auto_increment, create_time, update_time, engine, table_rows, data_length, index_length, table_collation, row_format from information_schema.TABLES where TABLE_SCHEMA = '${node.database}' and table_type = 'BASE TABLE'`)\n+ })\n+ })\n+ }\n+ })\n+ }\n+\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/vue/App.vue", "new_path": "src/vue/App.vue", "diff": "@@ -26,4 +26,7 @@ export default {\n</script>\n<style>\n+body{\n+ padding: 0;\n+}\n</style>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/vue/main.js", "new_path": "src/vue/main.js", "diff": "@@ -10,10 +10,11 @@ Vue.use(ElementUI);\nVue.config.productionTip = false\n-import connect from \"./connect\";\n-import status from \"./status\";\nimport Gojs from \"./diagram/Gojs\";\nimport Selector from \"./diagram/Selector\";\n+import connect from \"./connect\";\n+import status from \"./status\";\n+import overview from \"./overview\";\nconst router = new VueRouter({\n@@ -22,6 +23,7 @@ const router = new VueRouter({\n{ path: '/status', component: status, name: 'status' },\n{ path: '/diagram', component: Gojs, name: 'diagram' },\n{ path: '/selector', component: Selector, name: 'selector' },\n+ { path: '/overview', component: overview, name: 'overview' },\n]\n})\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/vue/overview/index.vue", "diff": "+<template>\n+ <div>\n+ <el-button type=\"primary\" @click=\"refresh\">refresh</el-button>\n+ <el-table :data=\"tableData\" stripe style=\"width: 100%\" :height=\"remainHeight\">\n+ <el-table-column align=\"center\" prop=\"table_name\" label=\"table_name\" ></el-table-column>\n+ <el-table-column align=\"center\" prop=\"table_comment\" label=\"table_comment\"></el-table-column>\n+ <el-table-column align=\"center\" prop=\"auto_increment\" label=\"auto_increment\" ></el-table-column>\n+ <el-table-column align=\"center\" prop=\"create_time\" label=\"create_time\" width=\"180\"></el-table-column>\n+ <el-table-column align=\"center\" prop=\"update_time\" label=\"update_time\" width=\"180\"></el-table-column>\n+ <el-table-column align=\"center\" prop=\"engine\" label=\"engine\"></el-table-column>\n+ <el-table-column align=\"center\" prop=\"table_rows\" label=\"table_rows\"></el-table-column>\n+ <el-table-column align=\"center\" prop=\"data_length\" label=\"data_length\">\n+ <template slot-scope=\"scope\">\n+ <span>{{prettyBytes(scope.row.data_length)}}</span>\n+ </template>\n+ </el-table-column>\n+ <el-table-column align=\"center\" prop=\"index_length\" label=\"index_length\">\n+ <template slot-scope=\"scope\">\n+ <span>{{prettyBytes(scope.row.index_length)}}</span>\n+ </template>\n+ </el-table-column>\n+ <el-table-column align=\"center\" prop=\"table_collation\" label=\"table_collation\"></el-table-column>\n+ <el-table-column align=\"center\" prop=\"row_format\" label=\"row_format\"></el-table-column>\n+ </el-table>\n+ </div>\n+</template>\n+\n+<script>\n+import { getVscodeEvent } from \"../util/vscode\";\n+const prettyBytes = require(\"pretty-bytes\");\n+let vscodeEvent;\n+\n+export default {\n+ data() {\n+ return {\n+ tableData: []\n+ };\n+ },\n+ destroyed() {\n+ vscodeEvent.destroy();\n+ },\n+ mounted() {\n+ vscodeEvent = getVscodeEvent();\n+ vscodeEvent.on(\"overview-data\", data => {\n+ console.log(data.infos);\n+ this.tableData = data.infos;\n+ });\n+ vscodeEvent.emit(\"route-\" + this.$route.name);\n+ },\n+ methods: {\n+ prettyBytes,\n+ refresh() {\n+ vscodeEvent.emit(\"route-\" + this.$route.name);\n+ }\n+ },\n+ computed: {\n+ remainHeight() {\n+ return window.outerHeight -130;\n+ }\n+ }\n+};\n+</script>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/vue/result/App.vue", "new_path": "src/vue/result/App.vue", "diff": "@@ -669,6 +669,7 @@ body {\nbackground-color: #f0f0f0;\nfont-family: \"Helvetica Neue\", Helvetica, \"PingFang SC\", \"Hiragino Sans GB\",\n\"Microsoft YaHei\", Arial, sans-serif;\n+ padding: 0;\n}\n#tool-panel * {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
init overview
141,908
07.08.2020 15:21:20
-28,800
d85b634019235f5b6d403f2a4464e47049467ace
fix id duplicate bug
[ { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.4.3\",\n+ \"version\": \"2.4.4\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" }, { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramGroup.ts", "new_path": "src/model/diagram/diagramGroup.ts", "diff": "@@ -34,7 +34,7 @@ export class DiagramGroup extends Node {\npublic iconPath = path.join(Constants.RES_PATH, \"icon/diagram.svg\")\nconstructor(readonly info: Node) {\nsuper(\"DIAGRAM\")\n- this.id = `${this.getConnectId()}_${info.database}_${ModelType.DIAGRAM_GROUP}`;\n+ // this.id = `${this.getConnectId()}_${info.database}_${ModelType.DIAGRAM_GROUP}`;\nthis.init(info)\n}\n" }, { "change_type": "MODIFY", "old_path": "src/model/diagram/diagramNode.ts", "new_path": "src/model/diagram/diagramNode.ts", "diff": "@@ -15,7 +15,7 @@ export class DiagramNode extends Node {\npublic iconPath = path.join(Constants.RES_PATH, \"icon/diagram-node.svg\")\nconstructor(public name: string, readonly info: Node) {\nsuper(name)\n- this.id = `${info.getConnectId()}_${info.database}_diragram_${name}`\n+ // this.id = `${info.getConnectId()}_${info.database}_diragram_${name}`\nthis.init(info)\nthis.collapsibleState = TreeItemCollapsibleState.None\nthis.command = {\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
fix id duplicate bug
141,908
10.08.2020 20:40:56
-28,800
7d91b023d532742eb247407e6406b3db8681f3d9
update to 2.4.5
[ { "change_type": "MODIFY", "old_path": "CHANGELOG.md", "new_path": "CHANGELOG.md", "diff": "# CHANGELOG\n+## 2.4.5 - 2020/8/10\n+- Support big number type.\n+\n## 2.4.3 - 2020/8/7\n- Add database overview.\n- Add diagram design.\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"name\": \"vscode-mysql-client2\",\n\"displayName\": \"MySQL\",\n\"description\": \"MySQL Client for vscode\",\n- \"version\": \"2.4.4\",\n+ \"version\": \"2.4.5\",\n\"publisher\": \"cweijan\",\n\"icon\": \"resources/logo.png\",\n\"engines\": {\n" }, { "change_type": "MODIFY", "old_path": "src/service/connectionManager.ts", "new_path": "src/service/connectionManager.ts", "diff": "@@ -111,7 +111,7 @@ export class ConnectionManager {\npublic static createConnection(connectionOptions: Node): mysql.Connection {\n- const newConnectionOptions = { ...connectionOptions, useConnectionPooling: true, multipleStatements: true, dateStrings: true } as any as mysql.ConnectionConfig;\n+ const newConnectionOptions = { ...connectionOptions, useConnectionPooling: true, multipleStatements: true, dateStrings: true, supportBigNumbers: true, bigNumberStrings: true } as any as mysql.ConnectionConfig;\nif (connectionOptions.certPath && fs.existsSync(connectionOptions.certPath)) {\nnewConnectionOptions.ssl = {\nca: fs.readFileSync(connectionOptions.certPath),\n" } ]
TypeScript
MIT License
cweijan/vscode-database-client
update to 2.4.5