Compare commits

..

301 Commits

Author SHA1 Message Date
superman 7b975aafcd Merge pull request #8880 in DEC/decision-webui-dcm from final/10.0 to release/10.0 8 months ago
superman 237c95efbf Merge pull request #8879 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 8 months ago
superman 11007e3f36 Merge pull request #8878 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 8 months ago
superman 71979b03a8 Merge pull request #8863 in DEC/decision-webui-dcm from final/10.0 to release/10.0 8 months ago
superman 1f2449fc65 Merge pull request #8860 in DEC/decision-webui-dcm from release/10.0 to final/10.0 8 months ago
superman af37d9ea6f Merge pull request #8859 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 8 months ago
superman e2c1b6d8ab Merge pull request #8762 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 9 months ago
superman 1d4af24341 Merge pull request #8761 in DEC/decision-webui-dcm from final/10.0 to release/10.0 9 months ago
superman a08d475729 Merge pull request #8758 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 9 months ago
superman 0137e66841 Merge pull request #8752 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 10 months ago
superman fd4699df2b Merge pull request #8725 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 11 months ago
superman f0fb49215d Merge pull request #8724 in DEC/decision-webui-dcm from final/10.0 to release/10.0 11 months ago
superman d04855fb19 Merge pull request #8723 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 11 months ago
superman b75f302dff Merge pull request #8716 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 11 months ago
superman 03d7174f20 Merge pull request #8664 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 11 months ago
superman 631b9d67c8 Merge pull request #8663 in DEC/decision-webui-dcm from final/10.0 to release/10.0 11 months ago
superman 6257cdd927 Merge pull request #8661 in DEC/decision-webui-dcm from release/10.0 to final/10.0 11 months ago
superman 4d92a75a50 Merge pull request #8660 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 11 months ago
superman 40cf0a9fc5 Merge pull request #8568 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 12 months ago
superman 1f7b36bd62 Merge pull request #8567 in DEC/decision-webui-dcm from final/10.0 to release/10.0 12 months ago
superman a3885c0730 Merge pull request #8566 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 12 months ago
superman 243b7ebf6e Merge pull request #8563 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 12 months ago
superman 6dc64e21ca Merge pull request #8541 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 12 months ago
superman b729af00aa Merge pull request #8540 in DEC/decision-webui-dcm from final/10.0 to release/10.0 12 months ago
superman 435964f5b0 Merge pull request #8538 in DEC/decision-webui-dcm from release/10.0 to final/10.0 12 months ago
superman 08be58a1bf Merge pull request #8537 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 12 months ago
superman 083bc8bb18 Merge pull request #8364 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 1 year ago
superman 1ad5f9dd7c Merge pull request #8363 in DEC/decision-webui-dcm from final/10.0 to release/10.0 1 year ago
superman 5256ed8a41 Merge pull request #8362 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 1 year ago
superman 3308bc4f7f Merge pull request #8361 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 1 year ago
superman 2d6f0eecf1 Merge pull request #8332 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 1 year ago
superman 7db8016228 Merge pull request #8331 in DEC/decision-webui-dcm from final/10.0 to release/10.0 1 year ago
superman 115630bdca Merge pull request #8329 in DEC/decision-webui-dcm from release/10.0 to final/10.0 1 year ago
superman d37bed5c44 Merge pull request #8328 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 1 year ago
superman 021702f638 Merge pull request #8184 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 1 year ago
superman 371de9aafb Merge pull request #8183 in DEC/decision-webui-dcm from final/10.0 to release/10.0 1 year ago
superman fa76ce0ce9 Merge pull request #8182 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 1 year ago
superman 51290ef9b7 Merge pull request #8181 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 1 year ago
superman cd6a4d2127 Merge pull request #8159 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 1 year ago
superman 888b550a2e Merge pull request #8158 in DEC/decision-webui-dcm from final/10.0 to release/10.0 1 year ago
superman 4fa9ed6ee8 Merge pull request #8156 in DEC/decision-webui-dcm from release/10.0 to final/10.0 1 year ago
superman 25dd01faf8 Merge pull request #8155 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 1 year ago
superman 43943f78e6 Merge pull request #8010 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 1 year ago
superman 634b4344b6 Merge pull request #8009 in DEC/decision-webui-dcm from final/10.0 to release/10.0 1 year ago
superman a32aa30c67 Merge pull request #8008 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 1 year ago
superman c6182c5ba1 Merge pull request #8007 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 1 year ago
superman 750b7a8e2e Merge pull request #7977 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 1 year ago
superman 4cc646bbfb Merge pull request #7976 in DEC/decision-webui-dcm from final/10.0 to release/10.0 1 year ago
superman e7e9d55d15 Merge pull request #7974 in DEC/decision-webui-dcm from release/10.0 to final/10.0 1 year ago
superman b3a179e128 Merge pull request #7973 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 1 year ago
superman 0b1ac1834f Merge pull request #7908 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 1 year ago
superman 457f7fbdf9 Merge pull request #7907 in DEC/decision-webui-dcm from final/10.0 to release/10.0 1 year ago
superman 4e90158678 Merge pull request #7906 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 1 year ago
superman 36951237bb Merge pull request #7902 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 1 year ago
superman a0dba40c06 Merge pull request #7888 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 1 year ago
superman 8ad9757d88 Merge pull request #7887 in DEC/decision-webui-dcm from final/10.0 to release/10.0 1 year ago
superman 74d9c328d0 Merge pull request #7885 in DEC/decision-webui-dcm from release/10.0 to final/10.0 1 year ago
superman 070bdef10a Merge pull request #7884 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 1 year ago
superman 1fa751f291 Merge pull request #7762 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 1 year ago
superman 884c35a71a Merge pull request #7761 in DEC/decision-webui-dcm from final/10.0 to release/10.0 1 year ago
superman 513d2c7d49 Merge pull request #7760 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 1 year ago
Cauchy.Ke-柯小龙 07ae3772db Pull request #7758: fix:锁依赖版本,修复打包问题 1 year ago
Cauchy.Ke 3789cd0724 fix:锁依赖版本,修复打包问题 1 year ago
Austin.Duan-段嗣跃 bd315ada58 Pull request #7757: 无JIRA任务,修复打包问题 1 year ago
Austin.Duan 3626aae9b5 无JIRA任务,修复打包问题 1 year ago
superman 63fce0ed61 Merge pull request #7756 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 1 year ago
superman 3204dae279 Merge pull request #7710 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 1 year ago
superman f5e5b2f2ad Merge pull request #7709 in DEC/decision-webui-dcm from final/10.0 to release/10.0 1 year ago
superman 2734362792 Merge pull request #7707 in DEC/decision-webui-dcm from release/10.0 to final/10.0 1 year ago
superman cfdf035283 Merge pull request #7706 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 1 year ago
superman f6dfb79098 Merge pull request #7648 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 1 year ago
superman 923ffcf1b0 Merge pull request #7647 in DEC/decision-webui-dcm from final/10.0 to release/10.0 1 year ago
superman 63a0ef62ae Merge pull request #7646 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 1 year ago
superman 5282c3c8df Merge pull request #7640 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 1 year ago
superman f63da6dadc Merge pull request #7612 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 1 year ago
superman fce2051711 Merge pull request #7611 in DEC/decision-webui-dcm from final/10.0 to release/10.0 1 year ago
superman 8e5d9fab31 Merge pull request #7609 in DEC/decision-webui-dcm from release/10.0 to final/10.0 1 year ago
superman e18c7d02a9 Merge pull request #7608 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 1 year ago
superman 4607d5dc35 Merge pull request #7533 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 81192032d5 Merge pull request #7532 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman e82190466a Merge pull request #7531 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman eb111f27ec Merge pull request #7529 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 5fa10c2b51 Merge pull request #7494 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 969e14d811 Merge pull request #7493 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 57293414b9 Merge pull request #7491 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman 2d60fd04ff Merge pull request #7490 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
superman 20d2f1f0fb Merge pull request #7305 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 36484cc153 Merge pull request #7304 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 796a25b7f2 Merge pull request #7303 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman 39014ec166 Merge pull request #7302 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 9c8aae0983 Merge pull request #7263 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman c8b7df658b Merge pull request #7262 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman d1f83e5453 Merge pull request #7260 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman a2061e02b3 Merge pull request #7259 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
superman ce5129e629 Merge pull request #7145 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman cdfa061c44 Merge pull request #7144 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 1a41e8afbf Merge pull request #7143 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman 51a9d3795d Merge pull request #7142 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 3eb92c14fb Merge pull request #7104 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 19d1ea14d7 Merge pull request #7103 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 74e76d4196 Merge pull request #7101 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman b9e0f93135 Merge pull request #7100 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
superman 1d22870b9d Merge pull request #6944 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 223a51d746 Merge pull request #6943 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 8f7893bdaa Merge pull request #6942 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman 106c8a031c Merge pull request #6941 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 05c6fc64e2 Merge pull request #6916 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman f7590b9598 Merge pull request #6915 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 538c0f2eae Merge pull request #6907 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman d8158a02bb Merge pull request #6906 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
superman 7fa05582c7 Merge pull request #6835 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman ffc8f7b44e Merge pull request #6834 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 71482284f7 Merge pull request #6833 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman f80a08835d Merge pull request #6831 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 56e4ef8f38 Merge pull request #6740 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman b0907dba5a Merge pull request #6739 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 0cf7976d15 Merge pull request #6738 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman fcc843036f Merge pull request #6736 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 6d02df3045 Merge pull request #6688 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 8eb9769b49 Merge pull request #6687 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 0374764c6d Merge pull request #6685 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman e4958abbd0 Merge pull request #6684 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
superman d876e7f939 Merge pull request #6492 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 2b4c3e504f Merge pull request #6491 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman cbc7923968 Merge pull request #6490 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman ff582356b3 Merge pull request #6489 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 60e393b825 Merge pull request #6473 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 26ed0d515b Merge pull request #6472 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman b28fe437ca Merge pull request #6470 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman 9f356e9c50 Merge pull request #6469 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
superman bdba89def3 Merge pull request #6340 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman b9b892159f Merge pull request #6339 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 983cce6f7a Merge pull request #6338 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman f37195497a Merge pull request #6336 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 6835b05db7 Merge pull request #6292 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 27c77b0d61 Merge pull request #6291 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 3d4aa516ad Merge pull request #6288 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman 4ccb735360 Merge pull request #6158 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman c565adc486 Merge pull request #6157 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman ac0b5e4d24 Merge pull request #6156 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman 4091c41216 Merge pull request #6155 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 2ea85d24fd Merge pull request #6129 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman d23c948c26 Merge pull request #6128 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman b370e1ef15 Merge pull request #6125 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman 67d7466ab9 Merge pull request #6124 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
superman dd6f4044a6 Merge pull request #6099 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
Kevin.King-王凯壮 5ddf614560 Pull request #6095: REPORT-77480 fix:SSRF漏洞处理10.0版本 2 years ago
Kevin.King 1a692e797d REPORT-77480 fix:SSRF漏洞处理 2 years ago
Kevin.King 9a2301a2d4 REPORT-77480 fix:SSRF漏洞处理 2 years ago
superman b9953b4a57 Merge pull request #6079 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman c2e0e7c315 Merge pull request #6078 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 9608658cf3 Merge pull request #6077 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman ab08aee745 Merge pull request #6076 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
lidongy-李东原 036ab7c420 Pull request #6064: BI-115167 StarRocks类型数据连接传一份到10.0 2 years ago
lidongy 113be29b5a BI-115167 传一份到10.0 2 years ago
superman 0e0de8a44e Merge pull request #5994 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 1b1386e768 Merge pull request #5993 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 7f7c657ef0 Merge pull request #5992 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman 509dce8634 Merge pull request #5991 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 9d941d4752 Merge pull request #5955 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 192d0f1ea7 Merge pull request #5954 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 1a419e850f Merge pull request #5952 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman aa856c22ce Merge pull request #5951 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
superman 59c88f509a Merge pull request #5825 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman e4bd8579cc Merge pull request #5824 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 835d390e0f Merge pull request #5823 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman 1dd8e44cea Merge pull request #5822 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman ae50373a9e Merge pull request #5808 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman d36004d602 Merge pull request #5807 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 89f2e538a1 Merge pull request #5805 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman fe7d94218b Merge pull request #5804 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
superman 53b1f53df3 Merge pull request #5777 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
Aries.Lsy 3cf2570797 Pull request #5773: BI-112953 fix:jdbcResolve正则匹配trino 2 years ago
Aries.lsy 10175ebf04 BI-112953 fix:jdbcResolve正则匹配trino 2 years ago
superman 01cc513199 Merge pull request #5757 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 8d25853607 Merge pull request #5756 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 7140f7b272 Merge pull request #5755 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman fa2a6e1430 Merge pull request #5749 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 9a32d7760c Merge pull request #5742 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 511d35d46d Merge pull request #5741 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 67020b7045 Merge pull request #5740 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
Aries.Lsy 7c784d0160 Pull request #5739: BI-108526 BI-111537 feat:添加trino tdsql数据连接 2 years ago
Aries.lsy 65f48022e3 BI-108526 BI-111537 feat:添加trino tdsql数据连接 2 years ago
superman 3b54b1335f Merge pull request #5737 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 13ba866422 Merge pull request #5714 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 3a18f06fba Merge pull request #5713 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 253e9ef25f Merge pull request #5709 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman c3d17b31d7 Merge pull request #5708 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
Aries.Lsy 539db173ee Pull request #5706: REPORT-78047 fix:greenplum连接url自动拼写添加DatabaseName= 2 years ago
Aries.lsy 73df01d70c REPORT-78047 fix:greenplum连接url自动拼写添加DatabaseName= 2 years ago
superman dd7ab65c83 Merge pull request #5598 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 46e696f1b0 Merge pull request #5597 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 492ca6de6e Merge pull request #5596 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman 0e8e60c6ea Merge pull request #5594 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 1cc72982e7 Merge pull request #5551 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman da38744180 Merge pull request #5550 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 2b1175ebda Merge pull request #5546 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman 3573c5f7ef Merge pull request #5545 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
superman 60ed51c891 Merge pull request #5538 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman ef8470c7a0 Merge pull request #5537 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman c94b32c715 Merge pull request #5534 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman d73b4349ed Merge pull request #5533 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
superman 68b644e707 Merge pull request #5503 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 322382ebdb Merge pull request #5502 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 9216c94185 Merge pull request #5501 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman 479387e37c Merge pull request #5495 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman 17427c2f09 Merge pull request #5459 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 66ec554eb8 Merge pull request #5458 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 46e0f73cda Merge pull request #5454 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman 17529d0c1f Merge pull request #5453 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
superman 97d7523c7d Merge pull request #5402 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 8ee8cff88b Merge pull request #5401 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman 3184f78887 Merge pull request #5400 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman edc0239032 Merge pull request #5399 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman be5f831ad7 Merge pull request #5355 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman 44350b97b0 Merge pull request #5354 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman f2593249e7 Merge pull request #5351 in DEC/decision-webui-dcm from release/10.0 to final/10.0 2 years ago
superman 5b677a0b05 Merge pull request #5350 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 2 years ago
superman 2f212dc34e Merge pull request #5251 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 2 years ago
superman c77ed41d84 Merge pull request #5250 in DEC/decision-webui-dcm from final/10.0 to release/10.0 2 years ago
superman e5a3d57d5d Merge pull request #5249 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 2 years ago
superman 3b1b68a365 Merge pull request #5239 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 2 years ago
superman a40e7ecac1 Merge pull request #5219 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman f31d9e3f6a Merge pull request #5218 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman 947454ed76 Merge pull request #5214 in DEC/decision-webui-dcm from release/10.0 to final/10.0 3 years ago
superman df920c8fa5 Merge pull request #5213 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 3 years ago
superman 6a86956e2c Merge pull request #5169 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
Cauchy.Ke 55bc265ebf Pull request #5166: REPORT-72078 fix:【10.0】修复Informix类型连接的URL转换问题 3 years ago
Cauchy.Ke 274e3d2142 REPORT-72078 fix:修复Informix类型连接的URL转换问题 3 years ago
superman 0bc2f9a1e2 Merge pull request #5129 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman 813c4b39bd Merge pull request #5128 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman abf27e0aee Merge pull request #5127 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 3 years ago
superman 90c9d5bfe1 Merge pull request #5124 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 3 years ago
superman d293085be5 Merge pull request #5086 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman 5ebadb61f6 Merge pull request #5085 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman 4be4303838 Merge pull request #5083 in DEC/decision-webui-dcm from release/10.0 to final/10.0 3 years ago
superman 1c7f525615 Merge pull request #5082 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 3 years ago
superman b908665cf5 Merge pull request #5071 in DEC/decision-webui-dcm from release/10.0 to final/10.0 3 years ago
superman adc578aabf Merge pull request #5074 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman 6c66dd63a3 Merge pull request #5070 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 3 years ago
superman 3ddc00d932 Merge pull request #5014 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman 475f3361a2 Merge pull request #5013 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman 1759574fbf Merge pull request #5012 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 3 years ago
superman 1a217658f5 Merge pull request #5010 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 3 years ago
superman fb5bf32865 Merge pull request #4929 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman 301c90997f Merge pull request #4928 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman 70e2ec0c54 Merge pull request #4927 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 3 years ago
superman 7ea907eaf7 Merge pull request #4925 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 3 years ago
superman 6b415c34d6 Merge pull request #4895 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman 829605fc8d Merge pull request #4894 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman c2a0b89c26 Merge pull request #4891 in DEC/decision-webui-dcm from release/10.0 to final/10.0 3 years ago
superman 4d302b4d55 Merge pull request #4890 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 3 years ago
superman 602e18c413 Merge pull request #4843 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman 4fd7b3c4ec Merge pull request #4842 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman 387a4560de Merge pull request #4841 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 3 years ago
superman ee695a5244 Merge pull request #4840 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 3 years ago
superman a8014846ff Merge pull request #4808 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman 3f7d04aee8 Merge pull request #4807 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman 69400a7adb Merge pull request #4804 in DEC/decision-webui-dcm from release/10.0 to final/10.0 3 years ago
superman 1533ba30ed Merge pull request #4803 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 3 years ago
superman 7fc4ba93db Merge pull request #4706 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman fcae560189 Merge pull request #4705 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman a2dfccaeb6 Merge pull request #4704 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 3 years ago
superman 1a2e031246 Merge pull request #4703 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 3 years ago
superman 731a4abeaf Merge pull request #4636 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman fb46ab33f0 Merge pull request #4635 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman 2c75cf6584 Merge pull request #4634 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 3 years ago
superman 80e1f9edb2 Merge pull request #4632 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 3 years ago
superman cc0b2b6bf7 Merge pull request #4594 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman cafa78d5ea Merge pull request #4593 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman 370dfcf3e6 Merge pull request #4590 in DEC/decision-webui-dcm from release/10.0 to final/10.0 3 years ago
superman c3579b8751 Merge pull request #4589 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 3 years ago
superman 12144d97e2 Merge pull request #4483 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman 887a0991bd Merge pull request #4482 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman 4343477e19 Merge pull request #4481 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 3 years ago
superman 86c123eefc Merge pull request #4478 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 3 years ago
superman 5249f646b2 Merge pull request #4382 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman f9ec95c3c8 Merge pull request #4381 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman 4963d2ccdc Merge pull request #4380 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 3 years ago
superman cd88d217b1 Merge pull request #4378 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 3 years ago
superman 3adb90e015 Merge pull request #4372 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman 543413f6d9 Merge pull request #4371 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman b52daaa0fd Merge pull request #4370 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 3 years ago
superman 93d8636221 Merge pull request #4369 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 3 years ago
superman 796749d980 Merge pull request #4355 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman d0c0221f29 Merge pull request #4354 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman eea6bdab04 Merge pull request #4353 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 3 years ago
superman 2f91541aed Merge pull request #4352 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 3 years ago
superman 229bbd7c5b Merge pull request #4313 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman 826f312495 Merge pull request #4312 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman ab387fac07 Merge pull request #4310 in DEC/decision-webui-dcm from release/10.0 to final/10.0 3 years ago
superman 5ee901acaf Merge pull request #4309 in DEC/decision-webui-dcm from bugfix/10.0 to release/10.0 3 years ago
superman 12030f0885 Merge pull request #4141 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman f28f63e82f Merge pull request #4140 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman 6e69d326b3 Merge pull request #4139 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 3 years ago
superman cac29926b6 Merge pull request #4138 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 3 years ago
superman 6bd505f1d3 Merge pull request #4099 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
superman 36d8310eeb Merge pull request #4098 in DEC/decision-webui-dcm from final/10.0 to release/10.0 3 years ago
superman 9ab54787ce Merge pull request #4097 in DEC/decision-webui-dcm from persist/10.0 to final/10.0 3 years ago
superman 7ae8feb2ca Merge pull request #4096 in DEC/decision-webui-dcm from final/10.0 to persist/10.0 3 years ago
superman 4c8bba50ff Merge pull request #4048 in DEC/decision-webui-dcm from release/10.0 to bugfix/10.0 3 years ago
  1. 5
      .eslintrc
  2. 165
      README.md
  3. 14
      babel.config.js
  4. 20
      i18n/zh_cn.properties
  5. 12
      package.json
  6. 16
      private/i18n.ts
  7. 3
      src/modules/app.model.ts
  8. 125
      src/modules/app.provider.ts
  9. 50
      src/modules/app.service.ts
  10. 34
      src/modules/app.ts
  11. 11
      src/modules/app.typings.d.ts
  12. 6
      src/modules/components/collapse/collapse.ts
  13. 68
      src/modules/components/file_chooser/file_chooser.model.ts
  14. 183
      src/modules/components/file_chooser/file_chooser.ts
  15. 13
      src/modules/components/file_upload/file_upload.less
  16. 35
      src/modules/components/file_upload/file_upload.model.ts
  17. 327
      src/modules/components/file_upload/file_upload.ts
  18. 36
      src/modules/components/test_status/test_status.ts
  19. 10
      src/modules/components/test_status/tip_icon/tip_fail.ts
  20. 120
      src/modules/components/text_checker/text_checker.ts
  21. 41
      src/modules/components/tips_combo/tips_combo.ts
  22. 81
      src/modules/constants/constant.ts
  23. 52
      src/modules/core/checkIllegalStrings/checkIllegalStrings.ts
  24. 15
      src/modules/core/checkIllegalStrings/constant.ts
  25. 1
      src/modules/core/index.ts
  26. 17
      src/modules/crud/api.ts
  27. 6
      src/modules/crud/crud.service.ts
  28. 245
      src/modules/crud/crud.typings.d.ts
  29. 48
      src/modules/crud/decision.api.ts
  30. 27
      src/modules/crud/design.api.ts
  31. 24
      src/modules/pages/__point__/connect.point.ts
  32. 9
      src/modules/pages/connection/connection.model.ts
  33. 84
      src/modules/pages/connection/connection.ts
  34. 600
      src/modules/pages/connection/connection_jdbc/connection_jdbc.ts
  35. 1
      src/modules/pages/connection/list/list.constant.ts
  36. 34
      src/modules/pages/connection/list/list.model.ts
  37. 2
      src/modules/pages/connection/list/list.ts
  38. 3
      src/modules/pages/connection/list/list_item/list_item.model.ts
  39. 33
      src/modules/pages/connection/list/list_item/list_item.ts
  40. 17
      src/modules/pages/database/database.constant.ts
  41. 23
      src/modules/pages/database/database.model.ts
  42. 46
      src/modules/pages/database/database.ts
  43. 7
      src/modules/pages/database/database_type/database_type.model.ts
  44. 4
      src/modules/pages/database/database_type/database_type.ts
  45. 17
      src/modules/pages/maintain/components/driverselector/driverselector.model.ts
  46. 32
      src/modules/pages/maintain/components/driverselector/driverselector.ts
  47. 18
      src/modules/pages/maintain/components/form_item/form_item.ts
  48. 2755
      src/modules/pages/maintain/forms/components/form.jdbc.ts
  49. 4
      src/modules/pages/maintain/forms/components/form.plugin.ts
  50. 5
      src/modules/pages/maintain/forms/form.model.ts
  51. 58
      src/modules/pages/maintain/forms/form.server.ts
  52. 109
      src/modules/pages/maintain/forms/form.ts
  53. 12
      src/modules/pages/maintain/maintain.ts
  54. 96
      src/modules/pages/setting/setting.ts
  55. 11
      src/modules/title/title.ts
  56. 5
      src/modules/title/title_database/title_datebase.ts
  57. 3
      src/modules/title/title_maintain/title_maintain.model.ts
  58. 14
      src/modules/title/title_maintain/title_maintain.ts
  59. 28
      tsconfig.json
  60. 24
      types/globals.d.ts
  61. 9
      types/request.d.ts

5
.eslintrc

@ -30,8 +30,7 @@
"no-use-before-define": [
"error",
{
"functions": false,
"classes ": false
"functions": false
}
],
"new-cap": [
@ -180,7 +179,7 @@
"array-bracket-spacing": ["error", "never"], // 数组紧贴括号部分不允许包含空格
"object-curly-spacing": ["error", "always"], // 对象紧贴花括号部分不允许包含空格
"no-regex-spaces": "error", // 禁止正则表达式字面量中出现多个空格
// "no-multi-spaces": "error", // 禁止出现多个空格而且不是用来作缩进的
"no-multi-spaces": "error", // 禁止出现多个空格而且不是用来作缩进的
"block-spacing": ["error", "never"], // 单行代码块中紧贴括号部分不允许包含空格
"computed-property-spacing": ["error", "never"], // 禁止括号和其内部值之间的空格
"no-trailing-spaces": [

165
README.md

@ -7,7 +7,7 @@
## 开始
安装依赖
```
yarn install
yarn
```
开始开发
@ -15,107 +15,8 @@ yarn install
yarn dev
```
## 决策平台开发:
### A.项目运行
#### 1. 工程`decision-webui-dev`添加代理(可跳过)
```js
webpack/webpack.config
"/plugin/dcm": {
pathRewrite: { "^/plugin/dcm": "" },
target: "http://localhost:10002",
},
```
#### 2. 工程`decision-webui-dev`引入
fr环境:`templates/bundle.report.html` bi环境:`templates/bundle.bi.html`
```html
// css 文件:
<head>
<link rel="stylesheet" type="text/css" href="/plugin/dcm/show.dev.css" />
<link rel="stylesheet" type="text/css" href="http://localhost:10002/show.dev.css" />
</head>
// js 文件
<script type="text/javascript" src="/plugin/dcm/show.dev.js"></script>
```
若未设1,将`/plugin/dcm`替换成`http://localhost:10002`亦可
#### 3. 启动工程[decision-webui-dev]以及数据连接[desicion-webui-dcm]工程
#### 4. 此时工程`decision-webui-dev`的`http://localhost:9002/#management/connnection`数据连接模块已替换成该工程
### B.插件形式添加数据连接-数据库
#### 1. 以多版本的tdsql为例 单一版本数据库不需drivers,versions,hasSchemas
```js
BI.config("dec.connection.provider.datebase", function (provider) {
BI.isFunction(provider.registerJdbcDatabase) && provider.registerJdbcDatabase({
text: 'TDSQL', // 数据库名称
databaseType: 'tdsql', // 数据库key
driver: 'org.postgresql.Driver', // 默认驱动
drivers: {
"pgsql": ["org.postgresql.Driver"],
"mysql": ["com.mysql.jdbc.Driver"]
}, // 驱动可选项,version: array[driver],[0]为该版本的默认驱动
versions: ["pgsql", "mysql"], // array[version]
urls: {
"org.postgresql.Driver": "jdbc:postgresql://hostname:port/database?finedbType=tdsql-pgsql",
"com.mysql.jdbc.Driver": "jdbc:mysql://hostname:port/database?finedbType=tdsql-mysql"
}, // urlkey : url 一个驱动对应一个url
url: 'jdbc:postgresql://hostname:port/database?finedbType=tdsql-pgsql',
commonly: false,
internal: true,
type: 'jdbc', 数据库类型
hasSchema: true, // 默认是否支持模式
hasSchemas: {
"pgsql": true,
"mysql": false,
},是否支持模式 version: boolean
kerberos: false, // 是否添加kerberos认证方式
}, function (url) {
var result = url.match(/^jdbc:(mysql|postgresql):\/\/([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?\/([0-9a-zA-Z_\\.]+)(.*)finedbType=([^&]+)(|(&.*))/i); // 匹配正则
if (result) {
return {
host: result[2], //主机
port: result[4] === "port" ? "" : result[4], // 端口
databaseName: result[5], // 数据库名称
version: result[7].split('-')[1] ?? "pgsql", // 版本 单版本不要返回这个
};
}
//适配原先tbase的url
result = url.match(/^jdbc:postgresql:\/\/([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?\/([0-9a-zA-Z_\\.]+)(.*)/i);
if (result) {
return {
host: result[1],
port: result[3] === "port" ? "" : result[3],
databaseName: result[4],
version: "pgsql",
};
}
});
});
```
### C 工程开发
#### 1. 图片资源添加
工程`decision-webui-dev`
decision-webui/dist/images/1x/icon/database
decision-webui/dist/images/2x/icon/database
#### 2. 国际化添加
工程`decision-webui-dev`
decision-i18n/decision-main-i18n/src/main/resources/com/fr/decision/web/i18n
#### 3. 版本控制
版本和平台保持一致
## 接口文档:
### A 增加数据连接类型
#### 1. 增加数据连接类型
### 增加数据连接类型
使用`BI.config`,ConstantName名称为`dec.constant.database.conf.connect.types`,值为连接的名称
例如增加`Redis`的连接:
@ -129,25 +30,25 @@ BI.config(ConstantPluginTyps, (datas: string[]) => [...datas, {
}]);
```
#### 2. 数据连接填写页面
### 数据连接填写页面
edit属性值为填写组件shortcut的名称
#### 3. 数据连接展示页面
### 数据连接展示页面
show属性值为组件shortcut的名称
#### 4. 示例
```js
### 示例
```
const DataBaseConfigProvider = 'dec.connection.provider.datebase';
const RedisShowName = 'dec.dcm.connection.plugin.redis.show';
const RedisEditName = 'dec.dcm.connection.plugin.redis.edit';
BI.config(DataBaseConfigProvider, function (provider) {
provider.registerDatabaseType([{
provider.registerDatabaseType({
text: "Redis",
databaseType: "Redis",
edit: "dec.dcm.connection.plugin.demo.edit",
show: "dec.dcm.connection.plugin.demo.show",
}]);
});
});
const RedisShow = BI.inherit(BI.Widget, {
@ -215,7 +116,7 @@ const RedisShow = BI.inherit(BI.Widget, {
],
},
],
},
};
},
});
BI.shortcut(RedisShowName, RedisShow);
@ -310,55 +211,7 @@ const RedisEdit = BI.inherit(BI.Widget, {
password: this.password.getValue(),
};
},
//可以触发组件的数据save方法,不需要则可不写
async save() {
let result = false;
await Promise.resolve().then(() => {result = true});
//要求返回是否成功的boolean变量
return result;
},
});
BI.shortcut(RedisEditName, RedisEdit);
```
### B 添加数据连接实例
#### 1. 增加数据连接
```js
BI.config('dec.constant.connection.list', function (value) {
const result = [{
"connectionType": "Redis",//和databaseType一致
"connectionName": "CHART",//类似于id,唯一性
"pluginConnection": true,//表示是外来添加的插件
"connectionData": {
//表单保存数据
},
"connectionId": null,
}];
return value.concat(result);
})
```
### C 添加数据连接类型分类
#### 1. 添加分类DEMO
```js
BI.config('dec.constant.database.filter.type', (value) => {
value.push({
text:"DEMO",
value:"DEMO_VALUE"
});
return value;
});
```
#### 2. 添加数据连接类型进DEMO
```js
BI.config('dec.connection.provider.datebase', function (provider) {
text: "Redis",//必填
databaseType: "Redis",//唯一值
marker: 'DEMO_VALUE',//marker对标dec.constant.database.filter.type常量item的value,用于过滤
isHideConnection: true, //是否隐藏测试连接按钮
isNoSave: true,//是否不执行平台的保存逻辑
iconUrl:'https://work.fineres.com/secure/projectavatar?pid=10301&avatarId=10011',
driver: 'com.amazon.redshift.jdbc41.Driver',
drivers: ['com.amazon.redshift.jdbc4.Driver', 'com.amazon.redshift.jdbc41.Driver'],
url: 'jdbc:redshift://endpoint:port/database',
}
```

14
babel.config.js

@ -1,13 +1,3 @@
module.exports = api => {
const { plugins, presets, sourceType } = require("@fui/babel-preset-fineui").configs.base(api);
return {
compact: false,
presets,
sourceType,
plugins: [
...plugins,
"@babel/plugin-proposal-logical-assignment-operators",
],
};
module.exports = function (api) {
return require("@fui/babel-preset-fineui").configs.base(api)
};

20
i18n/zh_cn.properties

@ -62,11 +62,6 @@ Dec-Dcm_Connection_Form_UserName= 用户名
Dec-Dcm_Connection_Form_Password= 密码
Dec-Dcm_Connection_Form_Principal= 客户端principal
Dec-Dcm_Connection_Form_KeyPath= keytab密钥路径
Dec-Dcm_Connection_Form_Krb5File= krb5.conf文件
Dec-Dcm_Connection_File_Upload_Success= 已成功上传并校验成功
Dec-Dcm_Connection_File_Upload_Error= 检测异常
Dec-Dcm_Connection_File_Upload_ErrorCode= 错误代码
Dec-Dcm_Connection_File_Upload_ErrorMsg= 错误详情
Dec-Dcm_Connection_Form_Pool_Properties= 连接池属性
Dec-Dcm_Connection_Form_SQL_Validation_Query= SQL验证查询
Dec-Dcm_Connection_Form_Connection-Check= 获取连接前校验
@ -85,10 +80,10 @@ Dec-Dcm_Connection_Form_Database_Max_Wait= 最大等待时间
Dec-Dcm_Connection_Form_Database_Validation_Query= SQL验证查询
Dec-Dcm_Connection_Form_Database_Test_On_Borrow= 获取连接前检验
Dec-Dcm_Connection_Form_Database_Test_On_Return= 归还连接前检验
Dec-Dcm_Connection_Form_Database_Test_While_Idle= 获取连接时空闲连接可用性校
Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis= 空闲连接回收器工作间隔
Dec-Dcm_Connection_Form_Database_Test_While_Idle= 开启空闲回收器检
Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis= 空闲连接回收器休眠时间
Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num= 空闲连接回收检查数
Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis= 空闲连接回收时间阈
Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis= 保持空闲最小时间
Dec-Dcm_Connection_Make_Sure_Delete= 确定删除该数据连接?
Dec-Dcm_Connection_ReConnect= 重新连接
Dec-Dcm_Connection_JNDI_Form_ConnectionName= JNDI的名字
@ -101,7 +96,7 @@ Dec-Dcm_Connection_JNDI= JNDI数据连接
Dec-Dcm_Connection_JNDI_Warning= 注意:需要把包含INTIAL_CONTEXT_FACTORY类的.jar文件复制到软件安装目录下的/lib目录下
Dec-Dcm_Connection_Error= 接口访问错误
Dec-Dcm_Connection_Is_Using= 该连接正在被{R1}编辑,请稍后再试
Dec-Dcm_Connection_Check_Integer= 请输入不小于{}的整数
Dec-Dcm_Connection_Check_Integer= 请输入不小于0的整数
Dec-Dcm_Connection_Check_Number= 只允许为整数
Dec-Dcm_Connection_JDBC_Other=其他JDBC
Dec-Dcm_Connection_JDBC_Warning= 请确认已经将krb5.Conf文件添加到/webapps/webroot/WEB_INF/resources目录
@ -308,9 +303,4 @@ BI-Basic_No_Select= 不选
BI-Basic_Now= 此刻
Dec-Dcm_Connection_Analytic_DB=阿里云AnalyticDB
Dec-Dcm_Connection_Value_Out_Range=数值超出范围
Dec-Dcm_Socket_Unable_Connect_Tip=可能出现编辑冲突
Dec-Dcm_Connection_File_Upload_ErrorTip1= 参考
Dec-Dcm_Connection_File_Upload_ErrorTip2= kerberos配置
Dec-Dcm_Connection_File_Upload_ErrorTip3= 获取帮助或联系技术支持
Dec-Dcm_Connection_Timeout_Detection=数据连接超时检测
Dec-Dcm_Connection_Timeout_Millisecond=毫秒(ms)
Dec-Dcm_Socket_Unable_Connect_Tip=可能出现编辑冲突

12
package.json

@ -7,7 +7,6 @@
"author": "decision",
"license": "MIT",
"dependencies": {
"@babel/plugin-proposal-logical-assignment-operators": "^7.20.7",
"@types/jss": "9.5.8",
"autoprefixer": "^9.6.1",
"es6-promise": "4.2.6",
@ -17,11 +16,11 @@
"nprogress": "0.2.0"
},
"devDependencies": {
"@fui/babel-preset-fineui": "^1.0.0",
"@fui/babel-preset-fineui": "^3.0.1",
"@types/jest": "24.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"axios": "^0.24.0",
"@typescript-eslint/eslint-plugin": "1.7.0",
"@typescript-eslint/parser": "1.7.0",
"axios": "0.18.0",
"babel-loader": "8.0.6",
"body-parser": "1.18.3",
"chokidar": "2.1.5",
@ -67,5 +66,8 @@
"i18n": "node ./lib/transform-i18n/transform-i18n.js",
"test": "jest --passWithNoTests",
"upgrade": "node lib/upgrade"
},
"overrides": {
"@babel/traverse": "7.22.6"
}
}

16
private/i18n.ts

@ -61,11 +61,6 @@ export default {
'Dec-Dcm_Connection_Form_Password': '密码',
'Dec-Dcm_Connection_Form_Principal': '客户端principal',
'Dec-Dcm_Connection_Form_KeyPath': 'keytab密钥路径',
'Dec-Dcm_Connection_Form_Krb5File': 'krb5.conf文件',
'Dec-Dcm_Connection_File_Upload_Success': ' 已成功上传并校验成功',
'Dec-Dcm_Connection_File_Upload_Error': '检测异常',
'Dec-Dcm_Connection_File_Upload_ErrorCode': '错误代码',
'Dec-Dcm_Connection_File_Upload_ErrorMsg': '错误详情',
'Dec-Dcm_Connection_Form_Pool_Properties': '连接池属性',
'Dec-Dcm_Connection_Form_SQL_Validation_Query': 'SQL验证查询',
'Dec-Dcm_Connection_Form_Connection-Check': '获取连接前校验',
@ -84,10 +79,10 @@ export default {
'Dec-Dcm_Connection_Form_Database_Validation_Query': 'SQL验证查询',
'Dec-Dcm_Connection_Form_Database_Test_On_Borrow': '获取连接前检验',
'Dec-Dcm_Connection_Form_Database_Test_On_Return': '归还连接前检验',
'Dec-Dcm_Connection_Form_Database_Test_While_Idle': '获取连接时空闲连接可用性校验',
'Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis': '空闲连接回收器工作间隔',
'Dec-Dcm_Connection_Form_Database_Test_While_Idle': '开启空闲回收器检验',
'Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis': '空闲连接回收器休眠时间',
'Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num': '空闲连接回收检查数',
'Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis': '空闲连接回收时间阈值',
'Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis': '保持空闲最小时间值',
'Dec-Dcm_Connection_Make_Sure_Delete': '确定删除该数据连接?',
'Dec-Dcm_Connection_ReConnect': '重新连接',
'Dec-Dcm_Connection_JNDI_Form_ConnectionName': 'JNDI的名字',
@ -100,7 +95,7 @@ export default {
'Dec-Dcm_Connection_JNDI_Warning': '注意:需要把包含INTIAL_CONTEXT_FACTORY类的.jar文件复制到软件安装目录下的/lib目录下',
'Dec-Dcm_Connection_Error': '接口访问错误',
'Dec-Dcm_Connection_Is_Using': '该连接正在被{R1}编辑,请稍后再试',
'Dec-Dcm_Connection_Check_Integer': '请输入不小于{}的整数',
'Dec-Dcm_Connection_Check_Integer': '请输入不小于0的整数',
'Dec-Dcm_Connection_Check_Number': '只允许为整数',
'Dec-Dcm_Connection_JDBC_Other': '其他JDBC',
'Dec-Dcm_Connection_JDBC_Warning': '请确认已经将krb5.Conf文件添加到/webapps/webroot/WEB_INF/resources目录',
@ -311,7 +306,4 @@ export default {
'Dec-Connection_Lic_Limit_Approach_Tip': '当前数据连接数量超过注册lic限制({}个),所有数据连接都不可用,请删除多余的数据连接',
'Dec-Connection_Lic_Limit_Approach_Prevent_Tip': '当前数据连接数量已经达到注册lic限制({}个),无法新增',
'Dec-Dcm_Connection_Check_Fetch_Size_Range': '请输入0-1000000之间的值',
'Dec-Dcm_Connection_File_Upload_ErrorTip1':'参考',
'Dec-Dcm_Connection_File_Upload_ErrorTip2': 'kerberos配置',
'Dec-Dcm_Connection_File_Upload_ErrorTip3': '取帮助或联系技术支持',
};

3
src/modules/app.model.ts

@ -7,7 +7,7 @@ import { getAllDatabaseTypes } from './app.service';
export class AppModel extends Model {
static xtype = 'dec.dcm.model.main';
childContext = <const>['pageIndex', 'datebaseTypeSelected', 'datebaseTypeSelectedOne', 'filter', 'connections', 'connectionSelected', 'connectionSelectedOne', 'saveEvent', 'testEvent', 'isCopy', 'connectionLicInfo', 'noTestConnection'];
childContext = <const>['pageIndex', 'datebaseTypeSelected', 'datebaseTypeSelectedOne', 'filter', 'connections', 'connectionSelected', 'connectionSelectedOne', 'saveEvent', 'testEvent', 'isCopy', 'connectionLicInfo'];
state() {
return {
@ -23,7 +23,6 @@ export class AppModel extends Model {
currentConnectionNum: 0,
maxConnectionNum: 0,
},
noTestConnection: false,
};
}

125
src/modules/app.provider.ts

@ -1,67 +1,11 @@
import { CONSTANT_PLUGIN_TYPES } from './app.constant';
import { DATA_BASE_TYPES } from '@constants/constant';
BI.provider('dec.connection.provider.datebase', function () {
BI.provider('dec.connection.provider.datebase', function() {
this.resolves = {};
function starRocksResolve(url: string) {
// 处理starRocks数据连接常规模式
let result = url.match(/^jdbc:mysql:\/\/([0-9a-zA-Z_\\.-]+):([0-9a-zA-Z_\\.-]+)\/([0-9a-zA-Z_\\.-]+)\.([^]+)(.*)/i);
if (result) {
return {
host: result[1],
port: result[2] === 'port' ? '' : result[2],
catalog: result[3],
databaseName: result[4],
urlInfo: result[0],
};
} else {
// 兼容老数据库里面没有catalog的情况
result = url.match(/^jdbc:mysql:\/\/([0-9a-zA-Z_\\.-]+):([0-9a-zA-Z_\\.-]+)\/([^]+)(.*)/i);
if (result) {
return {
host: result[1],
port: result[2] === 'port' ? '' : result[2],
catalog: '',
databaseName: result[3],
urlInfo: result[0],
};
}
}
// 处理starRocks数据连接负载均衡模式
let loadBalance = url.match(/^jdbc:mysql:loadbalance:\/\/[^/]+\/([^/]+)\.([^/]+)/i);
if (loadBalance) {
return {
host: '',
port: '',
catalog: loadBalance[1],
databaseName: loadBalance[2],
urlInfo: loadBalance[0],
}
} else {
// 兼容老数据库里面没有catalog的情况
loadBalance = url.match(/^jdbc:mysql:loadbalance:\/\/[^/]+\/([^/]+)([^/]+)/i);
if (loadBalance) {
return {
host: '',
port: '',
catalog: '',
databaseName: loadBalance[1],
urlInfo: loadBalance[0],
}
}
}
return {
host: '',
port: '',
databaseName: '',
urlInfo: '',
};
}
// 原service中resolveUrlInfo方法
function jdbcResolve(url: string) {
function jdbcResolve (url: string) {
if (BI.isNull(url)) return {};
const oracleUlr = url.match(/^jdbc:(oracle):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(:|\/)([^]+)(.*)/i);
if (oracleUlr) {
return {
@ -71,7 +15,7 @@ BI.provider('dec.connection.provider.datebase', function () {
urlInfo: oracleUlr[10],
};
}
const greenplumUrl = url.match(/^jdbc:(pivotal:greenplum):(thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;DatabaseName=)?([^]+)(.*)/i);
if (greenplumUrl) {
return {
@ -81,7 +25,7 @@ BI.provider('dec.connection.provider.datebase', function () {
urlInfo: greenplumUrl[9],
};
}
const result = url.match(/^jdbc:(mysql|sqlserver|db2|dm|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql|clickhouse|trino|sybase:Tds):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;DatabaseName=)?([^]+)?(.*)/i);
const result = url.match(/^jdbc:(mysql|sqlserver|db2|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql|clickhouse|trino):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;DatabaseName=)?([^]+)?(.*)/i);
if (result) {
return {
host: result[5],
@ -90,24 +34,13 @@ BI.provider('dec.connection.provider.datebase', function () {
urlInfo: result[10],
};
}
// 处理SAP HANA数据连接url
const sapHanaUrl = url.match(/^jdbc:(sap):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\?databaseName=)?([^&]+)([^]+)?(.*)/i);
if (sapHanaUrl) {
return {
host: sapHanaUrl[5],
port: sapHanaUrl[7] === 'port' ? '' : sapHanaUrl[7],
databaseName: sapHanaUrl[9] || '',
urlInfo: sapHanaUrl[10],
};
}
// 处理oracle的RAC方式
if (/^jdbc:oracle:thin:([0-9a-zA-Z/]*)?@\(DESCRIPTION/i.test(url)) {
const host = url.match(/\(HOST\s*=\s*([0-9a-zA-Z_\\.-]+)\)/i);
const port = url.match(/\(PORT\s*=\s*([0-9]+)\)/i);
const databaseName = url.match(/\(SERVICE_NAME\s*=\s*([\s0-9a-zA-Z_\\.]+)\)/i);
return {
host: host ? host[1] : '',
port: port && port[1] !== 'port' ? port[1] : '',
@ -115,6 +48,7 @@ BI.provider('dec.connection.provider.datebase', function () {
urlInfo: '',
};
}
return {
host: '',
port: '',
@ -123,55 +57,18 @@ BI.provider('dec.connection.provider.datebase', function () {
};
}
function coverBaseDatabase(config) {
const baseDataBase = DATA_BASE_TYPES.find(item => item.text === config.text);
if (BI.isNotNull(baseDataBase)) {
// 覆盖基础配置
Object.assign(baseDataBase, config);
return true;
}
return false;
}
function filterPluginDataTypeByPriority() {
const originTypes = [...BI.Constants.getConstant(CONSTANT_PLUGIN_TYPES)];
const sortDataTypes = BI.sortBy(originTypes, (index, value: any) => {
return value.priority || 0;
})
return BI.uniqWith(sortDataTypes, (current, other) => {
return current.text == other.text;
});
}
this.registerDatabaseType = (config: any) => {
if (coverBaseDatabase(config)) return;
BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, config));
};
this.registerJdbcDatabase = (config: any, resolve?: Function) => {
config = {
...config,
type: 'jdbc',
};
BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, { ...config, type: 'jdbc' }));
BI.isFunction(resolve) && (this.resolves[config.databaseType] = resolve);
if (coverBaseDatabase(config)) return;
BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, config));
};
this.$get = () => BI.inherit(BI.OB, {
getJdbcResolveByType: (type: string) => {
// starRocks特殊处理
// todo: 后面有专门的迭代系统处理,这里先临时解决下bug
if (type === "starrocks"){
return starRocksResolve
}
return this.resolves[type] || jdbcResolve
},
getJdbcResolveByType: (type: string) => this.resolves[type] || jdbcResolve,
customDatabaseType: BI.Constants.getConstant(CONSTANT_PLUGIN_TYPES),
});
});

50
src/modules/app.service.ts

@ -1,13 +1,7 @@
import {
DATA_BASE_TYPES,
DATA_BASE_TYPES_OTHER,
DESIGN_DRIVER_TYPE,
OTHER_JDBC,
DATABASE_TYPE,
} from '@constants/constant';
import { DATA_BASE_TYPES, DATA_BASE_TYPES_OTHER, DESIGN_DRIVER_TYPE, OTHER_JDBC } from '@constants/constant';
import { DatabaseType } from './app.typings';
import { Connection } from './crud/crud.typings';
export function getAllDatabaseTypes(): DatabaseType[] {
export function getAllDatabaseTypes():DatabaseType[] {
return [
...DATA_BASE_TYPES,
...BI.Providers.getProvider('dec.connection.provider.datebase').customDatabaseType.map(item => {
@ -51,13 +45,13 @@ export function getJdbcDatabaseType(database: string, driver: string): DatabaseT
if (!databaseType) {
return DATA_BASE_TYPES_OTHER;
}
return databaseType;
}
export function resolveUrlInfo(url: string, database?: string) {
export function resolveUrlInfo (url: string, database?: string) {
if (BI.isNull(url)) return {};
return BI.Providers.getProvider('dec.connection.provider.datebase').getJdbcResolveByType(database)(url) || {
host: '',
port: '',
@ -67,7 +61,7 @@ export function resolveUrlInfo(url: string, database?: string) {
}
// 拼接url
export function splitUrl(host: string, port: string, catalog: string, database: string, baseUrl: string, databaseType: string) {
export function splitUrl(host: string, port: string, database: string, baseUrl: string) {
if (baseUrl.startsWith('jdbc:sqlserver')) {
return baseUrl.replace('hostname', host).replace(':port', port ? `:${port}` : '')
.replace('=database', `=${database}`);
@ -76,31 +70,13 @@ export function splitUrl(host: string, port: string, catalog: string, database:
// https://work.fineres.com/browse/REPORT-72078
if (baseUrl.startsWith('jdbc:informix-sqli')) {
return baseUrl.replace('hostname', host)
.replace(':port', port ? `:${port}` : '')
.replace('database', database)
.replace(':INFORMIXSERVER={server}', '');
}
if (databaseType === DATABASE_TYPE.STAR_ROCKS) {
let databaseStr = '';
if (!catalog || !database) {
databaseStr = catalog + database;
} else {
databaseStr = catalog + '.' + database;
}
return baseUrl.replace('hostname', host).replace(':port', port ? `:${port}` : '')
.replace('default_catalog.database', databaseStr);
}
if (databaseType === DATABASE_TYPE.SAP_HANA) {
return baseUrl.replace('hostname', host)
.replace('port', port || '')
.replace('=database', `=${database}`);
.replace(':port', port ? `:${port}` : '')
.replace('database', database)
.replace(':INFORMIXSERVER={server}','');
}
return baseUrl.replace('hostname', host).replace(':port', port ? `:${port}` : '')
.replace('/database', `/${database}`)
.replace(':database', `:${database}`)
.replace('database', database)
.replace('dbname', database);
}
@ -109,13 +85,13 @@ export function connectionCanEdit(connection: Connection) {
// privilegeType === 4 代表编辑权限,privilegeValue === 2 代表有权限
return connection.privilegeDetailBeanList.some(item => item.privilegeType === 4 && item.privilegeValue === 2);
}
return true;
}
export function getTextByDatabaseType(databaseType: string) {
const database = getAllDatabaseTypes().find(item => item.databaseType === databaseType);
return database ? database.text : '';
}

34
src/modules/app.ts

@ -7,10 +7,8 @@ import { Tab } from '@fui/core';
import { Datebase } from './pages/database/database';
import { Maintain } from './pages/maintain/maintain';
import { ConnectionPool } from './pages/connection_pool/connection_pool';
import { TimeOutSetting } from './pages/setting/setting';
import './app.provider';
import '../less/index.less';
import "./pages/__point__/connect.point";
@shortcut()
@store(AppModel)
@ -39,12 +37,7 @@ export class App extends BI.Widget {
{
el: {
type: Title.xtype,
listeners: [{
eventName: 'EVENT_CLICK_SETTING',
action:() => {
this._setting();
},
}]
cls: 'bi-border-bottom',
},
height: 40,
},
@ -82,30 +75,13 @@ export class App extends BI.Widget {
}
},
},
left: 0,
top: 0,
right: 0,
bottom: 0,
left: 10,
top: 10,
right: 10,
bottom: 10,
}],
},
],
};
}
private _setting() {
const settingLayerId = BI.UUID();
BI.Layers.create(settingLayerId, null, {
container: this,
render: {
type: TimeOutSetting.xtype,
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
BI.Layers.remove(settingLayerId);
},
}],
},
}, this);
BI.Layers.show(settingLayerId);
}
}

11
src/modules/app.typings.d.ts vendored

@ -8,18 +8,9 @@ export interface DatabaseType {
internal: boolean;
type: string;
hasSchema?: boolean;
hasSchemas?: {
[key: string]: boolean;
};
fetchSize: number;
versionConfig?: {
[key: string]: DatabaseType;
},
kerberos?: boolean;
iconUrl?: string;
versions?: string[];
urls?: {
[key: string]: string;
};
marker?: string;
}
}

6
src/modules/components/collapse/collapse.ts

@ -12,7 +12,6 @@ export class Collapse extends BI.BasicButton {
name: '',
isCollapse: true,
$testId: 'dec-dcm-components-collapse',
el: {},
}
rightFont: IconLabel;
@ -58,7 +57,6 @@ export class Collapse extends BI.BasicButton {
lgap: 2,
text: this.options.name,
},
this.options.el,
],
};
}
@ -66,8 +64,4 @@ export class Collapse extends BI.BasicButton {
doClick() {
this.store.setCollapse(!this.model.isCollapse);
}
setCollapse(v: boolean) {
this.store.setCollapse(v);
}
}

68
src/modules/components/file_chooser/file_chooser.model.ts

@ -1,68 +0,0 @@
import { model, Model } from '@core/core';
type RootInfo = {
url: string; // api url
prefix: string; // 路径前缀
root: string; // 根文件夹名称
};
export const ROOT_INFO_MAP: Record<string, RootInfo> = {
// 证书 resources/certificates/
certificates: {
url: '/v10/certificates/all',
prefix: 'resources/',
root: 'certificates',
},
};
@model()
export class FileChooserModel extends Model {
static xtype = 'dec.dcm.model.components.file_chooser';
private options: {
root: string;
};
state() {
return {
keyword: '', // 搜索关键字
items: [], // 文件项
};
}
actions = {
/**
* items
* @param callback
*/
requestGetItems: (callback?: Function) => {
const { keyword } = this.model;
const { url, prefix, root } = ROOT_INFO_MAP[this.options.root];
const requestUrl = `${url}?keyword=${encodeURIComponent(keyword)}`;
Dec.reqGetHandle(requestUrl, '', (data) => {
this.model.items = data
.concat({
id: root,
text: prefix + root,
value: prefix + root,
isParent: true,
})
.map((item) => ({
...item,
value: prefix + item.path,
open: item.id === root || BI.isKey(keyword),
}));
BI.isFunction(callback) && callback();
});
},
/**
* keyword
* @param value
*/
setKeyword: (value: string) => {
this.model.keyword = value;
this.requestGetItems();
},
};
}

183
src/modules/components/file_chooser/file_chooser.ts

@ -1,183 +0,0 @@
import { EVENT_CHANGE } from './../collapse/collapse';
import { shortcut, store } from '@core/core';
import { SignEditor, MultiLayerSingleLevelTree, SearchEditor, Button, Editor } from '@fui/core';
import { FileChooserModel } from './file_chooser.model';
@shortcut()
@store(FileChooserModel, {
props(this: FileChooser) {
return this.options;
},
})
export class FileChooser extends BI.Widget {
static xtype = 'dec.dcm.components.file_chooser';
props = {
width: 300,
root: '', // 含义见model中的RootInfo
watermark: '',
value: '',
};
model: FileChooserModel['model'];
store: FileChooserModel['store'];
watch = {
items: (value) => {
this.fileTree.populate(value);
},
};
textEditor: SignEditor;
keywordEditor: SearchEditor;
fileTree: MultiLayerSingleLevelTree;
sureButton: Button;
render() {
const { width, watermark, value } = this.options;
return {
type: BI.VerticalAdaptLayout.xtype,
height: 24,
items: [
{
type: BI.SignEditor.xtype,
cls: 'bi-border-bottom bi-focus-shadow',
width,
height: 22,
watermark,
title: value,
value,
ref: (_ref: SignEditor) => {
this.textEditor = _ref;
},
listeners: [
{
eventName: BI.SignEditor.EVENT_CHANGE,
action: () => {
const value = this.textEditor.getValue();
this.setValue(value);
},
},
],
},
{
el: {
type: BI.Button.xtype,
text: BI.i18nText('Dec-Basic_Choose_File'),
clear: true,
handler: () => {
this.openFileChoosePopover();
},
},
lgap: 10,
},
],
};
}
getValue(): string {
return this.textEditor.getValue();
}
setValue(value: string) {
this.options.value = value;
this.textEditor.text.setTitle(value);
this.textEditor.setValue(value);
}
/**
*
*/
private openFileChoosePopover() {
// 重置搜索关键词
this.store.setKeyword('');
// 创建并显示窗口
const popoverName = BI.UUID();
BI.Popovers.create(
popoverName,
{
header: BI.i18nText('Dec-Data_Set_File_Select_Server_File'),
body: {
type: BI.VTapeLayout.xtype,
items: [
{
type: BI.SearchEditor.xtype,
ref: (ref: SearchEditor) => {
this.keywordEditor = ref;
},
height: 24,
value: this.model.keyword,
listeners: [
{
eventName: BI.SearchEditor.EVENT_CHANGE,
action: () => {
const value = this.keywordEditor.getValue();
this.store.setKeyword(value);
},
},
{
eventName: BI.SearchEditor.EVENT_CLEAR,
action: () => {
this.store.setKeyword('');
},
},
],
},
{
el: {
type: BI.MultiLayerSingleLevelTree.xtype,
ref: (ref: MultiLayerSingleLevelTree) => {
this.fileTree = ref;
},
keywordGetter: () => this.model.keyword,
items: this.model.items,
listeners: [
{
eventName: BI.MultiLayerSingleLevelTree.EVENT_CHANGE,
action: () => {
this.sureButton.setEnable(true);
},
},
],
},
tgap: 15,
},
{
type: BI.RightVerticalAdaptLayout.xtype,
height: 24,
vgap: 10,
items: [
{
type: BI.Button.xtype,
text: BI.i18nText('BI-Basic_Cancel'),
level: 'ignore',
handler: () => {
BI.Popovers.remove(popoverName);
},
},
{
el: {
type: BI.Button.xtype,
ref: (ref: Button) => {
this.sureButton = ref;
},
text: BI.i18nText('BI-Basic_OK'),
disabled: true,
handler: () => {
const value = this.fileTree.getValue()[0];
this.setValue(value);
BI.Popovers.remove(popoverName);
},
},
lgap: 10,
},
],
},
],
},
},
this
).show(popoverName);
}
}

13
src/modules/components/file_upload/file_upload.less

@ -1,13 +0,0 @@
.data-conf-file {
.x-icon{
width: 48px;
height: 48px;
}
}
.data-keytab-file {
.x-icon{
width: 48px;
height: 48px;
}
}

35
src/modules/components/file_upload/file_upload.model.ts

@ -1,35 +0,0 @@
import { model, Model } from '@core/core';
type UploadParam = {
keytabPath: string;
krb5ConfPath: string;
principal: string;
}
@model()
export class FileUploadModel extends Model {
static xtype = 'dec.dcm.model.components.file_upload';
private options: {
inter: string;
}
state() {
return {
uploadUrl: '',
fileName: '',
};
}
actions = {
setFileInfo: (params: UploadParam) => {
const inter = this.options.inter;
this.model.uploadUrl = Dec.Utils.getEncodeURL(Dec.fineServletURL + inter, "", params);
},
setFileName:(v: string) => {
this.model.fileName = v;
}
}
}

327
src/modules/components/file_upload/file_upload.ts

@ -1,327 +0,0 @@
import { shortcut, store } from '@core/core';
import { SignEditor, MultiLayerSingleLevelTree, SearchEditor, Button, Editor, Label } from '@fui/core';
import { FileUploadModel } from './file_upload.model';
import { ApiFactory } from 'src/modules/crud/apiFactory';
import './file_upload.less';
const api = new ApiFactory().create();
@shortcut()
@store(FileUploadModel, {
props(this: FileUpload) {
return this.options;
},
})
export class FileUpload extends BI.Widget {
public static xtype = "dec.dcm.components.file_upload";
public static EVENT_CHECK_SUCCESS = 'EVENT_CHECK_SUCCESS';
public static EVENT_CLEAR_FILE = 'EVENT_CLEAR_FILE';
public props = {
watermark: '',
value: '',
processId: '',
disabled: false,
inter: '',
access: '',
iconCls: ''
};
model: FileUploadModel['model'];
store: FileUploadModel['store'];
watch = {
uploadUrl: function () {
this.uploader.setUrl(this.model.uploadUrl);
},
};
public textEditor: SignEditor;
public keywordEditor: SearchEditor;
public fileTree: MultiLayerSingleLevelTree;
public sureButton: Button;
public infoLabel: Label;
public render() {
const { width, watermark, value, processId, inter } = this.options;
let self = this;
const processName = BI.concat("process-", processId);
const processClass = BI.concat(".process-", processId);
this.setFileInfo({
keytabPath: '',
principal:'',
krb5ConfPath: '',
});
return {
type: BI.VerticalLayout.xtype,
items:[{
type: BI.FloatLeftLayout.xtype,
items: [
{
type: BI.SignEditor.xtype,
cls: 'bi-border-bottom bi-focus-shadow',
width: 300,
height: 22,
watermark,
disabled: true,
value,
ref: (_ref: SignEditor) => {
this.textEditor = _ref;
},
listeners: [
{
eventName: BI.SignEditor.EVENT_CHANGE,
action: () => {
const value = this.textEditor.getValue();
this.setValue(value);
},
},
],
}, {
type: BI.Button.xtype,
width: 100,
_lgap: 10,
iconCls: "upload-font",
level: "ignore",
ghost: true,
ref: (_ref: Button) => {
this.uploadButton = _ref;
},
text: BI.i18nText('Dec-Basic_Choose_File'),
handler: () => {
this.uploader.select();
},
},
],
}, {
type: BI.FloatLeftLayout.xtype,
tgap: 8,
invisible: true,
ref: (_ref) => {
this.fileInfo = _ref;
},
items: [
{
type: BI.VerticalLayout.xtype,
cls: "bi-border",
items: [{
type: BI.HTapeLayout.xtype,
height: 68,
width: 300,
items: [{
el: {
type: BI.IconLabel.xtype,
cls: this.options.iconCls,
},
width: 48,
lgap: 8,
}, {
el: {
type: BI.VerticalLayout.xtype,
items : [{
type: BI.Label.xtype,
width: 200,
height: 20,
textAlign: "left",
ref: (_ref: Label) => {
this.fileName = _ref;
},
},{
type: BI.VerticalAdaptLayout.xtype,
items: [{
type: BI.Label.xtype,
cls: "bi-tips",
height: 20,
rgap: 3,
ref: (_ref: Label) => {
this.fileSize = _ref;
},
}, {
type: BI.Label.xtype,
cls: "bi-tips",
height: 20,
ref: (_ref: Label) => {
this.fileModified = _ref;
},
}]
}],
},
tgap: 14,
lgap: 4,
}, {
el: {
type: BI.IconButton.xtype,
cls: "default-delete-font",
handler: function () {
NProgress.set(0.0);
self.xhr.abort();
self.store.setFileName('');
self.clearInfo();
self.fireEvent(FileUpload.EVENT_CLEAR_FILE);
},
},
rgap: 10,
}]
}, {
type: BI.VerticalLayout.xtype,
cls: processName,
width: 300,
height: 1,
}]
}, {
el :{
type: BI.VerticalLayout.xtype,
cls: "bi-error",
ref: (_ref: any) => {
this.errorInfo = _ref;
},
invisible: true,
items : [{
type: BI.Label.xtype,
height: 20,
textAlign: "left",
ref: (_ref: Label) => {
this.errorCode = _ref;
},
},{
type: BI.Label.xtype,
height: 20,
textAlign: "left",
ref: (_ref: Label) => {
this.errorMsg = _ref;
},
}, {
type: BI.VerticalAdaptLayout.xtype,
rgap: 5,
items: [
{
type: BI.Label.xtype,
text: BI.i18nText('Dec-Dcm_Connection_File_Upload_ErrorTip1'),
},{
type: BI.TextButton.xtype,
cls: "bi-high-light bi-high-light-border-bottom",
text: BI.i18nText('Dec-Dcm_Connection_File_Upload_ErrorTip2'),
handler: function () {
window.open(Dec.system[DecCst.Hyperlink.DECISION_HYPERLINK_CONFIG][DecCst.Hyperlink.KERBEROS_CONF_HELP]);
},
},{
type: BI.Label.xtype,
text: BI.i18nText('Dec-Dcm_Connection_File_Upload_ErrorTip3'),
}
],
},],
},
vgap: 4,
lgap: 8,
}
],
}, {
type: BI.MultifileEditor.xtype,
ref: (ref:any) => {
self.uploader = ref;
},
url: this.model.uploadUrl,
accept: this.options.accept,
listeners: [
{
// 选择文件
eventName: BI.MultifileEditor.EVENT_CHANGE,
action: function (files) {
self.options.attachId = '';
const fileInfo = files.files[0];
self.setInfo(fileInfo);
self.store.setFileName(fileInfo.fileName);
this.upload();
NProgress.configure({ parent: processClass, minimum: 0.0 });
},
},
{
// 上传进度刷新
eventName: BI.MultifileEditor.EVENT_PROGRESS,
action: function (progress) {
let rate = progress.loaded/progress.total;
NProgress.set(rate);
},
},
{
// 开始上传文件
eventName: BI.MultifileEditor.EVENT_UPLOADSTART,
action: function (progressEvent, xhr) {
self.xhr = xhr;
},
},
{
// 上传文件完毕
eventName: BI.MultifileEditor.EVENT_UPLOADED,
action: function () {
const uploadedInfo = this.getValue();
const failed = BI.some(uploadedInfo, function (index, file) {
if (file.data.errorCode) {
BI.Msg.toast(uploadedInfo[0].filename + BI.i18nText('Dec-Dcm_Connection_File_Upload_Error'), {
level: "error",
});
self.setErrorInfo(file.data)
return true;
}
});
const key = self.options.processId +'Path';
!failed && self.setValue(uploadedInfo[0].data.kerberosInfo[key]);
!failed && self.fireEvent(FileUpload.EVENT_CHECK_SUCCESS, uploadedInfo[0].data);
!failed && BI.Msg.toast(uploadedInfo[0].filename + BI.i18nText('Dec-Dcm_Connection_File_Upload_Success'),{
level: "success"
});
NProgress.configure({ parent: 'body'});
},
},
],
}]
};
}
public getValue(): string {
return this.options.value;
}
public setValue(value: string) {
this.options.value = value;
this.textEditor.text.setTitle(value);
this.textEditor.setValue(value);
}
public setInfo(info: any) {
this.uploadButton.setEnable(false);
this.fileInfo.setVisible(true);
this.textEditor.setValue(info.fileName);
this.fileName.setText(info.fileName);
this.fileSize.setText(Dec.Utils.getByteWidthUnit(info.size));
this.fileModified.setText(BI.getDate().print("%Y-%X-%d %H:%M:%S"))
}
public clearInfo() {
this.uploadButton.setEnable(true);
this.fileInfo.setVisible(false);
this.errorInfo.setVisible(false);
this.textEditor.setValue('');
this.options.attachId = '';
}
public setErrorInfo(errorInfo: any) {
this.errorInfo.setVisible(true);
this.errorCode.setText(BI.i18nText("Dec-Dcm_Connection_File_Upload_ErrorCode") + ":"+ errorInfo.errorCode);
this.errorMsg.setText(BI.i18nText("Dec-Dcm_Connection_File_Upload_ErrorMsg") + ":" + errorInfo.errorMessage);
}
public setEnable(v) {
this.uploadButton._setEnable(v);
}
public setFileInfo(params) {
this.store.setFileInfo(params);
}
}

36
src/modules/components/test_status/test_status.ts

@ -29,9 +29,7 @@ export class TestStatus extends BI.Widget {
failDriverMessage: Label;
driverLink: FloatLeftLayout;
detail: VerticalLayout;
failMaskers: any;
extraContainer: VerticalLayout;
failMaskers:any;
watch = {
status: (status: string) => {
@ -40,9 +38,8 @@ export class TestStatus extends BI.Widget {
}
render() {
const LAYOUT_WIDTH = 400;
const { loadingCls, loadingText, successCls, successText, failCls, failText, retryText } = this.options;
var self=this;
return {
type: BI.CenterAdaptLayout.xtype,
cls: 'bi-z-index-mask',
@ -74,10 +71,10 @@ export class TestStatus extends BI.Widget {
tipCls: failCls,
tipText: failText,
retryText,
ref: (_ref: TipFail) => {
this.failMaskers = _ref;
if (BI.isEmptyString(this.failMessage.getText())) {
this.failMaskers.populateFail(BI.i18nText('Dec-Conn-ect-Failed'), false);
ref:(_ref:any)=>{
self.failMaskers=_ref;
if(this.failMessage.getText()===''){
this.failMaskers.populateFail(BI.i18nText("Dec-Conn-ect-Failed"),false);
}
},
listeners: [
@ -126,17 +123,10 @@ export class TestStatus extends BI.Widget {
scrolly: true,
height: 75,
items: [
{
type: BI.VerticalLayout.xtype,
width: LAYOUT_WIDTH,
ref: (_ref: VerticalLayout) => {
this.extraContainer = _ref;
}
},
{
type: BI.Label.xtype,
whiteSpace: 'normal',
width: LAYOUT_WIDTH,
width: 400,
textAlign: 'left',
text: '',
ref: (_ref: Label) => {
@ -185,7 +175,7 @@ export class TestStatus extends BI.Widget {
this.store.setStatus(TEST_STATUS.SUCCESS);
}
setFail(message: string = '', driver = '', link = '') {
setFail(message: string='', driver = '', link = '') {
this.store.setStatus(TEST_STATUS.FAIL);
this.failMessage.setText(message);
this.failDriverMessage.setVisible(!!driver);
@ -199,14 +189,4 @@ export class TestStatus extends BI.Widget {
setLoading() {
this.store.setStatus(TEST_STATUS.LOADING);
}
/**
*
*/
setExtraContainer(container: Obj) {
BI.createWidget({
...container,
element: this.extraContainer,
});
}
}

10
src/modules/components/test_status/tip_icon/tip_fail.ts

@ -54,7 +54,8 @@ export class TipFail extends BI.Widget {
}],
}, {
type: BI.Label.xtype,
_bgap: 10,
height: 14,
bgap: 10,
text: tipText,
ref:(_ref:Label)=>{
this.failText=_ref;
@ -62,12 +63,12 @@ export class TipFail extends BI.Widget {
},
{
type: BI.VerticalAdaptLayout.xtype,
hgap: 12,
hgap: 5,
items: [
{
type: BI.Button.xtype,
text: BI.i18nText('Dec-Dcm_Connection_Detailed_Information'),
clear: true,
level: 'ignore',
ref: (_ref: Button) => {
this.detailButton = _ref;
},
@ -78,8 +79,8 @@ export class TipFail extends BI.Widget {
},
{
type: BI.Button.xtype,
light: true,
text: BI.i18nText('Dec-Dcm_Back'),
level: 'ignore',
handler: () => {
this.fireEvent(TipFail.EVENT_CLOSE);
},
@ -88,7 +89,6 @@ export class TipFail extends BI.Widget {
type: BI.Button.xtype,
text: retryText,
handler: () => {
this.store.setIsCollapse(false);
this.fireEvent(TipFail.EVENT_RELOAD);
},
},

120
src/modules/components/text_checker/text_checker.ts

@ -3,97 +3,87 @@ import { Label, TextEditor } from '@fui/core';
@shortcut()
export class TextChecker extends BI.Widget {
public static xtype = 'dec.dcm.components.text_checker';
static xtype = 'dec.dcm.components.text_checker';
public props = {
props = {
width: 300,
allowBlank: true,
value: '',
watermark: '',
inputType: 'text',
autocomplete: '',
validationChecker: [] as {
errorText: string;
checker: (value: string) => boolean;
autoFix?: boolean;
}[],
$value: '',
};
}
public textEditor: TextEditor;
public errorLabel: Label;
textEditor: TextEditor;
errorLabel: Label;
private isError: boolean;
private value: string;
private errorChecker: {
errorText: string;
checker: (value: string) => boolean;
autoFix?: boolean;
};
}
public render() {
const { width, allowBlank, value, watermark, inputType, autocomplete, validationChecker, $value } = this.options;
render() {
const { width, allowBlank, value, watermark, validationChecker, $value } = this.options;
this.value = value;
return {
type: BI.AbsoluteLayout.xtype,
width,
height: 20,
items: [
{
el: {
type: BI.TextEditor.xtype,
$value,
width,
allowBlank,
value,
watermark,
inputType,
autocomplete,
ref: (_ref: TextEditor) => {
this.textEditor = _ref;
},
listeners: [
{
eventName: BI.Editor.EVENT_CHANGE,
action: () => {
const value = this.getValue();
if (value) {
this.errorChecker = validationChecker.find((item) => item.checker && !item.checker(value));
this.errorLabel.setText(BI.get(this.errorChecker, 'errorText'));
this.isError = !!BI.get(this.errorChecker, 'errorText');
} else {
this.errorLabel.setText('');
this.isError = false;
}
if (!this.isError) {
this.value = value;
}
this.fireEvent(BI.Editor.EVENT_CHANGE);
},
},
{
eventName: BI.TextEditor.EVENT_BLUR,
action: () => {
if (BI.get(this.errorChecker, 'autoFix')) {
this.setValue(this.value);
this.errorLabel.setText('');
}
},
},
],
items: [{
el: {
type: BI.TextEditor.xtype,
$value,
width,
allowBlank,
value,
watermark,
ref: (_ref: TextEditor) => {
this.textEditor = _ref;
},
},
{
el: {
type: BI.Label.xtype,
cls: 'bi-error',
ref: (_ref: Label) => {
this.errorLabel = _ref;
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action: () => {
const value = this.getValue();
if (value) {
this.errorChecker = validationChecker.find(item => item.checker && !item.checker(value));
this.errorLabel.setText(BI.get(this.errorChecker, 'errorText'));
this.isError = !!BI.get(this.errorChecker, 'errorText');
} else {
this.errorLabel.setText('');
this.isError = false;
}
if (!this.isError) {
this.value = value;
}
this.fireEvent(BI.Editor.EVENT_CHANGE);
},
}, {
eventName: BI.TextEditor.EVENT_BLUR,
action: () => {
if (BI.get(this.errorChecker, 'autoFix')) {
this.setValue(this.value);
this.errorLabel.setText('');
}
},
}],
},
}, {
el: {
type: BI.Label.xtype,
cls: 'bi-error',
ref: (_ref: Label) => {
this.errorLabel = _ref;
},
top: -15,
},
],
top: -15,
}],
};
}
@ -108,8 +98,4 @@ export class TextChecker extends BI.Widget {
public setError(value: string) {
this.errorLabel.setText(value);
}
public setWatermark(value: string) {
this.textEditor.setWaterMark(value);
}
}

41
src/modules/components/tips_combo/tips_combo.ts

@ -1,41 +0,0 @@
import { shortcut } from '@core/core';
import { BubbleCombo, BubblePopupView, IconButton } from '@fui/core';
@shortcut()
export class TipsCombo extends BI.Widget {
public static xtype = 'dec.dcm.tips.combo';
public props: BubblePopupView['props'] & IconButton['props'] = {
trigger: 'hover',
direction: 'top'
};
private bubbleCombo: BubbleCombo;
private bubbleComboPopup: BubblePopupView;
public render() {
const { direction, trigger, el } = this.options;
return {
type: BI.BubbleCombo.xtype,
trigger,
direction,
el: {
type: BI.IconButton.xtype,
cls: "detail-font",
},
popup: {
type: BI.BubblePopupView.xtype,
ref: (_ref: BubblePopupView) => {
this.bubbleComboPopup = _ref;
},
el,
},
listeners: [],
ref: (_ref: BubbleCombo) => {
this.bubbleCombo = _ref;
}
}
}
}

81
src/modules/constants/constant.ts

@ -5,11 +5,6 @@ export const PAGE_INDEX = {
POOL: 'pool',
};
export const DATABASE_TYPE = {
SAP_HANA: "sap-hana",
STAR_ROCKS :'starrocks',
};
export const OTHER_JDBC = 'otherJDBC';
export const DEFAULT_HELP_LINK = 'databaseHelpLink';
@ -284,7 +279,7 @@ export const DATA_BASE_TYPES = [
text: 'ClickHouse',
databaseType: 'clickhouse',
driver: 'ru.yandex.clickhouse.ClickHouseDriver',
url: 'jdbc:clickhouse://hostname:port/database',
url: 'jdbc:clickhouse://hostname:port',
commonly: false,
internal: true,
type: 'jdbc',
@ -464,7 +459,6 @@ export const DATA_BASE_TYPES = [
text: 'KINGBASE',
databaseType: 'kingbase',
driver: 'com.kingbase.Driver',
versions: ['KingbaseES 7.0'],
url: 'jdbc:kingbase://hostname:port/database',
commonly: false,
internal: true,
@ -578,28 +572,6 @@ export const DATA_BASE_TYPES = [
type: 'jdbc',
hasSchema: false,
kerberos: false,
}, {
text: BI.i18nText('Dec-Dcm_Connection_Database_DM'),
databaseType: 'dm',
driver: 'dm.jdbc.driver.DmDriver',
drivers: ['dm.jdbc.driver.DmDriver'],
url: 'jdbc:dm://hostname:port',
commonly: false,
internal: true,
type: 'jdbc',
hasSchema: true,
kerberos: true,
}, {
text: 'dremio',
databaseType: 'dremio',
driver: 'com.dremio.jdbc.Driver',
drivers: ['com.dremio.jdbc.Driver'],
url: 'jdbc:dremio:direct=hostname:31010',
commonly: false,
internal: true,
type: 'jdbc',
hasSchema: true,
kerberos: false,
}, {
text: 'Presto',
databaseType: 'presto',
@ -614,7 +586,7 @@ export const DATA_BASE_TYPES = [
text: 'SAP HANA',
databaseType: 'sap-hana',
driver: 'com.sap.db.jdbc.Driver',
url: 'jdbc:sap://hostname:port?databaseName=database&reconnect=true',
url: 'jdbc:sap://hostname:port?reconnect=true',
commonly: false,
internal: true,
type: 'jdbc',
@ -698,7 +670,7 @@ export const DATA_BASE_TYPES = [
'org.sqlite.JDBC': 'jdbc:sqlite:[PATH_TO_DB_FILES]',
},
},
{
{
text: 'trino',
databaseType: 'trino',
driver: 'io.trino.jdbc.TrinoDriver',
@ -708,13 +680,12 @@ export const DATA_BASE_TYPES = [
type: 'jdbc',
hasSchema: true,
kerberos: false,
},
},
{
text: 'TDSQL',
text: BI.i18nText('Dec-Dcm_Connection_TDSQL'),
databaseType: 'tdsql',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/database',
versions: ['pgsql'],
commonly: false,
internal: true,
type: 'jdbc',
@ -727,7 +698,7 @@ export const DATA_BASE_TYPES = [
databaseType: 'starrocks',
driver: 'com.mysql.jdbc.Driver',
drivers: ['com.mysql.jdbc.Driver'],
url: 'jdbc:mysql://hostname:port/default_catalog.database',
url: 'jdbc:mysql://hostname:port/database',
commonly: false,
internal: true,
type: 'jdbc',
@ -776,28 +747,6 @@ export const CONNECT_CHARSET = [
},
];
export const CONNECT_SSH_TYPE = [
{
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
value: 'NORMAL',
privateKeyPathFormVisible: false,
secretFormName: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
},
{
text: BI.i18nText('Dec-Dcm_Connection_Form_PublicKey'),
value: 'KEY',
privateKeyPathFormVisible: true,
secretFormName: BI.i18nText('Dec-Dcm_Connection_Form_Passphrase'),
},
];
export const CONNECT_SSL_TYPE = [
{
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
value: 'NORMAL',
},
];
export const TEST_STATUS = {
LOADING: 'loading',
SUCCESS: 'success',
@ -834,18 +783,15 @@ export const DEFAULT_JDBC_POOL = {
minIdle: 0,
maxWait: 10000,
testOnBorrow: true,
keepAlive: true,
testOnReturn: false,
testWhileIdle: false,
timeBetweenEvictionRunsMillis: 60000,
timeBetweenEvictionRunsMillis: -1,
numTestsPerEvictionRun: 3,
minEvictableIdleTimeMillis: 1800,
maxEvictableIdleTimeMillis: 25200,
keepAliveBetweenTimeMillis: 120000,
};
export const CONNECTION_LAYOUT = {
hgap: 10,
hgap: 5,
vgap: 15,
labelHeight: 24,
};
@ -876,14 +822,3 @@ export const JNDI_FACTORYS = [
export const PAGE_SIZE = 50;
export const INT_MAX_VALUE = 2147483647;
export const INT_MIN_VALUE = -2147483648;
export const YES_OR_NO = [
{
text: BI.i18nText('Dec-Basic_Yes'),
value: 1,
},
{
text: BI.i18nText('Dec-Basic_No'),
value: 0,
}
]

52
src/modules/core/checkIllegalStrings/checkIllegalStrings.ts

@ -1,52 +0,0 @@
/*
https://work.fineres.com/browse/REPORT-91724 用于参数统一校验
*/
import { ILLEGAL_STRINGS } from "./constant";
export type CheckResult = {
legal: boolean,
errorMsg: string,
}
export const CHECK_CORRECT: CheckResult = {
legal: true,
errorMsg: "",
};
/**
*
* @param value
*/
export function checkIllegalStrings(value: string): CheckResult {
// 后端传入的校验开关,如果没传,那也默认开启
const enabled = Dec.system.enableParameterVerify ?? true;
let result = CHECK_CORRECT;
if (enabled) {
// 关键字不区分大小写
ILLEGAL_STRINGS.every(s => {
const sIndex = value.toLowerCase().indexOf(s);
if (sIndex !== -1) {
result = {
legal: false,
errorMsg: `${BI.i18nText("Dec-Basic_Check_Illegal_Strings")}${value.substr(sIndex, s.length)}`,
};
return false;
}
return true;
});
return result;
}
return result;
}
export function checkIllegalStringsInWidgetAndShowError(widget: any) {
const value = widget.getValue();
const result = checkIllegalStrings(value);
if (!result.legal) {
widget.showError(result.errorMsg);
}
return result.legal;
}

15
src/modules/core/checkIllegalStrings/constant.ts

@ -1,15 +0,0 @@
/**
*
*/
export const ILLEGAL_STRINGS = [
"\"",
"<",
">",
"&",
"/script",
"javascript:",
"onblur",
"getruntime",
"processbuilder",
"java.lang.processimpl",
];

1
src/modules/core/index.ts

@ -1 +0,0 @@
export { checkIllegalStringsInWidgetAndShowError, checkIllegalStrings } from "./checkIllegalStrings/checkIllegalStrings"

17
src/modules/crud/api.ts

@ -5,7 +5,6 @@ import {
ConnectionPoolType,
SocketResult,
ResultType,
checkDriverStatusParams,
} from './crud.typings';
export interface Api {
@ -47,17 +46,6 @@ export interface Api {
*/
testConnection(data: Connection): Promise<TestRequest>;
/**
*
*/
getDriverLoadPath(data: Connection): Promise<ResultType<string>>;
/**
*
* @param data
*/
checkDriverStatus(data: checkDriverStatusParams): Promise<ResultType<boolean>>;
/**
*
* @param name
@ -105,9 +93,4 @@ export interface Api {
*
*/
getHyperlink(name: string): string;
/**
* JNDI数据库类型可用状态
*/
getJNDIDatabaseStatus(): Promise<{ data?: boolean }>;
}

6
src/modules/crud/crud.service.ts

@ -15,7 +15,7 @@ export function requestGet(url: string, data?: any): Promise<ResultType> {
export function requestPost(url: string, data = {}): Promise<ResultType> {
return new Promise(resolve => {
Dec.reqByEncrypt("POST", getFullUrl(url), data, re => {
Dec.reqPost(getFullUrl(url), data, re => {
resolve(re);
});
});
@ -23,7 +23,7 @@ export function requestPost(url: string, data = {}): Promise<ResultType> {
export function requestDelete(url: string, data = {}) {
return new Promise(resolve => {
Dec.reqByEncrypt("DELETE", getFullUrl(url), data, re => {
Dec.reqDelete(getFullUrl(url), data, re => {
resolve(re);
});
});
@ -31,7 +31,7 @@ export function requestDelete(url: string, data = {}) {
export function requestPut(url: string, data = {}) {
return new Promise(resolve => {
Dec.reqByEncrypt("PUT", getFullUrl(url), data, re => {
Dec.reqPut(getFullUrl(url), data, re => {
resolve(re);
});
});

245
src/modules/crud/crud.typings.d.ts vendored

@ -1,7 +1,3 @@
export interface CrudParams {
[key: string]: string | number | { [key: string]: any };
}
export interface CrudReqOpts {
url?: string;
type?: 'GET' | 'POST' | 'DELETE' | 'PUT';
@ -13,116 +9,28 @@ export interface CrudReqOpts {
params?: CrudParams;
}
export interface ConnectionLicInfo {
currentConnectionNum: number;
maxConnectionNum: number;
export interface CrudParams {
[key: string]: string | number | { [key: string]: any };
}
export interface ConnectionPoolType {
maxActive: number;
maxIdle: number;
numActive: number;
numIdle: number;
export interface Connection {
connectionId: string;
connectionType: string;
connectionName: string;
creator?: string;
connectionData: ConnectionJDBC | ConnectionJNDI | ConnectionPlugin | string;
privilegeDetailBeanList?: {
privilegeType: number;
privilegeValue: number;
}[];
}
type ConnectionDataOfSSH = {
usingSsh: boolean; // 使用SSH通道
sshIp: string; // 主机
sshPort: number; // 端口
sshUser: string; // 用户名
redirectPort: number;
redirectIp: string;
sshTimeOut: number;
sshKeepAlive: number;
} & (
| {
sshType: 'NORMAL'; // 验证方法:密码
sshPrivateKeyPath: ''; // 没啥意义,该验证方法下为空字符串
sshSecret: string; // 密码
}
| {
sshType: 'KEY'; // 验证方法:公钥
sshPrivateKeyPath: string; // 私钥
sshSecret: string; // 密码短语
}
);
type ConnectionDataOfSSL = {
usingSsl: boolean; // 使用SSL通道
sslType: 'NORMAL'; // SSL类型,只有NORMAL一种
caCertificate: string; // CA证书
verifyCa: boolean; // 验证针对CA的服务器证书
sslClientPrivateKey: string; // 客户端密钥
sslClientCertificate: string; // 客户端证书
};
export interface ConnectionPoolJDBC {
/**
*
*/
initialSize?: number;
/**
*
*/
maxActive?: number;
/**
*
*/
maxIdle?: number;
/**
*
*/
minIdle?: number;
/**
*
*/
maxWait?: number;
/**
* sql查询
*/
validationQuery?: string;
/**
*
*/
testOnBorrow?: boolean;
/**
*
*/
keepAlive?: boolean;
/**
*
*/
testOnReturn?: boolean;
/**
*
*/
testWhileIdle?: boolean;
/**
* 线
*/
timeBetweenEvictionRunsMillis?: number;
/**
*
*/
numTestsPerEvictionRun?: number;
/**
*
*/
minEvictableIdleTimeMillis?: number;
/**
*
*/
maxEvictableIdleTimeMillis?: number;
/**
*
*/
keepAliveBetweenTimeMillis?: number;
export interface ConnectionLicInfo {
currentConnectionNum: number;
maxConnectionNum: number;
}
export type ConnectionJDBC = {
export interface ConnectionJDBC {
/**
*
*/
@ -136,10 +44,6 @@ export type ConnectionJDBC = {
*
*/
driver: string;
/**
*
*/
driverSource: 'default' | 'custom';
/**
* url
*/
@ -204,10 +108,6 @@ export type ConnectionJDBC = {
*
*/
keyPath?: string;
/**
* krb5.conf文件
*/
krb5Path?: string;
/**
* fetchSize
*/
@ -218,45 +118,71 @@ export type ConnectionJDBC = {
identity?: string;
connectionPoolAttr: ConnectionPoolJDBC;
}
export interface ConnectionPoolJDBC {
/**
*
*
*/
parallelLoad?: IParallelLoad;
initialSize?: number;
/**
* HDFS
*
*/
hdfs?: {
/**
* HDFS地址
*/
hdfsAddress?: string;
};
} & ConnectionDataOfSSH & ConnectionDataOfSSL;
maxActive?: number;
/**
*
*/
maxIdle?: number;
/**
*
*/
minIdle?: number;
/**
*
*/
maxWait?: number;
/**
* sql查询
*/
validationQuery?: string;
/**
*
*/
testOnBorrow?: boolean;
/**
*
*/
export interface IParallelLoad {
/**
*
*
*/
serverAddress?: string;
testOnReturn?: boolean;
/**
*
*
*/
serverAddressItems?: string[];
testWhileIdle?: boolean;
/**
*
* 线
*/
reuseTemporaryTable?: string;
timeBetweenEvictionRunsMillis?: number;
/**
*
*
*/
filePiecesLimit?: string;
numTestsPerEvictionRun?: number;
/**
*
*
*/
fileSizeLimit?: string
minEvictableIdleTimeMillis?: number;
}
export interface ConnectionJNDI {
jndiName: string;
/**
*
*/
originalCharsetName: string;
newCharsetName: string;
creator?: string;
contextHashtable: ContextHashtable;
}
export interface ContextHashtable {
@ -277,54 +203,33 @@ export interface ContextHashtable {
'java.naming.applet': string;
}
export interface ConnectionJNDI {
jndiName: string;
/**
*
*/
originalCharsetName: string;
newCharsetName: string;
creator?: string;
contextHashtable: ContextHashtable;
}
export interface ConnectionPlugin {
pluginType: 'json';
creator: '';
pluginData: any;
}
export interface Connection {
connectionId: string;
connectionType: string;
connectionName: string;
creator?: string;
connectionData: ConnectionJDBC | ConnectionJNDI | ConnectionPlugin | string;
privilegeDetailBeanList?: {
privilegeType: number;
privilegeValue: number;
}[];
}
export interface TestRequest {
data?: string[];
errorCode?: string;
errorMsg?: string;
}
export interface ConnectionPoolType {
maxActive: number;
maxIdle: number;
numActive: number;
numIdle: number;
}
export interface SocketResult {
data?: string;
errorCode?: string;
errorMsg?: string;
}
export interface ResultType<T = any> {
data?: T;
export interface ResultType {
data?: any;
errorCode?: string;
errorMsg?: string;
}
export type checkDriverStatusParams = {
path: string;
driver: ConnectionJDBC['driver'];
}

48
src/modules/crud/decision.api.ts

@ -1,5 +1,5 @@
import { Api } from './api';
import { Connection, TestRequest, ConnectionPoolType, SocketResult, ConnectionLicInfo, ResultType, checkDriverStatusParams } from './crud.typings';
import { Connection, TestRequest, ConnectionPoolType, SocketResult, ConnectionLicInfo } from './crud.typings';
import { requestGet, requestDelete, requestPost, requestPut } from './crud.service';
import { editStatusEvent, errorCode } from '@constants/env';
@ -48,27 +48,6 @@ export class DecisionApi implements Api {
return requestPost('test', form);
}
/**
*
* @returns
*/
getDriverLoadPath(data: Connection): Promise<ResultType<string>> {
const form = {
...data,
connectionData: JSON.stringify(data.connectionData),
};
return requestPost('driver/path', form);
}
/**
*
* @param data
*/
checkDriverStatus(data: checkDriverStatusParams): Promise<ResultType<boolean>> {
return requestGet(Dec.Utils.getEncodeURL('test/driver/conflict', '', data));
}
getConnectionPool(name: string): Promise<{ data?: ConnectionPoolType }> {
return requestGet(`pool/info?connectionName=${encodeURIComponent(name)}`, {});
}
@ -129,39 +108,18 @@ export class DecisionApi implements Api {
getCipher(password: string) {
return BI.Providers.getProvider('dec.provider.cipher')
.getCompleteCipher(password);
.getCipher(password);
}
getPlain(cipher: string) {
return BI.Providers.getProvider('dec.provider.cipher')
.getCompletePlain(cipher);
.getPlain(cipher);
}
getHyperlink(name: string) {
return Dec.system[DecCst.Hyperlink.DECISION_HYPERLINK_CONFIG][name];
}
changePrincipal(value: any) {
return requestPost(`switch/principal`, value);
}
getPrincipals(keytab: string) {
return requestGet(`/principals?keytabPath=${keytab}`, {});
}
getTimeOut(): Promise<{ data?: any }> {
return requestGet('kdc/timeout', {});
}
putTimeOut(value: number) {
return requestPut(`kdc/timeout?timeout=${value}`, {})
}
// 获取当前lic是否可以使用JNDI数据库类型
getJNDIDatabaseStatus(): Promise<{ data?: boolean }> {
return requestGet('databasetype/limit', {});
}
private sendEditStatusEvent(name: string, type: string): Promise<SocketResult> {
return new Promise(resolve => {
if (Dec && Dec.socket.connected) {

27
src/modules/crud/design.api.ts

@ -1,5 +1,5 @@
import { Api } from './api';
import { Connection, TestRequest, ConnectionPoolType, SocketResult, ConnectionLicInfo, ResultType, ConnectionJDBC, checkDriverStatusParams } from './crud.typings';
import { Connection, TestRequest, ConnectionPoolType, SocketResult, ConnectionLicInfo } from './crud.typings';
import { requestGet } from './crud.service';
// TODO: 此页面的接口等待设计器提供相应的方法
@ -39,27 +39,6 @@ export class DesignApi implements Api {
});
}
/**
*
* @param name
* @returns
*/
getDriverLoadPath(data: Connection): Promise<ResultType<string>> {
return new Promise(resolve => {
resolve({ data: '' });
});
}
/**
*
* @param data
*/
checkDriverStatus(data: checkDriverStatusParams): Promise<ResultType<boolean>> {
return new Promise(resolve => {
resolve({ data: false });
});
}
getConnectionPool(name: string): Promise<{ data: ConnectionPoolType }> {
return new Promise(resolve => {
resolve({
@ -109,8 +88,4 @@ export class DesignApi implements Api {
// 设计器获取超链
return '';
}
getJNDIDatabaseStatus() {
return Promise.resolve({ data: true });
}
}

24
src/modules/pages/__point__/connect.point.ts

@ -1,24 +0,0 @@
BI.point("dec.dcm.model.connection", "createNewConnection", () => {
Dec.Utils.saveFocusPoint({
id: "E73325",
title: "新建数据连接",
});
});
BI.point("dec.dcm.model.title_maintain", "setTestEvent", () => {
Dec.Utils.saveFocusPoint({
id: "E73328",
title: "测试数据连接",
});
});
BI.point("dec.dcm.model.maintain_form", "addConnection", function () {
Dec.Utils.saveFocusPoint({
id: "E8827",
title: "保存数据连接",
body: {
datebaseType: this.model.datebaseTypeSelected,
databaseName: this.model.connectionSelected,
},
});
});

9
src/modules/pages/connection/connection.model.ts

@ -13,14 +13,13 @@ export class ConnectionModel extends Model<{
connectionSelected: AppModel['TYPE']['connectionSelected'];
connectionSelectedOne: AppModel['TYPE']['connectionSelectedOne'];
datebaseTypeSelected: AppModel['TYPE']['datebaseTypeSelected'];
noTestConnection: AppModel['TYPE']['noTestConnection'];
},
childContext: ConnectionModel['childContext'];
context: ConnectionModel['context'];
}> {
static xtype = 'dec.dcm.model.connection';
context = <const>['pageIndex', 'connectionSelected', 'connectionSelectedOne', 'datebaseTypeSelected', 'connectionLicInfo', 'noTestConnection'];
context = <const>['pageIndex', 'connectionSelected', 'connectionSelectedOne', 'datebaseTypeSelected', 'connectionLicInfo'];
actions = {
initConnectionLicInfo: (cb: Function) => {
@ -54,14 +53,8 @@ export class ConnectionModel extends Model<{
this.model.connectionSelected = name;
},
getConnectionStatus() {
if (this.model.connectionSelectedOne.pluginConnection) {
return Promise.resolve();
}
return api.getConnectionStatus(this.model.connectionSelected);
},
setNoTestConnection(value: boolean) {
this.model.noTestConnection = value;
},
checkConnectionLic() {
return this.model.connectionLicInfo.currentConnectionNum > this.model.connectionLicInfo.maxConnectionNum;
},

84
src/modules/pages/connection/connection.ts

@ -24,17 +24,24 @@ export class Connection extends BI.Widget {
title: HTapeLayout;
watch = {
connectionSelectedOne: {
immediate: true,
handler: (v: Connection) => {
BI.nextTick(() => {
const connectionName = v.connectionName;
connectionName
? this.renderConnectionListView(connectionName)
: this.renderEmptyListView();
});
},
connectionSelected: (name: string) => {
if (name) {
const canEdit = connectionCanEdit(this.model.connectionSelectedOne);
const type = this.getSelectConnectionType();
this.connectionTitleWidget.setText(`${name}${getTextByDatabaseType(type)}`);
this.connectionEditWidget.setVisible(canEdit);
const hasRegistered = this.hasRegistered();
this.title.setVisible(hasRegistered);
if (!hasRegistered) {
this.listView.populate(BI.createItems(this.renderNoRegistered()));
} else {
this.listView.populate(BI.createItems(this.renderItems()));
}
} else {
this.listView.populate(BI.createItems(this.renderEmpty()));
this.connectionTitleWidget.setText('');
this.connectionEditWidget.setVisible(false);
}
},
};
@ -43,6 +50,8 @@ export class Connection extends BI.Widget {
}
render() {
this.store.setConnectionSelected('');
return {
type: BI.HTapeLayout.xtype,
hgap: 10,
@ -62,9 +71,6 @@ export class Connection extends BI.Widget {
{
type: BI.Button.xtype,
text: BI.i18nText('Dec-Dcm_Connection_New'),
title: BI.i18nText('Dec-Dcm_Connection_New'),
minWidth: 0,
width: 98,
handler: () => {
this.store.createNewConnection();
},
@ -73,7 +79,7 @@ export class Connection extends BI.Widget {
right: [
{
type: 'dec.connection.driver.entry',
invisible: !BI.Services.getService('dec.service.global').isAdmin(),
invisible: true,
from: '.dec-dcm',
listeners: [
{
@ -128,17 +134,16 @@ export class Connection extends BI.Widget {
},
handler: () => {
this.store.getConnectionStatus()
.then(() => {
const databaseType = this.model.connectionSelectedOne.connectionType;
const database = BI.find(getAllDatabaseTypes(), (_index, value) => value.databaseType === databaseType);
this.setMaintainPage();
this.store.setNoTestConnection(database.isHideConnection);
.then(re => {
this.store.setPageIndex(PAGE_INDEX.MAINTAIN);
this.store.setDatebaseTypeSelected('');
})
.catch(() => {
});
},
}],
},
width: 90,
},
],
},
@ -205,6 +210,12 @@ export class Connection extends BI.Widget {
}];
}
private renderEmpty() {
return [{
type: BI.Layout.xtype,
}];
}
private hasRegistered() {
const allDatabaseTypes = getAllDatabaseTypes();
switch (this.model.connectionSelectedOne.connectionType) {
@ -226,37 +237,4 @@ export class Connection extends BI.Widget {
return databaseType;
}
private setMaintainPage() {
this.store.setPageIndex(PAGE_INDEX.MAINTAIN);
this.store.setDatebaseTypeSelected('');
}
private renderConnectionListView(name: string) {
const canEdit = connectionCanEdit(this.model.connectionSelectedOne),
type = this.getSelectConnectionType(),
hasRegistered = this.hasRegistered();
this.connectionTitleWidget.setText(`${name}${getTextByDatabaseType(type)}`);
this.connectionEditWidget.setVisible(canEdit);
this.title.setVisible(hasRegistered);
hasRegistered
? this.listView.populate(BI.createItems(this.renderItems()))
: this.listView.populate(BI.createItems(this.renderNoRegistered()));
}
private renderEmptyListView() {
this.listView.populate(
BI.createItems([
{
type: BI.Layout.xtype,
}
])
);
this.connectionTitleWidget.setText('');
this.connectionEditWidget.setVisible(false);
}
}

600
src/modules/pages/connection/connection_jdbc/connection_jdbc.ts

@ -1,405 +1,195 @@
import { shortcut, store } from '@core/core';
import { FormItem } from '../components/form_item/form_item';
import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { ConnectionJdecModel } from './connection_jdbc.model';
import { ConnectionJDBC } from 'src/modules/crud/crud.typings';
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo } from '../../../app.service';
import { CONNECTION_LAYOUT, CONNECT_SSH_TYPE } from '@constants/constant';
import { VerticalLayout } from '@fui/core';
import { ApiFactory } from '../../../crud/apiFactory';
const api = new ApiFactory().create();
@shortcut()
@store(ConnectionJdecModel)
export class ConnectionJdbc extends BI.Widget {
static xtype = 'dec.dcm.connection_jdbc';
model: ConnectionJdecModel['model'];
allDatabaseTypes = getAllDatabaseTypes();
sshSet: VerticalLayout;
sslSet: VerticalLayout;
advancedSet: VerticalLayout;
parallelLoadSet: VerticalLayout;
render() {
const connectionData = this.model.connectionSelectedOne.connectionData as ConnectionJDBC;
const {
driver,
driverSource,
database,
user,
originalCharsetName,
schema,
connectionPoolAttr,
authType,
principal,
url,
fetchSize,
// ssh
usingSsh,
sshIp,
sshPort,
sshUser,
sshType,
sshSecret,
sshPrivateKeyPath,
// ssl
usingSsl,
caCertificate,
verifyCa,
sslClientPrivateKey,
sslClientCertificate,
// 并行装载
parallelLoad,
// HDFS
hdfs,
} = connectionData;
const databaseType = getJdbcDatabaseType(database, driver);
const { host, port, catalog, databaseName, version } = resolveUrlInfo(url, database);
this.version = !BI.isUndefined(databaseType.versions) ? (version ?? databaseType.versions[0]) : version;
const { hgap, vgap } = CONNECTION_LAYOUT;
return {
type: BI.VerticalLayout.xtype,
hgap,
vgap,
items: [
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Basic_Version'),
invisible: BI.isUndefined(this.version),
value: BI.i18nText('Dec-Migration_Database_Version', this.version),
},
{
type: FormItem.xtype,
_tgap: BI.isUndefined(this.version) ? vgap : 0,
name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
value: BI.isKey(driverSource) ? `${driver} (${driverSource})` : driver,
},
{
type: FormItem.xtype,
name: 'catalog',
invisible: database !== 'starrocks',
value: catalog,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'),
value: databaseName,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'),
value: host,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
value: port,
},
authType
? {
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_AuthType'),
value: authType,
}
: {
type: BI.Layout.xtype,
},
{
type: FormItem.xtype,
name: authType ? BI.i18nText('Dec-Dcm_Connection_Form_Principal') : BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
value: authType ? principal : user,
},
{
type: FormItem.xtype,
name: authType ? BI.i18nText('Dec-Dcm_Connection_Form_KeyPath') : BI.i18nText('Dec-Dcm_Connection_Form_Password'),
value: '******',
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
value: originalCharsetName ? originalCharsetName : BI.i18nText('Dec-Dcm_Connection_Form_Default'),
},
// HDFS设置
{
type: FormItem.xtype,
invisible: BI.isNull(hdfs),
name: BI.i18nText('Dec-Dcm_Connection_Address', 'HDFS'),
value: hdfs?.hdfsAddress,
},
// 并行装载设置
{
type: Collapse.xtype,
invisible: BI.isNull(parallelLoad),
name: BI.i18nText('Dec-Dcm_Connection_Setting', BI.i18nText('Dec-Dcm_Connection_Parallel_Load')),
listeners: [
{
eventName: EVENT_CHANGE,
action: (isCollapse: boolean) => {
this.parallelLoadSet.setVisible(!isCollapse);
},
},
],
},
{
type: BI.VerticalLayout.xtype,
invisible: true,
ref: (_ref: VerticalLayout) => {
this.parallelLoadSet = _ref;
},
items: [
{
type: FormItem.xtype,
_bgap: vgap,
name: `${BI.i18nText('Dec-Dcm_Connection_Server_Address')}-${BI.i18nText('Dec-Memory_Detection_Server_Cluster_Node', '1')}`,
value: parallelLoad?.serverAddress,
},
{
type: FormItem.xtype,
_bgap: vgap,
name: BI.i18nText('Dec-Dcm_Connection_Reuse_Temporary_Table'),
value: parallelLoad?.reuseTemporaryTable,
},
{
type: FormItem.xtype,
_bgap: vgap,
name: BI.i18nText('Dec-Dcm_Connection_Temporary_File_Pieces_Limit'),
value: parallelLoad?.filePiecesLimit,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Temporary_File_Size_Limit'),
value: parallelLoad?.fileSizeLimit,
},
],
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'),
value: schema,
invisible: !databaseType.hasSchema,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'),
value: url,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'),
value: connectionPoolAttr.maxActive,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'),
value: connectionPoolAttr.testOnBorrow ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Regular_Check_On_Borrow'),
value: connectionPoolAttr.keepAlive ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'),
value: api.getPlain(connectionPoolAttr.validationQuery || ''),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'),
value: connectionPoolAttr.maxWait,
unit: BI.i18nText('Dec-Dcm_Millisecond'),
},
// ssh设置
{
type: Collapse.xtype,
width: 100,
invisible: !usingSsh,
name: BI.i18nText('Dec-Dcm_Connection_Setting', 'SSH'),
listeners: [
{
eventName: EVENT_CHANGE,
action: (isCollapse: boolean) => {
this.sshSet.setVisible(!isCollapse);
},
},
],
},
{
el: {
type: BI.VerticalLayout.xtype,
bgap: vgap,
invisible: true,
ref: (_ref: VerticalLayout) => {
this.sshSet = _ref;
},
items: [
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'),
value: sshIp,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
value: sshPort,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
value: sshUser,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_VerifyType'),
value: CONNECT_SSH_TYPE.find((SSH_TYPE) => sshType === SSH_TYPE.value).text,
},
{
type: FormItem.xtype,
invisible: sshType !== 'KEY',
name: BI.i18nText('Dec-Dcm_Connection_Form_PrivateKey'),
value: sshPrivateKeyPath,
},
{
type: FormItem.xtype,
name: CONNECT_SSH_TYPE.find((SSH_TYPE) => sshType === SSH_TYPE.value).secretFormName,
value: sshSecret,
},
],
},
},
// ssl设置
{
type: Collapse.xtype,
width: 100,
invisible: !usingSsl,
name: BI.i18nText('Dec-Dcm_Connection_Setting', 'SSL'),
listeners: [
{
eventName: EVENT_CHANGE,
action: (isCollapse: boolean) => {
this.sslSet.setVisible(!isCollapse);
},
},
],
},
{
el: {
type: BI.VerticalLayout.xtype,
bgap: vgap,
invisible: true,
ref: (_ref: VerticalLayout) => {
this.sslSet = _ref;
},
items: [
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_CA_Certificate'),
value: caCertificate,
},
{
type: FormItem.xtype,
invisible: !caCertificate,
name: BI.i18nText('Dec-Dcm_Connection_Form_Verify_CA_Certificate'),
value: verifyCa ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_SecretKey'),
value: sslClientPrivateKey,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Client') + BI.i18nText('Dec-Dcm_Connection_Form_Certificate'),
value: sslClientCertificate,
},
],
},
},
// 更多设置
{
type: Collapse.xtype,
width: 100,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_More_Setting'),
listeners: [
{
eventName: EVENT_CHANGE,
action: (isCollapse: boolean) => {
this.advancedSet.setVisible(!isCollapse);
},
},
],
},
{
el: {
type: BI.VerticalLayout.xtype,
bgap: vgap,
invisible: true,
ref: (_ref: VerticalLayout) => {
this.advancedSet = _ref;
},
items: [
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
value: connectionPoolAttr.initialSize,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'),
value: connectionPoolAttr.minIdle,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'),
value: connectionPoolAttr.testOnReturn ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'),
value: connectionPoolAttr.testWhileIdle ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'),
value: connectionPoolAttr.timeBetweenEvictionRunsMillis,
unit: BI.i18nText('Dec-Dcm_Millisecond'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num'),
value: connectionPoolAttr.numTestsPerEvictionRun,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'),
value: connectionPoolAttr.minEvictableIdleTimeMillis,
unit: BI.i18nText('BI-Basic_Seconds'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Evictable_Idle_Time_Millis'),
value: connectionPoolAttr.maxEvictableIdleTimeMillis,
unit: BI.i18nText('BI-Basic_Seconds'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Regular_Check_On_Borrow_Threshold'),
value: connectionPoolAttr.keepAliveBetweenTimeMillis,
unit: BI.i18nText('Dec-Dcm_Millisecond'),
},
{
type: FormItem.xtype,
name: 'Fetchsize',
value: fetchSize,
},
],
},
},
],
};
}
}
import { shortcut, store } from '@core/core';
import { FormItem } from '../components/form_item/form_item';
import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { ConnectionJdecModel } from './connection_jdbc.model';
import { ConnectionJDBC } from 'src/modules/crud/crud.typings';
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo } from '../../../app.service';
import { CONNECTION_LAYOUT } from '@constants/constant';
import { VerticalLayout } from '@fui/core';
import { ApiFactory } from '../../../crud/apiFactory';
const api = new ApiFactory().create();
@shortcut()
@store(ConnectionJdecModel)
export class ConnectionJdbc extends BI.Widget {
static xtype = 'dec.dcm.connection_jdbc';
advancedSet: any;
model: ConnectionJdecModel['model'];
allDatabaseTypes = getAllDatabaseTypes();
render() {
const connectionData = this.model.connectionSelectedOne.connectionData as ConnectionJDBC;
const {
driver,
driverSource,
database,
user,
originalCharsetName,
schema,
connectionPoolAttr,
authType,
principal,
url,
fetchSize,
} = connectionData;
const databaseType = getJdbcDatabaseType(database, driver);
const { host, port, databaseName } = resolveUrlInfo(url, database);
const { hgap, vgap } = CONNECTION_LAYOUT;
return {
type: BI.VerticalLayout.xtype,
hgap,
vgap,
items: [
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
value: BI.isKey(driverSource) ? `${driver} (${driverSource})` : driver,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'),
value: databaseName,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'),
value: host,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
value: port,
},
authType ?
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_AuthType'),
value: authType,
} : {
type: BI.Layout.xtype,
},
{
type: FormItem.xtype,
name: authType ? BI.i18nText('Dec-Dcm_Connection_Form_Principal') : BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
value: authType ? principal : user,
},
{
type: FormItem.xtype,
name: authType ? BI.i18nText('Dec-Dcm_Connection_Form_KeyPath') : BI.i18nText('Dec-Dcm_Connection_Form_Password'),
value: '******',
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
value: originalCharsetName ? originalCharsetName : BI.i18nText('Dec-Dcm_Connection_Form_Default'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'),
value: schema,
invisible: !databaseType.hasSchema,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'),
value: url,
},
{
type: Collapse.xtype,
width: 70,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Advanced_Setting'),
listeners: [
{
eventName: EVENT_CHANGE,
action: (isCollapse: boolean) => {
this.advancedSet.setVisible(!isCollapse);
},
},
],
},
{
type: BI.VerticalLayout.xtype,
tgap: -15,
vgap,
invisible: true,
ref: (_ref: VerticalLayout) => {
this.advancedSet = _ref;
},
items: [
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
value: connectionPoolAttr.initialSize,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'),
value: connectionPoolAttr.maxActive,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'),
value: connectionPoolAttr.maxIdle,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'),
value: connectionPoolAttr.minIdle,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'),
value: connectionPoolAttr.maxWait,
unit: BI.i18nText('Dec-Dcm_Millisecond'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Validation_Query'),
value: api.getPlain(connectionPoolAttr.validationQuery || ''),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'),
value: connectionPoolAttr.testOnBorrow ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'),
value: connectionPoolAttr.testOnReturn ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'),
value: connectionPoolAttr.testWhileIdle ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'),
value: connectionPoolAttr.timeBetweenEvictionRunsMillis,
unit: BI.i18nText('Dec-Dcm_Millisecond'),
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num'),
value: connectionPoolAttr.numTestsPerEvictionRun,
},
{
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'),
value: connectionPoolAttr.minEvictableIdleTimeMillis,
unit: BI.i18nText('BI-Basic_Seconds'),
}, {
type: FormItem.xtype,
invisible: fetchSize < 0 && fetchSize !== -2,
name: 'Fetchsize',
value: fetchSize === -2 ? '' : fetchSize,
},
],
},
],
};
}
}

1
src/modules/pages/connection/list/list.constant.ts

@ -1 +0,0 @@
BI.constant('dec.constant.connection.list', []);

34
src/modules/pages/connection/list/list.model.ts

@ -1,11 +1,10 @@
import { model, Model } from '@core/core';
import { ApiFactory } from '../../..//crud/apiFactory';
import { AppModel } from '../../../app.model';
import type { ConnectionJDBC } from '../../../crud/crud.typings';
const api = new ApiFactory().create();
@model()
export class ConnectionListModel extends Model<{
types: {
types : {
connections: AppModel['TYPE']['connections'];
connectionSelected: AppModel['TYPE']['connectionSelected'];
},
@ -20,40 +19,21 @@ export class ConnectionListModel extends Model<{
}
actions = {
setConnections: (): Promise<void> => api.getConnectionList().then(data => {
data.data.push(...BI.Constants.getConstant('dec.constant.connection.list'));
setConnections: ():Promise<void> => api.getConnectionList().then(data => {
if (BI.size(data.data) > 0) {
this.model.connections = data.data;
let defaultDatabaseName,
defaultDatabaseId = BI.Services.getService("dec.service.global")
.getHashSearchParams("databaseId");
this.model.connections.forEach(item => {
// REPORT-111534 有些环境存在脏数据,补下容错
if (BI.isNull(item.connectionData)) return;
// 后端传过来的是字符串,转为对象
BI.isString(item.connectionData) && (item.connectionData = JSON.parse(item.connectionData as string));
// 目前只有jdbc存在identity,后期拓展
if ((item.connectionData as ConnectionJDBC).identity === defaultDatabaseId) {
defaultDatabaseName = item.connectionName;
}
// 后端传过来的是字符串,转为对象
item.connectionData = JSON.parse(item.connectionData as string);
});
// 仅首次进入时从url中读取参数,其他情况保留选中状态
defaultDatabaseName ||= data.data[0].connectionName;
this.setSelectedConnection(defaultDatabaseName);
this.model.connectionSelected = data.data[0].connectionName;
} else {
this.model.connectionSelected = '';
}
return new Promise(resolve => {
resolve();
});
}),
setSelectedConnection(name: string) {
this.model.connectionSelected = name;
}
}
}

2
src/modules/pages/connection/list/list.ts

@ -3,7 +3,6 @@ import { ListItem } from './list_item/list_item';
import { ConnectionListModel } from './list.model';
import { getDatabaseType } from './list.service';
import { Tab } from '@fui/core';
import './list.constant'
@shortcut()
@store(ConnectionListModel)
@ -92,7 +91,6 @@ export class ConnectionList extends BI.Pane {
creator: item.creator,
databaseType: getDatabaseType(item),
selected: this.model.connectionSelected ? this.model.connectionSelected === item.connectionName : index === 0,
pluginConnection: item.pluginConnection,
};
});
}

3
src/modules/pages/connection/list/list_item/list_item.model.ts

@ -139,9 +139,8 @@ export class ListItemModel extends Model<{
// 后端传过来的是字符串,转为对象
item.connectionData = JSON.parse(item.connectionData as string);
});
if (name === this.model.connectionSelected) {
this.setConnectionSelected(this.model.connections?.[0]?.connectionName || '');
this.model.connectionSelected = BI.size(this.model.connections) > 0 ? this.model.connections[0].connectionName : '';
}
api.shutdownConnectionStatus(name);
});

33
src/modules/pages/connection/list/list_item/list_item.ts

@ -6,10 +6,6 @@ import { hasRegistered } from '../list.service';
import { connectionCanEdit, getTextByDatabaseType, getChartLength } from '../../../../app.service';
import { testConnection } from '../../../maintain/forms/form.server';
import { DownListCombo, Label, SignEditor } from '@fui/core';
import { ApiFactory } from '../../../../crud/apiFactory';
import { checkIllegalStrings } from "@core/index";
const api = new ApiFactory().create();
@shortcut()
@store(ListItemModel)
@ -20,7 +16,6 @@ export class ListItem extends BI.BasicButton {
name: '',
creator: '',
databaseType: '',
pluginConnection: false,
height: 25,
baseCls: 'dec-dcm-connection-list-item bi-list-item-active2',
$testId: 'dec-dcm-connection-list-item',
@ -44,7 +39,7 @@ export class ListItem extends BI.BasicButton {
};
render() {
const { name, databaseType, pluginConnection } = this.options;
const { name, databaseType } = this.options;
return {
type: BI.HTapeLayout.xtype,
@ -91,17 +86,6 @@ export class ListItem extends BI.BasicButton {
return;
}
const result = checkIllegalStrings(newName);
if (!result.legal) {
BI.Msg.toast(result.errorMsg, {
level: 'error',
});
this.store.setIsEdit(false, name);
this.nameLabel.setText(name);
this.nameEditor.setValue(name);
return;
}
this.store.changeName(name, newName).then(re => {
this.store.setIsEdit(false, name);
if (re.errorCode) {
@ -119,7 +103,7 @@ export class ListItem extends BI.BasicButton {
},
],
}, {
el: databaseType && !pluginConnection ? {
el: databaseType ? {
type: BI.DownListCombo.xtype,
cls: 'link-item-icon',
stopPropagation: true,
@ -222,17 +206,8 @@ export class ListItem extends BI.BasicButton {
}
private testConnectionAction() {
// 接口返回的内容是对称加密的,前端要先解密再用新加密传回去
const connection = BI.cloneDeep(this.model.connections
.find(item => item.connectionName === this.options.name));
if (BI.isNull(connection)) return;
const validationQuery = connection?.connectionData?.connectionPoolAttr?.validationQuery || '';
BI.set(connection, 'connectionData.connectionPoolAttr.validationQuery', api.getCipher(api.getPlain(validationQuery)));
testConnection(connection);
const { name } = this.options;
testConnection(this.model.connections.find(item => item.connectionName === name));
}
private itemActionCalculate() {

17
src/modules/pages/database/database.constant.ts

@ -1,17 +0,0 @@
import { DATEBASE_FILTER_TYPE } from "@constants/constant";
BI.constant('dec.constant.database.filter.type', [
{
text: BI.i18nText('Dec-Dcm_Connection_Commonly'),
value: DATEBASE_FILTER_TYPE.COMMONLY,
selected: true,
},
{
text: BI.i18nText('Dec-Dcm_Connection_All'),
value: DATEBASE_FILTER_TYPE.ALL,
},
{
text: BI.i18nText('Dec-Dcm_Connection_Other'),
value: DATEBASE_FILTER_TYPE.OTHER,
},
]);

23
src/modules/pages/database/database.model.ts

@ -2,12 +2,10 @@ import { model, Model } from '@core/core';
import { AppModel } from 'src/modules/app.model';
import { getAllDatabaseTypes } from '../../app.service';
import { DatabaseType } from '../../app.typings';
import { connectionType } from '@constants/env';
import { OTHER_JDBC } from '@constants/constant';
@model()
export class DatebaseModel extends Model<{
types: {
types : {
filter: AppModel['TYPE']['filter'];
datebaseTypeSelected: AppModel['TYPE']['datebaseTypeSelected'];
},
@ -22,30 +20,20 @@ export class DatebaseModel extends Model<{
isInternal: true,
isPlugin: true,
datebaseTypes: getAllDatabaseTypes().filter(item => item.commonly),
isJNDILimit: false,
};
}
computed = {
otherDatabases: () => {
return this.model.isJNDILimit
? [OTHER_JDBC]
: [OTHER_JDBC, connectionType.JNDI];
}
}
actions = {
setSearch: (search: string) => {
setSearch:(search: string) => {
this.model.search = search;
},
setFilter: (filter: string) => {
setFilter:(filter: string) => {
this.model.filter = filter;
},
setDatebaseTypes: (datebaseTypes: DatabaseType[]) => {
this.model.datebaseTypes = datebaseTypes;
this.model.datebaseTypeSelected = '';
},
setInternal: (isInternal: boolean) => {
setInternal:(isInternal: boolean) => {
this.model.isInternal = isInternal;
},
setPlugin: (isPlugin: boolean) => {
@ -54,8 +42,5 @@ export class DatebaseModel extends Model<{
setDatebaseTypeSelected(datebaseType: string) {
this.model.datebaseTypeSelected = datebaseType;
},
setJNDILimit: (v: boolean) => {
this.model.isJNDILimit = v;
},
}
}

46
src/modules/pages/database/database.ts

@ -6,11 +6,6 @@ import { connectionType } from '@constants/env';
import { DatebaseType } from './database_type/database_type';
import { getAllDatabaseTypes } from '../../app.service';
import { ButtonGroup, MultiSelectItem, SearchEditor } from '@fui/core';
import { ApiFactory } from 'src/modules/crud/apiFactory';
import './database.constant'
const api = new ApiFactory().create();
@shortcut()
@store(DatebaseModel)
export class Datebase extends BI.Widget {
@ -70,7 +65,6 @@ export class Datebase extends BI.Widget {
mounted() {
this.store.setFilter(DATEBASE_FILTER_TYPE.COMMONLY);
this.store.setDatebaseTypeSelected('');
this.getDatabaseTypeLimit();
}
render() {
@ -122,12 +116,24 @@ export class Datebase extends BI.Widget {
ref: (_ref: ButtonGroup) => {
this.filter = _ref;
},
items: () => BI.map(BI.Constants.getConstant('dec.constant.database.filter.type'), (_, value) => {
return {
items: [
{
type: Filter.xtype,
...value,
}
}),
text: BI.i18nText('Dec-Dcm_Connection_Commonly'),
value: DATEBASE_FILTER_TYPE.COMMONLY,
selected: true,
},
{
type: Filter.xtype,
text: BI.i18nText('Dec-Dcm_Connection_All'),
value: DATEBASE_FILTER_TYPE.ALL,
},
{
type: Filter.xtype,
text: BI.i18nText('Dec-Dcm_Connection_Other'),
value: DATEBASE_FILTER_TYPE.OTHER,
},
],
},
width: 200,
},
@ -136,18 +142,20 @@ export class Datebase extends BI.Widget {
items: [
{
el: {
type: BI.VerticalAdaptLayout.xtype,
type: BI.HTapeLayout.xtype,
hgap: 20,
invisible: true,
items: [
{
type: BI.Label.xtype,
width: 70,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Type_Filter'),
title: BI.i18nText('Dec-Dcm_Connection_Type_Filter'),
},
{
type: BI.MultiSelectItem.xtype,
width: 80,
selected: this.model.isInternal,
text: BI.i18nText('Dec-Dcm_Connection_Support_Inner'),
title: BI.i18nText('Dec-Dcm_Connection_Support_Inner'),
@ -160,6 +168,7 @@ export class Datebase extends BI.Widget {
},
{
type: BI.MultiSelectItem.xtype,
width: 80,
selected: this.model.isPlugin,
text: BI.i18nText('Dec-Dcm_Connection_Support_Plugin'),
title: BI.i18nText('Dec-Dcm_Connection_Support_Plugin'),
@ -241,20 +250,11 @@ export class Datebase extends BI.Widget {
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.commonly));
break;
case DATEBASE_FILTER_TYPE.OTHER:
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => this.model.otherDatabases.includes(item.type)));
break;
case DATEBASE_FILTER_TYPE.ALL:
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.type !== connectionType.JNDI && item.type !== OTHER_JDBC));
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.type === connectionType.JNDI || item.type === OTHER_JDBC));
break;
default:
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.marker && (item.marker === filter)));
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.type !== connectionType.JNDI && item.type !== OTHER_JDBC));
break;
}
}
// 获取JNDI
private async getDatabaseTypeLimit() {
const result = await api.getJNDIDatabaseStatus();
this.store.setJNDILimit(result.data);
}
}

7
src/modules/pages/database/database_type/database_type.model.ts

@ -6,13 +6,11 @@ export class DatebaseTypeModel extends Model<
types: {
datebaseTypeSelected: AppModel['TYPE']['datebaseTypeSelected'];
pageIndex: AppModel['TYPE']['pageIndex'];
noTestConnection: AppModel['TYPE']['noTestConnection'];
datebaseTypeSelectedOne: AppModel['TYPE']['datebaseTypeSelectedOne'];
},
context: DatebaseTypeModel['context'];
}> {
static xtype = 'dec.dcm.model.datebase.type';
context = <const>['datebaseTypeSelected', 'pageIndex', 'noTestConnection', 'datebaseTypeSelectedOne'];
context = <const>['datebaseTypeSelected', 'pageIndex'];
actions = {
setDatebaseTypeSelected: (datebaseTypeSelected: string) => {
@ -21,8 +19,5 @@ export class DatebaseTypeModel extends Model<
setPageIndex: (index: string) => {
this.model.pageIndex = index;
},
setNoTestConnection: (value: boolean) => {
this.model.noTestConnection = value;
}
}
}

4
src/modules/pages/database/database_type/database_type.ts

@ -70,7 +70,6 @@ export class DatebaseType extends BI.BasicButton {
const { value } = this.options;
this.store.setDatebaseTypeSelected(value);
this.store.setPageIndex(PAGE_INDEX.MAINTAIN);
this.store.setNoTestConnection(this.model.datebaseTypeSelectedOne.isHideConnection);
}
mounted() {
@ -89,9 +88,6 @@ export class DatebaseType extends BI.BasicButton {
if (url.startsWith('/')) {
return `${PluginImgPrefix}${url}`;
}
if (url.startsWith('http')) {
return url;
}
return `${PluginImgPrefix}/${url}`;
}

17
src/modules/pages/maintain/components/driverselector/driverselector.model.ts

@ -67,8 +67,7 @@ export class DriverSelectorModel extends Model {
this.model.customDriver.driver = driver;
this.model.customDrivers.some(customDriver => {
// DEC-21469 存在driver值相同但driver名不同的场景,因此要用拼接名判断
if (`${customDriver.driverClass} (${customDriver.name})` === value) {
if (customDriver.driverClass === driver) {
this.model.driverSource = customDriver.name;
this.model.customDriver.value = `${driver} (${customDriver.name})`;
@ -87,12 +86,6 @@ export class DriverSelectorModel extends Model {
changeDriverSource: driverTypeComboValue => {
this.model.driverSource = driverTypeComboValue === 'default' ? '' : this.model.driverSource;
},
setDefaultDrivers: version => {
const defaultDrivers = this.getDrivers(version);
this.model.defaultDrivers = defaultDrivers;
this.changeDefaultDriver(defaultDrivers[0]?.value);
}
};
private resolveSelectedDriverType = () => {
@ -103,12 +96,11 @@ export class DriverSelectorModel extends Model {
return [this.options.driverSource, this.options.driver];
};
private getDrivers = (version?: string) => {
private getDrivers = () => {
const connectionData = this.options.connectionData as ConnectionJDBC;
const connectionType = getJdbcDatabaseType(connectionData.database, connectionData.driver);
const selectedVersion = version ?? this.options.version;
const drivers = connectionType.drivers ?
(BI.isUndefined(connectionType.versions) ? connectionType.drivers : connectionType.drivers[selectedVersion]).map(item => {
connectionType.drivers.map(item => {
return {
text: item,
value: item,
@ -118,7 +110,8 @@ export class DriverSelectorModel extends Model {
text: connectionType.driver,
value: connectionType.driver,
}];
if (BI.isUndefined(connectionType.versions) && !drivers.some(item => item.text === connectionData.driver)) {
if (!drivers.some(item => item.text === connectionData.driver)) {
return [
{
text: connectionData.driver,

32
src/modules/pages/maintain/components/driverselector/driverselector.ts

@ -24,32 +24,21 @@ export class DriverSelector extends BI.Widget {
driver: '',
driverSource: '',
connectionData: {} as ConnectionJDBC,
version: '',
};
defaultDrivers: EditorIconCheckCombo = null;
customDrivers: SearchTextValueCombo = null;
beforeRender(cb: Function) {
this.store.initDriverClassList(cb);
}
watch = {
driverClassItems: items => {
this.customDrivers.populate(items);
this.customDrivers.setValue(this.model.customDriver.value);
// this.customDrivers.populate(items);
// this.customDrivers.setValue(this.model.customDriver.value);
},
driverManageEntryVisible: b => {
this.driverManageEntry.setVisible(b);
this.driverManageEntry.setVisible(false);
},
defaultDrivers: items => {
this.defaultDrivers.populate(items);
this.defaultDrivers.setValue(this.model.defaultDriver.driver);
this.fireEvent('EVENT_CHANGE');
}
};
private driverManageEntry = null;
@ -66,6 +55,7 @@ export class DriverSelector extends BI.Widget {
type: BI.TextValueCombo.xtype,
width: 86,
value: this.model.selectedDriverType,
invisible: true,
items: [
{
text: BI.i18nText('Dec-Basic_Default'),
@ -105,7 +95,7 @@ export class DriverSelector extends BI.Widget {
this.defaultDrivers = _ref;
},
invisible: this.model.driverSource !== '',
width: 204,
width: 300,
items: this.model.defaultDrivers,
value: this.model.defaultDriver.driver,
listeners: [
@ -126,13 +116,13 @@ export class DriverSelector extends BI.Widget {
ref: _ref => {
this.customDrivers = _ref;
},
invisible: this.model.driverSource === '',
invisible: true,
width: 204,
watermark: BI.i18nText('Dec-Please_Input'),
items: this.model.driverClassItems,
value: this.model.customDriver.value,
text: () => this.model.customDriver.value || '',
defaultText: BI.i18nText('Dec-Please_Select_One'),
defaultText: BI.i18nText('Dec-Please_Select'),
warningTitle: BI.i18nText('Dec-Dcm-Driver_Driver_File_Lost'),
listeners: [
{
@ -156,7 +146,7 @@ export class DriverSelector extends BI.Widget {
text: BI.i18nText('Dec-Dcm_Create_New_Driver'),
},
from: '.dec-dcm',
invisible: !this.model.driverManageEntryVisible,
invisible: true,
listeners: [
{
eventName: 'EVENT_CLOSE',
@ -185,12 +175,8 @@ export class DriverSelector extends BI.Widget {
getValue() {
return {
driverSource: this.model.driverSource,
// driverSource: this.model.driverSource,
driver: this.model.driverSource === '' ? this.model.defaultDriver.driver : this.model.customDriver.driver,
};
}
setDefaultDrivers(version: string) {
this.store.setDefaultDrivers(version);
}
}

18
src/modules/pages/maintain/components/form_item/form_item.ts

@ -1,5 +1,4 @@
import { shortcut } from '@core/core';
import { Label } from '@fui/core';
import { CONNECTION_LAYOUT } from '@constants/constant';
@shortcut()
@ -12,19 +11,14 @@ export class FormItem extends BI.Widget {
nameWidth: 140,
isBold: true,
$testId: 'dec-dcm-maintain-form-item',
};
nameLabel: Label;
}
render() {
render () {
return {
type: BI.FloatLeftLayout.xtype,
items: [
{
type: BI.Label.xtype,
ref: (ref: Label) => {
this.nameLabel = ref;
},
cls: this.options.isBold ? 'bi-font-bold' : '',
width: this.options.nameWidth,
textAlign: 'left',
@ -35,12 +29,4 @@ export class FormItem extends BI.Widget {
],
};
}
/**
*
* @param name
*/
setName(name: string) {
this.nameLabel.setText(name);
}
}

2755
src/modules/pages/maintain/forms/components/form.jdbc.ts

File diff suppressed because it is too large Load Diff

4
src/modules/pages/maintain/forms/components/form.plugin.ts

@ -37,8 +37,4 @@ export class FormPlugin extends BI.Widget {
connectionData: <ConnectionPlugin>BI.extend({}, connectionData, this.plugin.getValue()),
};
}
public getSaveFn() {
return this.plugin.save;
}
}

5
src/modules/pages/maintain/forms/form.model.ts

@ -17,7 +17,6 @@ export class MaintainFormModel extends Model<{
pageIndex: AppModel['TYPE']['pageIndex'];
connections: AppModel['TYPE']['connections'];
isCopy: AppModel['TYPE']['isCopy'];
connectionSelected: AppModel['TYPE']['connectionSelected'];
},
context: MaintainFormModel['context'];
}> {
@ -32,7 +31,6 @@ export class MaintainFormModel extends Model<{
'testEvent',
'connections',
'isCopy',
'connectionSelected',
];
actions = {
@ -53,8 +51,5 @@ export class MaintainFormModel extends Model<{
goFirstPage() {
this.model.pageIndex = PAGE_INDEX.CONNECTION;
},
setConnectionSelected(name: string) {
this.model.connectionSelected = name;
}
}
}

58
src/modules/pages/maintain/forms/form.server.ts

@ -5,7 +5,6 @@ import { TestStatus } from '../../../components/test_status/test_status';
import { getJdbcDatabaseType } from '../../../app.service';
import { ApiFactory } from '../../../crud/apiFactory';
const api = new ApiFactory().create();
export function testConnection(value: Connection): Promise<string[]> {
return new Promise(resolve => {
let testStatus = null;
@ -16,18 +15,16 @@ export function testConnection(value: Connection): Promise<string[]> {
return false;
}
const id = BI.UUID();
const testConnection = () => {
const formValue = value;
api.testConnection(formValue).then(re => {
if (re && re.errorCode) {
if (re.errorCode === DecCst.ErrorCode.NO_IP_AUTHORIZED) {
if(re.errorCode === DecCst.ErrorCode.NO_IP_AUTHORIZED){
testStatus.setFail();
return;
}
// 判断是否是缺少驱动,如果缺少驱动则显示下载驱动的连接
// 判断是否是缺少驱动,如果缺少驱动则显示下载驱动的连接
if (api.isDriverError(re.errorCode)) {
if (formValue.connectionType === connectionType.JDBC) {
const driver = (formValue.connectionData as ConnectionJDBC).driver;
@ -47,11 +44,7 @@ export function testConnection(value: Connection): Promise<string[]> {
} else if (re.errorCode === errorCode.DUPLICATE_NAMES) {
testStatus.setFail(BI.i18nText(re.errorMsg));
} else {
// 不缺少驱动,但连接失败,打印出当前驱动加载路径,并显示检测驱动按钮
testStatus.setFail(re.errorMsg);
api.getDriverLoadPath(formValue).then(res => {
testStatus.setExtraContainer(createDriverTestContainer(res.data));
})
}
} else if (re.data) {
testStatus.setSuccess();
@ -66,54 +59,7 @@ export function testConnection(value: Connection): Promise<string[]> {
BI.Maskers.remove(id);
}
});
/**
*
*/
function createDriverTestContainer(path: string) {
return {
type: BI.VerticalLayout.xtype,
vgap: 5,
items: [
{
type: BI.Label.xtype,
text: BI.i18nText('Dec-Connection_Driver_Current_Load_Path', path),
textAlign: 'left',
whiteSpace: 'normal',
},
{
type: BI.TextButton.xtype,
cls: 'bi-high-light',
text: BI.i18nText('Dec-Connection_Driver_Check'),
textAlign: 'left',
handler: () => {
api.checkDriverStatus({
driver: (formValue.connectionData as ConnectionJDBC).driver,
path,
}).then(res => {
const isDriverConflict = res.data;
testStatus.setExtraContainer({
type: BI.VerticalLayout.xtype,
items: [
{
type: BI.Label.xtype,
textAlign: 'left',
text: isDriverConflict
? BI.i18nText('Dec-Connection_Driver_Has_Confilt_Tip')
: BI.i18nText('Dec-Connection_Driver_No_Confilt_Tip'),
cls: isDriverConflict ? 'bi-error' : '',
}
]
})
});
}
}
]
}
}
};
BI.Maskers.create(id, null, {
render: {
type: TestStatus.xtype,

109
src/modules/pages/maintain/forms/form.ts

@ -6,15 +6,13 @@ import { FormPlugin } from './components/form.plugin';
import { connectionType, errorCode } from '@constants/env';
import { ConnectionJDBC, Connection, ResultType } from 'src/modules/crud/crud.typings';
import { DEFAULT_JNDI_DATA, DEFAULT_JDBC_POOL, DATEBASE_FILTER_TYPE } from '@constants/constant';
import { getJdbcDatabaseType, getChartLength, getAllDatabaseTypes } from '../../../app.service';
import { getJdbcDatabaseType, getChartLength } from '../../../app.service';
import { NAME_MAX_LENGTH } from '../../../app.constant';
import { checkIllegalStrings } from "@core/index";
@shortcut()
@store(MaintainFormModel)
export class MaintainForm extends BI.Widget {
static xtype = 'dec.dcm.maintain.form';
static EVENT_TESTCONNECTION = 'EVENT_TEST_CONNECTION';
props = {
connectionType: '',
@ -30,37 +28,34 @@ export class MaintainForm extends BI.Widget {
watch = {
saveEvent: () => {
const sonSave = this.form.getSaveFn?.();
if (sonSave) {
sonSave().then((success: boolean) => {
if (success) {
this.store.goFirstPage();
BI.Msg.toast(BI.i18nText("Dec-Basic_Save_Success"), {
level: "success",
});
} else {
BI.Msg.toast(BI.i18nText("Dec-Basic_Save_Fail"), {
level: "error",
});
}
});
if (!this.testValue()) {
return;
}
if (this.connectionName && !this.model.isCopy) {
const value = this.form.getSubmitValue();
(value.connectionData as ConnectionJDBC).creator = BI.get(this.getFormData(), 'creator');
// DEC-10155 为了适配插件的数据连接,在外层也加一个creator字段
value.creator = BI.get(this.getFormData(), 'creator');
this.store.updateConnection(this.connectionName, value).then(result => {
if (result.errorCode) {
if(result.errorCode === DecCst.ErrorCode.NO_IP_AUTHORIZED){
BI.Msg.toast(BI.i18nText("Dec-Basic_Save_Fail"),{
level: "error",
});
}
this.showError(result);
//只有外来插件才可以使用是否不执行平台的保存逻辑
if (this.model.datebaseTypeSelected) {
const isPluginDatabase = BI.some(BI.Providers.getProvider('dec.connection.provider.datebase').customDatabaseType, (_index, value) => value.databaseType === this.model.datebaseTypeSelected);
if (isPluginDatabase && this.model.datebaseTypeSelectedOne.isNoSave) {
return;
}
} else {
const databaseType = this.model.connectionSelectedOne.connectionType;
const database = BI.find(getAllDatabaseTypes(), (_index, value) => value.databaseType === databaseType);
if (this.model.connectionSelectedOne.pluginConnection && database?.isNoSave) {
return;
}
}
this.store.goFirstPage();
});
} else {
const form = this.form.getSubmitValue();
form.connectionId = this.connectionName;
// DEC-10155 为了适配插件的数据连接,在外层也加一个creator字段
form.creator = Dec ? Dec.personal.username : '';
this.addConnection(form);
}
this.save();
},
testEvent: () => {
this.testConnection();
@ -81,7 +76,7 @@ export class MaintainForm extends BI.Widget {
this.form = _ref;
},
listeners: [{
eventName: MaintainForm.EVENT_TESTCONNECTION,
eventName: 'EVENT_TEST_CONNECTION',
action: () => {
this.testConnection();
},
@ -126,16 +121,15 @@ export class MaintainForm extends BI.Widget {
let editConnection: Connection;
let connectionData: ConnectionJDBC;
if (this.model.datebaseTypeSelected) {
const { databaseType: database, fetchSize } = this.model.datebaseTypeSelectedOne;
connectionData = {
...this.model.datebaseTypeSelectedOne,
database,
driver: this.model.datebaseTypeSelectedOne.driver,
url: this.model.datebaseTypeSelectedOne.url,
database: this.model.datebaseTypeSelectedOne.databaseType,
connectionName,
connectionPoolAttr: DEFAULT_JDBC_POOL,
port: '',
host: 'localhost',
fetchSize: fetchSize ?? -1,
fetchSize: this.model.datebaseTypeSelectedOne.fetchSize ?? -1,
identity: BI.UUID(),
};
editConnection = {
@ -214,12 +208,6 @@ export class MaintainForm extends BI.Widget {
if (this.form.validation && !this.form.validation()) {
return false;
}
const result = checkIllegalStrings(value.connectionName);
if (!result.legal) {
this.setFromError(result.errorMsg);
return false;
}
return true;
}
@ -270,8 +258,8 @@ export class MaintainForm extends BI.Widget {
private addConnection(form: Connection) {
this.store.addConnection(form).then(result => {
if (result.errorCode) {
if (result.errorCode === DecCst.ErrorCode.NO_IP_AUTHORIZED) {
BI.Msg.toast(BI.i18nText("Dec-Basic_Save_Fail"), {
if(result.errorCode === DecCst.ErrorCode.NO_IP_AUTHORIZED){
BI.Msg.toast(BI.i18nText("Dec-Basic_Save_Fail"),{
level: "error",
});
}
@ -295,41 +283,8 @@ export class MaintainForm extends BI.Widget {
return;
}
// 新增之后connections待更新,connectionSelected先置空
this.store.setConnectionSelected('');
this.store.goFirstPage();
this.store.setIsCopy(false);
});
}
private save() {
if (!this.testValue()) {
return;
}
if (this.connectionName && !this.model.isCopy) {
const value = this.form.getSubmitValue();
(value.connectionData as ConnectionJDBC).creator = BI.get(this.getFormData(), 'creator');
// DEC-10155 为了适配插件的数据连接,在外层也加一个creator字段
value.creator = BI.get(this.getFormData(), 'creator');
this.store.updateConnection(this.connectionName, value).then(result => {
if (result.errorCode) {
if (result.errorCode === DecCst.ErrorCode.NO_IP_AUTHORIZED) {
BI.Msg.toast(BI.i18nText("Dec-Basic_Save_Fail"), {
level: "error",
});
}
this.showError(result);
return;
}
this.store.goFirstPage();
});
} else {
const form = this.form.getSubmitValue();
form.connectionId = this.connectionName;
// DEC-10155 为了适配插件的数据连接,在外层也加一个creator字段
form.creator = Dec ? Dec.personal.username : '';
this.addConnection(form);
}
}
}

12
src/modules/pages/maintain/maintain.ts

@ -9,7 +9,7 @@ import './maintain.less';
import { connectionType } from '@constants/env';
import { getJdbcDatabaseType, getTextByDatabaseType } from '../../app.service';
import { ConnectionJDBC } from 'src/modules/crud/crud.typings';
import { ButtonGroup } from '@fui/core';
import { ListView } from '@fui/core';
@shortcut()
@store(MaintainModel)
@ -19,7 +19,7 @@ export class Maintain extends BI.Widget {
model: MaintainModel['model'];
store: MaintainModel['store'];
buttonGroup: ButtonGroup;
listView: ListView;
socketTip: LinkButton;
render() {
@ -28,7 +28,7 @@ export class Maintain extends BI.Widget {
return {
type: BI.VTapeLayout.xtype,
hgap: 16,
hgap: 5,
items: [
{
type: BI.VerticalAdaptLayout.xtype,
@ -64,9 +64,9 @@ export class Maintain extends BI.Widget {
],
},
{
type: BI.ButtonGroup.xtype,
ref: (_ref: ButtonGroup) => {
this.buttonGroup = _ref;
type: BI.ListView.xtype,
ref: (_ref: ListView) => {
this.listView = _ref;
},
items: this.renderItems(),
},

96
src/modules/pages/setting/setting.ts

@ -1,96 +0,0 @@
import { shortcut } from '@core/core';
import { ApiFactory } from 'src/modules/crud/apiFactory';
const api = new ApiFactory().create();
@shortcut()
export class TimeOutSetting extends BI.Widget {
public static xtype = 'dec.dcm.page.timeout.setting';
public props = {
value: 0,
};
beforeRender(cb: Function) {
const self = this;
api.getTimeOut().then(res => {
self.props.value = res.data.count;
cb();
});
}
public render() {
const { value } = this.props;
const self = this;
return {
type: 'bi.vtape',
cls: 'bi-background',
items: [{
type: 'dec.setting.header',
height: 40,
listeners: [{
eventName: 'EVENT_CANCEL',
action: function () {
self.fireEvent('EVENT_CHANGE');
},
}, {
eventName: 'EVENT_SAVE',
action: function () {
api.putTimeOut(Number(self.editor.getValue()));
self.fireEvent('EVENT_CHANGE');
},
}],
}, {
type: 'bi.vertical',
cls: 'bi-card',
vgap: 10,
items: [
{
el: {
type: 'bi.vertical_adapt',
cls: 'bi-border-bottom',
height: 40,
items: [{
type: 'bi.label',
textAlign: 'left',
width: 120,
cls: 'dec-font-weight-bold',
text: BI.i18nText('Dec-Dcm_Connection_Timeout_Detection'),
}]
}, tgap: -10, hgap: 16,
},
{
type: 'bi.vertical_adapt',
hgap: 16,
items: [{
type: 'dec.label.editor.item',
text: BI.i18nText('Dec-Over_Time'),
textWidth: 100,
editorWidth: 80,
allowBlank: false,
value: value,
validationChecker: function(v) {
return BI.isPositiveInteger(v);
},
errorText: BI.i18nText('BI-Please_Input_Positive_Integer'),
ref: function (_ref) {
self.editor = _ref;
},
}, {
el: {
type: 'bi.label',
text: BI.i18nText('Dec-Dcm_Connection_Timeout_Millisecond'),
},
lgap: 10,
}]
},
]
}],
ref: function (_ref) {
self.setting = _ref;
},
};
}
}

11
src/modules/title/title.ts

@ -11,7 +11,7 @@ export class Title extends BI.Widget {
static xtype = 'dec.dcm.title';
props = {
baseCls: '',
baseCls: 'bi-card',
}
tab: Tab;
linearSegment: LinearSegment;
@ -31,14 +31,6 @@ export class Title extends BI.Widget {
type: BI.LeftRightVerticalAdaptLayout.xtype,
items: {
left: [
{
type: 'bi.icon_button',
cls: 'setting-font',
_lgap: 15,
handler: () => {
this.fireEvent('EVENT_CLICK_SETTING');
},
},
{
type: BI.LinearSegment.xtype,
cls: 'bi-font-bold',
@ -78,7 +70,6 @@ export class Title extends BI.Widget {
type: BI.Tab.xtype,
height: 40,
showIndex: this.model.pageIndex,
width:200,
ref: (_ref: Tab) => {
this.tab = _ref;
},

5
src/modules/title/title_database/title_datebase.ts

@ -25,13 +25,13 @@ export class TitleDatabase extends BI.Widget {
items: [{
type: BI.VerticalAdaptLayout.xtype,
height: 40,
rgap: 16,
rgap: 5,
items: [
{
type: BI.Button.xtype,
$value: 'title-database-cancel',
text: BI.i18nText('BI-Basic_Cancel'),
light: true,
level: 'ignore',
handler: () => {
this.store.setPageIndex(PAGE_INDEX.CONNECTION);
},
@ -49,7 +49,6 @@ export class TitleDatabase extends BI.Widget {
},
},
],
_rgap: -16,
}],
};
}

3
src/modules/title/title_maintain/title_maintain.model.ts

@ -11,13 +11,12 @@ export class TitleMaintainModel extends Model<{
connectionSelected: AppModel['TYPE']['connectionSelected'];
testEvent: AppModel['TYPE']['testEvent'];
isCopy: AppModel['TYPE']['isCopy'];
noTestConnection: AppModel['TYPE']['noTestConnection'];
},
context: TitleMaintainModel['context'];
}> {
static xtype = 'dec.dcm.model.title_maintain';
context = <const>['pageIndex', 'saveEvent', 'testEvent', 'connectionSelected', 'isCopy', 'noTestConnection'];
context = <const>['pageIndex', 'saveEvent', 'testEvent', 'connectionSelected', 'isCopy'];
actions = {
setPageIndex: (index: string) => {

14
src/modules/title/title_maintain/title_maintain.ts

@ -1,7 +1,6 @@
import { shortcut, store } from '@core/core';
import { TitleMaintainModel } from './title_maintain.model';
import { PAGE_INDEX } from '@constants/constant';
import { Button } from '@fui/core';
@shortcut()
@store(TitleMaintainModel)
@ -10,20 +9,19 @@ export class TitleMaintain extends BI.Widget {
store: TitleMaintainModel['store'];
model: TitleMaintainModel['model'];
render() {
return {
type: BI.FloatRightLayout.xtype,
items: [{
type: BI.VerticalAdaptLayout.xtype,
height: 40,
rgap: 5,
items: [
{
type: BI.Button.xtype,
$value: 'title-maintain-cancel',
text: BI.i18nText('BI-Basic_Cancel'),
clear: true,
_rgap: 16,
level: 'ignore',
handler: () => {
this.store.setIsCopy(false);
this.store.setPageIndex(PAGE_INDEX.CONNECTION);
@ -32,21 +30,15 @@ export class TitleMaintain extends BI.Widget {
},
{
type: BI.Button.xtype,
ref: (_ref) => {
this.testConnectionBtn = _ref;
},
invisible: () => this.model.noTestConnection,
_rgap: 16,
$value: 'title-maintain-connection-test',
text: BI.i18nText('Dec-Dcm_Connection_Test'),
light: true,
level: 'ignore',
handler: () => {
this.store.setTestEvent();
},
},
{
type: BI.Button.xtype,
_rgap: 16,
$value: 'title-maintain-save',
text: BI.i18nText('BI-Basic_Save'),
handler: () => {

28
tsconfig.json

@ -5,8 +5,8 @@
"module": "es2015",
"moduleResolution": "node",
"lib": [
"es2017",
"dom"
"es2017",
"dom"
],
"declaration": true,
"experimentalDecorators": true,
@ -19,23 +19,13 @@
// "noUnusedParameters": true,
// "noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": false,
"skipLibCheck": true,
"paths": {
"ui": [
"./src/ui"
],
"ReportCst": [
"./private/constants"
],
"types": [
"./types/index.d.ts"
],
"@core/*": [
"./src/modules/core/*"
],
"@constants/*": [
"./src/modules/constants/*"
]
"ui": ["./src/ui"],
"ReportCst": ["./private/constants"],
"types": ["./types/index.d.ts"],
"@core/*": ["./src/modules/core/*"],
"@constants/*": ["./src/modules/constants/*"]
}
},
"include": [
@ -43,6 +33,6 @@
"src/**/*.ts",
"private/*.ts",
"private/**/*.ts",
"types"
"types/globals.d.ts"
]
}

24
types/globals.d.ts vendored

@ -2,8 +2,6 @@ interface Obj {
[key: string]: any;
}
type RequestFunction = (url: string, data: any, callback: (re: any) => void) => void;
declare let BI: Obj & import('@fui/core').BI & import('@fui/materials').BI;
declare const Fix: Obj;
declare const DecCst: Obj;
@ -12,21 +10,15 @@ declare const Dec: {
socket: {
connected: boolean;
};
system: {};
system: {
};
personal: {
username: string;
};
Utils: Obj;
reqByEncrypt: (method: AxiosType.X_Method, url: string, data?: any, config?: AxiosType.X_AxiosRequestConfig) => {},
socketEmit: (type: string, name: string, callback: (re: any) => void) => void;
// req
reqGet: RequestFunction;
reqPost: RequestFunction;
reqPut: RequestFunction;
reqDelete: RequestFunction;
// reqHandle
reqGetHandle: RequestFunction;
reqPostHandle: RequestFunction;
reqPutHandle: RequestFunction;
reqDeleteHandle: RequestFunction;
};
reqGet: (url: string, data: any, callback: (re: any) => void) => void;
reqPost: (url: string, data: any, callback: (re: any) => void) => void;
reqPut: (url: string, data: any, callback: (re: any) => void) => void;
reqDelete: (url: string, data: any, callback: (re: any) => void) => void;
};

9
types/request.d.ts vendored

@ -1,9 +0,0 @@
import { Method, AxiosRequestConfig } from 'axios';
declare namespace AxiosType {
type X_Method = Method
interface X_AxiosRequestConfig extends AxiosRequestConfig { }
}
export = AxiosType;
export as namespace AxiosType;
Loading…
Cancel
Save