diff --git a/CHANGELOG.md b/CHANGELOG.md index 3674f1d..295b95c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,25 @@ # 更新日志 > 有空会补补BUG、添添新功能。 +## 2021/12/01 - `v2.0.8` +### 核心 +* 修复 Mssql 连接 2000 时候的语句兼容性问题 +* 设置程序默认编码 +* 删除敏感文件(详细说明情况请看文档里的公告一栏) + +## 2021/09/14 - `v2.0.7` +### 核心 +* 优化内部代码 +* 修订设置窗口文字 + +### PostgreSql +* 增加 Windows UDF 提权支持 +* 修订插件命名规则 + +### 其他 +* 文档更新 PostgreSql UDF 插件编写链接 (thx @huahua) +* v2.0.6 之后不再强制要求先下载 v2.0 版,下载即用 + ## 2021/08/17 - `v2.0.6` ### 核心 * 优化内部代码 diff --git a/MDAT-DEV/MDUT-Dev.iml b/MDAT-DEV/MDUT-Dev.iml index 3dd716b..c152a40 100644 --- a/MDAT-DEV/MDUT-Dev.iml +++ b/MDAT-DEV/MDUT-Dev.iml @@ -14,6 +14,13 @@ + + + + + + + diff --git a/MDAT-DEV/pom.xml b/MDAT-DEV/pom.xml index 220719d..bd6979e 100644 --- a/MDAT-DEV/pom.xml +++ b/MDAT-DEV/pom.xml @@ -49,6 +49,12 @@ compile + + org.pegdown + pegdown + 1.6.0 + + redis.clients jedis diff --git a/MDAT-DEV/src/main/Plugins/Redis/sethc.exe b/MDAT-DEV/src/main/Plugins/Redis/sethc.exe deleted file mode 100644 index 1956add..0000000 Binary files a/MDAT-DEV/src/main/Plugins/Redis/sethc.exe and /dev/null differ diff --git a/MDAT-DEV/src/main/Plugins/Redis/startup.hta b/MDAT-DEV/src/main/Plugins/Redis/startup.hta deleted file mode 100644 index b0a425d..0000000 --- a/MDAT-DEV/src/main/Plugins/Redis/startup.hta +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/MDAT-DEV/src/main/java/Controller/MssqlController.java b/MDAT-DEV/src/main/java/Controller/MssqlController.java index 89e83ed..d11465c 100644 --- a/MDAT-DEV/src/main/java/Controller/MssqlController.java +++ b/MDAT-DEV/src/main/java/Controller/MssqlController.java @@ -226,7 +226,7 @@ public void initComBoBox(){ "GBK" ); // 初始化下拉框 - ComboBox_EncodeType.setPromptText("编码"); + ComboBox_EncodeType.setPromptText("UTF-8"); ComboBox_EncodeType.setItems(mssqlTypeCodeoptions); } diff --git a/MDAT-DEV/src/main/java/Controller/MysqlController.java b/MDAT-DEV/src/main/java/Controller/MysqlController.java index 46acb8c..de8c06b 100644 --- a/MDAT-DEV/src/main/java/Controller/MysqlController.java +++ b/MDAT-DEV/src/main/java/Controller/MysqlController.java @@ -125,7 +125,7 @@ public void initComboBox() { "GBK" ); // 初始化下拉框 - MysqlEncode.setPromptText("编码"); + MysqlEncode.setPromptText("UTF-8"); MysqlEncode.setItems(OracleTypeCodeoptions); } diff --git a/MDAT-DEV/src/main/java/Controller/PostgreSqlController.java b/MDAT-DEV/src/main/java/Controller/PostgreSqlController.java index e2a84e0..73609c4 100644 --- a/MDAT-DEV/src/main/java/Controller/PostgreSqlController.java +++ b/MDAT-DEV/src/main/java/Controller/PostgreSqlController.java @@ -111,7 +111,7 @@ public void initComboBox(){ "GBK" ); // 初始化下拉框 - postgreSqlEncodeCombox.setPromptText("编码"); + postgreSqlEncodeCombox.setPromptText("UTF-8"); postgreSqlEncodeCombox.setItems(postgreSqlTypeCodeoptions); } diff --git a/MDAT-DEV/src/main/java/Controller/RedisController.java b/MDAT-DEV/src/main/java/Controller/RedisController.java index e9837ef..29c3284 100644 --- a/MDAT-DEV/src/main/java/Controller/RedisController.java +++ b/MDAT-DEV/src/main/java/Controller/RedisController.java @@ -197,7 +197,7 @@ public void initComboBox() { "GBK" ); // 初始化下拉框 - redisEncodeCombox.setPromptText("编码"); + redisEncodeCombox.setPromptText("UTF-8"); redisEncodeCombox.setItems(postgreSqlTypeCodeoptions); } } diff --git a/MDAT-DEV/src/main/java/Controller/UpdateController.java b/MDAT-DEV/src/main/java/Controller/UpdateController.java index 592b5bd..bc11917 100644 --- a/MDAT-DEV/src/main/java/Controller/UpdateController.java +++ b/MDAT-DEV/src/main/java/Controller/UpdateController.java @@ -10,10 +10,11 @@ import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.control.Label; -import javafx.scene.control.TextArea; +import javafx.scene.web.WebView; import javafx.stage.Stage; import java.io.File; +import java.io.IOException; import java.net.URL; import java.util.ResourceBundle; import Util.Utils; @@ -25,7 +26,7 @@ public class UpdateController implements Initializable { @FXML - private TextArea updateLogTextArea; + private WebView updateLogWebView; @FXML private Label currentVersionLabel; @@ -102,7 +103,10 @@ void checkVersion(ActionEvent event) { Platform.runLater(() -> { newVersionLabel.setText("最新版本: " + versionData.getString("version")); updateMsgLabel.setText("新版本已发布!请点击下载按钮下载更新"); - updateLogTextArea.setText(versionData.getString("body")); + try { + String body = Utils.generateHtml(versionData.getString("body")); + updateLogWebView.getEngine().loadContent(body); + } catch (IOException e) { } downloadBtn.setDisable(false); }); }else { diff --git a/MDAT-DEV/src/main/java/Dao/MssqlDao.java b/MDAT-DEV/src/main/java/Dao/MssqlDao.java index 2b62875..65711c9 100644 --- a/MDAT-DEV/src/main/java/Dao/MssqlDao.java +++ b/MDAT-DEV/src/main/java/Dao/MssqlDao.java @@ -299,7 +299,7 @@ public void clearHistory(){ excute("if OBJECT_ID(N'oashellresult',N'U') is not null\n" + "\tDROP TABLE oashellresult;",""); mssqlController.mssqlLogTextArea.appendText(Utils.log("oashellresult 表删除成功!")); - excute("if (exists (select * from sys.objects where name = 'kitmain'))drop proc kitmain;\n" + + excute("if (exists (select * from dbo.sysobjects where name = 'kitmain'))drop proc kitmain;\n" + "if (exists (select * from sys.assemblies where name='MDATKit'))drop assembly MDATKit;\n",""); mssqlController.mssqlLogTextArea.appendText(Utils.log("CLR 删除成功!")); } catch (SQLException e) { @@ -329,7 +329,7 @@ public void activateCLR(){ */ public void initCLR(){ try { - String checksql = "if (exists (select * from sys.objects where name = 'kitmain'))drop proc kitmain;\n" + + String checksql = "if (exists (select * from dbo.sysobjects where name = 'kitmain'))drop proc kitmain;\n" + "if (exists (select * from sys.assemblies where name='MDATKit'))drop assembly MDATKit;\n"; excute(checksql,""); // 获取插件目录 @@ -355,7 +355,7 @@ public void initCLR(){ */ public boolean checkCLR(){ try { - String checksql1 = "if (exists (select * from sys.objects where name = 'kitmain')) select '1' as res;" ; + String checksql1 = "if (exists (select * from dbo.sysobjects where name = 'kitmain')) select '1' as res;" ; //String checksql2 = "if (exists (select * from sys.assemblies where name='MDATKit')) select '1' as res;" ; String c1 = excute(checksql1,""); //String c2 = excute(checksql2,""); @@ -483,7 +483,7 @@ public ArrayList getFiles(String path){ String filesql = String.format("if OBJECT_ID(N'DirectoryTree',N'U') is not null\n" + " DROP TABLE DirectoryTree;\n" + "CREATE TABLE DirectoryTree (subdirectory varchar(8000),depth int,isfile bit);\n" + - "INSERT DirectoryTree (subdirectory,depth,isfile) EXEC master.sys.xp_dirtree N'%s',1,1;",path); + "INSERT DirectoryTree (subdirectory,depth,isfile) EXEC master.dbo.xp_dirtree N'%s',1,1;",path); String selectfile = "SELECT * FROM DirectoryTree"; ArrayList res = new ArrayList<>(); try { diff --git a/MDAT-DEV/src/main/java/Util/Utils.java b/MDAT-DEV/src/main/java/Util/Utils.java index 6d5594d..426b7c8 100644 --- a/MDAT-DEV/src/main/java/Util/Utils.java +++ b/MDAT-DEV/src/main/java/Util/Utils.java @@ -1,8 +1,10 @@ package Util; import com.alibaba.fastjson.JSONObject; +import org.pegdown.PegDownProcessor; import java.io.*; +import java.nio.charset.StandardCharsets; import java.sql.Driver; import java.sql.SQLException; import java.text.DateFormat; @@ -21,7 +23,7 @@ public class Utils { * @return */ public static String getCurrentVersion() { - return "v2.0.7"; + return "v2.0.8"; } /** @@ -411,4 +413,22 @@ public static int compareVersion(String curVer, String newVer) { } } + /** + * 解析 MarkDown 语法,转换成 HTML 语法 + * @param markdownString + * @throws IOException + */ + public static String generateHtml(String markdownString) throws IOException { + InputStream is = new ByteArrayInputStream(markdownString.getBytes(StandardCharsets.UTF_8)); + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + String line = null; + String mdContent = ""; + while ((line = br.readLine()) != null) { + mdContent += line + "\n"; + } + PegDownProcessor pdp = new PegDownProcessor(Integer.MAX_VALUE); + String htmlContent = pdp.markdownToHtml(mdContent); + return htmlContent; + } + } diff --git a/MDAT-DEV/src/main/java/main.java b/MDAT-DEV/src/main/java/main.java index 531188f..15e8288 100644 --- a/MDAT-DEV/src/main/java/main.java +++ b/MDAT-DEV/src/main/java/main.java @@ -6,8 +6,6 @@ import javafx.scene.image.Image; import javafx.stage.Stage; -import java.util.Properties; - public class main extends Application { @Override diff --git a/MDAT-DEV/src/main/resources/update.fxml b/MDAT-DEV/src/main/resources/update.fxml index 5700fd1..66159cd 100644 --- a/MDAT-DEV/src/main/resources/update.fxml +++ b/MDAT-DEV/src/main/resources/update.fxml @@ -1,20 +1,19 @@ - - - - - + + + + - + -