diff --git a/root/index.html b/root/index.html
index 7e7293c..02fed0d 100644
--- a/root/index.html
+++ b/root/index.html
@@ -7,26 +7,35 @@
+
+
Meta-Kit
+
-
- -
+
-
- -
+
-
root
@@ -73,7 +82,7 @@
sysPlat: red.getData("sysPlat"),
sysPlats: red.getData("sysPlats"),
pages: [
- {name: "DDL", url: "/qtask/ddl.html"},
+ /*{name: "DDL", url: "/qtask/ddl.html"},*/
{name: "MetaData", url: "/meta", nodes: [
/*{url:"/metadata/metatable/list.html", name:"TableList"},*/
{url:"/metadata/metatable/metaTable.html", name:"MetaTable"},
@@ -99,6 +108,7 @@
{url:"/plat/db.html", name:"数据中心", icon: "icon-database"},
]
},
+ {name: "关于", url: "/single/about.html"}
],
menus: red.getData("menus", [
diff --git a/root/res/css/red-kit.css b/root/res/css/red-kit.css
index 200be64..4b280db 100644
--- a/root/res/css/red-kit.css
+++ b/root/res/css/red-kit.css
@@ -22,9 +22,9 @@ body {
}
#top {
background-color: #404a53;
- padding: 0 10px;
+ padding: 5px 10px;
margin: 0px;
- height: 45px;
+ height: 50px;
}
#top a {
color: #ddd;
@@ -35,7 +35,9 @@ body {
}
.nav-tabs>li>a{
border: 0;
+ font-size: 15px;
}
+
.nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover, .nav-tabs>li>a:hover {
background-color: #404a53;
color: #fff;
diff --git a/root/single/about.html b/root/single/about.html
new file mode 100644
index 0000000..86599ae
--- /dev/null
+++ b/root/single/about.html
@@ -0,0 +1,11 @@
+
+ {{about}}
+
+
\ No newline at end of file
diff --git a/src/main/java/net/tccn/base/FileKit.java b/src/main/java/net/tccn/base/FileKit.java
new file mode 100644
index 0000000..ce5491e
--- /dev/null
+++ b/src/main/java/net/tccn/base/FileKit.java
@@ -0,0 +1,151 @@
+package net.tccn.base;
+
+import java.io.*;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.nio.file.Files;
+
+import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
+import static java.util.Arrays.asList;
+
+/**
+ * Created by liangxianyou at 2018/5/31 10:23.
+ */
+public final class FileKit {
+
+ private FileKit() { }
+
+ public static void strToFile(String entityBody, File file) throws IOException {
+ strToFile(entityBody, file, true);
+ }
+
+ public static void strToFile(String entityBody, File file, boolean existDel) throws IOException {
+ if (file.exists()) {
+ if (existDel) {
+ file.delete();
+ }else {
+ throw new RuntimeException(file.getPath() + "已经存在");
+ }
+ }
+
+ if (!file.getParentFile().exists()){
+ file.getParentFile().mkdirs();
+ }
+ FileOutputStream out = new FileOutputStream(file);
+ out.write(entityBody.getBytes("UTF-8"));
+ out.close();
+ }
+
+ /**
+ * 拷贝文件/文件目录
+ * @param source
+ * @param target
+ * @param linkPath
+ */
+ public static void copyFiles(File source, File target, String linkPath) {
+ if (source.isDirectory()){
+ final String _linkPath = linkPath + File.separator+ source.getName();
+ asList(source.listFiles()).forEach(f->{
+ copyFiles(f, target, _linkPath);
+ });
+ }else if (source.isFile()){
+ try {
+ String _linkPath = "";
+ int index = linkPath.indexOf(File.separator, 1);
+ if (index > 0){
+ _linkPath = linkPath.substring(index);
+ }
+ File targetFile = new File(target.toPath() + _linkPath + File.separator + source.getName());
+ if (!targetFile.getParentFile().exists()){
+ targetFile.getParentFile().mkdirs();
+ }
+
+ Files.copy(source.toPath(), targetFile.toPath(), REPLACE_EXISTING);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * 获取 clazz的路径,如果是jar里面的文件得到jar存放的目录,如:lib
+ * @param clazz
+ * @return
+ */
+ public static String rootPath(Class clazz){
+ //return clazz.getClassLoader().getResource("").getPath();
+ URL url = clazz.getProtectionDomain().getCodeSource().getLocation();
+ try {
+ String filePath = URLDecoder.decode(url.getPath(), "utf-8");
+ if (filePath.endsWith(".jar")){
+ return filePath.substring(0, filePath.lastIndexOf("/")+1);
+ }
+ return filePath;
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ }
+
+ return "";
+ }
+
+ /**
+ * 读取流内的所有内容
+ * @param inputStream
+ * @return
+ * @throws IOException
+ */
+ public static String readAll(InputStream inputStream) throws IOException {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+ StringBuffer buf = new StringBuffer();
+ String str;
+ while ((str = reader.readLine()) != null){
+ buf.append(str+ "\n");
+ }
+ return buf.toString();
+ }
+
+ /**
+ * 渲染模板到文件
+ * @param sourceStr
+ * @param target
+ * @param kv
+ */
+ /*public static void tplRender(String sourceStr, File target, Kv kv){
+ String str = "";
+ if (sourceStr != null && !sourceStr.isEmpty()){
+ str = Engine.use().getTemplateByString(sourceStr).renderToString(kv);
+ }
+ try {
+ strToFile(str, target, true);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }*/
+
+ /**
+ * 通过模板创建内容
+ * @param tplFile
+ * @param para
+ */
+ /*public static void tplRender(File tplFile, File file, Map para) throws IOException {
+ String str = Engine.use().getTemplate(tplFile.getPath()).renderToString(para);
+ strToFile(str, file);
+ }*/
+
+ /*public static String tplRender(File tplFile, Map para){
+ return Engine.use().getTemplate(tplFile.getPath()).renderToString(para);
+ }*/
+
+ /*public static void objToFile(Object obj, File file) throws FileNotFoundException {
+ if (file.exists()) {
+ throw new RuntimeException(file.getPath() + "已经存在");
+ }
+
+ if (!file.getParentFile().exists()){
+ file.getParentFile().mkdirs();
+ }
+ FileOutputStream out = new FileOutputStream(file);
+ out.write(obj.);
+ out.close();
+ }*/
+}