From deafe26db43cd88ba13b870602f4a43e1c141c32 Mon Sep 17 00:00:00 2001 From: Gdk666 <763366136@qq.com> Date: Tue, 20 Sep 2022 08:57:33 +0800 Subject: [PATCH 01/44] add ClassUtilTest test case (#709) * add BeanUtilTest test case * add BeanUtilTest test case * add BeanUtilTest test case * add ClassUtilTest test case --- .../hippo4j/config/toolkit/BeanUtilTest.java | 17 +++++-- .../hippo4j/config/toolkit/ClassUtilTest.java | 51 +++++++++++++++++++ 2 files changed, 64 insertions(+), 4 deletions(-) diff --git a/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/BeanUtilTest.java b/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/BeanUtilTest.java index c0e1e066..7f44fa32 100644 --- a/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/BeanUtilTest.java +++ b/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/BeanUtilTest.java @@ -21,13 +21,11 @@ import cn.hippo4j.common.toolkit.Assert; import com.github.dozermapper.core.converters.ConversionException; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import com.google.common.collect.Sets; import lombok.*; import org.junit.Test; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; /** * BeanUtil Test @@ -75,6 +73,17 @@ public class BeanUtilTest { Assert.isTrue(Objects.equals(list.size(), persons.size())); } + @Test + public void SetToSetConvertTest() { + final Set sets = Sets.newHashSet(); + sets.add(Person.builder().name("one").age(1).build()); + sets.add(Person.builder().name("two").age(2).build()); + sets.add(Person.builder().name("three").age(3).build()); + + final Set persons = BeanUtil.convert(sets, PersonVo.class); + Assert.isTrue(Objects.equals(sets.size(), persons.size())); + } + @Test public void copyPropertiesBeanToMapTest() { // 测试BeanToMap diff --git a/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/ClassUtilTest.java b/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/ClassUtilTest.java index 41aff764..cffb82b1 100644 --- a/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/ClassUtilTest.java +++ b/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/ClassUtilTest.java @@ -17,8 +17,59 @@ package cn.hippo4j.config.toolkit; +import cn.hippo4j.common.toolkit.Assert; +import cn.hutool.core.lang.caller.CallerUtil; +import org.junit.Test; + +import java.util.Objects; + /** * ClassUtil Test */ public class ClassUtilTest { + + @Test + public void isAssignableFromTest() { + final boolean assignableFrom = ClassUtil.isAssignableFrom(TestClass.class, TestSubClass.class); + Assert.isTrue(assignableFrom); + } + + @Test + public void isNotAssignableFromTest() { + final boolean assignableFrom = ClassUtil.isAssignableFrom(TestSubClass.class, TestClass.class); + Assert.isTrue(!assignableFrom); + } + + @Test + public void getCanonicalNameTest() { + final String canonicalName = ClassUtil.getCanonicalName(TestClass.class); + Assert.isTrue(Objects.equals("cn.hippo4j.config.toolkit.ClassUtilTest.TestClass", canonicalName)); + } + + @SuppressWarnings("unused") + static class TestClass { + + private String privateField; + + protected String field; + + private void privateMethod() { + } + + public void publicMethod() { + } + } + + @SuppressWarnings({"unused", "InnerClassMayBeStatic"}) + class TestSubClass extends TestClass { + + private String subField; + + private void privateSubMethod() { + } + + public void publicSubMethod() { + } + + } } From f1d3ed9d60907a55b55cc7e38f003a7456d3cd58 Mon Sep 17 00:00:00 2001 From: monsterxxp <37952446+monsterxxp@users.noreply.github.com> Date: Wed, 21 Sep 2022 17:09:47 +0800 Subject: [PATCH 02/44] add SimpleReadWriteLockTest test case (#710) * add MapUtilTest test case * add RequestUtilTest test case * add SimpleReadWriteLockTest test case --- .../toolkit/SimpleReadWriteLockTest.java | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) diff --git a/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/SimpleReadWriteLockTest.java b/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/SimpleReadWriteLockTest.java index 3703de6a..7b1d37f4 100644 --- a/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/SimpleReadWriteLockTest.java +++ b/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/SimpleReadWriteLockTest.java @@ -17,8 +17,121 @@ package cn.hippo4j.config.toolkit; +import cn.hippo4j.common.toolkit.Assert; +import org.junit.Test; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + /** * SimpleReadWriteLock Test */ public class SimpleReadWriteLockTest { + + @Test + public void singleTryReadLockTest() { + SimpleReadWriteLock simpleReadWriteLock = new SimpleReadWriteLock(); + boolean result = simpleReadWriteLock.tryReadLock(); + Assert.isTrue(result); + } + + @Test + public void multiTryReadLockTest() { + SimpleReadWriteLock simpleReadWriteLock = new SimpleReadWriteLock(); + simpleReadWriteLock.tryReadLock(); + boolean result = simpleReadWriteLock.tryReadLock(); + Assert.isTrue(result); + } + + @Test + public void singleTryWriteLockTest() { + SimpleReadWriteLock simpleReadWriteLock = new SimpleReadWriteLock(); + boolean result = simpleReadWriteLock.tryWriteLock(); + Assert.isTrue(result); + } + @Test + public void multiTryWriteLockTest() { + SimpleReadWriteLock simpleReadWriteLock = new SimpleReadWriteLock(); + simpleReadWriteLock.tryWriteLock(); + boolean result = simpleReadWriteLock.tryWriteLock(); + Assert.isTrue(!result); + } + + @Test + public void tryReadWriteLockTest() { + SimpleReadWriteLock simpleReadWriteLock = new SimpleReadWriteLock(); + simpleReadWriteLock.tryReadLock(); + boolean result = simpleReadWriteLock.tryWriteLock(); + Assert.isTrue(!result); + } + + @Test + public void tryWriteReadLockTest() { + SimpleReadWriteLock simpleReadWriteLock = new SimpleReadWriteLock(); + simpleReadWriteLock.tryWriteLock(); + boolean result = simpleReadWriteLock.tryReadLock(); + Assert.isTrue(!result); + } + + @Test + public void releaseReadLockTest() { + SimpleReadWriteLock simpleReadWriteLock = new SimpleReadWriteLock(); + simpleReadWriteLock.tryReadLock(); + simpleReadWriteLock.releaseReadLock(); + boolean result = simpleReadWriteLock.tryWriteLock(); + Assert.isTrue(result); + } + + @Test + public void releaseWriteLockTest() { + SimpleReadWriteLock simpleReadWriteLock = new SimpleReadWriteLock(); + simpleReadWriteLock.tryWriteLock(); + simpleReadWriteLock.releaseWriteLock(); + boolean result = simpleReadWriteLock.tryReadLock(); + Assert.isTrue(result); + } + + @Test + public void multiThreadTryWriteLockTest() throws Exception { + SimpleReadWriteLock simpleReadWriteLock = new SimpleReadWriteLock(); + CountDownLatch countDownLatch = new CountDownLatch(2); + new Thread(() -> { + try { + TimeUnit.SECONDS.sleep(1); + while (true) { + if (simpleReadWriteLock.tryWriteLock()) { + System.out.println(Thread.currentThread() + " -1 get write lock success"); + TimeUnit.SECONDS.sleep(5); + System.out.println(Thread.currentThread() + " -1 execute done"); + simpleReadWriteLock.releaseWriteLock(); + countDownLatch.countDown(); + break; + } + } + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + }).start(); + new Thread(() -> { + try { + TimeUnit.SECONDS.sleep(2); + while (true) { + if (simpleReadWriteLock.tryWriteLock()){ + System.out.println(Thread.currentThread() + " -2 get write lock success"); + TimeUnit.SECONDS.sleep(1); + System.out.println(Thread.currentThread() + " -2 execute done"); + countDownLatch.countDown(); + break; + } + } + } catch (InterruptedException e) { + throw new RuntimeException(e); + }finally { + simpleReadWriteLock.releaseWriteLock(); + } + }).start(); + countDownLatch.await(); + Assert.isTrue(simpleReadWriteLock.tryWriteLock()); + } + } From a893e1261e6dd31f479a0074fe92836be2eb3319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Wed, 21 Sep 2022 18:10:18 +0800 Subject: [PATCH 03/44] Update README.md --- README.md | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index e3386b13..18ecab36 100644 --- a/README.md +++ b/README.md @@ -38,50 +38,28 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - 容器管理 - Tomcat、Jetty、Undertow 容器线程池运行时查看和线程数变更。 - 中间件适配 - Dubbo、Hystrix、RocketMQ、RabbitMQ 等消费线程池运行时数据查看和线程数变更。 -> 开源作者为爱发电不容易,看完有收获,右上角帮忙点个 Star 🤩 - ## 快速开始 对于本地演示目的,请参阅 [Quick start](https://hippo4j.cn/docs/user_docs/user_guide/quick-start) -演示环境: http://console.hippo4j.cn/index.html +演示环境: [http://console.hippo4j.cn/index.html](http://console.hippo4j.cn/index.html) ## 联系我 ![](https://user-images.githubusercontent.com/77398366/185774220-c11951f9-e130-4d60-8204-afb5c51d4401.png) -扫码添加微信,备注:hippo4j,邀您加入群聊。若图片加载不出来,访问 [官网站点](https://hippo4j.cn/docs/user_docs/other/group) +扫码添加微信,备注:hippo4j,邀您加入群聊。若图片加载不出来,访问 [官网站点](https://hippo4j.cn/docs/user_docs/other/group)。 ## 友情链接 -- [[ Sa-Token ]](https://github.com/dromara/sa-token):一个轻量级 java 权限认证框架,让鉴权变得简单、优雅! +- [[ Sa-Token ]](https://github.com/dromara/sa-token):一个轻量级 java 权限认证框架,让鉴权变得简单、优雅! - [[ HertzBeat ]](https://github.com/dromara/hertzbeat):易用友好的云监控系统, 无需 Agent, 强大自定义监控能力。 - - [[ JavaGuide ]](https://github.com/Snailclimb/JavaGuide):一份涵盖大部分 Java 程序员所需要掌握的核心知识。 - - [[ toBeBetterJavaer ]](https://github.com/itwanger/toBeBetterJavaer):一份通俗易懂、风趣幽默的 Java 学习指南。 -## 开发者 +## 贡献者 -Hippo-4J 获得的成就属于每一位贡献者!如果有意贡献,请参考 [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) 或者 [good pro issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+pro+issue%22)。 +感谢所有为项目作出贡献的开发者 [[Contributors](https://github.com/opengoofy/hippo4j/graphs/contributors)]。如果有意贡献,参考 [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)。 - -## 谁在使用 - -如果您正在使用这个项目,可以在 [此处](https://github.com/opengoofy/hippo4j/issues/13) 登记您所在的组织或公司,谢谢。 - -![身边云](https://user-images.githubusercontent.com/77398366/189787832-f51d475c-d758-40f2-9812-997637804e6f.png) -![Medbanks](https://user-images.githubusercontent.com/77398366/189787960-16f89af9-a615-4da3-8309-18d0793aed05.png) -![神州数码](https://user-images.githubusercontent.com/77398366/189786973-1a924f41-1558-4b03-acfd-49f279b99ce7.png) -![payermax](https://user-images.githubusercontent.com/77398366/189787071-ccfa45fa-31c0-4a39-9969-9d20d6948a7b.png) -![轻松到家](https://user-images.githubusercontent.com/77398366/189787144-fb6f7c4a-bdd8-4bdf-8ce1-c1e386c7aecd.png) -![鲁班到家](https://user-images.githubusercontent.com/77398366/189787219-09201124-8ac6-496e-b562-9b4eecc11806.png) -![广东天枢新能源科技有限公司](https://user-images.githubusercontent.com/77398366/189787263-d1998874-51ec-42ea-89d8-961cf1c2a557.png) -![FitTime](https://user-images.githubusercontent.com/77398366/189787924-c6f1835c-c81b-403b-a7ec-386c261766a9.png) -![51社保](https://user-images.githubusercontent.com/77398366/189787481-b9eae343-8310-4333-b385-b68e224d1438.png) -![好货云店](https://user-images.githubusercontent.com/77398366/189787520-7ea68573-2232-4ba5-bedc-94754884c75c.png) -![斗象科技](https://user-images.githubusercontent.com/77398366/189788405-ea93d8f0-3c17-49e0-bd96-8fc259d0eb89.png) -![深圳航天信息有限公司](https://user-images.githubusercontent.com/77398366/189787780-7815f0c0-8478-4403-99ec-27fe07537b99.png) -![新东方](https://user-images.githubusercontent.com/77398366/189787802-2bb240bd-307f-4e8d-aaa5-ff71e0d46acc.png) From 23336017f45711d854ab616cdad81ee6526383c6 Mon Sep 17 00:00:00 2001 From: weihubeats Date: Thu, 22 Sep 2022 10:24:52 +0800 Subject: [PATCH 04/44] remove redundant dependencies (#713) --- .../config/toolkit/SimpleReadWriteLockTest.java | 10 +++++----- hippo4j-server/pom.xml | 6 ------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/SimpleReadWriteLockTest.java b/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/SimpleReadWriteLockTest.java index 7b1d37f4..afa70bbd 100644 --- a/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/SimpleReadWriteLockTest.java +++ b/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/SimpleReadWriteLockTest.java @@ -17,12 +17,12 @@ package cn.hippo4j.config.toolkit; -import cn.hippo4j.common.toolkit.Assert; -import org.junit.Test; - import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import cn.hippo4j.common.toolkit.Assert; +import org.junit.Test; + /** * SimpleReadWriteLock Test */ @@ -116,7 +116,7 @@ public class SimpleReadWriteLockTest { try { TimeUnit.SECONDS.sleep(2); while (true) { - if (simpleReadWriteLock.tryWriteLock()){ + if (simpleReadWriteLock.tryWriteLock()) { System.out.println(Thread.currentThread() + " -2 get write lock success"); TimeUnit.SECONDS.sleep(1); System.out.println(Thread.currentThread() + " -2 execute done"); @@ -126,7 +126,7 @@ public class SimpleReadWriteLockTest { } } catch (InterruptedException e) { throw new RuntimeException(e); - }finally { + } finally { simpleReadWriteLock.releaseWriteLock(); } }).start(); diff --git a/hippo4j-server/pom.xml b/hippo4j-server/pom.xml index 4b8ee0f2..ebb19a0b 100644 --- a/hippo4j-server/pom.xml +++ b/hippo4j-server/pom.xml @@ -21,12 +21,6 @@ ${revision} - - cn.hippo4j - hippo4j-discovery - ${revision} - - javax.xml.bind From 197917a25af15777733e4ad85266348f29bb6d8e Mon Sep 17 00:00:00 2001 From: Gdk666 <763366136@qq.com> Date: Thu, 22 Sep 2022 18:21:05 +0800 Subject: [PATCH 05/44] add ConfigExecutorTest test case (#715) * add BeanUtilTest test case * add BeanUtilTest test case * add BeanUtilTest test case * add ClassUtilTest test case * add ConfigExecutorTest test case * Revert "add ConfigExecutorTest test case" This reverts commit ffc00ff4 * add ConfigExecutorTest test case --- .../config/toolkit/ConfigExecutorTest.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/ConfigExecutorTest.java b/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/ConfigExecutorTest.java index 4864cd7d..fb8cc27b 100644 --- a/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/ConfigExecutorTest.java +++ b/hippo4j-config/src/test/java/cn/hippo4j/config/toolkit/ConfigExecutorTest.java @@ -17,8 +17,28 @@ package cn.hippo4j.config.toolkit; +import lombok.extern.slf4j.Slf4j; +import org.junit.Test; +import java.util.concurrent.TimeUnit; + /** * ConfigExecutor Test */ +@Slf4j public class ConfigExecutorTest { + + @Test + public void executeLongPollingTest() { + ConfigExecutor.executeLongPolling(() -> log.info(Thread.currentThread().getName())); + } + + @Test + public void scheduleLongPollingTest() { + ConfigExecutor.scheduleLongPolling(() -> log.info(Thread.currentThread().getName()), 5, TimeUnit.SECONDS); + } + + @Test + public void scheduleLongPollingInitialTest() { + ConfigExecutor.scheduleLongPolling(() -> log.info(Thread.currentThread().getName()), 0, 5, TimeUnit.SECONDS); + } } From e20ae4b32dd8b51c08bf1369f0ce3874f4980c3b Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Thu, 22 Sep 2022 18:27:19 +0800 Subject: [PATCH 06/44] Update the list of contributors via action --- .github/workflows/main.yml | 34 ++++++++++++++++++++++++++++++++++ README.md | 3 ++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..7e72b394 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +on: + push: + branches: + - develop + +jobs: + contrib-readme-job: + runs-on: ubuntu-latest + name: A job to automate contrib in readme + steps: + - name: Contribute List + uses: akhilmhdh/contributors-readme-action@v2.3.6 + env: + GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} diff --git a/README.md b/README.md index 18ecab36..f5e67f1f 100644 --- a/README.md +++ b/README.md @@ -62,4 +62,5 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 感谢所有为项目作出贡献的开发者 [[Contributors](https://github.com/opengoofy/hippo4j/graphs/contributors)]。如果有意贡献,参考 [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)。 - + + From 025a4d7479ab40936ce5f1fe2e2f7890b62c957d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Thu, 22 Sep 2022 18:27:45 +0800 Subject: [PATCH 07/44] docs(contributor): contrib-readme-action has updated readme --- README.md | 540 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 540 insertions(+) diff --git a/README.md b/README.md index f5e67f1f..a2f0b851 100644 --- a/README.md +++ b/README.md @@ -63,4 +63,544 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 感谢所有为项目作出贡献的开发者 [[Contributors](https://github.com/opengoofy/hippo4j/graphs/contributors)]。如果有意贡献,参考 [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + itmachen +
+ 小马哥 +
+
+ + shining-stars-lk +
+ Lucky 8 +
+
+ + weihubeats +
+ Weihubeats +
+
+ + pirme +
+ 李金来 +
+
+ + iwangjie +
+ 王杰 +
+
+ + shanjianq +
+ Shanjianq +
+
+ + BigXin0109 +
+ BigXin0109 +
+
+ + xqxyxchy +
+ Null +
+
+ + Gdk666 +
+ Null +
+
+ + maxisvest +
+ Null +
+
+ + zhuanghaozhe +
+ 庄昊哲 +
+
+ + liulinfei121 +
+ Null +
+
+ + road2master +
+ Lijx +
+
+ + pizihao +
+ Pizihao +
+
+ + Atmanuclear +
+ Null +
+
+ + hippo4j +
+ Hippo4j +
+
+ + imyzt +
+ 杨镇涛 +
+
+ + Tliutao +
+ Liutao +
+
+ + monsterxxp +
+ Null +
+
+ + voilaf +
+ Null +
+
+ + gywanghai +
+ 二师兄 +
+
+ + skyemin +
+ Null +
+
+ + Redick01 +
+ Redick Liu +
+
+ + xiaochengxuyuan +
+ Sean Wu +
+
+ + HKMV +
+ Serenity +
+
+ + gewuwo +
+ 格悟沃 +
+
+ + hushtian +
+ Null +
+
+ + jinlingmei +
+ Null +
+
+ + linlinjie +
+ Null +
+
+ + selectbook +
+ Leping Huang +
+
+ + soulmz +
+ Soulzz +
+
+ + tomsun28 +
+ Tomsun28 +
+
+ + backbay2-yzg +
+ 游祖光 +
+
+ + 2EXP +
+ Null +
+
+ + onesimplecoder +
+ Alic +
+
+ + CalebZYC +
+ Null +
+
+ + Hibernate5666 +
+ Cheng Xihong +
+
+ + smartdj +
+ DJ +
+
+ + dmego +
+ Dmego +
+
+ + dousp +
+ Douspeng +
+
+ + hl1248 +
+ Lucas +
+
+ + gentlelynn +
+ Lynn +
+
+ + sanliangitch +
+ WuLang +
+
+ + alexhaoxuan +
+ Alexli +
+
+ + qizhongju +
+ Bug搬运工 +
+
+ + san4j +
+ San4j +
+
+ + zhenyed +
+ Zhenye +
+
+ + dongming0920 +
+ Null +
+
+ + f497196689 +
+ Fengjing +
+
+ + Snailclimb +
+ Guide +
+
+ + hbw1994 +
+ Null +
+
+ + hncboy +
+ Null +
+
+ + stronglong +
+ Itermis +
+
+ + janey668 +
+ Null +
+
+ + jialei-jack +
+ Jialei-jack +
+
+ + klsq94 +
+ Hui Cao +
+
+ + kongyanbo-cx +
+ Null +
+
+ + lishiyu +
+ Null +
+
+ + puppet4 +
+ Tudo +
+
+ + Nhxz +
+ Nhxz +
+
+ + op-lht +
+ Op-lht +
+
+ + wangjie-github +
+ Wangjie +
+
+ + wangyi123456 +
+ Null +
+
+ + Williamren97 +
+ William Ren +
+
+ + wzw8795 +
+ Null +
+
+ + huaxianchao +
+ Null +
+
+ + yangzhiw +
+ Opentanent +
+
+ + yhc777 +
+ Null +
+
+ + zhaiweij +
+ Zhaiweij +
+
+ + zhaojinchao95 +
+ Zhaojinchao +
+
+ + zj1997 +
+ Null +
+
+ + li-xiao-shuang +
+ 李晓双 Li Xiao Shuang +
+
+ + oreoft +
+ 没有气的汽水 +
+
+ + wo883721 +
+ Xinhao +
+
+ + Createsequence +
+ 黄成兴 +
+
From 446da52fec99ae7ebe661902658508b30056560c Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Thu, 22 Sep 2022 18:30:26 +0800 Subject: [PATCH 08/44] Change contributor avatar size --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e72b394..47920cb9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,5 +30,7 @@ jobs: steps: - name: Contribute List uses: akhilmhdh/contributors-readme-action@v2.3.6 + with: + image_size: 50 env: GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} From 5b385e6c7c8486be2e768bf99666a322489edd4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Thu, 22 Sep 2022 18:30:56 +0800 Subject: [PATCH 09/44] docs(contributor): contrib-readme-action has updated readme --- README.md | 150 +++++++++++++++++++++++++++--------------------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index a2f0b851..404ff4a9 100644 --- a/README.md +++ b/README.md @@ -67,42 +67,42 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - itmachen + itmachen
小马哥
- shining-stars-lk + shining-stars-lk
Lucky 8
- weihubeats + weihubeats
Weihubeats
- pirme + pirme
李金来
- iwangjie + iwangjie
王杰
- shanjianq + shanjianq
Shanjianq
@@ -110,42 +110,42 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - BigXin0109 + BigXin0109
BigXin0109
- xqxyxchy + xqxyxchy
Null
- Gdk666 + Gdk666
Null
- maxisvest + maxisvest
Null
- zhuanghaozhe + zhuanghaozhe
庄昊哲
- liulinfei121 + liulinfei121
Null
@@ -153,42 +153,42 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - road2master + road2master
Lijx
- pizihao + pizihao
Pizihao
- Atmanuclear + Atmanuclear
Null
- hippo4j + hippo4j
Hippo4j
- imyzt + imyzt
杨镇涛
- Tliutao + Tliutao
Liutao
@@ -196,42 +196,42 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - monsterxxp + monsterxxp
Null
- voilaf + voilaf
Null
- gywanghai + gywanghai
二师兄
- skyemin + skyemin
Null
- Redick01 + Redick01
Redick Liu
- xiaochengxuyuan + xiaochengxuyuan
Sean Wu
@@ -239,42 +239,42 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - HKMV + HKMV
Serenity
- gewuwo + gewuwo
格悟沃
- hushtian + hushtian
Null
- jinlingmei + jinlingmei
Null
- linlinjie + linlinjie
Null
- selectbook + selectbook
Leping Huang
@@ -282,42 +282,42 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - soulmz + soulmz
Soulzz
- tomsun28 + tomsun28
Tomsun28
- backbay2-yzg + backbay2-yzg
游祖光
- 2EXP + 2EXP
Null
- onesimplecoder + onesimplecoder
Alic
- CalebZYC + CalebZYC
Null
@@ -325,42 +325,42 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - Hibernate5666 + Hibernate5666
Cheng Xihong
- smartdj + smartdj
DJ
- dmego + dmego
Dmego
- dousp + dousp
Douspeng
- hl1248 + hl1248
Lucas
- gentlelynn + gentlelynn
Lynn
@@ -368,42 +368,42 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - sanliangitch + sanliangitch
WuLang
- alexhaoxuan + alexhaoxuan
Alexli
- qizhongju + qizhongju
Bug搬运工
- san4j + san4j
San4j
- zhenyed + zhenyed
Zhenye
- dongming0920 + dongming0920
Null
@@ -411,42 +411,42 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - f497196689 + f497196689
Fengjing
- Snailclimb + Snailclimb
Guide
- hbw1994 + hbw1994
Null
- hncboy + hncboy
Null
- stronglong + stronglong
Itermis
- janey668 + janey668
Null
@@ -454,42 +454,42 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - jialei-jack + jialei-jack
Jialei-jack
- klsq94 + klsq94
Hui Cao
- kongyanbo-cx + kongyanbo-cx
Null
- lishiyu + lishiyu
Null
- puppet4 + puppet4
Tudo
- Nhxz + Nhxz
Nhxz
@@ -497,42 +497,42 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - op-lht + op-lht
Op-lht
- wangjie-github + wangjie-github
Wangjie
- wangyi123456 + wangyi123456
Null
- Williamren97 + Williamren97
William Ren
- wzw8795 + wzw8795
Null
- huaxianchao + huaxianchao
Null
@@ -540,42 +540,42 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - yangzhiw + yangzhiw
Opentanent
- yhc777 + yhc777
Null
- zhaiweij + zhaiweij
Zhaiweij
- zhaojinchao95 + zhaojinchao95
Zhaojinchao
- zj1997 + zj1997
Null
- li-xiao-shuang + li-xiao-shuang
李晓双 Li Xiao Shuang
@@ -583,21 +583,21 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - oreoft + oreoft
没有气的汽水
- wo883721 + wo883721
Xinhao
- Createsequence + Createsequence
黄成兴
From 4f79b8c41cd356b2c084d706c178b11415b3f8af Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Thu, 22 Sep 2022 18:33:52 +0800 Subject: [PATCH 10/44] Update contributor action --- .github/workflows/{main.yml => reademe-contributors.yml} | 4 ++++ 1 file changed, 4 insertions(+) rename .github/workflows/{main.yml => reademe-contributors.yml} (88%) diff --git a/.github/workflows/main.yml b/.github/workflows/reademe-contributors.yml similarity index 88% rename from .github/workflows/main.yml rename to .github/workflows/reademe-contributors.yml index 47920cb9..d501db52 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/reademe-contributors.yml @@ -32,5 +32,9 @@ jobs: uses: akhilmhdh/contributors-readme-action@v2.3.6 with: image_size: 50 + columns_per_row: 9 + committer_email: machen@apache.org + committer_username: itmachen + commit_message: 'Update the list of contributors' env: GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} From efed83d69c830b7ed43e2427cd071aa308200aeb Mon Sep 17 00:00:00 2001 From: itmachen Date: Thu, 22 Sep 2022 18:34:10 +0800 Subject: [PATCH 11/44] Update the list of contributors --- README.md | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 404ff4a9..9037b6cc 100644 --- a/README.md +++ b/README.md @@ -106,8 +106,7 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Shanjianq - - + BigXin0109 @@ -128,7 +127,8 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- + + maxisvest @@ -149,8 +149,7 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- - + road2master @@ -235,8 +234,7 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Sean Wu
- - + HKMV @@ -257,7 +255,8 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- + + jinlingmei @@ -278,8 +277,7 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Leping Huang
- - + soulmz @@ -364,8 +362,7 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Lynn
- - + sanliangitch @@ -386,7 +383,8 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Bug搬运工
- + + san4j @@ -407,8 +405,7 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- - + f497196689 @@ -493,8 +490,7 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Nhxz
- - + op-lht @@ -515,7 +511,8 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- + + Williamren97 @@ -536,8 +533,7 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- - + yangzhiw From a8e0b1792bfc4f27fe1b49715511299d26eb738e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=87=91=E6=9D=A5?= <41976977+pirme@users.noreply.github.com> Date: Thu, 22 Sep 2022 19:12:26 +0800 Subject: [PATCH 12/44] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6786d573..51fd6e3f 100644 --- a/pom.xml +++ b/pom.xml @@ -338,7 +338,7 @@ chen.ma machen@apache.org - https://github.com/mabaiwan + https://github.com/itmachen OpenGoofy https://github.com/opengoofy From 639e72930091a95167fa125702d52e747fcebab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Thu, 22 Sep 2022 19:17:50 +0800 Subject: [PATCH 13/44] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9037b6cc..157ac8aa 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 ## 贡献者 -感谢所有为项目作出贡献的开发者 [[Contributors](https://github.com/opengoofy/hippo4j/graphs/contributors)]。如果有意贡献,参考 [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)。 +感谢所有为项目作出贡献的开发者。如果有意贡献,参考 [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)。 From bbe1e989c2a8be5cea46d3dc0dc2cee1846059ed Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Thu, 22 Sep 2022 22:03:33 +0800 Subject: [PATCH 14/44] Add .mvn wrapper --- .mvn/wrapper/maven-wrapper.jar | 0 .mvn/wrapper/maven-wrapper.properties | 1 + 2 files changed, 1 insertion(+) create mode 100644 .mvn/wrapper/maven-wrapper.jar create mode 100644 .mvn/wrapper/maven-wrapper.properties diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 00000000..e69de29b diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 00000000..c3150437 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1 @@ +distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip From 7dc30efc5346a64d82bdf2740305d55570045f30 Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Fri, 23 Sep 2022 21:30:06 +0800 Subject: [PATCH 15/44] Adapt to H2 database --- hippo4j-config/pom.xml | 2 + .../biz/impl/ThreadPoolServiceImpl.java | 2 +- .../service/impl/DashboardServiceImpl.java | 39 +-- hippo4j-server/pom.xml | 1 - .../server/config/DataBaseConfiguration.java | 42 +++ .../server/config/DataBaseProperties.java | 41 +++ .../server/init/LocalDataSourceLoader.java | 110 ++++++ .../main/resources/application-h2.properties | 9 +- .../resources/application-mysql.properties | 5 - .../src/main/resources/application.properties | 11 + .../sql-script/h2/hippo4j_manager.sql | 317 ++++++++---------- .../sql-script/mysql/hippo4j_manager.sql | 214 ++++++++++++ 12 files changed, 583 insertions(+), 210 deletions(-) create mode 100644 hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseConfiguration.java create mode 100644 hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseProperties.java create mode 100644 hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java delete mode 100644 hippo4j-server/src/main/resources/application-mysql.properties create mode 100644 hippo4j-server/src/main/resources/sql-script/mysql/hippo4j_manager.sql diff --git a/hippo4j-config/pom.xml b/hippo4j-config/pom.xml index 79a9473f..61cd12de 100644 --- a/hippo4j-config/pom.xml +++ b/hippo4j-config/pom.xml @@ -11,6 +11,7 @@ true + 2.1.214 @@ -38,6 +39,7 @@ com.h2database h2 + ${h2.version} runtime diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ThreadPoolServiceImpl.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ThreadPoolServiceImpl.java index 9bb67cdf..b26016b9 100644 --- a/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ThreadPoolServiceImpl.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ThreadPoolServiceImpl.java @@ -61,7 +61,7 @@ public class ThreadPoolServiceImpl implements ThreadPoolService { .eq(!StringUtils.isBlank(reqDTO.getTenantId()), ConfigAllInfo::getTenantId, reqDTO.getTenantId()) .eq(!StringUtils.isBlank(reqDTO.getItemId()), ConfigAllInfo::getItemId, reqDTO.getItemId()) .eq(!StringUtils.isBlank(reqDTO.getTpId()), ConfigAllInfo::getTpId, reqDTO.getTpId()) - .eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL) + .eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL.getIntCode()) .orderByDesc(reqDTO.getDesc() != null, ConfigAllInfo::getGmtCreate); return configInfoMapper.selectPage(reqDTO, wrapper).convert(each -> BeanUtil.convert(each, ThreadPoolRespDTO.class)); } diff --git a/hippo4j-console/src/main/java/cn/hippo4j/console/service/impl/DashboardServiceImpl.java b/hippo4j-console/src/main/java/cn/hippo4j/console/service/impl/DashboardServiceImpl.java index f2603a0c..09702b30 100644 --- a/hippo4j-console/src/main/java/cn/hippo4j/console/service/impl/DashboardServiceImpl.java +++ b/hippo4j-console/src/main/java/cn/hippo4j/console/service/impl/DashboardServiceImpl.java @@ -17,12 +17,6 @@ package cn.hippo4j.console.service.impl; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - import cn.hippo4j.common.enums.DelEnum; import cn.hippo4j.common.model.InstanceInfo; import cn.hippo4j.common.toolkit.GroupKey; @@ -30,17 +24,9 @@ import cn.hippo4j.config.mapper.ConfigInfoMapper; import cn.hippo4j.config.mapper.HisRunDataMapper; import cn.hippo4j.config.mapper.ItemInfoMapper; import cn.hippo4j.config.mapper.TenantInfoMapper; -import cn.hippo4j.config.model.CacheItem; -import cn.hippo4j.config.model.ConfigAllInfo; -import cn.hippo4j.config.model.ConfigInfoBase; -import cn.hippo4j.config.model.ItemInfo; -import cn.hippo4j.config.model.TenantInfo; +import cn.hippo4j.config.model.*; import cn.hippo4j.config.service.ConfigCacheService; -import cn.hippo4j.console.model.ChartInfo; -import cn.hippo4j.console.model.LineChartInfo; -import cn.hippo4j.console.model.PieChartInfo; -import cn.hippo4j.console.model.RankingChart; -import cn.hippo4j.console.model.TenantChart; +import cn.hippo4j.console.model.*; import cn.hippo4j.console.service.DashboardService; import cn.hippo4j.discovery.core.BaseInstanceRegistry; import cn.hippo4j.discovery.core.Lease; @@ -52,9 +38,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; import lombok.AllArgsConstructor; - import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + import static cn.hippo4j.common.toolkit.ContentUtil.getGroupKey; /** @@ -76,9 +67,9 @@ public class DashboardServiceImpl implements DashboardService { @Override public ChartInfo getChartInfo() { - Integer tenantCount = tenantInfoMapper.selectCount(Wrappers.lambdaQuery(TenantInfo.class).eq(TenantInfo::getDelFlag, DelEnum.NORMAL.getCode())); + Integer tenantCount = tenantInfoMapper.selectCount(Wrappers.lambdaQuery(TenantInfo.class).eq(TenantInfo::getDelFlag, DelEnum.NORMAL.getIntCode())); Integer itemCount = itemInfoMapper.selectCount(Wrappers.lambdaQuery(ItemInfo.class).eq(ItemInfo::getDelFlag, DelEnum.NORMAL.getIntCode())); - Integer threadPoolCount = configInfoMapper.selectCount(Wrappers.lambdaQuery(ConfigAllInfo.class).eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL.getCode())); + Integer threadPoolCount = configInfoMapper.selectCount(Wrappers.lambdaQuery(ConfigAllInfo.class).eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL.getIntCode())); ChartInfo chartInfo = new ChartInfo(); chartInfo.setTenantCount(tenantCount) .setItemCount(itemCount) @@ -111,16 +102,16 @@ public class DashboardServiceImpl implements DashboardService { @Override public TenantChart getTenantChart() { List> tenantChartList = Lists.newArrayList(); - List tenantInfos = tenantInfoMapper.selectList(Wrappers.lambdaQuery(TenantInfo.class).eq(TenantInfo::getDelFlag, DelEnum.NORMAL)); + List tenantInfos = tenantInfoMapper.selectList(Wrappers.lambdaQuery(TenantInfo.class).eq(TenantInfo::getDelFlag, DelEnum.NORMAL.getIntCode())); for (TenantInfo tenant : tenantInfos) { int tenantThreadPoolNum = 0; LambdaQueryWrapper itemQueryWrapper = - Wrappers.lambdaQuery(ItemInfo.class).eq(ItemInfo::getTenantId, tenant.getTenantId()).eq(ItemInfo::getDelFlag, DelEnum.NORMAL).select(ItemInfo::getItemId); + Wrappers.lambdaQuery(ItemInfo.class).eq(ItemInfo::getTenantId, tenant.getTenantId()).eq(ItemInfo::getDelFlag, DelEnum.NORMAL.getIntCode()).select(ItemInfo::getItemId); List itemInfos = itemInfoMapper.selectList(itemQueryWrapper); for (ItemInfo item : itemInfos) { LambdaQueryWrapper threadPoolQueryWrapper = Wrappers.lambdaQuery(ConfigAllInfo.class) .eq(ConfigInfoBase::getItemId, item.getItemId()) - .eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL); + .eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL.getIntCode()); Integer threadPoolCount = configInfoMapper.selectCount(threadPoolQueryWrapper); tenantThreadPoolNum += threadPoolCount; } @@ -136,13 +127,13 @@ public class DashboardServiceImpl implements DashboardService { @Override public PieChartInfo getPieChart() { - LambdaQueryWrapper itemQueryWrapper = Wrappers.lambdaQuery(ItemInfo.class).eq(ItemInfo::getDelFlag, DelEnum.NORMAL).select(ItemInfo::getItemId); + LambdaQueryWrapper itemQueryWrapper = Wrappers.lambdaQuery(ItemInfo.class).eq(ItemInfo::getDelFlag, DelEnum.NORMAL.getIntCode()).select(ItemInfo::getItemId); List itemNameList = itemInfoMapper.selectObjs(itemQueryWrapper); List> pieDataList = Lists.newArrayList(); for (Object each : itemNameList) { LambdaQueryWrapper threadPoolQueryWrapper = Wrappers.lambdaQuery(ConfigAllInfo.class) .eq(ConfigInfoBase::getItemId, each) - .eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL); + .eq(ConfigAllInfo::getDelFlag, DelEnum.NORMAL.getIntCode()); Integer threadPoolCount = configInfoMapper.selectCount(threadPoolQueryWrapper); if (threadPoolCount != null) { Dict dict = Dict.create().set("name", each).set("value", threadPoolCount); diff --git a/hippo4j-server/pom.xml b/hippo4j-server/pom.xml index ebb19a0b..f6d2b20e 100644 --- a/hippo4j-server/pom.xml +++ b/hippo4j-server/pom.xml @@ -14,7 +14,6 @@ - cn.hippo4j hippo4j-console diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseConfiguration.java b/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseConfiguration.java new file mode 100644 index 00000000..db8affd4 --- /dev/null +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseConfiguration.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.server.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Database configuration. + * + * @see org.apache.shenyu.admin.config.DataBaseConfiguration + */ +@Configuration +public class DataBaseConfiguration { + + @Bean + @ConditionalOnMissingBean(value = DataBaseProperties.class) + public DataBaseProperties dataBaseProperties(@Value("${hippo4j.database.init_script:sql-script/h2/schema.sql}") String initScript, + @Value("${hippo4j.database.init_enable:true}") Boolean initEnable) { + DataBaseProperties dataSourceProperties = new DataBaseProperties(); + dataSourceProperties.setInitScript(initScript); + dataSourceProperties.setInitEnable(initEnable); + return dataSourceProperties; + } +} diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseProperties.java b/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseProperties.java new file mode 100644 index 00000000..b6029999 --- /dev/null +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseProperties.java @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.server.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Database properties. + * + * @see org.apache.shenyu.admin.config.properties.DataBaseProperties + */ +@Data +@ConfigurationProperties(prefix = "hippo4j.database") +public class DataBaseProperties { + + /** + * Init script + */ + private String initScript; + + /** + * Init enable + */ + private Boolean initEnable; +} diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java b/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java new file mode 100644 index 00000000..1ecccf2b --- /dev/null +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java @@ -0,0 +1,110 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.server.init; + +import cn.hippo4j.server.config.DataBaseProperties; +import com.google.common.base.Splitter; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.io.Resources; +import org.apache.ibatis.jdbc.ScriptRunner; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; +import org.springframework.lang.NonNull; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.nio.charset.StandardCharsets; +import java.sql.Connection; +import java.sql.DriverManager; +import java.util.List; + +/** + * Local datasource loader. + * + * @see org.apache.shenyu.admin.spring.LocalDataSourceLoader + */ +@Slf4j +@Component +@ConditionalOnExpression("'${hippo4j.database.dialect}' == 'mysql' or '${hippo4j.database.dialect}' == 'h2'") +public class LocalDataSourceLoader implements InstantiationAwareBeanPostProcessor { + + private static final String PRE_FIX = "file:"; + + @Resource + private DataBaseProperties dataBaseProperties; + + @Override + public Object postProcessAfterInitialization(@NonNull final Object bean, final String beanName) throws BeansException { + if ((bean instanceof DataSourceProperties) && dataBaseProperties.getInitEnable()) { + this.init((DataSourceProperties) bean); + } + return bean; + } + + protected void init(final DataSourceProperties properties) { + try { + // If jdbcUrl in the configuration file specifies the hippo4j database, it is removed, + // because the hippo4j database does not need to be specified when executing the SQL file, + // otherwise the hippo4j database will be disconnected when the hippo4j database does not exist + String jdbcUrl = StringUtils.replace(properties.getUrl(), "/hippo4j_manager?", "?"); + Connection connection = DriverManager.getConnection(jdbcUrl, properties.getUsername(), properties.getPassword()); + this.execute(connection, dataBaseProperties.getInitScript()); + } catch (Exception ex) { + log.error("Datasource init error.", ex); + throw new RuntimeException(ex.getMessage()); + } + } + + protected void execute(final Connection conn, final String script) throws Exception { + ScriptRunner runner = new ScriptRunner(conn); + try { + // Doesn't print logger + runner.setLogWriter(null); + runner.setAutoCommit(true); + Resources.setCharset(StandardCharsets.UTF_8); + List initScripts = Splitter.on(";").splitToList(script); + for (String sqlScript : initScripts) { + if (sqlScript.startsWith(PRE_FIX)) { + String sqlFile = sqlScript.substring(PRE_FIX.length()); + try (Reader fileReader = getResourceAsReader(sqlFile)) { + log.info("Execute hippo4j schema sql: {}", sqlFile); + runner.runScript(fileReader); + } + } else { + try (Reader fileReader = Resources.getResourceAsReader(sqlScript)) { + log.info("Execute hippo4j schema sql: {}", sqlScript); + runner.runScript(fileReader); + } + } + } + } finally { + conn.close(); + } + } + + private static Reader getResourceAsReader(final String resource) throws IOException { + return new InputStreamReader(new FileInputStream(resource), StandardCharsets.UTF_8); + } +} diff --git a/hippo4j-server/src/main/resources/application-h2.properties b/hippo4j-server/src/main/resources/application-h2.properties index 5859aa19..999857c8 100644 --- a/hippo4j-server/src/main/resources/application-h2.properties +++ b/hippo4j-server/src/main/resources/application-h2.properties @@ -1,6 +1,9 @@ -### Default database +### Data source customization section +hippo4j.database.dialect=h2 +hippo4j.database.init_enable=true +hippo4j.database.init_script=sql-script/h2/hippo4j_manager.sql + spring.datasource.driver-class-name=org.h2.Driver -spring.datasource.url=jdbc:h2:mem:hippo4j_manager;DB_CLOSE_DELAY=-1;MODE=MySQL; +spring.datasource.url=jdbc:h2:file:/Users/single/Desktop/temp/h2_hippo4j_test_file;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL; spring.datasource.username=sa spring.datasource.password=sa -spring.datasource.schema=classpath:sql-script/h2/hippo4j_manager.sql diff --git a/hippo4j-server/src/main/resources/application-mysql.properties b/hippo4j-server/src/main/resources/application-mysql.properties deleted file mode 100644 index 2940c413..00000000 --- a/hippo4j-server/src/main/resources/application-mysql.properties +++ /dev/null @@ -1,5 +0,0 @@ -### Data source customization section -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.url=jdbc:mysql://localhost:3306/hippo4j_manager?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 -spring.datasource.username=root -spring.datasource.password=root diff --git a/hippo4j-server/src/main/resources/application.properties b/hippo4j-server/src/main/resources/application.properties index 69a499af..b14c92fd 100644 --- a/hippo4j-server/src/main/resources/application.properties +++ b/hippo4j-server/src/main/resources/application.properties @@ -21,10 +21,21 @@ tenant=hippo4j hippo4j.core.clean-history-data-period=30 hippo4j.core.clean-history-data-enable=true +### Initialize the database dialect class. +hippo4j.database.dialect=mysql +hippo4j.database.init_enable=true +hippo4j.database.init_script=sql-script/mysql/hippo4j_manager.sql + ### Use netty to report thread pool monitoring data. The default is http. # hippo4j.core.monitor.report-type=netty #*************** Config Module Related Configurations ***************# +### Default database +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.url=jdbc:mysql://localhost:3306/hippo4j_manager?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 +spring.datasource.username=root +spring.datasource.password=root + ### Hikari Datasource spring.datasource.hikari.pool-name=Hikari spring.datasource.hikari.connectionTimeout=30000 diff --git a/hippo4j-server/src/main/resources/sql-script/h2/hippo4j_manager.sql b/hippo4j-server/src/main/resources/sql-script/h2/hippo4j_manager.sql index 2768fe2b..641791e8 100755 --- a/hippo4j-server/src/main/resources/sql-script/h2/hippo4j_manager.sql +++ b/hippo4j-server/src/main/resources/sql-script/h2/hippo4j_manager.sql @@ -2,234 +2,199 @@ /* 数据库全名 = hippo4j_manager */ /* 表名称 = tenant */ /******************************************/ -DROP TABLE IF EXISTS `tenant`, `tenant_info`; -CREATE TABLE `tenant` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', - `tenant_name` varchar(128) DEFAULT NULL COMMENT '租户名称', - `tenant_desc` varchar(256) DEFAULT NULL COMMENT '租户介绍', - `owner` varchar(32) DEFAULT '-' COMMENT '负责人', - `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', - `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', - `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', - PRIMARY KEY (`id`), - UNIQUE KEY `tenant_id` (`id`), - KEY `uk_tenantinfo_tenantid` (`tenant_id`,`del_flag`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='租户表'; +CREATE TABLE IF NOT EXISTS `tenant` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `tenant_name` varchar(128) DEFAULT NULL COMMENT '租户名称', + `tenant_desc` varchar(256) DEFAULT NULL COMMENT '租户介绍', + `owner` varchar(32) DEFAULT '-' COMMENT '负责人', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', + `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) +); /******************************************/ /* 数据库全名 = hippo4j_manager */ /* 表名称 = item */ /******************************************/ -DROP TABLE IF EXISTS `item`, `item_info`; -CREATE TABLE `item` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', - `item_id` varchar(128) DEFAULT NULL COMMENT '项目ID', - `item_name` varchar(128) DEFAULT NULL COMMENT '项目名称', - `item_desc` varchar(256) DEFAULT NULL COMMENT '项目介绍', - `owner` varchar(32) DEFAULT NULL COMMENT '负责人', - `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', - `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', - `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', - PRIMARY KEY (`id`), - UNIQUE KEY `item_id` (`id`), - UNIQUE KEY `item_uk_iteminfo_tenantitem` (`tenant_id`,`item_id`,`del_flag`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='项目表'; +CREATE TABLE IF NOT EXISTS `item` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `item_id` varchar(128) DEFAULT NULL COMMENT '项目ID', + `item_name` varchar(128) DEFAULT NULL COMMENT '项目名称', + `item_desc` varchar(256) DEFAULT NULL COMMENT '项目介绍', + `owner` varchar(32) DEFAULT NULL COMMENT '负责人', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', + `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) +); /******************************************/ /* 数据库全名 = hippo4j_manager */ /* 表名称 = config */ /******************************************/ -DROP TABLE IF EXISTS `config`, `config_info`; -CREATE TABLE `config` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', - `item_id` varchar(256) DEFAULT NULL COMMENT '项目ID', - `tp_id` varchar(56) DEFAULT NULL COMMENT '线程池ID', - `tp_name` varchar(56) DEFAULT NULL COMMENT '线程池名称', - `core_size` int(11) DEFAULT NULL COMMENT '核心线程数', - `max_size` int(11) DEFAULT NULL COMMENT '最大线程数', - `queue_type` int(11) DEFAULT NULL COMMENT '队列类型...', - `capacity` int(11) DEFAULT NULL COMMENT '队列大小', - `rejected_type` int(11) DEFAULT NULL COMMENT '拒绝策略', - `keep_alive_time` int(11) DEFAULT NULL COMMENT '线程存活时间', - `allow_core_thread_time_out` tinyint(1) DEFAULT NULL COMMENT '允许核心线程超时', - `content` longtext COMMENT '线程池内容', - `md5` varchar(32) NOT NULL COMMENT 'MD5', - `is_alarm` tinyint(1) DEFAULT NULL COMMENT '是否报警', - `capacity_alarm` int(11) DEFAULT NULL COMMENT '容量报警', - `liveness_alarm` int(11) DEFAULT NULL COMMENT '活跃度报警', - `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', - `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', - PRIMARY KEY (`id`), - UNIQUE KEY `config_id` (`id`), - UNIQUE KEY `config_uk_configinfo_datagrouptenant` (`tenant_id`,`item_id`,`tp_id`,`del_flag`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='线程池配置表'; +CREATE TABLE IF NOT EXISTS `config` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `item_id` varchar(256) DEFAULT NULL COMMENT '项目ID', + `tp_id` varchar(56) DEFAULT NULL COMMENT '线程池ID', + `tp_name` varchar(56) DEFAULT NULL COMMENT '线程池名称', + `core_size` int(11) DEFAULT NULL COMMENT '核心线程数', + `max_size` int(11) DEFAULT NULL COMMENT '最大线程数', + `queue_type` int(11) DEFAULT NULL COMMENT '队列类型...', + `capacity` int(11) DEFAULT NULL COMMENT '队列大小', + `rejected_type` int(11) DEFAULT NULL COMMENT '拒绝策略', + `keep_alive_time` int(11) DEFAULT NULL COMMENT '线程存活时间(秒)', + `execute_time_out` int(11) DEFAULT NULL COMMENT '执行超时时间(毫秒)', + `allow_core_thread_time_out` tinyint(1) DEFAULT NULL COMMENT '允许核心线程超时', + `content` longtext COMMENT '线程池内容', + `md5` varchar(32) NOT NULL COMMENT 'MD5', + `is_alarm` tinyint(1) DEFAULT NULL COMMENT '是否报警', + `capacity_alarm` int(11) DEFAULT NULL COMMENT '容量报警', + `liveness_alarm` int(11) DEFAULT NULL COMMENT '活跃度报警', + `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', + `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) +); /******************************************/ /* 数据库全名 = hippo4j_manager */ /* 表名称 = inst_config */ /******************************************/ -DROP TABLE IF EXISTS `inst_config`; -CREATE TABLE `inst_config` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', - `item_id` varchar(256) DEFAULT NULL COMMENT '项目ID', - `tp_id` varchar(56) DEFAULT NULL COMMENT '线程池ID', - `instance_id` varchar(256) DEFAULT NULL COMMENT '实例ID', - `content` longtext COMMENT '线程池内容', - `md5` varchar(32) NOT NULL COMMENT 'MD5', - `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', - PRIMARY KEY (`id`), - UNIQUE KEY `inst_config_id` (`id`), - KEY `idx_config_instance` (`tenant_id`,`item_id`,`tp_id`,`instance_id`) USING BTREE, - KEY `idx_instance` (`instance_id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='线程池配置实例表'; +CREATE TABLE IF NOT EXISTS `inst_config` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `item_id` varchar(256) DEFAULT NULL COMMENT '项目ID', + `tp_id` varchar(56) DEFAULT NULL COMMENT '线程池ID', + `instance_id` varchar(256) DEFAULT NULL COMMENT '实例ID', + `content` longtext COMMENT '线程池内容', + `md5` varchar(32) NOT NULL COMMENT 'MD5', + `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', + PRIMARY KEY (`id`) +); /******************************************/ /* 数据库全名 = hippo4j_manager */ /* 表名称 = his_run_data */ /******************************************/ -DROP TABLE IF EXISTS `his_run_data`; -CREATE TABLE `his_run_data` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', - `item_id` varchar(256) DEFAULT NULL COMMENT '项目ID', - `tp_id` varchar(56) DEFAULT NULL COMMENT '线程池ID', - `instance_id` varchar(256) DEFAULT NULL COMMENT '实例ID', - `current_load` bigint(20) DEFAULT NULL COMMENT '当前负载', - `peak_load` bigint(20) DEFAULT NULL COMMENT '峰值负载', - `pool_size` bigint(20) DEFAULT NULL COMMENT '线程数', - `active_size` bigint(20) DEFAULT NULL COMMENT '活跃线程数', - `queue_capacity` bigint(20) DEFAULT NULL COMMENT '队列容量', - `queue_size` bigint(20) DEFAULT NULL COMMENT '队列元素', - `queue_remaining_capacity` bigint(20) DEFAULT NULL COMMENT '队列剩余容量', - `completed_task_count` bigint(20) DEFAULT NULL COMMENT '已完成任务计数', - `reject_count` bigint(20) DEFAULT NULL COMMENT '拒绝次数', - `timestamp` bigint(20) DEFAULT NULL COMMENT '时间戳', - `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', - `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', - PRIMARY KEY (`id`), - KEY `idx_group_key` (`tenant_id`,`item_id`,`tp_id`,`instance_id`) USING BTREE, - KEY `idx_timestamp` (`timestamp`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='历史运行数据表'; +CREATE TABLE IF NOT EXISTS `his_run_data` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `item_id` varchar(256) DEFAULT NULL COMMENT '项目ID', + `tp_id` varchar(56) DEFAULT NULL COMMENT '线程池ID', + `instance_id` varchar(256) DEFAULT NULL COMMENT '实例ID', + `current_load` bigint(20) DEFAULT NULL COMMENT '当前负载', + `peak_load` bigint(20) DEFAULT NULL COMMENT '峰值负载', + `pool_size` bigint(20) DEFAULT NULL COMMENT '线程数', + `active_size` bigint(20) DEFAULT NULL COMMENT '活跃线程数', + `queue_capacity` bigint(20) DEFAULT NULL COMMENT '队列容量', + `queue_size` bigint(20) DEFAULT NULL COMMENT '队列元素', + `queue_remaining_capacity` bigint(20) DEFAULT NULL COMMENT '队列剩余容量', + `completed_task_count` bigint(20) DEFAULT NULL COMMENT '已完成任务计数', + `reject_count` bigint(20) DEFAULT NULL COMMENT '拒绝次数', + `timestamp` bigint(20) DEFAULT NULL COMMENT '时间戳', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`id`) +); /******************************************/ /* 数据库全名 = hippo4j_manager */ /* 表名称 = log_record_info */ /******************************************/ -DROP TABLE IF EXISTS `log_record_info`; -CREATE TABLE `log_record_info` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `tenant` varchar(128) NOT NULL DEFAULT '' COMMENT '租户标识', - `biz_key` varchar(128) NOT NULL DEFAULT '' COMMENT '日志业务标识', - `biz_no` varchar(128) NOT NULL DEFAULT '' COMMENT '业务码标识', - `operator` varchar(64) NOT NULL DEFAULT '' COMMENT '操作人', - `action` varchar(128) NOT NULL DEFAULT '' COMMENT '动作', - `category` varchar(128) NOT NULL DEFAULT '' COMMENT '种类', - `detail` varchar(2048) NOT NULL DEFAULT '' COMMENT '修改的详细信息,可以为json', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`), - KEY `idx_biz_key` (`biz_key`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='操作日志表'; +CREATE TABLE IF NOT EXISTS `log_record_info` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `tenant` varchar(128) NOT NULL DEFAULT '' COMMENT '租户标识', + `biz_key` varchar(128) NOT NULL DEFAULT '' COMMENT '日志业务标识', + `biz_no` varchar(128) NOT NULL DEFAULT '' COMMENT '业务码标识', + `operator` varchar(64) NOT NULL DEFAULT '' COMMENT '操作人', + `action` varchar(128) NOT NULL DEFAULT '' COMMENT '动作', + `category` varchar(128) NOT NULL DEFAULT '' COMMENT '种类', + `detail` varchar(2048) NOT NULL DEFAULT '' COMMENT '修改的详细信息,可以为json', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + PRIMARY KEY (`id`) +); /******************************************/ /* 数据库全名 = hippo4j_manager */ /* 表名称 = user */ /******************************************/ -DROP TABLE IF EXISTS `user`; -CREATE TABLE `user` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `user_name` varchar(64) NOT NULL COMMENT '用户名', - `password` varchar(512) NOT NULL COMMENT '用户密码', - `role` varchar(50) NOT NULL COMMENT '角色', - `gmt_create` datetime NOT NULL COMMENT '创建时间', - `gmt_modified` datetime NOT NULL COMMENT '修改时间', - `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='用户表'; +CREATE TABLE IF NOT EXISTS `user` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `user_name` varchar(64) NOT NULL COMMENT '用户名', + `password` varchar(512) NOT NULL COMMENT '用户密码', + `role` varchar(50) NOT NULL COMMENT '角色', + `gmt_create` datetime NOT NULL COMMENT '创建时间', + `gmt_modified` datetime NOT NULL COMMENT '修改时间', + `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) +); /******************************************/ /* 数据库全名 = hippo4j_manager */ /* 表名称 = role */ /******************************************/ -DROP TABLE IF EXISTS `role`; -CREATE TABLE `role` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `role` varchar(64) NOT NULL COMMENT '角色', - `user_name` varchar(64) NOT NULL COMMENT '用户名', - `gmt_create` datetime NOT NULL COMMENT '创建时间', - `gmt_modified` datetime NOT NULL COMMENT '修改时间', - `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='角色表'; +CREATE TABLE IF NOT EXISTS `role` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `role` varchar(64) NOT NULL COMMENT '角色', + `user_name` varchar(64) NOT NULL COMMENT '用户名', + `gmt_create` datetime NOT NULL COMMENT '创建时间', + `gmt_modified` datetime NOT NULL COMMENT '修改时间', + `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) +); /******************************************/ /* 数据库全名 = hippo4j_manager */ /* 表名称 = permission */ /******************************************/ -DROP TABLE IF EXISTS `permission`; -CREATE TABLE `permission` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `role` varchar(512) NOT NULL COMMENT '角色', - `resource` varchar(512) NOT NULL COMMENT '资源', - `action` varchar(8) NOT NULL COMMENT '读写权限', - `gmt_create` datetime NOT NULL COMMENT '创建时间', - `gmt_modified` datetime NOT NULL COMMENT '修改时间', - `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='权限表'; +CREATE TABLE IF NOT EXISTS `permission` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `role` varchar(512) NOT NULL COMMENT '角色', + `resource` varchar(512) NOT NULL COMMENT '资源', + `action` varchar(8) NOT NULL COMMENT '读写权限', + `gmt_create` datetime NOT NULL COMMENT '创建时间', + `gmt_modified` datetime NOT NULL COMMENT '修改时间', + `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) +); /******************************************/ /* 数据库全名 = hippo4j_manager */ /* 表名称 = notify */ /******************************************/ -DROP TABLE IF EXISTS `alarm`, `notify`; -CREATE TABLE `notify` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `tenant_id` varchar(128) NOT NULL DEFAULT '' COMMENT '租户ID', - `item_id` varchar(128) NOT NULL COMMENT '项目ID', - `tp_id` varchar(128) NOT NULL COMMENT '线程池ID', - `platform` varchar(32) NOT NULL COMMENT '通知平台', - `type` varchar(32) NOT NULL COMMENT '通知类型', - `secret_key` varchar(256) NOT NULL COMMENT '密钥', - `interval` int(11) DEFAULT NULL COMMENT '报警间隔', - `receives` varchar(512) NOT NULL COMMENT '接收者', - `enable` tinyint(1) DEFAULT NULL COMMENT '是否启用', - `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', - `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', - PRIMARY KEY (`id`), - UNIQUE KEY `notify_uk_notify_biz_key` (`tenant_id`,`item_id`,`tp_id`,`platform`,`type`,`del_flag`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='通知表'; +CREATE TABLE IF NOT EXISTS `notify` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `tenant_id` varchar(128) NOT NULL DEFAULT '' COMMENT '租户ID', + `item_id` varchar(128) NOT NULL COMMENT '项目ID', + `tp_id` varchar(128) NOT NULL COMMENT '线程池ID', + `platform` varchar(32) NOT NULL COMMENT '通知平台', + `type` varchar(32) NOT NULL COMMENT '通知类型', + `secret_key` varchar(256) NOT NULL COMMENT '密钥', + `interval` int(11) DEFAULT NULL COMMENT '报警间隔', + `receives` varchar(512) NOT NULL COMMENT '接收者', + `enable` tinyint(1) DEFAULT NULL COMMENT '是否启用', + `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', + `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) +); /* 租户 */ -INSERT INTO `tenant` (`id`, `tenant_id`, `tenant_name`, `tenant_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', '处方组', '负责维护处方服务, 包括不限于电子处方等业务', '谢良辰', '2021-10-24 13:42:11', '2021-10-24 13:42:11', '0'); +INSERT IGNORE INTO `tenant` (`id`, `tenant_id`, `tenant_name`, `tenant_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', '处方组', '负责维护处方服务, 包括不限于电子处方等业务', '谢良辰', '2021-10-24 13:42:11', '2021-10-24 13:42:11', '0'); /* 项目 */ -INSERT INTO `item` (`id`, `tenant_id`, `item_id`, `item_name`, `item_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', '动态线程池示例项目', '动态线程池示例项目,对应 Hippo 项目的 example 模块', '马称', '2021-10-24 16:11:00', '2021-10-24 16:11:00', '0'); +INSERT IGNORE INTO `item` (`id`, `tenant_id`, `item_id`, `item_name`, `item_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', '动态线程池示例项目', '动态线程池示例项目,对应 Hippo 项目的 example 模块', '马称', '2021-10-24 16:11:00', '2021-10-24 16:11:00', '0'); /* 线程池 */ -INSERT INTO `config` (`id`, `tenant_id`, `item_id`, `tp_id`, `tp_name`, `core_size`, `max_size`, `queue_type`, `capacity`, `rejected_type`, `keep_alive_time`, `allow_core_thread_time_out`, `content`, `md5`, `is_alarm`, `capacity_alarm`, `liveness_alarm`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', 'message-consume', '示例消费者线程池', '5', '10', '9', '1024', '2', '9999', '0', '{\"tenantId\":\"prescription\",\"itemId\":\"dynamic-threadpool-example\",\"tpId\":\"message-consume\",\"coreSize\":5,\"maxSize\":10,\"queueType\":9,\"capacity\":1024,\"keepAliveTime\":9999,\"rejectedType\":2,\"isAlarm\":0,\"capacityAlarm\":80,\"livenessAlarm\":80,\"allowCoreThreadTimeOut\":0}', 'f80ea89044889fb6cec20e1a517f2ec3', '0', '80', '80', '2021-10-24 10:24:00', '2021-12-22 08:58:55', '0'), - ('2', 'prescription', 'dynamic-threadpool-example', 'message-produce', '示例生产者线程池', '5', '15', '9', '1024', '1', '9999', '0', '{\"tenantId\":\"prescription\",\"itemId\":\"dynamic-threadpool-example\",\"tpId\":\"message-produce\",\"coreSize\":5,\"maxSize\":15,\"queueType\":9,\"capacity\":1024,\"keepAliveTime\":9999,\"rejectedType\":1,\"isAlarm\":0,\"capacityAlarm\":30,\"livenessAlarm\":30,\"allowCoreThreadTimeOut\":0}', '525e1429468bcfe98df7e70a75710051', '0', '30', '30', '2021-10-24 10:24:00', '2021-12-22 08:59:02', '0'); +INSERT IGNORE INTO `config` (`id`, `tenant_id`, `item_id`, `tp_id`, `tp_name`, `core_size`, `max_size`, `queue_type`, `capacity`, `rejected_type`, `keep_alive_time`, `allow_core_thread_time_out`, `content`, `md5`, `is_alarm`, `capacity_alarm`, `liveness_alarm`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', 'message-consume', '示例消费者线程池', '5', '10', '9', '1024', '2', '9999', '0', '{\"tenantId\":\"prescription\",\"itemId\":\"dynamic-threadpool-example\",\"tpId\":\"message-consume\",\"coreSize\":5,\"maxSize\":10,\"queueType\":9,\"capacity\":1024,\"keepAliveTime\":9999,\"rejectedType\":2,\"isAlarm\":0,\"capacityAlarm\":80,\"livenessAlarm\":80,\"allowCoreThreadTimeOut\":0}', 'f80ea89044889fb6cec20e1a517f2ec3', '0', '80', '80', '2021-10-24 10:24:00', '2021-12-22 08:58:55', '0'), ('2', 'prescription', 'dynamic-threadpool-example', 'message-produce', '示例生产者线程池', '5', '15', '9', '1024', '1', '9999', '0', '{\"tenantId\":\"prescription\",\"itemId\":\"dynamic-threadpool-example\",\"tpId\":\"message-produce\",\"coreSize\":5,\"maxSize\":15,\"queueType\":9,\"capacity\":1024,\"keepAliveTime\":9999,\"rejectedType\":1,\"isAlarm\":0,\"capacityAlarm\":30,\"livenessAlarm\":30,\"allowCoreThreadTimeOut\":0}', '525e1429468bcfe98df7e70a75710051', '0', '30', '30', '2021-10-24 10:24:00', '2021-12-22 08:59:02', '0'); /* 用户 */ -INSERT INTO `user` (`id`, `user_name`, `password`, `role`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'admin', '$2a$10$2KCqRbra0Yn2TwvkZxtfLuWuUP5KyCWsljO/ci5pLD27pqR3TV1vy', 'ROLE_ADMIN', '2021-11-04 21:35:17', '2021-11-15 23:04:59', '0'); +INSERT IGNORE INTO `user` (`id`, `user_name`, `password`, `role`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'admin', '$2a$10$2KCqRbra0Yn2TwvkZxtfLuWuUP5KyCWsljO/ci5pLD27pqR3TV1vy', 'ROLE_ADMIN', '2021-11-04 21:35:17', '2021-11-15 23:04:59', '0'); /* 通知表 */ -INSERT INTO `notify` (`id`, `tenant_id`, `item_id`, `tp_id`, `platform`, `type`, `secret_key`, `interval`, `receives`, `enable`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', 'message-produce', 'DING', 'CONFIG', '4a582a588a161d6e3a1bd1de7eea9ee9f562cdfcbe56b6e72029e7fd512b2eae', NULL, '15601166691', '0', '2021-11-18 22:49:50', '2021-11-18 22:49:50', '0'), - ('2', 'prescription', 'dynamic-threadpool-example', 'message-produce', 'DING', 'ALARM', '4a582a588a161d6e3a1bd1de7eea9ee9f562cdfcbe56b6e72029e7fd512b2eae', '30', '15601166691', '0', '2021-11-18 22:50:06', '2021-11-18 22:50:06', '0'); - -/* 1.1.0 Upgrade Start */ -ALTER TABLE `config` DROP INDEX `config_uk_configinfo_datagrouptenant`; -ALTER TABLE `item` DROP INDEX `item_uk_iteminfo_tenantitem`; -ALTER TABLE `tenant` DROP INDEX `uk_tenantinfo_tenantid`; -/* 1.1.0 Upgrade End */ - -/* 1.4.0 Upgrade Start */ -ALTER TABLE config Modify COLUMN keep_alive_time int(11) COMMENT '线程存活时间(秒)'; -ALTER TABLE config Add execute_time_out int(11) COMMENT '执行超时时间(毫秒)' AFTER keep_alive_time; -/* 1.4.0 Upgrade Start */ +INSERT IGNORE INTO `notify` (`id`, `tenant_id`, `item_id`, `tp_id`, `platform`, `type`, `secret_key`, `interval`, `receives`, `enable`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', 'message-produce', 'DING', 'CONFIG', '4a582a588a161d6e3a1bd1de7eea9ee9f562cdfcbe56b6e72029e7fd512b2eae', NULL, '15601166691', '0', '2021-11-18 22:49:50', '2021-11-18 22:49:50', '0'), ('2', 'prescription', 'dynamic-threadpool-example', 'message-produce', 'DING', 'ALARM', '4a582a588a161d6e3a1bd1de7eea9ee9f562cdfcbe56b6e72029e7fd512b2eae', '30', '15601166691', '0', '2021-11-18 22:50:06', '2021-11-18 22:50:06', '0'); diff --git a/hippo4j-server/src/main/resources/sql-script/mysql/hippo4j_manager.sql b/hippo4j-server/src/main/resources/sql-script/mysql/hippo4j_manager.sql new file mode 100644 index 00000000..348dc009 --- /dev/null +++ b/hippo4j-server/src/main/resources/sql-script/mysql/hippo4j_manager.sql @@ -0,0 +1,214 @@ +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `hippo4j_manager` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */; + +USE `hippo4j_manager`; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = tenant */ +/******************************************/ +CREATE TABLE IF NOT EXISTS `tenant` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `tenant_name` varchar(128) DEFAULT NULL COMMENT '租户名称', + `tenant_desc` varchar(256) DEFAULT NULL COMMENT '租户介绍', + `owner` varchar(32) DEFAULT '-' COMMENT '负责人', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', + `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', + PRIMARY KEY (`id`), + UNIQUE KEY `id` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='租户表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = item */ +/******************************************/ +CREATE TABLE IF NOT EXISTS `item` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `item_id` varchar(128) DEFAULT NULL COMMENT '项目ID', + `item_name` varchar(128) DEFAULT NULL COMMENT '项目名称', + `item_desc` varchar(256) DEFAULT NULL COMMENT '项目介绍', + `owner` varchar(32) DEFAULT NULL COMMENT '负责人', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', + `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', + PRIMARY KEY (`id`), + UNIQUE KEY `id` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='项目表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = config */ +/******************************************/ +CREATE TABLE IF NOT EXISTS `config` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `item_id` varchar(256) DEFAULT NULL COMMENT '项目ID', + `tp_id` varchar(56) DEFAULT NULL COMMENT '线程池ID', + `tp_name` varchar(56) DEFAULT NULL COMMENT '线程池名称', + `core_size` int(11) DEFAULT NULL COMMENT '核心线程数', + `max_size` int(11) DEFAULT NULL COMMENT '最大线程数', + `queue_type` int(11) DEFAULT NULL COMMENT '队列类型...', + `capacity` int(11) DEFAULT NULL COMMENT '队列大小', + `rejected_type` int(11) DEFAULT NULL COMMENT '拒绝策略', + `keep_alive_time` int(11) DEFAULT NULL COMMENT '线程存活时间(秒)', + `execute_time_out` int(11) DEFAULT NULL COMMENT '执行超时时间(毫秒)', + `allow_core_thread_time_out` tinyint(1) DEFAULT NULL COMMENT '允许核心线程超时', + `content` longtext COMMENT '线程池内容', + `md5` varchar(32) NOT NULL COMMENT 'MD5', + `is_alarm` tinyint(1) DEFAULT NULL COMMENT '是否报警', + `capacity_alarm` int(11) DEFAULT NULL COMMENT '容量报警', + `liveness_alarm` int(11) DEFAULT NULL COMMENT '活跃度报警', + `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', + `del_flag` tinyint(1) DEFAULT NULL COMMENT '是否删除', + PRIMARY KEY (`id`), + UNIQUE KEY `id` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='线程池配置表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = inst_config */ +/******************************************/ +CREATE TABLE IF NOT EXISTS `inst_config` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `item_id` varchar(256) DEFAULT NULL COMMENT '项目ID', + `tp_id` varchar(56) DEFAULT NULL COMMENT '线程池ID', + `instance_id` varchar(256) DEFAULT NULL COMMENT '实例ID', + `content` longtext COMMENT '线程池内容', + `md5` varchar(32) NOT NULL COMMENT 'MD5', + `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', + PRIMARY KEY (`id`), + UNIQUE KEY `id` (`id`), + KEY `idx_config_instance` (`tenant_id`,`item_id`,`tp_id`,`instance_id`) USING BTREE, + KEY `idx_instance` (`instance_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='线程池配置实例表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = his_run_data */ +/******************************************/ +CREATE TABLE IF NOT EXISTS `his_run_data` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', + `item_id` varchar(256) DEFAULT NULL COMMENT '项目ID', + `tp_id` varchar(56) DEFAULT NULL COMMENT '线程池ID', + `instance_id` varchar(256) DEFAULT NULL COMMENT '实例ID', + `current_load` bigint(20) DEFAULT NULL COMMENT '当前负载', + `peak_load` bigint(20) DEFAULT NULL COMMENT '峰值负载', + `pool_size` bigint(20) DEFAULT NULL COMMENT '线程数', + `active_size` bigint(20) DEFAULT NULL COMMENT '活跃线程数', + `queue_capacity` bigint(20) DEFAULT NULL COMMENT '队列容量', + `queue_size` bigint(20) DEFAULT NULL COMMENT '队列元素', + `queue_remaining_capacity` bigint(20) DEFAULT NULL COMMENT '队列剩余容量', + `completed_task_count` bigint(20) DEFAULT NULL COMMENT '已完成任务计数', + `reject_count` bigint(20) DEFAULT NULL COMMENT '拒绝次数', + `timestamp` bigint(20) DEFAULT NULL COMMENT '时间戳', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`id`), + KEY `idx_group_key` (`tenant_id`,`item_id`,`tp_id`,`instance_id`) USING BTREE, + KEY `idx_timestamp` (`timestamp`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='历史运行数据表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = log_record_info */ +/******************************************/ +CREATE TABLE IF NOT EXISTS `log_record_info` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `tenant` varchar(128) NOT NULL DEFAULT '' COMMENT '租户标识', + `biz_key` varchar(128) NOT NULL DEFAULT '' COMMENT '日志业务标识', + `biz_no` varchar(128) NOT NULL DEFAULT '' COMMENT '业务码标识', + `operator` varchar(64) NOT NULL DEFAULT '' COMMENT '操作人', + `action` varchar(128) NOT NULL DEFAULT '' COMMENT '动作', + `category` varchar(128) NOT NULL DEFAULT '' COMMENT '种类', + `detail` varchar(2048) NOT NULL DEFAULT '' COMMENT '修改的详细信息,可以为json', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + PRIMARY KEY (`id`), + KEY `idx_biz_key` (`biz_key`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='操作日志表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = user */ +/******************************************/ +CREATE TABLE IF NOT EXISTS `user` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `user_name` varchar(64) NOT NULL COMMENT '用户名', + `password` varchar(512) NOT NULL COMMENT '用户密码', + `role` varchar(50) NOT NULL COMMENT '角色', + `gmt_create` datetime NOT NULL COMMENT '创建时间', + `gmt_modified` datetime NOT NULL COMMENT '修改时间', + `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='用户表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = role */ +/******************************************/ +CREATE TABLE IF NOT EXISTS `role` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `role` varchar(64) NOT NULL COMMENT '角色', + `user_name` varchar(64) NOT NULL COMMENT '用户名', + `gmt_create` datetime NOT NULL COMMENT '创建时间', + `gmt_modified` datetime NOT NULL COMMENT '修改时间', + `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='角色表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = permission */ +/******************************************/ +CREATE TABLE IF NOT EXISTS `permission` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `role` varchar(512) NOT NULL COMMENT '角色', + `resource` varchar(512) NOT NULL COMMENT '资源', + `action` varchar(8) NOT NULL COMMENT '读写权限', + `gmt_create` datetime NOT NULL COMMENT '创建时间', + `gmt_modified` datetime NOT NULL COMMENT '修改时间', + `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='权限表'; + +/******************************************/ +/* 数据库全名 = hippo4j_manager */ +/* 表名称 = notify */ +/******************************************/ +CREATE TABLE IF NOT EXISTS `notify` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `tenant_id` varchar(128) NOT NULL DEFAULT '' COMMENT '租户ID', + `item_id` varchar(128) NOT NULL COMMENT '项目ID', + `tp_id` varchar(128) NOT NULL COMMENT '线程池ID', + `platform` varchar(32) NOT NULL COMMENT '通知平台', + `type` varchar(32) NOT NULL COMMENT '通知类型', + `secret_key` varchar(256) NOT NULL COMMENT '密钥', + `interval` int(11) DEFAULT NULL COMMENT '报警间隔', + `receives` varchar(512) NOT NULL COMMENT '接收者', + `enable` tinyint(1) DEFAULT NULL COMMENT '是否启用', + `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', + `del_flag` tinyint(1) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_notify_biz_key` (`tenant_id`,`item_id`,`tp_id`,`platform`,`type`,`del_flag`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='通知表'; + +/* 租户 */ +INSERT IGNORE INTO `tenant` (`id`, `tenant_id`, `tenant_name`, `tenant_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', '处方组', '负责维护处方服务, 包括不限于电子处方等业务', '谢良辰', '2021-10-24 13:42:11', '2021-10-24 13:42:11', '0'); + +/* 项目 */ +INSERT IGNORE INTO `item` (`id`, `tenant_id`, `item_id`, `item_name`, `item_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', '动态线程池示例项目', '动态线程池示例项目,对应 Hippo 项目的 example 模块', '马称', '2021-10-24 16:11:00', '2021-10-24 16:11:00', '0'); + +/* 线程池 */ +INSERT IGNORE INTO `config` (`id`, `tenant_id`, `item_id`, `tp_id`, `tp_name`, `core_size`, `max_size`, `queue_type`, `capacity`, `rejected_type`, `keep_alive_time`, `allow_core_thread_time_out`, `content`, `md5`, `is_alarm`, `capacity_alarm`, `liveness_alarm`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', 'message-consume', '示例消费者线程池', '5', '10', '9', '1024', '2', '9999', '0', '{\"tenantId\":\"prescription\",\"itemId\":\"dynamic-threadpool-example\",\"tpId\":\"message-consume\",\"coreSize\":5,\"maxSize\":10,\"queueType\":9,\"capacity\":1024,\"keepAliveTime\":9999,\"rejectedType\":2,\"isAlarm\":0,\"capacityAlarm\":80,\"livenessAlarm\":80,\"allowCoreThreadTimeOut\":0}', 'f80ea89044889fb6cec20e1a517f2ec3', '0', '80', '80', '2021-10-24 10:24:00', '2021-12-22 08:58:55', '0'), ('2', 'prescription', 'dynamic-threadpool-example', 'message-produce', '示例生产者线程池', '5', '15', '9', '1024', '1', '9999', '0', '{\"tenantId\":\"prescription\",\"itemId\":\"dynamic-threadpool-example\",\"tpId\":\"message-produce\",\"coreSize\":5,\"maxSize\":15,\"queueType\":9,\"capacity\":1024,\"keepAliveTime\":9999,\"rejectedType\":1,\"isAlarm\":0,\"capacityAlarm\":30,\"livenessAlarm\":30,\"allowCoreThreadTimeOut\":0}', '525e1429468bcfe98df7e70a75710051', '0', '30', '30', '2021-10-24 10:24:00', '2021-12-22 08:59:02', '0'); + +/* 用户 */ +INSERT IGNORE INTO `user` (`id`, `user_name`, `password`, `role`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'admin', '$2a$10$2KCqRbra0Yn2TwvkZxtfLuWuUP5KyCWsljO/ci5pLD27pqR3TV1vy', 'ROLE_ADMIN', '2021-11-04 21:35:17', '2021-11-15 23:04:59', '0'); + +/* 通知表 */ +INSERT IGNORE INTO `notify` (`id`, `tenant_id`, `item_id`, `tp_id`, `platform`, `type`, `secret_key`, `interval`, `receives`, `enable`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', 'message-produce', 'DING', 'CONFIG', '4a582a588a161d6e3a1bd1de7eea9ee9f562cdfcbe56b6e72029e7fd512b2eae', NULL, '15601166691', '0', '2021-11-18 22:49:50', '2021-11-18 22:49:50', '0'), ('2', 'prescription', 'dynamic-threadpool-example', 'message-produce', 'DING', 'ALARM', '4a582a588a161d6e3a1bd1de7eea9ee9f562cdfcbe56b6e72029e7fd512b2eae', '30', '15601166691', '0', '2021-11-18 22:50:06', '2021-11-18 22:50:06', '0'); From a7f2bb7521d91c7ea0d7a23b430220ba31249237 Mon Sep 17 00:00:00 2001 From: pizihao <48643103+pizihao@users.noreply.github.com> Date: Fri, 23 Sep 2022 21:49:18 +0800 Subject: [PATCH 16/44] =?UTF-8?q?Adapter=20=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E6=A0=B8=E5=BF=83=E5=8F=82=E6=95=B0=20(#716)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat : Unify get the IP and port of the current instance(#609) * feat : add enable prop for this(#609) * feat : add ThreadPoolInitRefresh for init(#609) * feat : adapter thread pool init, including nacos, zookeeper, etcd and apollo(#609) --- .../adapter/web/WebIpAndPortHolder.java | 97 +++++++++++++++++++ .../common/api/ThreadPoolInitRefresh.java | 51 ++++++++++ .../config/AdapterExecutorProperties.java | 5 + .../config/WebThreadPoolProperties.java | 5 + ...bstractConfigThreadPoolDynamicRefresh.java | 12 ++- .../refresher/ApolloRefresherHandler.java | 10 ++ .../refresher/EtcdRefresherHandler.java | 46 ++++++--- .../refresher/NacosCloudRefresherHandler.java | 17 +++- .../refresher/NacosRefresherHandler.java | 15 ++- .../refresher/ZookeeperRefresherHandler.java | 40 +++++++- .../event/AbstractRefreshListener.java | 57 +---------- .../AdapterExecutorsRefreshListener.java | 2 +- .../event/WebExecutorRefreshListener.java | 2 +- 13 files changed, 281 insertions(+), 78 deletions(-) create mode 100644 hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/WebIpAndPortHolder.java create mode 100644 hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadPoolInitRefresh.java diff --git a/hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/WebIpAndPortHolder.java b/hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/WebIpAndPortHolder.java new file mode 100644 index 00000000..c35f90af --- /dev/null +++ b/hippo4j-adapter/hippo4j-adapter-web/src/main/java/cn/hippo4j/adapter/web/WebIpAndPortHolder.java @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.adapter.web; + +import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.model.WebIpAndPortInfo; +import cn.hippo4j.common.toolkit.Assert; +import cn.hippo4j.common.toolkit.StringUtil; +import cn.hippo4j.core.toolkit.inet.InetUtils; +import org.springframework.boot.web.server.WebServer; + +import java.util.Arrays; +import java.util.Objects; +import java.util.concurrent.atomic.AtomicReference; + +/** + * Ip and port Holder + */ +public class WebIpAndPortHolder { + + /** + * Application ip and application post + */ + protected static AtomicReference webIpAndPort = new AtomicReference<>(); + + public static final String ALL = "*"; + + protected static final String SEPARATOR = ","; + + private WebIpAndPortHolder() { + + } + + protected static void initIpAndPort() { + webIpAndPort.compareAndSet(null, getWebIpAndPortInfo()); + } + + private static WebIpAndPortInfo getWebIpAndPortInfo() { + InetUtils inetUtils = ApplicationContextHolder.getBean(InetUtils.class); + InetUtils.HostInfo loopBackHostInfo = inetUtils.findFirstNonLoopBackHostInfo(); + Assert.notNull(loopBackHostInfo, "Unable to get the application IP address"); + String ip = loopBackHostInfo.getIpAddress(); + WebThreadPoolHandlerChoose webThreadPoolHandlerChoose = ApplicationContextHolder.getBean(WebThreadPoolHandlerChoose.class); + WebThreadPoolService webThreadPoolService = webThreadPoolHandlerChoose.choose(); + // When get the port at startup, can get the message: "port xxx was already in use" or use two ports + WebServer webServer = webThreadPoolService.getWebServer(); + String port = String.valueOf(webServer.getPort()); + return new WebIpAndPortInfo(ip, port); + } + + /** + * get WebIpAndPortInfo, If it is null, initialize it + * + * @return WebIpAndPortInfo + */ + public static WebIpAndPortInfo getWebIpAndPort() { + if (webIpAndPort.get() == null) { + initIpAndPort(); + } + return WebIpAndPortHolder.webIpAndPort.get(); + } + + /** + * Check the new properties and instance IP and port + * + * @param nodes nodes in properties + * @return Whether it meets the conditions + */ + public static boolean check(String nodes) { + WebIpAndPortInfo webIpAndPort = WebIpAndPortHolder.getWebIpAndPort(); + if (StringUtil.isEmpty(nodes) || ALL.equals(nodes)) { + return true; + } + String[] splitNodes = nodes.split(SEPARATOR); + return Arrays.stream(splitNodes) + .distinct() + .map(WebIpAndPortInfo::build) + .filter(Objects::nonNull) + .anyMatch(each -> each.check(webIpAndPort.getIpSegment(), webIpAndPort.getPort())); + } + +} \ No newline at end of file diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadPoolInitRefresh.java b/hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadPoolInitRefresh.java new file mode 100644 index 00000000..e3b752ea --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadPoolInitRefresh.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.common.api; + +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; + +/** + * when init thread-pool dynamic refresh. + */ +public interface ThreadPoolInitRefresh extends ApplicationRunner { + + /** + * Initializes the thread pool after system startup + * + * @param context new properties + */ + void initRefresh(String context); + + /** + * get from the Configuration center + * + * @return new properties + * @throws Exception exception + */ + String getProperties() throws Exception; + + @Override + default void run(ApplicationArguments args) throws Exception { + String properties = getProperties(); + if (properties == null) { + return; + } + initRefresh(properties); + } +} diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/config/AdapterExecutorProperties.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/config/AdapterExecutorProperties.java index 6ff8c9e0..c46d8934 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/config/AdapterExecutorProperties.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/config/AdapterExecutorProperties.java @@ -49,4 +49,9 @@ public class AdapterExecutorProperties { * Nodes, application startup is not affect, change properties is effect */ private String nodes; + + /** + * these propertied is enabled? + */ + private Boolean enable = true; } diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/config/WebThreadPoolProperties.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/config/WebThreadPoolProperties.java index b7cb737c..f2d1ff02 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/config/WebThreadPoolProperties.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/config/WebThreadPoolProperties.java @@ -44,4 +44,9 @@ public class WebThreadPoolProperties { * Nodes, application startup is not affect, change properties is effect */ private String nodes; + + /** + * these propertied is enabled? + */ + private Boolean enable = true; } diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/AbstractConfigThreadPoolDynamicRefresh.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/AbstractConfigThreadPoolDynamicRefresh.java index bf545487..ba5933fc 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/AbstractConfigThreadPoolDynamicRefresh.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/AbstractConfigThreadPoolDynamicRefresh.java @@ -18,6 +18,7 @@ package cn.hippo4j.config.springboot.starter.refresher; import cn.hippo4j.common.api.ThreadPoolDynamicRefresh; +import cn.hippo4j.common.api.ThreadPoolInitRefresh; import cn.hippo4j.common.config.ApplicationContextHolder; import cn.hippo4j.common.toolkit.CollectionUtil; import cn.hippo4j.config.springboot.starter.config.BootstrapConfigProperties; @@ -37,7 +38,11 @@ import java.util.concurrent.ExecutorService; */ @Slf4j @RequiredArgsConstructor -public abstract class AbstractConfigThreadPoolDynamicRefresh implements ThreadPoolDynamicRefresh, InitializingBean { +public abstract class AbstractConfigThreadPoolDynamicRefresh + implements + ThreadPoolDynamicRefresh, + ThreadPoolInitRefresh, + InitializingBean { protected final BootstrapConfigProperties bootstrapConfigProperties; @@ -47,6 +52,11 @@ public abstract class AbstractConfigThreadPoolDynamicRefresh implements ThreadPo bootstrapConfigProperties = ApplicationContextHolder.getBean(BootstrapConfigProperties.class); } + @Override + public void initRefresh(String context) { + dynamicRefresh(context); + } + @Override public void dynamicRefresh(String configContent) { dynamicRefresh(configContent, null); diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/ApolloRefresherHandler.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/ApolloRefresherHandler.java index bc4ce2e2..90425870 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/ApolloRefresherHandler.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/ApolloRefresherHandler.java @@ -41,6 +41,16 @@ public class ApolloRefresherHandler extends AbstractConfigThreadPoolDynamicRefre @Value(APOLLO_PROPERTY) private String namespace; + @Override + public String getProperties() { + String[] apolloNamespaces = this.namespace.split(","); + this.namespace = apolloNamespaces[0]; + String copyNamespace = this.namespace.replaceAll("." + bootstrapConfigProperties.getConfigFileType().getValue(), ""); + ConfigFileFormat configFileFormat = ConfigFileFormat.fromString(bootstrapConfigProperties.getConfigFileType().getValue()); + ConfigFile configFile = ConfigService.getConfigFile(copyNamespace, configFileFormat); + return configFile.getContent(); + } + @Override public void afterPropertiesSet() { String[] apolloNamespaces = this.namespace.split(","); diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/EtcdRefresherHandler.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/EtcdRefresherHandler.java index 30df2d14..5f0cbe25 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/EtcdRefresherHandler.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/EtcdRefresherHandler.java @@ -52,22 +52,25 @@ public class EtcdRefresherHandler extends AbstractConfigThreadPoolDynamicRefresh private static final String KEY = "key"; + @Override + public String getProperties() throws Exception { + Map etcd = bootstrapConfigProperties.getEtcd(); + Charset charset = StringUtil.isBlank(etcd.get(CHARSET)) ? StandardCharsets.UTF_8 : Charset.forName(etcd.get(CHARSET)); + initClient(etcd, charset); + + String key = etcd.get(KEY); + GetResponse getResponse = client.getKVClient().get(ByteSequence.from(key, charset)).get(); + KeyValue keyValue = getResponse.getKvs().get(0); + return Objects.isNull(keyValue) ? null : keyValue.getValue().toString(charset); + } + @Override public void afterPropertiesSet() throws Exception { Map etcd = bootstrapConfigProperties.getEtcd(); - String user = etcd.get(USER); - String password = etcd.get(PASSWORD); - String endpoints = etcd.get(ENDPOINTS); - String authority = etcd.get(AUTHORITY); String key = etcd.get(KEY); Charset charset = StringUtil.isBlank(etcd.get(CHARSET)) ? StandardCharsets.UTF_8 : Charset.forName(etcd.get(CHARSET)); - ClientBuilder clientBuilder = Client.builder().endpoints(endpoints.split(",")); - // todo - if (Objects.isNull(client)) { - client = StringUtil.isAllNotEmpty(user, password) ? clientBuilder.user(ByteSequence.from(user, charset)) - .password(ByteSequence.from(password, charset)).authority(authority) - .build() : clientBuilder.build(); - } + initClient(etcd, charset); + // todo Currently only supports json GetResponse getResponse = client.getKVClient().get(ByteSequence.from(key, charset)).get(); KeyValue keyValue = getResponse.getKvs().get(0); @@ -100,4 +103,25 @@ public class EtcdRefresherHandler extends AbstractConfigThreadPoolDynamicRefresh } }); } + + /** + * if client is null, init it + * + * @param etcd etcd configuration item + * @param charset charset + */ + private void initClient(Map etcd, Charset charset) { + // todo + if (Objects.isNull(client)) { + String user = etcd.get(USER); + String password = etcd.get(PASSWORD); + String authority = etcd.get(AUTHORITY); + String endpoints = etcd.get(ENDPOINTS); + ClientBuilder clientBuilder = Client.builder().endpoints(endpoints.split(",")); + client = StringUtil.isAllNotEmpty(user, password) ? clientBuilder.user(ByteSequence.from(user, charset)) + .password(ByteSequence.from(password, charset)).authority(authority) + .build() : clientBuilder.build(); + } + } + } \ No newline at end of file diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/NacosCloudRefresherHandler.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/NacosCloudRefresherHandler.java index 4433cfa4..6f328b1f 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/NacosCloudRefresherHandler.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/NacosCloudRefresherHandler.java @@ -31,17 +31,28 @@ import java.util.concurrent.Executor; @Slf4j public class NacosCloudRefresherHandler extends AbstractConfigThreadPoolDynamicRefresh { + static final String DATA_ID = "data-id"; + static final String GROUP = "group"; + private final NacosConfigManager nacosConfigManager; public NacosCloudRefresherHandler() { nacosConfigManager = ApplicationContextHolder.getBean(NacosConfigManager.class); } + @Override + public String getProperties() throws Exception { + Map nacosConfig = bootstrapConfigProperties.getNacos(); + String dataId = nacosConfig.get(DATA_ID); + String group = nacosConfig.get(GROUP); + return nacosConfigManager.getConfigService().getConfig(dataId, group, 5000L); + } + @Override public void afterPropertiesSet() throws Exception { Map nacosConfig = bootstrapConfigProperties.getNacos(); - nacosConfigManager.getConfigService().addListener(nacosConfig.get("data-id"), - nacosConfig.get("group"), new Listener() { + nacosConfigManager.getConfigService().addListener(nacosConfig.get(DATA_ID), + nacosConfig.get(GROUP), new Listener() { @Override public Executor getExecutor() { @@ -53,6 +64,6 @@ public class NacosCloudRefresherHandler extends AbstractConfigThreadPoolDynamicR dynamicRefresh(configInfo); } }); - log.info("Dynamic thread pool refresher, add nacos cloud listener success. data-id: {}, group: {}", nacosConfig.get("data-id"), nacosConfig.get("group")); + log.info("Dynamic thread pool refresher, add nacos cloud listener success. data-id: {}, group: {}", nacosConfig.get(DATA_ID), nacosConfig.get(GROUP)); } } diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/NacosRefresherHandler.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/NacosRefresherHandler.java index fa5f7e91..ad052018 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/NacosRefresherHandler.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/NacosRefresherHandler.java @@ -32,6 +32,9 @@ import java.util.concurrent.Executor; @Slf4j public class NacosRefresherHandler extends AbstractConfigThreadPoolDynamicRefresh { + static final String DATA_ID = "data-id"; + static final String GROUP = "group"; + @NacosInjected private ConfigService configService; @@ -39,11 +42,19 @@ public class NacosRefresherHandler extends AbstractConfigThreadPoolDynamicRefres super(bootstrapConfigProperties); } + @Override + public String getProperties() throws Exception { + Map nacosConfig = bootstrapConfigProperties.getNacos(); + String dataId = nacosConfig.get(DATA_ID); + String group = nacosConfig.get(GROUP); + return configService.getConfig(dataId, group, Long.MAX_VALUE); + } + @Override public void afterPropertiesSet() throws Exception { Map nacosConfig = bootstrapConfigProperties.getNacos(); - configService.addListener(nacosConfig.get("data-id"), nacosConfig.get("group"), + configService.addListener(nacosConfig.get(DATA_ID), nacosConfig.get(GROUP), new Listener() { @Override @@ -56,6 +67,6 @@ public class NacosRefresherHandler extends AbstractConfigThreadPoolDynamicRefres dynamicRefresh(configInfo); } }); - log.info("Dynamic thread pool refresher, add nacos listener success. data-id: {}, group: {}", nacosConfig.get("data-id"), nacosConfig.get("group")); + log.info("Dynamic thread pool refresher, add nacos listener success. data-id: {}, group: {}", nacosConfig.get(DATA_ID), nacosConfig.get(GROUP)); } } diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/ZookeeperRefresherHandler.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/ZookeeperRefresherHandler.java index 479bba79..fe886001 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/ZookeeperRefresherHandler.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/ZookeeperRefresherHandler.java @@ -41,15 +41,31 @@ import java.util.Map; @Slf4j public class ZookeeperRefresherHandler extends AbstractConfigThreadPoolDynamicRefresh { + static final String ZK_CONNECT_STR = "zk-connect-str"; + + static final String ROOT_NODE = "root-node"; + + static final String CONFIG_VERSION = "config-version"; + + static final String NODE = "node"; + private CuratorFramework curatorFramework; + @Override + public String getProperties() { + Map zkConfigs = bootstrapConfigProperties.getZookeeper(); + String nodePath = ZKPaths.makePath(ZKPaths.makePath(zkConfigs.get(ROOT_NODE), + zkConfigs.get(CONFIG_VERSION)), zkConfigs.get(NODE)); + return nodePathResolver(nodePath); + } + @Override public void afterPropertiesSet() { Map zkConfigs = bootstrapConfigProperties.getZookeeper(); - curatorFramework = CuratorFrameworkFactory.newClient(zkConfigs.get("zk-connect-str"), + curatorFramework = CuratorFrameworkFactory.newClient(zkConfigs.get(ZK_CONNECT_STR), new ExponentialBackoffRetry(1000, 3)); - String nodePath = ZKPaths.makePath(ZKPaths.makePath(zkConfigs.get("root-node"), - zkConfigs.get("config-version")), zkConfigs.get("node")); + String nodePath = ZKPaths.makePath(ZKPaths.makePath(zkConfigs.get(ROOT_NODE), + zkConfigs.get(CONFIG_VERSION)), zkConfigs.get(NODE)); final ConnectionStateListener connectionStateListener = (client, newState) -> { if (newState == ConnectionState.CONNECTED) { loadNode(nodePath); @@ -81,6 +97,20 @@ public class ZookeeperRefresherHandler extends AbstractConfigThreadPoolDynamicRe * @param nodePath zk config node path. */ public void loadNode(String nodePath) { + String content = nodePathResolver(nodePath); + if (content != null) { + dynamicRefresh(content); + registerNotifyAlarmManage(); + } + } + + /** + * resolver for zk config + * + * @param nodePath zk config node path + * @return resolver result + */ + private String nodePathResolver(String nodePath) { try { final GetChildrenBuilder childrenBuilder = curatorFramework.getChildren(); final List children = childrenBuilder.watched().forPath(nodePath); @@ -97,10 +127,10 @@ public class ZookeeperRefresherHandler extends AbstractConfigThreadPoolDynamicRe } content.append(nodeName).append("=").append(value).append("\n"); }); - dynamicRefresh(content.toString()); - registerNotifyAlarmManage(); + return content.toString(); } catch (Exception ex) { log.error("Load zookeeper node error, nodePath is: {}", nodePath, ex); + return null; } } diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/AbstractRefreshListener.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/AbstractRefreshListener.java index a630db60..61d6fe08 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/AbstractRefreshListener.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/AbstractRefreshListener.java @@ -17,55 +17,15 @@ package cn.hippo4j.config.springboot.starter.refresher.event; -import cn.hippo4j.adapter.web.WebThreadPoolHandlerChoose; -import cn.hippo4j.adapter.web.WebThreadPoolService; -import cn.hippo4j.common.config.ApplicationContextHolder; -import cn.hippo4j.common.model.WebIpAndPortInfo; -import cn.hippo4j.common.toolkit.Assert; -import cn.hippo4j.common.toolkit.StringUtil; -import cn.hippo4j.core.toolkit.inet.InetUtils; +import cn.hippo4j.adapter.web.WebIpAndPortHolder; import lombok.extern.slf4j.Slf4j; -import java.util.Arrays; -import java.util.Objects; - /** * Refresh listener abstract base class. */ @Slf4j public abstract class AbstractRefreshListener implements RefreshListener { - protected static final String ALL = "*"; - - protected static final String SEPARATOR = ","; - - /** - * Application ip and application post - */ - protected static volatile WebIpAndPortInfo webIpAndPort; - - protected void initIpAndPort() { - if (webIpAndPort == null) { - synchronized (AbstractRefreshListener.class) { - if (webIpAndPort == null) { - webIpAndPort = getWebIpAndPortInfo(); - } - } - } - } - - private WebIpAndPortInfo getWebIpAndPortInfo() { - InetUtils inetUtils = ApplicationContextHolder.getBean(InetUtils.class); - InetUtils.HostInfo loopBackHostInfo = inetUtils.findFirstNonLoopBackHostInfo(); - Assert.notNull(loopBackHostInfo, "Unable to get the application IP address"); - String ip = loopBackHostInfo.getIpAddress(); - WebThreadPoolHandlerChoose webThreadPoolHandlerChoose = ApplicationContextHolder.getBean(WebThreadPoolHandlerChoose.class); - WebThreadPoolService webThreadPoolService = webThreadPoolHandlerChoose.choose(); - // When get the port at startup, can get the message: "port xxx was already in use" or use two ports - String port = String.valueOf(webThreadPoolService.getWebServer().getPort()); - return new WebIpAndPortInfo(ip, port); - } - /** * Matching nodes
* nodes is ip + port.Get 'nodes' in the new Properties,Compare this with the ip + port of Application.
@@ -82,19 +42,8 @@ public abstract class AbstractRefreshListener implements RefreshListener each.check(webIpAndPort.getIpSegment(), webIpAndPort.getPort())); + return WebIpAndPortHolder.check(nodes); } /** @@ -104,6 +53,6 @@ public abstract class AbstractRefreshListener implements RefreshListener Date: Fri, 23 Sep 2022 21:49:32 +0800 Subject: [PATCH 17/44] Update the list of contributors --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 157ac8aa..71082230 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,13 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 庄昊哲 +
- + + + + + + +
+ + pizihao +
+ Pizihao +
+
liulinfei121 @@ -157,13 +164,6 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 Lijx - - pizihao -
- Pizihao -
-
Atmanuclear From 60f837ec8ab633abe4edf18c783a010f56efaf75 Mon Sep 17 00:00:00 2001 From: pizihao <48643103+pizihao@users.noreply.github.com> Date: Fri, 23 Sep 2022 22:30:40 +0800 Subject: [PATCH 18/44] update developer.md (#718) Co-authored-by: pizihao --- docs/docs/community/developer.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/docs/community/developer.md b/docs/docs/community/developer.md index 3412e1d8..957a051c 100644 --- a/docs/docs/community/developer.md +++ b/docs/docs/community/developer.md @@ -47,4 +47,11 @@ sidebar_position: 2 Only丶Big 1064730540@qq.com
刘文浩pizihaopizihaohao3073liu@163.com
From 3f41dcc6d067ad745cf60d370d873ba9c07e9dce Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Fri, 23 Sep 2022 22:38:05 +0800 Subject: [PATCH 19/44] Change h2 persistent directory --- hippo4j-server/src/main/resources/application-h2.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hippo4j-server/src/main/resources/application-h2.properties b/hippo4j-server/src/main/resources/application-h2.properties index 999857c8..b4bdea1c 100644 --- a/hippo4j-server/src/main/resources/application-h2.properties +++ b/hippo4j-server/src/main/resources/application-h2.properties @@ -4,6 +4,6 @@ hippo4j.database.init_enable=true hippo4j.database.init_script=sql-script/h2/hippo4j_manager.sql spring.datasource.driver-class-name=org.h2.Driver -spring.datasource.url=jdbc:h2:file:/Users/single/Desktop/temp/h2_hippo4j_test_file;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL; +spring.datasource.url=jdbc:h2:file:{your storage address}/h2_hippo4j_test_file;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL; spring.datasource.username=sa spring.datasource.password=sa From a7ca425707bfd6b10ab52aa85b006a824f7bb0c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=9D=B0?= <345127857@qq.com> Date: Fri, 23 Sep 2022 23:21:36 +0800 Subject: [PATCH 20/44] FIX #708 (#719) --- .../adapter/dubbo/DubboThreadPoolAdapter.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hippo4j-adapter/hippo4j-adapter-dubbo/src/main/java/cn/hippo4j/adapter/dubbo/DubboThreadPoolAdapter.java b/hippo4j-adapter/hippo4j-adapter-dubbo/src/main/java/cn/hippo4j/adapter/dubbo/DubboThreadPoolAdapter.java index e747d9ad..dfbaeb33 100644 --- a/hippo4j-adapter/hippo4j-adapter-dubbo/src/main/java/cn/hippo4j/adapter/dubbo/DubboThreadPoolAdapter.java +++ b/hippo4j-adapter/hippo4j-adapter-dubbo/src/main/java/cn/hippo4j/adapter/dubbo/DubboThreadPoolAdapter.java @@ -94,13 +94,15 @@ public class DubboThreadPoolAdapter implements ThreadPoolAdapter, ApplicationLis @Override public void onApplicationEvent(ApplicationStartedEvent event) { - boolean is2xVersion = false; + boolean isLegacyVersion = false; String poolKey = ExecutorService.class.getName(); - if (Version.getIntVersion(Version.getVersion()) < 3000000) { - is2xVersion = true; + // Since 2.7.5, Dubbo has changed the way thread pools are used + // fixed https://github.com/opengoofy/hippo4j/issues/708 + if (Version.getIntVersion(Version.getVersion()) < 2070500) { + isLegacyVersion = true; } try { - if (is2xVersion) { + if (isLegacyVersion) { DataStore dataStore = ExtensionLoader.getExtensionLoader(DataStore.class).getDefaultExtension(); Map executors = dataStore.get(poolKey); executors.forEach((key, value) -> DUBBO_PROTOCOL_EXECUTOR.put(key, (ThreadPoolExecutor) value)); @@ -112,7 +114,7 @@ public class DubboThreadPoolAdapter implements ThreadPoolAdapter, ApplicationLis ConcurrentMap executorServiceMap = data.get(poolKey); executorServiceMap.forEach((key, value) -> DUBBO_PROTOCOL_EXECUTOR.put(String.valueOf(key), (ThreadPoolExecutor) value)); } catch (Exception ex) { - log.error("Failed to get Dubbo {}.X protocol thread pool", is2xVersion ? "2" : "3", ex); + log.error("Failed to get Dubbo {}.X protocol thread pool", isLegacyVersion ? "2" : "3", ex); } } } From 3cbf4b23629f05ec38c216a2f16909795cf4799b Mon Sep 17 00:00:00 2001 From: itmachen Date: Fri, 23 Sep 2022 23:21:49 +0800 Subject: [PATCH 21/44] Update the list of contributors --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 71082230..95fa71e4 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,13 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 + + + pizihao +
+ Pizihao +
+ maxisvest @@ -143,13 +150,6 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 庄昊哲 - - - pizihao -
- Pizihao -
- liulinfei121 From f6fa1821cd220e508b98743369ec4117dcfd2dad Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Sat, 24 Sep 2022 13:50:56 +0800 Subject: [PATCH 22/44] Dockerfile refactoring build with h2 database (#722) --- hippo4j-server/Dockerfile | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/hippo4j-server/Dockerfile b/hippo4j-server/Dockerfile index e53fe44c..8f9cc9a9 100644 --- a/hippo4j-server/Dockerfile +++ b/hippo4j-server/Dockerfile @@ -29,19 +29,26 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone ADD conf/hippo4j-logback.xml ${BASE_DIR}/logback.xml ADD target/hippo4j-server.jar ${BASE_DIR}/hippo4j-server.jar +ADD target/classes/sql-script/h2/hippo4j_manager.sql ${BASE_DIR}/hippo4j_manager.sql WORKDIR ${BASE_DIR} ENTRYPOINT ["sh","-c","java -jar \ -Xloggc:${BASE_DIR}/hippo4j_gc.log -verbose:gc -XX:+PrintGCDetails \ - -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation \ - -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M \ - -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${BASE_DIR}/java_heapdump.hprof \ - -Xms1024m -Xmx1024m -Xmn512m \ - -Dhippo4j.standalone=true -Dhippo4j.home=${BASE_DIR} \ + -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation \ + -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M \ + -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${BASE_DIR}/java_heapdump.hprof \ + -Xms1024m -Xmx1024m -Xmn512m \ + -Dhippo4j.standalone=true -Dhippo4j.home=${BASE_DIR} \ hippo4j-server.jar \ - --server.max-http-header-size=524288 --server.tomcat.basedir=${BASE_DIR}/tomcat/ \ - --logging.config=${BASE_DIR}/logback.xml \ - --spring.datasource.url=\"jdbc:mysql://$MYSQL_HOST:$MYSQL_PORT/$MYSQL_DB?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8\" \ - --spring.datasource.username=$MYSQL_USERNAME --spring.datasource.password=$MYSQL_PASSWORD \ - "] \ No newline at end of file + --server.max-http-header-size=524288 \ + --server.tomcat.basedir=${BASE_DIR}/tomcat \ + --logging.config=${BASE_DIR}/logback.xml \ + --spring.profiles.active=h2 \ + --spring.datasource.driver-class-name=org.h2.Driver \ + --spring.datasource.url=jdbc:h2:file:${BASE_DIR}/h2_hippo4j;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL \ + --spring.datasource.username=sa \ + --spring.datasource.password=sa \ + --spring.datasource.schema=${BASE_DIR}/hippo4j_manager.sql \ + "] + \ No newline at end of file From 54f8a801e5e8732ade279bbabfb22155cf9f2382 Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Sat, 24 Sep 2022 22:03:02 +0800 Subject: [PATCH 23/44] Adapt to h2 database --- hippo4j-server/Dockerfile | 5 -- .../server/config/DataBaseConfiguration.java | 2 +- .../server/config/DataBaseProperties.java | 2 +- .../server/init/LocalDataSourceLoader.java | 26 +++++++-- .../sql-script/h2/hippo4j_manager.sql | 55 ++----------------- 5 files changed, 27 insertions(+), 63 deletions(-) diff --git a/hippo4j-server/Dockerfile b/hippo4j-server/Dockerfile index 8f9cc9a9..23678131 100644 --- a/hippo4j-server/Dockerfile +++ b/hippo4j-server/Dockerfile @@ -29,7 +29,6 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone ADD conf/hippo4j-logback.xml ${BASE_DIR}/logback.xml ADD target/hippo4j-server.jar ${BASE_DIR}/hippo4j-server.jar -ADD target/classes/sql-script/h2/hippo4j_manager.sql ${BASE_DIR}/hippo4j_manager.sql WORKDIR ${BASE_DIR} @@ -45,10 +44,6 @@ ENTRYPOINT ["sh","-c","java -jar \ --server.tomcat.basedir=${BASE_DIR}/tomcat \ --logging.config=${BASE_DIR}/logback.xml \ --spring.profiles.active=h2 \ - --spring.datasource.driver-class-name=org.h2.Driver \ --spring.datasource.url=jdbc:h2:file:${BASE_DIR}/h2_hippo4j;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL \ - --spring.datasource.username=sa \ - --spring.datasource.password=sa \ - --spring.datasource.schema=${BASE_DIR}/hippo4j_manager.sql \ "] \ No newline at end of file diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseConfiguration.java b/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseConfiguration.java index db8affd4..341f0e25 100644 --- a/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseConfiguration.java +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseConfiguration.java @@ -25,7 +25,7 @@ import org.springframework.context.annotation.Configuration; /** * Database configuration. * - * @see org.apache.shenyu.admin.config.DataBaseConfiguration + *

Quoted from org.apache.shenyu.admin.config.DataBaseConfiguration */ @Configuration public class DataBaseConfiguration { diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseProperties.java b/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseProperties.java index b6029999..351166b4 100644 --- a/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseProperties.java +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseProperties.java @@ -23,7 +23,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; /** * Database properties. * - * @see org.apache.shenyu.admin.config.properties.DataBaseProperties + *

Quoted from org.apache.shenyu.admin.config.properties.DataBaseProperties */ @Data @ConfigurationProperties(prefix = "hippo4j.database") diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java b/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java index 1ecccf2b..2ed2e01a 100644 --- a/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java @@ -36,14 +36,13 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.nio.charset.StandardCharsets; -import java.sql.Connection; -import java.sql.DriverManager; +import java.sql.*; import java.util.List; /** * Local datasource loader. * - * @see org.apache.shenyu.admin.spring.LocalDataSourceLoader + *

Quoted from org.apache.shenyu.admin.spring.LocalDataSourceLoader */ @Slf4j @Component @@ -63,21 +62,36 @@ public class LocalDataSourceLoader implements InstantiationAwareBeanPostProcesso return bean; } - protected void init(final DataSourceProperties properties) { + private void init(final DataSourceProperties properties) { try { // If jdbcUrl in the configuration file specifies the hippo4j database, it is removed, // because the hippo4j database does not need to be specified when executing the SQL file, // otherwise the hippo4j database will be disconnected when the hippo4j database does not exist String jdbcUrl = StringUtils.replace(properties.getUrl(), "/hippo4j_manager?", "?"); Connection connection = DriverManager.getConnection(jdbcUrl, properties.getUsername(), properties.getPassword()); - this.execute(connection, dataBaseProperties.getInitScript()); + // TODO Compatible with h2 to execute `INSERT IGNORE INTO` statement error + if (ifExecute(connection)) { + execute(connection, dataBaseProperties.getInitScript()); + } } catch (Exception ex) { log.error("Datasource init error.", ex); throw new RuntimeException(ex.getMessage()); } } - protected void execute(final Connection conn, final String script) throws Exception { + private boolean ifExecute(final Connection conn) throws SQLException { + try (Statement statement = conn.createStatement(); + ResultSet resultSet = statement.executeQuery("SELECT COUNT(*) FROM `user`")) { + if (resultSet.next()) { + int countUser = resultSet.getInt(1); + return countUser > 0 ? false : true; + } + } catch (Exception ignored) { + } + return true; + } + + private void execute(final Connection conn, final String script) throws Exception { ScriptRunner runner = new ScriptRunner(conn); try { // Doesn't print logger diff --git a/hippo4j-server/src/main/resources/sql-script/h2/hippo4j_manager.sql b/hippo4j-server/src/main/resources/sql-script/h2/hippo4j_manager.sql index 641791e8..6db62ec4 100755 --- a/hippo4j-server/src/main/resources/sql-script/h2/hippo4j_manager.sql +++ b/hippo4j-server/src/main/resources/sql-script/h2/hippo4j_manager.sql @@ -1,7 +1,3 @@ -/******************************************/ -/* 数据库全名 = hippo4j_manager */ -/* 表名称 = tenant */ -/******************************************/ CREATE TABLE IF NOT EXISTS `tenant` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', @@ -14,10 +10,6 @@ CREATE TABLE IF NOT EXISTS `tenant` ( PRIMARY KEY (`id`) ); -/******************************************/ -/* 数据库全名 = hippo4j_manager */ -/* 表名称 = item */ -/******************************************/ CREATE TABLE IF NOT EXISTS `item` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', @@ -31,10 +23,6 @@ CREATE TABLE IF NOT EXISTS `item` ( PRIMARY KEY (`id`) ); -/******************************************/ -/* 数据库全名 = hippo4j_manager */ -/* 表名称 = config */ -/******************************************/ CREATE TABLE IF NOT EXISTS `config` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', @@ -60,10 +48,6 @@ CREATE TABLE IF NOT EXISTS `config` ( PRIMARY KEY (`id`) ); -/******************************************/ -/* 数据库全名 = hippo4j_manager */ -/* 表名称 = inst_config */ -/******************************************/ CREATE TABLE IF NOT EXISTS `inst_config` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', @@ -77,10 +61,6 @@ CREATE TABLE IF NOT EXISTS `inst_config` ( PRIMARY KEY (`id`) ); -/******************************************/ -/* 数据库全名 = hippo4j_manager */ -/* 表名称 = his_run_data */ -/******************************************/ CREATE TABLE IF NOT EXISTS `his_run_data` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', `tenant_id` varchar(128) DEFAULT NULL COMMENT '租户ID', @@ -102,10 +82,6 @@ CREATE TABLE IF NOT EXISTS `his_run_data` ( PRIMARY KEY (`id`) ); -/******************************************/ -/* 数据库全名 = hippo4j_manager */ -/* 表名称 = log_record_info */ -/******************************************/ CREATE TABLE IF NOT EXISTS `log_record_info` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `tenant` varchar(128) NOT NULL DEFAULT '' COMMENT '租户标识', @@ -119,10 +95,6 @@ CREATE TABLE IF NOT EXISTS `log_record_info` ( PRIMARY KEY (`id`) ); -/******************************************/ -/* 数据库全名 = hippo4j_manager */ -/* 表名称 = user */ -/******************************************/ CREATE TABLE IF NOT EXISTS `user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', `user_name` varchar(64) NOT NULL COMMENT '用户名', @@ -134,10 +106,6 @@ CREATE TABLE IF NOT EXISTS `user` ( PRIMARY KEY (`id`) ); -/******************************************/ -/* 数据库全名 = hippo4j_manager */ -/* 表名称 = role */ -/******************************************/ CREATE TABLE IF NOT EXISTS `role` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', `role` varchar(64) NOT NULL COMMENT '角色', @@ -148,10 +116,6 @@ CREATE TABLE IF NOT EXISTS `role` ( PRIMARY KEY (`id`) ); -/******************************************/ -/* 数据库全名 = hippo4j_manager */ -/* 表名称 = permission */ -/******************************************/ CREATE TABLE IF NOT EXISTS `permission` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', `role` varchar(512) NOT NULL COMMENT '角色', @@ -163,10 +127,6 @@ CREATE TABLE IF NOT EXISTS `permission` ( PRIMARY KEY (`id`) ); -/******************************************/ -/* 数据库全名 = hippo4j_manager */ -/* 表名称 = notify */ -/******************************************/ CREATE TABLE IF NOT EXISTS `notify` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', `tenant_id` varchar(128) NOT NULL DEFAULT '' COMMENT '租户ID', @@ -184,17 +144,12 @@ CREATE TABLE IF NOT EXISTS `notify` ( PRIMARY KEY (`id`) ); -/* 租户 */ -INSERT IGNORE INTO `tenant` (`id`, `tenant_id`, `tenant_name`, `tenant_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', '处方组', '负责维护处方服务, 包括不限于电子处方等业务', '谢良辰', '2021-10-24 13:42:11', '2021-10-24 13:42:11', '0'); +INSERT INTO `tenant` (`id`, `tenant_id`, `tenant_name`, `tenant_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', '处方组', '负责维护处方服务, 包括不限于电子处方等业务', '谢良辰', '2021-10-24 13:42:11', '2021-10-24 13:42:11', '0'); -/* 项目 */ -INSERT IGNORE INTO `item` (`id`, `tenant_id`, `item_id`, `item_name`, `item_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', '动态线程池示例项目', '动态线程池示例项目,对应 Hippo 项目的 example 模块', '马称', '2021-10-24 16:11:00', '2021-10-24 16:11:00', '0'); +INSERT INTO `item` (`id`, `tenant_id`, `item_id`, `item_name`, `item_desc`, `owner`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', '动态线程池示例项目', '动态线程池示例项目,对应 Hippo 项目的 example 模块', '马称', '2021-10-24 16:11:00', '2021-10-24 16:11:00', '0'); -/* 线程池 */ -INSERT IGNORE INTO `config` (`id`, `tenant_id`, `item_id`, `tp_id`, `tp_name`, `core_size`, `max_size`, `queue_type`, `capacity`, `rejected_type`, `keep_alive_time`, `allow_core_thread_time_out`, `content`, `md5`, `is_alarm`, `capacity_alarm`, `liveness_alarm`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', 'message-consume', '示例消费者线程池', '5', '10', '9', '1024', '2', '9999', '0', '{\"tenantId\":\"prescription\",\"itemId\":\"dynamic-threadpool-example\",\"tpId\":\"message-consume\",\"coreSize\":5,\"maxSize\":10,\"queueType\":9,\"capacity\":1024,\"keepAliveTime\":9999,\"rejectedType\":2,\"isAlarm\":0,\"capacityAlarm\":80,\"livenessAlarm\":80,\"allowCoreThreadTimeOut\":0}', 'f80ea89044889fb6cec20e1a517f2ec3', '0', '80', '80', '2021-10-24 10:24:00', '2021-12-22 08:58:55', '0'), ('2', 'prescription', 'dynamic-threadpool-example', 'message-produce', '示例生产者线程池', '5', '15', '9', '1024', '1', '9999', '0', '{\"tenantId\":\"prescription\",\"itemId\":\"dynamic-threadpool-example\",\"tpId\":\"message-produce\",\"coreSize\":5,\"maxSize\":15,\"queueType\":9,\"capacity\":1024,\"keepAliveTime\":9999,\"rejectedType\":1,\"isAlarm\":0,\"capacityAlarm\":30,\"livenessAlarm\":30,\"allowCoreThreadTimeOut\":0}', '525e1429468bcfe98df7e70a75710051', '0', '30', '30', '2021-10-24 10:24:00', '2021-12-22 08:59:02', '0'); +INSERT INTO `config` (`id`, `tenant_id`, `item_id`, `tp_id`, `tp_name`, `core_size`, `max_size`, `queue_type`, `capacity`, `rejected_type`, `keep_alive_time`, `allow_core_thread_time_out`, `content`, `md5`, `is_alarm`, `capacity_alarm`, `liveness_alarm`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', 'message-consume', '示例消费者线程池', '5', '10', '9', '1024', '2', '9999', '0', '{\"tenantId\":\"prescription\",\"itemId\":\"dynamic-threadpool-example\",\"tpId\":\"message-consume\",\"coreSize\":5,\"maxSize\":10,\"queueType\":9,\"capacity\":1024,\"keepAliveTime\":9999,\"rejectedType\":2,\"isAlarm\":0,\"capacityAlarm\":80,\"livenessAlarm\":80,\"allowCoreThreadTimeOut\":0}', 'f80ea89044889fb6cec20e1a517f2ec3', '0', '80', '80', '2021-10-24 10:24:00', '2021-12-22 08:58:55', '0'), ('2', 'prescription', 'dynamic-threadpool-example', 'message-produce', '示例生产者线程池', '5', '15', '9', '1024', '1', '9999', '0', '{\"tenantId\":\"prescription\",\"itemId\":\"dynamic-threadpool-example\",\"tpId\":\"message-produce\",\"coreSize\":5,\"maxSize\":15,\"queueType\":9,\"capacity\":1024,\"keepAliveTime\":9999,\"rejectedType\":1,\"isAlarm\":0,\"capacityAlarm\":30,\"livenessAlarm\":30,\"allowCoreThreadTimeOut\":0}', '525e1429468bcfe98df7e70a75710051', '0', '30', '30', '2021-10-24 10:24:00', '2021-12-22 08:59:02', '0'); -/* 用户 */ -INSERT IGNORE INTO `user` (`id`, `user_name`, `password`, `role`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'admin', '$2a$10$2KCqRbra0Yn2TwvkZxtfLuWuUP5KyCWsljO/ci5pLD27pqR3TV1vy', 'ROLE_ADMIN', '2021-11-04 21:35:17', '2021-11-15 23:04:59', '0'); +INSERT INTO `user` (`id`, `user_name`, `password`, `role`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'admin', '$2a$10$2KCqRbra0Yn2TwvkZxtfLuWuUP5KyCWsljO/ci5pLD27pqR3TV1vy', 'ROLE_ADMIN', '2021-11-04 21:35:17', '2021-11-15 23:04:59', '0'); -/* 通知表 */ -INSERT IGNORE INTO `notify` (`id`, `tenant_id`, `item_id`, `tp_id`, `platform`, `type`, `secret_key`, `interval`, `receives`, `enable`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', 'message-produce', 'DING', 'CONFIG', '4a582a588a161d6e3a1bd1de7eea9ee9f562cdfcbe56b6e72029e7fd512b2eae', NULL, '15601166691', '0', '2021-11-18 22:49:50', '2021-11-18 22:49:50', '0'), ('2', 'prescription', 'dynamic-threadpool-example', 'message-produce', 'DING', 'ALARM', '4a582a588a161d6e3a1bd1de7eea9ee9f562cdfcbe56b6e72029e7fd512b2eae', '30', '15601166691', '0', '2021-11-18 22:50:06', '2021-11-18 22:50:06', '0'); +INSERT INTO `notify` (`id`, `tenant_id`, `item_id`, `tp_id`, `platform`, `type`, `secret_key`, `interval`, `receives`, `enable`, `gmt_create`, `gmt_modified`, `del_flag`) VALUES ('1', 'prescription', 'dynamic-threadpool-example', 'message-produce', 'DING', 'CONFIG', '4a582a588a161d6e3a1bd1de7eea9ee9f562cdfcbe56b6e72029e7fd512b2eae', NULL, '15601166691', '0', '2021-11-18 22:49:50', '2021-11-18 22:49:50', '0'), ('2', 'prescription', 'dynamic-threadpool-example', 'message-produce', 'DING', 'ALARM', '4a582a588a161d6e3a1bd1de7eea9ee9f562cdfcbe56b6e72029e7fd512b2eae', '30', '15601166691', '0', '2021-11-18 22:50:06', '2021-11-18 22:50:06', '0'); From 4024401618206357541877efaf94a6ac3cbcdf63 Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Sun, 25 Sep 2022 00:21:44 +0800 Subject: [PATCH 24/44] Changed docker deployment hippo4j documentation --- .../user_docs/ops/hippo4j-server-deploy.md | 2 +- docs/docs/user_docs/ops/server-docker.md | 45 ++++++------------- docs/docs/user_docs/user_guide/quick-start.md | 12 +---- 3 files changed, 16 insertions(+), 43 deletions(-) diff --git a/docs/docs/user_docs/ops/hippo4j-server-deploy.md b/docs/docs/user_docs/ops/hippo4j-server-deploy.md index d605704a..f78457ba 100644 --- a/docs/docs/user_docs/ops/hippo4j-server-deploy.md +++ b/docs/docs/user_docs/ops/hippo4j-server-deploy.md @@ -2,7 +2,7 @@ sidebar_position: 1 --- -# hippo4j server 部署 +# 源码包部署 [RELEASE](https://github.com/opengoofy/hippo4j/releases) 页面下载对应版本并进行解压。 diff --git a/docs/docs/user_docs/ops/server-docker.md b/docs/docs/user_docs/ops/server-docker.md index 97d019e2..8ff51566 100644 --- a/docs/docs/user_docs/ops/server-docker.md +++ b/docs/docs/user_docs/ops/server-docker.md @@ -2,11 +2,21 @@ sidebar_position: 2 --- -# hippo4j server docker 构建 +# Docker 部署 + +## 镜像启动 + +Docker 镜像默认使用内置 H2 数据库,数据持久化到 Docker 容器存储卷中。 + +```shell +docker run -d -p 6691:6691 --name hippo4j-server hippo4j/hippo4j-server +``` + +访问 Server 控制台,路径 `http://localhost:6691/index.html`,默认用户名密码:admin / 123456 ## 镜像构建 -可以通过以下命令快速构建 Hippo4J Server: +如果想要自定义镜像,可以通过以下命令快速构建 Hippo4J Server: 方式一: @@ -18,39 +28,10 @@ docker build -t hippo4j/hippo4j-server ../hippo4j-server ``` 方式二: + 通过 `maven docker plugin` ```shell # 进入到 hippo4j-server 工程路径下 mvn clean package -DskipTests -Dskip.spotless.apply=true docker:build ``` - -## 镜像启动 - -- 下载镜像 - -```shell -docker pull hippo4j/hippo4j-server -``` - -- 创建容器并运行 - -```shell -docker run -d -p 6691:6691 --name hippo4j-server hippo4j/hippo4j-server - -# 如需个性化参数指定,请参考下述命令 - -/** - * 暂时只暴露以下参数 - * - * MYSQL_HOST、MYSQL_PORT、MYSQL_DB、MYSQL_USERNAME、MYSQL_PASSWORD - * MYSQL_HOST 需要使用本地 IP,不能使用 127.0.0.1 - */ -docker run -d -p 6691:6691 --name hippo4j-server \ --e MYSQL_HOST=xxx.xxx.x.x \ --e MYSQL_PORT=3306 \ --e MYSQL_DB=hippo4j_manager \ --e MYSQL_USERNAME=root \ --e MYSQL_PASSWORD=root \ -hippo4j/hippo4j-server -``` diff --git a/docs/docs/user_docs/user_guide/quick-start.md b/docs/docs/user_docs/user_guide/quick-start.md index 4a37019e..b8537e94 100644 --- a/docs/docs/user_docs/user_guide/quick-start.md +++ b/docs/docs/user_docs/user_guide/quick-start.md @@ -6,18 +6,10 @@ sidebar_position: 3 ## 服务启动 -MySQL 数据库导入 [Hippo4J 初始化 SQL 语句](https://github.com/longtai-cn/hippo4j/blob/develop/hippo4j-server/conf/hippo4j_manager.sql)。 - -使用 Docker 运行服务端,可以灵活定制相关参数。`MYSQL_HOST` 需要使用本地 IP,不能使用 `127.0.0.1`。 +使用 Docker 运行服务端,默认使用内置 H2 数据库,数据持久化到 Docker 容器存储卷中。 ```shell -docker run -d -p 6691:6691 --name hippo4j-server \ --e MYSQL_HOST=xxx.xxx.x.x \ --e MYSQL_PORT=3306 \ --e MYSQL_DB=hippo4j_manager \ --e MYSQL_USERNAME=root \ --e MYSQL_PASSWORD=root \ -hippo4j/hippo4j-server +docker run -d -p 6691:6691 --name hippo4j-server hippo4j/hippo4j-server ``` > 如果没有 Docker,可以使用源码编译的方式,启动 [Hippo4J-Server](https://github.com/longtai-cn/hippo4j/tree/develop/hippo4j-server) 模块下 ServerApplication 应用类。 From 8d529bca4d801ded7277ab1eebebd1f19e068d8f Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Sun, 25 Sep 2022 01:02:07 +0800 Subject: [PATCH 25/44] Database initialization logic is perfect --- .../server/config/DataBaseConfiguration.java | 6 ++++-- .../server/config/DataBaseProperties.java | 5 +++++ .../server/init/LocalDataSourceLoader.java | 18 ++++++++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseConfiguration.java b/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseConfiguration.java index 341f0e25..607d4370 100644 --- a/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseConfiguration.java +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseConfiguration.java @@ -32,9 +32,11 @@ public class DataBaseConfiguration { @Bean @ConditionalOnMissingBean(value = DataBaseProperties.class) - public DataBaseProperties dataBaseProperties(@Value("${hippo4j.database.init_script:sql-script/h2/schema.sql}") String initScript, - @Value("${hippo4j.database.init_enable:true}") Boolean initEnable) { + public DataBaseProperties dataBaseProperties(@Value("${hippo4j.database.dialect:h2}") String dialect, + @Value("${hippo4j.database.init_script:sql-script/h2/schema.sql}") String initScript, + @Value("${hippo4j.database.init_enable:false}") Boolean initEnable) { DataBaseProperties dataSourceProperties = new DataBaseProperties(); + dataSourceProperties.setDialect(dialect); dataSourceProperties.setInitScript(initScript); dataSourceProperties.setInitEnable(initEnable); return dataSourceProperties; diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseProperties.java b/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseProperties.java index 351166b4..15565724 100644 --- a/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseProperties.java +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/config/DataBaseProperties.java @@ -29,6 +29,11 @@ import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties(prefix = "hippo4j.database") public class DataBaseProperties { + /** + * Dialect + */ + private String dialect; + /** * Init script */ diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java b/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java index 2ed2e01a..9dce207b 100644 --- a/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java @@ -38,6 +38,7 @@ import java.io.Reader; import java.nio.charset.StandardCharsets; import java.sql.*; import java.util.List; +import java.util.Objects; /** * Local datasource loader. @@ -64,31 +65,36 @@ public class LocalDataSourceLoader implements InstantiationAwareBeanPostProcesso private void init(final DataSourceProperties properties) { try { + String jdbcUrl = properties.getUrl(); // If jdbcUrl in the configuration file specifies the hippo4j database, it is removed, // because the hippo4j database does not need to be specified when executing the SQL file, // otherwise the hippo4j database will be disconnected when the hippo4j database does not exist - String jdbcUrl = StringUtils.replace(properties.getUrl(), "/hippo4j_manager?", "?"); + if (Objects.equals(dataBaseProperties.getDialect(), "mysql")) { + jdbcUrl = StringUtils.replace(properties.getUrl(), "/hippo4j_manager?", "?"); + } Connection connection = DriverManager.getConnection(jdbcUrl, properties.getUsername(), properties.getPassword()); // TODO Compatible with h2 to execute `INSERT IGNORE INTO` statement error - if (ifExecute(connection)) { - execute(connection, dataBaseProperties.getInitScript()); + if (Objects.equals(dataBaseProperties.getDialect(), "h2") && ifNonExecute(connection)) { + return; } + execute(connection, dataBaseProperties.getInitScript()); } catch (Exception ex) { log.error("Datasource init error.", ex); throw new RuntimeException(ex.getMessage()); } } - private boolean ifExecute(final Connection conn) throws SQLException { + private boolean ifNonExecute(final Connection conn) throws SQLException { try (Statement statement = conn.createStatement(); ResultSet resultSet = statement.executeQuery("SELECT COUNT(*) FROM `user`")) { if (resultSet.next()) { int countUser = resultSet.getInt(1); - return countUser > 0 ? false : true; + return countUser > 0 ? true : false; } } catch (Exception ignored) { + log.error("Query data for errors.", ignored); } - return true; + return false; } private void execute(final Connection conn, final String script) throws Exception { From 92359fd005dcd615122856edffa63bb26e872f2e Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Sun, 25 Sep 2022 01:08:57 +0800 Subject: [PATCH 26/44] Change banner --- hippo4j-server/src/main/resources/banner.txt | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/hippo4j-server/src/main/resources/banner.txt b/hippo4j-server/src/main/resources/banner.txt index f075fe2c..3da2014a 100644 --- a/hippo4j-server/src/main/resources/banner.txt +++ b/hippo4j-server/src/main/resources/banner.txt @@ -1,15 +1,7 @@ - ,--, ,--, ,---._ - ,--.'| ,--.'| .-- -.' \ Hippo4J ${application.version} - ,--, | : ,--, ,-.----. ,-.----. ,--, | : | | : Port: ${server.port} -,---.'| : ',--.'| \ / \ \ / \ ,---. ,---.'| : ' : ; | PID: ${pid} -| | : _' || |, | : || : | ' ,'\ ; : | | ; : | Console: http://127.0.0.1:${server.port}/index.html -: : |.' |`--'_ | | .\ :| | .\ : / / || | : _' | | : : -| ' ' ; :,' ,'| . : |: |. : |: |. ; ,. :: : |.' | : https://hippo4j.cn -' | .'. |' | | | | \ :| | \ :' | |: :| ' ' ; : | ; | -| | : | '| | : | : . || : . |' | .; :\ \ .'. | ___ l -' : | : ;' : |__ : |`-': |`-'| : | `---`: | ' / /\ J : -| | ' ,/ | | '.'|: : : : : : \ \ / ' ; |/ ../ `..- , -; : ;--' ; : ;| | : | | : `----' | : ;\ \ ; -| ,/ | , / `---'.| `---'.| ' ,/ \ \ ,' -'---' ---`-' `---` `---` '--' "---....--' + __ __ ___ ___ __ + | |--.|__|.-----..-----..-----.| | | |__| Hippo4J ${application.version} + | || || _ || _ || _ || | | | | Port: ${server.port} PID: ${pid} + |__|__||__|| __|| __||_____||____ | | | + |__| |__| |: ||___| Site: https://hippo4j.cn + `---' From c84d25f73280267318bc72f5575e2380c1f904f9 Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Sun, 25 Sep 2022 22:33:45 +0800 Subject: [PATCH 27/44] Supplementary test case --- .../auth/secuity/JwtTokenManagerTest.java | 21 +++++++++++++++++++ .../auth/toolkit/JwtTokenUtilTest.java | 21 +++++++++++++++++++ .../common/executor/ExecutorFactoryTest.java | 21 +++++++++++++++++++ .../executor/ThreadPoolManagerTest.java | 21 +++++++++++++++++++ .../common/function/MatcherFunctionTest.java | 21 +++++++++++++++++++ .../common/function/NoArgsConsumerTest.java | 21 +++++++++++++++++++ .../DynamicThreadPoolServiceLoaderTest.java | 21 +++++++++++++++++++ .../cn/hippo4j/common/toolkit/AssertTest.java | 21 +++++++++++++++++++ .../hippo4j/common/toolkit/GroupKeyTest.java | 21 +++++++++++++++++++ .../cn/hippo4j/common/web/ResultsTest.java | 21 +++++++++++++++++++ 10 files changed, 210 insertions(+) create mode 100644 hippo4j-auth/src/test/java/cn/hippo4j/auth/secuity/JwtTokenManagerTest.java create mode 100644 hippo4j-auth/src/test/java/cn/hippo4j/auth/toolkit/JwtTokenUtilTest.java create mode 100644 hippo4j-common/src/test/java/cn/hippo4j/common/executor/ExecutorFactoryTest.java create mode 100644 hippo4j-common/src/test/java/cn/hippo4j/common/executor/ThreadPoolManagerTest.java create mode 100644 hippo4j-common/src/test/java/cn/hippo4j/common/function/MatcherFunctionTest.java create mode 100644 hippo4j-common/src/test/java/cn/hippo4j/common/function/NoArgsConsumerTest.java create mode 100644 hippo4j-common/src/test/java/cn/hippo4j/common/spi/DynamicThreadPoolServiceLoaderTest.java create mode 100644 hippo4j-common/src/test/java/cn/hippo4j/common/toolkit/AssertTest.java create mode 100644 hippo4j-common/src/test/java/cn/hippo4j/common/toolkit/GroupKeyTest.java create mode 100644 hippo4j-common/src/test/java/cn/hippo4j/common/web/ResultsTest.java diff --git a/hippo4j-auth/src/test/java/cn/hippo4j/auth/secuity/JwtTokenManagerTest.java b/hippo4j-auth/src/test/java/cn/hippo4j/auth/secuity/JwtTokenManagerTest.java new file mode 100644 index 00000000..060e1632 --- /dev/null +++ b/hippo4j-auth/src/test/java/cn/hippo4j/auth/secuity/JwtTokenManagerTest.java @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.auth.secuity; + +public final class JwtTokenManagerTest { +} diff --git a/hippo4j-auth/src/test/java/cn/hippo4j/auth/toolkit/JwtTokenUtilTest.java b/hippo4j-auth/src/test/java/cn/hippo4j/auth/toolkit/JwtTokenUtilTest.java new file mode 100644 index 00000000..28c8b227 --- /dev/null +++ b/hippo4j-auth/src/test/java/cn/hippo4j/auth/toolkit/JwtTokenUtilTest.java @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.auth.toolkit; + +public final class JwtTokenUtilTest { +} diff --git a/hippo4j-common/src/test/java/cn/hippo4j/common/executor/ExecutorFactoryTest.java b/hippo4j-common/src/test/java/cn/hippo4j/common/executor/ExecutorFactoryTest.java new file mode 100644 index 00000000..8cd8e010 --- /dev/null +++ b/hippo4j-common/src/test/java/cn/hippo4j/common/executor/ExecutorFactoryTest.java @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.common.executor; + +public final class ExecutorFactoryTest { +} diff --git a/hippo4j-common/src/test/java/cn/hippo4j/common/executor/ThreadPoolManagerTest.java b/hippo4j-common/src/test/java/cn/hippo4j/common/executor/ThreadPoolManagerTest.java new file mode 100644 index 00000000..de10bbd9 --- /dev/null +++ b/hippo4j-common/src/test/java/cn/hippo4j/common/executor/ThreadPoolManagerTest.java @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.common.executor; + +public final class ThreadPoolManagerTest { +} diff --git a/hippo4j-common/src/test/java/cn/hippo4j/common/function/MatcherFunctionTest.java b/hippo4j-common/src/test/java/cn/hippo4j/common/function/MatcherFunctionTest.java new file mode 100644 index 00000000..e228e013 --- /dev/null +++ b/hippo4j-common/src/test/java/cn/hippo4j/common/function/MatcherFunctionTest.java @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.common.function; + +public final class MatcherFunctionTest { +} diff --git a/hippo4j-common/src/test/java/cn/hippo4j/common/function/NoArgsConsumerTest.java b/hippo4j-common/src/test/java/cn/hippo4j/common/function/NoArgsConsumerTest.java new file mode 100644 index 00000000..38249887 --- /dev/null +++ b/hippo4j-common/src/test/java/cn/hippo4j/common/function/NoArgsConsumerTest.java @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.common.function; + +public final class NoArgsConsumerTest { +} diff --git a/hippo4j-common/src/test/java/cn/hippo4j/common/spi/DynamicThreadPoolServiceLoaderTest.java b/hippo4j-common/src/test/java/cn/hippo4j/common/spi/DynamicThreadPoolServiceLoaderTest.java new file mode 100644 index 00000000..8387793c --- /dev/null +++ b/hippo4j-common/src/test/java/cn/hippo4j/common/spi/DynamicThreadPoolServiceLoaderTest.java @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.common.spi; + +public final class DynamicThreadPoolServiceLoaderTest { +} diff --git a/hippo4j-common/src/test/java/cn/hippo4j/common/toolkit/AssertTest.java b/hippo4j-common/src/test/java/cn/hippo4j/common/toolkit/AssertTest.java new file mode 100644 index 00000000..d2987c80 --- /dev/null +++ b/hippo4j-common/src/test/java/cn/hippo4j/common/toolkit/AssertTest.java @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.common.toolkit; + +public final class AssertTest { +} diff --git a/hippo4j-common/src/test/java/cn/hippo4j/common/toolkit/GroupKeyTest.java b/hippo4j-common/src/test/java/cn/hippo4j/common/toolkit/GroupKeyTest.java new file mode 100644 index 00000000..c45d5919 --- /dev/null +++ b/hippo4j-common/src/test/java/cn/hippo4j/common/toolkit/GroupKeyTest.java @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.common.toolkit; + +public final class GroupKeyTest { +} diff --git a/hippo4j-common/src/test/java/cn/hippo4j/common/web/ResultsTest.java b/hippo4j-common/src/test/java/cn/hippo4j/common/web/ResultsTest.java new file mode 100644 index 00000000..44369db3 --- /dev/null +++ b/hippo4j-common/src/test/java/cn/hippo4j/common/web/ResultsTest.java @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.common.web; + +public final class ResultsTest { +} From 7d795d7817fbcf56eb05434845c3e43068f074c7 Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Sun, 25 Sep 2022 22:34:05 +0800 Subject: [PATCH 28/44] Code format --- .../java/cn/hippo4j/server/init/LocalDataSourceLoader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java b/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java index 9dce207b..fc3283c4 100644 --- a/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java +++ b/hippo4j-server/src/main/java/cn/hippo4j/server/init/LocalDataSourceLoader.java @@ -85,8 +85,9 @@ public class LocalDataSourceLoader implements InstantiationAwareBeanPostProcesso } private boolean ifNonExecute(final Connection conn) throws SQLException { - try (Statement statement = conn.createStatement(); - ResultSet resultSet = statement.executeQuery("SELECT COUNT(*) FROM `user`")) { + try ( + Statement statement = conn.createStatement(); + ResultSet resultSet = statement.executeQuery("SELECT COUNT(*) FROM `user`")) { if (resultSet.next()) { int countUser = resultSet.getInt(1); return countUser > 0 ? true : false; From b97d1df300260964147e6958c5806c60b217fb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Wed, 28 Sep 2022 00:54:56 +0800 Subject: [PATCH 29/44] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 95fa71e4..c7bed8db 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ - 无法执行优雅关闭,当项目关闭时,大量正在运行的线程池任务被丢弃。 - 线程池运行中,任务执行停止,怀疑发生死锁或执行耗时操作,但是无从下手。 +--- + ## 什么是 Hippo-4J Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池等功能,为业务系统提高线上运行保障能力。 @@ -38,18 +40,24 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - 容器管理 - Tomcat、Jetty、Undertow 容器线程池运行时查看和线程数变更。 - 中间件适配 - Dubbo、Hystrix、RocketMQ、RabbitMQ 等消费线程池运行时数据查看和线程数变更。 +--- + ## 快速开始 对于本地演示目的,请参阅 [Quick start](https://hippo4j.cn/docs/user_docs/user_guide/quick-start) 演示环境: [http://console.hippo4j.cn/index.html](http://console.hippo4j.cn/index.html) +--- + ## 联系我 ![](https://user-images.githubusercontent.com/77398366/185774220-c11951f9-e130-4d60-8204-afb5c51d4401.png) 扫码添加微信,备注:hippo4j,邀您加入群聊。若图片加载不出来,访问 [官网站点](https://hippo4j.cn/docs/user_docs/other/group)。 +--- + ## 友情链接 - [[ Sa-Token ]](https://github.com/dromara/sa-token):一个轻量级 java 权限认证框架,让鉴权变得简单、优雅! @@ -58,6 +66,8 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - [[ JavaGuide ]](https://github.com/Snailclimb/JavaGuide):一份涵盖大部分 Java 程序员所需要掌握的核心知识。 - [[ toBeBetterJavaer ]](https://github.com/itwanger/toBeBetterJavaer):一份通俗易懂、风趣幽默的 Java 学习指南。 +--- + ## 贡献者 感谢所有为项目作出贡献的开发者。如果有意贡献,参考 [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)。 From 3b419c89bebb5b5a8382b0bc11b97f6e4e66d81a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A9=AC=E5=93=A5?= Date: Wed, 28 Sep 2022 00:55:30 +0800 Subject: [PATCH 30/44] Update README.md --- README.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/README.md b/README.md index c7bed8db..95fa71e4 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,6 @@ - 无法执行优雅关闭,当项目关闭时,大量正在运行的线程池任务被丢弃。 - 线程池运行中,任务执行停止,怀疑发生死锁或执行耗时操作,但是无从下手。 ---- - ## 什么是 Hippo-4J Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池等功能,为业务系统提高线上运行保障能力。 @@ -40,24 +38,18 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - 容器管理 - Tomcat、Jetty、Undertow 容器线程池运行时查看和线程数变更。 - 中间件适配 - Dubbo、Hystrix、RocketMQ、RabbitMQ 等消费线程池运行时数据查看和线程数变更。 ---- - ## 快速开始 对于本地演示目的,请参阅 [Quick start](https://hippo4j.cn/docs/user_docs/user_guide/quick-start) 演示环境: [http://console.hippo4j.cn/index.html](http://console.hippo4j.cn/index.html) ---- - ## 联系我 ![](https://user-images.githubusercontent.com/77398366/185774220-c11951f9-e130-4d60-8204-afb5c51d4401.png) 扫码添加微信,备注:hippo4j,邀您加入群聊。若图片加载不出来,访问 [官网站点](https://hippo4j.cn/docs/user_docs/other/group)。 ---- - ## 友情链接 - [[ Sa-Token ]](https://github.com/dromara/sa-token):一个轻量级 java 权限认证框架,让鉴权变得简单、优雅! @@ -66,8 +58,6 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - [[ JavaGuide ]](https://github.com/Snailclimb/JavaGuide):一份涵盖大部分 Java 程序员所需要掌握的核心知识。 - [[ toBeBetterJavaer ]](https://github.com/itwanger/toBeBetterJavaer):一份通俗易懂、风趣幽默的 Java 学习指南。 ---- - ## 贡献者 感谢所有为项目作出贡献的开发者。如果有意贡献,参考 [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)。 From 43f3a078159026f45a82071bfa180a8676f85e1e Mon Sep 17 00:00:00 2001 From: tudo <1847923783@qq.com> Date: Wed, 28 Sep 2022 14:30:14 +0800 Subject: [PATCH 31/44] add MatcherFunctionTest test case (#743) --- .../common/function/MatcherFunctionTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hippo4j-common/src/test/java/cn/hippo4j/common/function/MatcherFunctionTest.java b/hippo4j-common/src/test/java/cn/hippo4j/common/function/MatcherFunctionTest.java index e228e013..2a202302 100644 --- a/hippo4j-common/src/test/java/cn/hippo4j/common/function/MatcherFunctionTest.java +++ b/hippo4j-common/src/test/java/cn/hippo4j/common/function/MatcherFunctionTest.java @@ -17,5 +17,19 @@ package cn.hippo4j.common.function; +import cn.hippo4j.common.toolkit.Assert; +import java.math.BigDecimal; +import org.junit.Test; + public final class MatcherFunctionTest { + + public static boolean matchTest(Matcher matcher, T value) { + return matcher.match(value); + } + + @Test + public void assertMatch() { + Assert.isTrue(matchTest(Boolean.TRUE::equals, true)); + Assert.isTrue(matchTest(BigDecimal.ZERO::equals, BigDecimal.ZERO)); + } } From c0f0cbd14a8c08b1075ffaabadba5ac4779d8229 Mon Sep 17 00:00:00 2001 From: baymax55 <35788491+baymax55@users.noreply.github.com> Date: Wed, 28 Sep 2022 14:46:26 +0800 Subject: [PATCH 32/44] Add test case for GroupKey.java (#744) --- .../cn/hippo4j/common/toolkit/GroupKey.java | 2 +- .../hippo4j/common/toolkit/GroupKeyTest.java | 66 ++++++++++++++++++- 2 files changed, 65 insertions(+), 3 deletions(-) diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/GroupKey.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/GroupKey.java index b082690d..227bba06 100644 --- a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/GroupKey.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/GroupKey.java @@ -41,7 +41,7 @@ public class GroupKey { for (int i = 1; i < params.length - 1; i++) { groupKey.append(params[i]).append(GROUP_KEY_DELIMITER); } - groupKey.append(params[params.length]); + groupKey.append(params[params.length - 1]); return groupKey.toString(); } diff --git a/hippo4j-common/src/test/java/cn/hippo4j/common/toolkit/GroupKeyTest.java b/hippo4j-common/src/test/java/cn/hippo4j/common/toolkit/GroupKeyTest.java index c45d5919..b512704a 100644 --- a/hippo4j-common/src/test/java/cn/hippo4j/common/toolkit/GroupKeyTest.java +++ b/hippo4j-common/src/test/java/cn/hippo4j/common/toolkit/GroupKeyTest.java @@ -17,5 +17,67 @@ package cn.hippo4j.common.toolkit; -public final class GroupKeyTest { -} +import org.checkerframework.checker.units.qual.A; +import org.junit.Test; + +import java.util.Arrays; +import java.util.List; + +import static org.junit.Assert.*; + +public class GroupKeyTest { + + @Test + public void getKey() { + String dataId = "dataId"; + String group = "group"; + String datumStr = "datumStr"; + String expected = "dataId+group+datumStr"; + String key = GroupKey.getKey(dataId, group, datumStr); + Assert.isTrue(key.equals(expected)); + } + + @Test + public void testGetKey() { + String dataId = "dataId"; + String group = "group"; + String expected = "dataId+group"; + String key = GroupKey.getKey(dataId, group); + Assert.isTrue(key.equals(expected)); + } + + @Test + public void testGetKey1() { + String[] strings = {"dataId", "group", "datumStr"}; + String expected = "dataId+group+datumStr"; + String key = GroupKey.getKey(strings); + Assert.isTrue(key.equals(expected)); + } + + @Test + public void getKeyTenant() { + String dataId = "dataId"; + String group = "group"; + String datumStr = "datumStr"; + String expected = "dataId+group+datumStr"; + + String keyTenant = GroupKey.getKeyTenant(dataId, group, datumStr); + Assert.isTrue(keyTenant.equals(expected)); + } + + @Test + public void parseKey() { + String groupKey = "prescription+dynamic-threadpool-example+message-consume+12"; + String[] strings = GroupKey.parseKey(groupKey); + Assert.isTrue(strings.length == 4); + } + + @Test + public void urlEncode() { + String str = "hello+World%"; + String expected = "hello%2BWorld%25"; + StringBuilder stringBuilder = new StringBuilder(); + GroupKey.urlEncode(str, stringBuilder); + Assert.isTrue(stringBuilder.toString().contains(expected)); + } +} \ No newline at end of file From 120c0fa4c8e163854ddf515b869a01ced5f03834 Mon Sep 17 00:00:00 2001 From: BigXin0109 <1064730540@qq.com> Date: Wed, 28 Sep 2022 15:27:21 +0800 Subject: [PATCH 33/44] docker support mysql and h2 (#746) --- docs/docs/user_docs/ops/server-docker.md | 17 ++++++++- hippo4j-server/Dockerfile | 31 ++++++----------- hippo4j-server/conf/hippo4j-logback.xml | 1 + hippo4j-server/docker-startup.sh | 44 ++++++++++++++++++++++++ 4 files changed, 72 insertions(+), 21 deletions(-) create mode 100644 hippo4j-server/docker-startup.sh diff --git a/docs/docs/user_docs/ops/server-docker.md b/docs/docs/user_docs/ops/server-docker.md index 8ff51566..010ccae2 100644 --- a/docs/docs/user_docs/ops/server-docker.md +++ b/docs/docs/user_docs/ops/server-docker.md @@ -12,7 +12,22 @@ Docker 镜像默认使用内置 H2 数据库,数据持久化到 Docker 容器 docker run -d -p 6691:6691 --name hippo4j-server hippo4j/hippo4j-server ``` -访问 Server 控制台,路径 `http://localhost:6691/index.html`,默认用户名密码:admin / 123456 +使用mysql +```shell +/** +* 暂时只暴露以下参数 +* DATASOURCE_HOST、DATASOURCE_PORT、DATASOURCE_DB、DATASOURCE_USERNAME、DATASOURCE_PASSWORD +*/ +docker run -d -p 6691:6691 --name hippo4j-server \ +-e DATASOURCE_HOST=127.0.0.1 \ +-e DATASOURCE_PORT=3306 \ +-e DATASOURCE_DB=hippo4j_manager \ +-e DATASOURCE_USERNAME=root \ +-e DATASOURCE_PASSWORD=root \ +hippo4j/hippo4j-server +``` + +访问 Server 控制台,路径 `http://localhost:6691/index.html` ,默认用户名密码:admin / 123456 ## 镜像构建 diff --git a/hippo4j-server/Dockerfile b/hippo4j-server/Dockerfile index 23678131..0bfee974 100644 --- a/hippo4j-server/Dockerfile +++ b/hippo4j-server/Dockerfile @@ -17,33 +17,24 @@ FROM openjdk:8-jre-slim MAINTAINER lijianxin -ENV MYSQL_HOST="127.0.0.1" \ - MYSQL_PORT="3306" \ - MYSQL_DB="hippo4j_manager" \ - MYSQL_USERNAME="root" \ - MYSQL_PASSWORD="root" \ +ENV DATASOURCE_MODE="h2" \ + DATASOURCE_HOST="127.0.0.1" \ + DATASOURCE_PORT="3306" \ + DATASOURCE_DB="hippo4j_manager" \ + DATASOURCE_USERNAME="root" \ + DATASOURCE_PASSWORD="root" \ BASE_DIR="/opt/hippo4j" ENV TZ=PRC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -ADD conf/hippo4j-logback.xml ${BASE_DIR}/logback.xml +ADD conf/hippo4j-logback.xml ${BASE_DIR}/conf/hippo4j-logback.xml +ADD conf/application.properties ${BASE_DIR}/conf/application.properties ADD target/hippo4j-server.jar ${BASE_DIR}/hippo4j-server.jar +ADD docker-startup.sh ${BASE_DIR}/docker-startup.sh WORKDIR ${BASE_DIR} +RUN chmod +x docker-startup.sh -ENTRYPOINT ["sh","-c","java -jar \ - -Xloggc:${BASE_DIR}/hippo4j_gc.log -verbose:gc -XX:+PrintGCDetails \ - -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation \ - -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M \ - -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${BASE_DIR}/java_heapdump.hprof \ - -Xms1024m -Xmx1024m -Xmn512m \ - -Dhippo4j.standalone=true -Dhippo4j.home=${BASE_DIR} \ - hippo4j-server.jar \ - --server.max-http-header-size=524288 \ - --server.tomcat.basedir=${BASE_DIR}/tomcat \ - --logging.config=${BASE_DIR}/logback.xml \ - --spring.profiles.active=h2 \ - --spring.datasource.url=jdbc:h2:file:${BASE_DIR}/h2_hippo4j;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL \ - "] +ENTRYPOINT ["./docker-startup.sh"] \ No newline at end of file diff --git a/hippo4j-server/conf/hippo4j-logback.xml b/hippo4j-server/conf/hippo4j-logback.xml index 80b844bf..3f8442d9 100644 --- a/hippo4j-server/conf/hippo4j-logback.xml +++ b/hippo4j-server/conf/hippo4j-logback.xml @@ -47,6 +47,7 @@ + diff --git a/hippo4j-server/docker-startup.sh b/hippo4j-server/docker-startup.sh new file mode 100644 index 00000000..3a562b13 --- /dev/null +++ b/hippo4j-server/docker-startup.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +export JAVA_HOME +export JAVA="$JAVA_HOME/bin/java" + +export SERVER="hippo4j-server" + +JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext" +JAVA_OPT="${JAVA_OPT} -Xloggc:${BASE_DIR}/logs/hippo4j_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M" + +JAVA_OPT="${JAVA_OPT} -Xms1024m -Xmx1024m -Xmn512m" +JAVA_OPT="${JAVA_OPT} -Dhippo4j.standalone=true" +JAVA_OPT="${JAVA_OPT} -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${BASE_DIR}/logs/java_heapdump.hprof" +JAVA_OPT="${JAVA_OPT} -Dhippo4j.home=${BASE_DIR}" + +JAVA_OPT="${JAVA_OPT} ${JAVA_OPT_EXT}" +JAVA_OPT="${JAVA_OPT} --logging.config=${BASE_DIR}/conf/hippo4j-logback.xml" +JAVA_OPT="${JAVA_OPT} --server.max-http-header-size=524288" +JAVA_OPT="${JAVA_OPT} --server.tomcat.basedir=${BASE_DIR}/bin" + +if [[ "${DATASOURCE_MODE}" == "mysql" ]]; then + JAVA_OPT="${JAVA_OPT} --spring.datasource.url=\"jdbc:mysql://${DATASOURCE_HOST}:${DATASOURCE_PORT}/${DATASOURCE_DB}?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8\" " + JAVA_OPT="${JAVA_OPT} ---spring.datasource.username=${DATASOURCE_USERNAME} --spring.datasource.password=${DATASOURCE_PASSWORD} " +elif [[ "${DATASOURCE_MODE}" == "h2" ]]; then + JAVA_OPT="${JAVA_OPT} --spring.profiles.active=h2 --spring.datasource.url=jdbc:h2:file:${BASE_DIR}/h2_hippo4j;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL" +else + echo "hippo4j DATASOURCE_MODE is error, value ${DATASOURCE_MODE}, use default h2" +fi + +if [ ! -d "${BASE_DIR}/logs" ]; then + mkdir ${BASE_DIR}/logs +fi + +echo "$JAVA ${JAVA_OPT}" + +echo "hippo4j is starting with standalone" + +if [ ! -f "${BASE_DIR}/logs/start.out" ]; then + touch "${BASE_DIR}/logs/start.out" +fi + +echo "$JAVA ${JAVA_OPT}" > ${BASE_DIR}/logs/start.out 2>&1 & +java -jar hippo4j-server.jar ${JAVA_OPT} +echo "hippo4j is starting,you can check the ${BASE_DIR}/logs/" From 85820c3639c5c704272227710f6234aa72ab9585 Mon Sep 17 00:00:00 2001 From: itmachen Date: Wed, 28 Sep 2022 15:27:34 +0800 Subject: [PATCH 34/44] Update the list of contributors --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 95fa71e4..2c94977b 100644 --- a/README.md +++ b/README.md @@ -299,6 +299,13 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 游祖光 + + + puppet4 +
+ Tudo +
+ 2EXP @@ -312,15 +319,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Alic
- + + CalebZYC
Null
- - + Hibernate5666 @@ -376,15 +383,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Alexli
- + + qizhongju
Bug搬运工
- - + san4j @@ -440,15 +447,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Itermis
- + + janey668
Null
- - + jialei-jack @@ -477,13 +484,6 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 Null - - - puppet4 -
- Tudo -
- Nhxz From 43cd089db1fb198ca4f1d4baf409ebf294dc47ff Mon Sep 17 00:00:00 2001 From: itmachen Date: Wed, 28 Sep 2022 15:27:46 +0800 Subject: [PATCH 35/44] Update the list of contributors --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2c94977b..095aa02e 100644 --- a/README.md +++ b/README.md @@ -385,6 +385,13 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 + + + baymax55 +
+ Baymax55 +
+ qizhongju @@ -440,15 +447,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- + + stronglong
Itermis
- - + janey668 @@ -477,13 +484,6 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 Null - - - lishiyu -
- Null -
- Nhxz From 817ea6953ee761defb674cdad1f60422d92f112d Mon Sep 17 00:00:00 2001 From: itmachen Date: Wed, 28 Sep 2022 15:27:58 +0800 Subject: [PATCH 36/44] Update the list of contributors --- README.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 095aa02e..95fa71e4 100644 --- a/README.md +++ b/README.md @@ -299,13 +299,6 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 游祖光 - - - puppet4 -
- Tudo -
- 2EXP @@ -319,15 +312,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Alic
- - + CalebZYC
Null
- + + Hibernate5666 @@ -383,14 +376,6 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Alexli
- - - - - baymax55 -
- Baymax55 -
@@ -398,7 +383,8 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Bug搬运工
- + + san4j @@ -447,8 +433,7 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- - + stronglong @@ -462,7 +447,8 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- + + jialei-jack @@ -484,6 +470,20 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 Null + + + lishiyu +
+ Null +
+ + + + puppet4 +
+ Tudo +
+ Nhxz From 69f0a4aa885f2011bd6e90814457160024fce2a0 Mon Sep 17 00:00:00 2001 From: itmachen Date: Wed, 28 Sep 2022 15:28:13 +0800 Subject: [PATCH 37/44] Update the list of contributors --- README.md | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 95fa71e4..a0054c80 100644 --- a/README.md +++ b/README.md @@ -299,6 +299,13 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 游祖光 + + + puppet4 +
+ Tudo +
+ 2EXP @@ -312,15 +319,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Alic
- + + CalebZYC
Null
- - + Hibernate5666 @@ -376,6 +383,14 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Alexli
+ + + + + baymax55 +
+ Baymax55 +
@@ -383,8 +398,7 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Bug搬运工
- - + san4j @@ -433,7 +447,8 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- + + stronglong @@ -447,8 +462,7 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- - + jialei-jack @@ -477,13 +491,6 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 Null - - - puppet4 -
- Tudo -
- Nhxz @@ -504,15 +511,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Wangjie
- + + wangyi123456
Null
- - + Williamren97 @@ -568,15 +575,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- + + li-xiao-shuang
李晓双 Li Xiao Shuang
- - + oreoft From d7b8fe1961a5d604216183e6ce5c502a9bacf243 Mon Sep 17 00:00:00 2001 From: itmachen Date: Wed, 28 Sep 2022 15:28:27 +0800 Subject: [PATCH 38/44] Update the list of contributors --- README.md | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index a0054c80..2c94977b 100644 --- a/README.md +++ b/README.md @@ -385,13 +385,6 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - - - baymax55 -
- Baymax55 -
- qizhongju @@ -447,15 +440,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- - + stronglong
Itermis
- + + janey668 @@ -511,15 +504,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Wangjie
- - + wangyi123456
Null
- + + Williamren97 @@ -575,15 +568,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- - + li-xiao-shuang
李晓双 Li Xiao Shuang
- + + oreoft From 49bf63ab606e93347e780b596ac75769a3b76206 Mon Sep 17 00:00:00 2001 From: itmachen Date: Wed, 28 Sep 2022 15:28:44 +0800 Subject: [PATCH 39/44] Update the list of contributors --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 2c94977b..95fa71e4 100644 --- a/README.md +++ b/README.md @@ -299,13 +299,6 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 游祖光 - - - puppet4 -
- Tudo -
- 2EXP @@ -319,15 +312,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Alic
- - + CalebZYC
Null
- + + Hibernate5666 @@ -383,15 +376,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Alexli
- - + qizhongju
Bug搬运工
- + + san4j @@ -447,15 +440,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Itermis
- - + janey668
Null
- + + jialei-jack @@ -484,6 +477,13 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 Null + + + puppet4 +
+ Tudo +
+ Nhxz From 6b5e636cbeae0a18bb0b98daca6a829f57bd4b80 Mon Sep 17 00:00:00 2001 From: itmachen Date: Wed, 28 Sep 2022 15:28:56 +0800 Subject: [PATCH 40/44] Update the list of contributors --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 95fa71e4..2c94977b 100644 --- a/README.md +++ b/README.md @@ -299,6 +299,13 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 游祖光 + + + puppet4 +
+ Tudo +
+ 2EXP @@ -312,15 +319,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Alic
- + + CalebZYC
Null
- - + Hibernate5666 @@ -376,15 +383,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Alexli
- + + qizhongju
Bug搬运工
- - + san4j @@ -440,15 +447,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Itermis
- + + janey668
Null
- - + jialei-jack @@ -477,13 +484,6 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 Null - - - puppet4 -
- Tudo -
- Nhxz From 492e2ab53a35d4e1093994432ba297c48d94f44c Mon Sep 17 00:00:00 2001 From: itmachen Date: Wed, 28 Sep 2022 15:29:11 +0800 Subject: [PATCH 41/44] Update the list of contributors --- README.md | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 2c94977b..da371244 100644 --- a/README.md +++ b/README.md @@ -101,17 +101,17 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 - - shanjianq + + BigXin0109
- Shanjianq + BigXin0109
- - BigXin0109 + + shanjianq
- BigXin0109 + Shanjianq
@@ -385,6 +385,13 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池 + + + baymax55 +
+ Baymax55 +
+ qizhongju @@ -440,15 +447,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- + + stronglong
Itermis
- - + janey668 @@ -504,15 +511,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Wangjie
- + + wangyi123456
Null
- - + Williamren97 @@ -568,15 +575,15 @@ Hippo-4J 通过对 JDK 线程池增强,以及扩展三方框架底层线程池
Null
- + + li-xiao-shuang
李晓双 Li Xiao Shuang
- - + oreoft From 052ad9bf075feb97653e7c64f99c6e85a893ed30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=87=91=E6=9D=A5?= <41976977+pirme@users.noreply.github.com> Date: Wed, 28 Sep 2022 18:35:22 +0800 Subject: [PATCH 42/44] Update reademe-contributors.yml (#747) --- .github/workflows/reademe-contributors.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reademe-contributors.yml b/.github/workflows/reademe-contributors.yml index d501db52..cf7b75f5 100644 --- a/.github/workflows/reademe-contributors.yml +++ b/.github/workflows/reademe-contributors.yml @@ -33,8 +33,8 @@ jobs: with: image_size: 50 columns_per_row: 9 - committer_email: machen@apache.org - committer_username: itmachen + committer_email: m7798432@163.com + committer_username: pirme commit_message: 'Update the list of contributors' env: GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} From a9c616c6f98744c7e253d0071f4ae19ea305f91b Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Wed, 28 Sep 2022 18:44:11 +0800 Subject: [PATCH 43/44] Update docker deployment documentation --- docs/docs/user_docs/ops/server-docker.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/docs/user_docs/ops/server-docker.md b/docs/docs/user_docs/ops/server-docker.md index 010ccae2..a6da6349 100644 --- a/docs/docs/user_docs/ops/server-docker.md +++ b/docs/docs/user_docs/ops/server-docker.md @@ -12,14 +12,11 @@ Docker 镜像默认使用内置 H2 数据库,数据持久化到 Docker 容器 docker run -d -p 6691:6691 --name hippo4j-server hippo4j/hippo4j-server ``` -使用mysql +或者,底层存储数据库切换为 MySQL。`DATASOURCE_HOST` 需要切换为本地 IP,不能使用 `127.0.0.1` 或 `localhost`。 + ```shell -/** -* 暂时只暴露以下参数 -* DATASOURCE_HOST、DATASOURCE_PORT、DATASOURCE_DB、DATASOURCE_USERNAME、DATASOURCE_PASSWORD -*/ docker run -d -p 6691:6691 --name hippo4j-server \ --e DATASOURCE_HOST=127.0.0.1 \ +-e DATASOURCE_HOST=xxx.xxx.xxx.xxx \ -e DATASOURCE_PORT=3306 \ -e DATASOURCE_DB=hippo4j_manager \ -e DATASOURCE_USERNAME=root \ From a2c4975b1ff08d77ae85c6436654f939cf51fc46 Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Wed, 28 Sep 2022 22:13:26 +0800 Subject: [PATCH 44/44] Optimize the front-end project monitoring page (#741) --- hippo4j-console/src/main/resources/static/index.html | 2 +- ...{chunk-02e8e2bd.2ee7a1f2.css => chunk-70528506.0840a153.css} | 2 +- .../static/static/js/{app.43ff9914.js => app.0ce10ef9.js} | 2 +- .../main/resources/static/static/js/chunk-02e8e2bd.48523c0f.js | 1 - .../main/resources/static/static/js/chunk-70528506.18aa1627.js | 1 + 5 files changed, 4 insertions(+), 4 deletions(-) rename hippo4j-console/src/main/resources/static/static/css/{chunk-02e8e2bd.2ee7a1f2.css => chunk-70528506.0840a153.css} (85%) rename hippo4j-console/src/main/resources/static/static/js/{app.43ff9914.js => app.0ce10ef9.js} (99%) delete mode 100644 hippo4j-console/src/main/resources/static/static/js/chunk-02e8e2bd.48523c0f.js create mode 100644 hippo4j-console/src/main/resources/static/static/js/chunk-70528506.18aa1627.js diff --git a/hippo4j-console/src/main/resources/static/index.html b/hippo4j-console/src/main/resources/static/index.html index 161e51c9..3fb66f4f 100644 --- a/hippo4j-console/src/main/resources/static/index.html +++ b/hippo4j-console/src/main/resources/static/index.html @@ -1 +1 @@ -Hippo4J Web

\ No newline at end of file +Hippo4J Web
\ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/css/chunk-02e8e2bd.2ee7a1f2.css b/hippo4j-console/src/main/resources/static/static/css/chunk-70528506.0840a153.css similarity index 85% rename from hippo4j-console/src/main/resources/static/static/css/chunk-02e8e2bd.2ee7a1f2.css rename to hippo4j-console/src/main/resources/static/static/css/chunk-70528506.0840a153.css index 9ff1fde0..560ca5db 100644 --- a/hippo4j-console/src/main/resources/static/static/css/chunk-02e8e2bd.2ee7a1f2.css +++ b/hippo4j-console/src/main/resources/static/static/css/chunk-70528506.0840a153.css @@ -1 +1 @@ -.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.dashboard-editor-container[data-v-490e92e5]{padding:32px;background-color:#f0f2f5;position:relative;min-height:100vh} \ No newline at end of file +.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.dashboard-editor-container[data-v-a25e0782]{padding:32px;background-color:#f0f2f5;position:relative;min-height:100vh} \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/js/app.43ff9914.js b/hippo4j-console/src/main/resources/static/static/js/app.0ce10ef9.js similarity index 99% rename from hippo4j-console/src/main/resources/static/static/js/app.43ff9914.js rename to hippo4j-console/src/main/resources/static/static/js/app.0ce10ef9.js index 95c1299e..eb73e28d 100644 --- a/hippo4j-console/src/main/resources/static/static/js/app.43ff9914.js +++ b/hippo4j-console/src/main/resources/static/static/js/app.0ce10ef9.js @@ -1 +1 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["app"],{0:function(e,t,n){e.exports=n("56d7")},"0334":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-batch-create",use:"icon-batch-create-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"034c":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tenant_two",use:"icon-tenant_two-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"0781":function(e,t,n){"use strict";n.r(t);var a=n("24ab"),i=n.n(a),o=n("83d6"),c=n.n(o),s=c.a.showSettings,l=c.a.tagsView,r=c.a.fixedHeader,d=c.a.sidebarLogo,h={theme:i.a.theme,showSettings:s,tagsView:l,fixedHeader:r,sidebarLogo:d},u={CHANGE_SETTING:function(e,t){var n=t.key,a=t.value;e.hasOwnProperty(n)&&(e[n]=a)}},p={changeSetting:function(e,t){var n=e.commit;n("CHANGE_SETTING",t)}};t["default"]={namespaced:!0,state:h,mutations:u,actions:p}},"07c6":function(e,t,n){"use strict";n("48c1")},"096e":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-skill",use:"icon-skill-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"0f9a":function(e,t,n){"use strict";n.r(t);var a=n("c80c"),i=(n("96cf"),n("3b8d")),o=n("b775");function c(e){return Object(o["a"])({url:"/hippo4j/v1/cs/auth/login",method:"post",data:e})}var s=n("5f87"),l=n("a18c"),r={token:Object(s["a"])(),name:"",avatar:"",introduction:"",roles:[]},d={SET_TOKEN:function(e,t){e.token=t},SET_INTRODUCTION:function(e,t){e.introduction=t},SET_NAME:function(e,t){e.name=t},SET_AVATAR:function(e,t){e.avatar=t},SET_ROLES:function(e,t){e.roles=t}},h={login:function(e,t){var n=e.commit,a=t.username,i=t.password;return new Promise((function(e,t){c({username:a.trim(),password:i,rememberMe:1}).then((function(t){var a=t.data,i=t.roles;n("SET_TOKEN",a),localStorage.setItem("roles",JSON.stringify(i)),Object(s["c"])(a),e()})).catch((function(e){alert("登录失败"),t(e)}))}))},getInfo:function(e){var t=e.commit;e.state;return new Promise((function(e,n){var a={};a.roles=JSON.parse(localStorage.getItem("roles")),t("SET_ROLES",a.roles),e(a)}))},logout:function(e){var t=e.commit;e.state;return new Promise((function(e){t("SET_TOKEN",""),t("SET_ROLES",[]),Object(s["b"])(),Object(l["d"])(),e()}))},resetToken:function(e){var t=e.commit;return new Promise((function(e){t("SET_TOKEN",""),t("SET_ROLES",[]),Object(s["b"])(),e()}))},changeRoles:function(e,t){var n=e.commit,o=e.dispatch;return new Promise(function(){var e=Object(i["a"])(Object(a["a"])().mark((function e(i){var c,r,d,h;return Object(a["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return c=t+"-token",n("SET_TOKEN",c),Object(s["c"])(c),e.next=5,o("getInfo");case 5:return r=e.sent,d=r.roles,Object(l["d"])(),e.next=10,o("permission/generateRoutes",d,{root:!0});case 10:h=e.sent,l["c"].addRoutes(h),o("tagsView/delAllViews",null,{root:!0}),i();case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}};t["default"]={namespaced:!0,state:r,mutations:d,actions:h}},"119b":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-other4",use:"icon-other4-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"12a5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-shopping",use:"icon-shopping-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},1424:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tenant_logo2",use:"icon-tenant_logo2-usage",viewBox:"0 0 1331 1024",content:''});c.a.add(s);t["default"]=s},1430:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-qq",use:"icon-qq-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"158d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item",use:"icon-item-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},1695:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-thread_pool_Instance",use:"icon-thread_pool_Instance-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},1779:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-bug",use:"icon-bug-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"187a":function(e,t,n){},"18f0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-link",use:"icon-link-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},1994:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-user-cfg",use:"icon-user-cfg-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"24ab":function(e,t,n){e.exports={theme:"#1890ff"}},2538:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-json",use:"icon-json-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},2580:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-language",use:"icon-language-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"273b":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-running",use:"icon-running-usage",viewBox:"0 0 1129 1024",content:''});c.a.add(s);t["default"]=s},"273d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-user6",use:"icon-user6-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"29aa":function(e,t,n){},"2a3d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-password",use:"icon-password-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"2b97":function(e,t,n){},"2f11":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-peoples",use:"icon-peoples-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},3046:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-money",use:"icon-money-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"30c3":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-example",use:"icon-example-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"31c2":function(e,t,n){"use strict";n.r(t),n.d(t,"filterAsyncRoutes",(function(){return c}));var a=n("db72"),i=(n("ac6a"),n("6762"),n("2fdb"),n("a18c"));function o(e,t){return!t.meta||!t.meta.roles||e.some((function(e){return t.meta.roles.includes(e)}))}function c(e,t){var n=[];return e.forEach((function(e){var i=Object(a["a"])({},e);o(t,i)&&(i.children&&(i.children=c(i.children,t)),n.push(i))})),n}var s={routes:[],addRoutes:[]},l={SET_ROUTES:function(e,t){e.addRoutes=t,e.routes=i["b"].concat(t)}},r={generateRoutes:function(e,t){var n=e.commit;return new Promise((function(e){var a;a=t.includes("ROLE_ADMIN")?i["a"]||[]:c(i["a"],t),n("SET_ROUTES",a),e(a)}))}};t["default"]={namespaced:!0,state:s,mutations:l,actions:r}},3289:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-list",use:"icon-list-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},3743:function(e,t,n){"use strict";n("5b1d")},3749:function(e,t,n){"use strict";n("3f7d")},"3da9":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-thread_logo",use:"icon-thread_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"3f7d":function(e,t,n){},4213:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-link3",use:"icon-link3-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"42e9":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-instance_logo",use:"icon-instance_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},4360:function(e,t,n){"use strict";n("a481"),n("ac6a");var a=n("2b0e"),i=n("2f62"),o=(n("7f7f"),{sidebar:function(e){return e.app.sidebar},size:function(e){return e.app.size},device:function(e){return e.app.device},visitedViews:function(e){return e.tagsView.visitedViews},cachedViews:function(e){return e.tagsView.cachedViews},token:function(e){return e.user.token},avatar:function(e){return e.user.avatar},name:function(e){return e.user.name},introduction:function(e){return e.user.introduction},roles:function(e){return e.user.roles},permission_routes:function(e){return e.permission.routes},errorLogs:function(e){return e.errorLog.logs}}),c=o;a["default"].use(i["a"]);var s=n("c653"),l=s.keys().reduce((function(e,t){var n=t.replace(/^\.\/(.*)\.\w+$/,"$1"),a=s(t);return e[n]=a.default,e}),{}),r=new i["a"].Store({modules:l,getters:c});t["a"]=r},"441c":function(e,t,n){},"47f1":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-table",use:"icon-table-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"47ff":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-message",use:"icon-message-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"48c1":function(e,t,n){},"4d49":function(e,t,n){"use strict";n.r(t);var a={logs:[]},i={ADD_ERROR_LOG:function(e,t){e.logs.push(t)},CLEAR_ERROR_LOG:function(e){e.logs.splice(0)}},o={addErrorLog:function(e,t){var n=e.commit;n("ADD_ERROR_LOG",t)},clearErrorLog:function(e){var t=e.commit;t("CLEAR_ERROR_LOG")}};t["default"]={namespaced:!0,state:a,mutations:i,actions:o}},"4df5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-eye",use:"icon-eye-usage",viewBox:"0 0 128 64",content:''});c.a.add(s);t["default"]=s},"51ff":function(e,t,n){var a={"./404.svg":"a14a","./batch-create.svg":"0334","./battery-line.svg":"659b","./bug.svg":"1779","./cfg-datasouce.svg":"ce80","./chart.svg":"c829","./clipboard.svg":"bc35","./component.svg":"56d6","./dashboard.svg":"f782","./dashboard2.svg":"ea93","./documentation.svg":"90fb","./drag.svg":"9bbf","./edit.svg":"aa46","./education.svg":"ad1c","./email.svg":"cbb7","./example.svg":"30c3","./excel.svg":"6599","./exe-cfg.svg":"c309","./exit-fullscreen.svg":"dbc7","./eye-open.svg":"d7ec","./eye.svg":"4df5","./fail.svg":"9448","./form.svg":"eb1b","./fullscreen.svg":"9921","./guide.svg":"6683","./icon.svg":"9d91","./instance_logo.svg":"42e9","./item.svg":"158d","./item4.svg":"f385","./item_logo.svg":"b444","./item_logo2.svg":"ac67","./item_logo3.svg":"5f29","./item_logo4.svg":"8811","./item_logo_1.svg":"d314","./item_three.svg":"bddf","./item_two.svg":"d50e","./json.svg":"2538","./language.svg":"2580","./lessee.svg":"dbd7","./link.svg":"18f0","./link3.svg":"4213","./list.svg":"3289","./lock.svg":"ab00","./log.svg":"fea0","./log3.svg":"6ba9","./message.svg":"47ff","./money.svg":"3046","./nested.svg":"dcf8","./notify.svg":"5448","./other4.svg":"119b","./password.svg":"2a3d","./pdf.svg":"f9a1","./people.svg":"d056","./peoples.svg":"2f11","./pool3.svg":"a551","./project.svg":"69e4","./qq.svg":"1430","./running.svg":"273b","./search.svg":"8e8d","./shopping.svg":"12a5","./size.svg":"8644","./skill.svg":"096e","./star.svg":"708a","./success.svg":"a8cf","./tab.svg":"8fb7","./table.svg":"47f1","./task-cfg.svg":"7824","./task-tmp.svg":"90d2","./tenant_logo.svg":"67a0","./tenant_logo2.svg":"1424","./tenant_two.svg":"034c","./theme.svg":"e534","./threadPool_logo1.svg":"b6d1","./threadPool_logo2.svg":"9bc4","./thread_logo.svg":"3da9","./thread_pool_Instance.svg":"1695","./threadpool_logo.svg":"eb7b","./tree-table.svg":"e7c8","./tree.svg":"93cd","./user-cfg.svg":"1994","./user.svg":"b3b5","./user6.svg":"273d","./vessel3.svg":"6e71","./wechat.svg":"80da","./work.svg":"7bb0","./zip.svg":"8aa6"};function i(e){var t=o(e);return n(t)}function o(e){var t=a[e];if(!(t+1)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return t}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id="51ff"},5448:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-notify",use:"icon-notify-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"56d6":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-component",use:"icon-component-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"56d7":function(e,t,n){"use strict";n.r(t);var a={};n.r(a),n.d(a,"parseTime",(function(){return j["e"]})),n.d(a,"formatTime",(function(){return j["c"]})),n.d(a,"timeAgo",(function(){return q})),n.d(a,"numberFormatter",(function(){return I})),n.d(a,"toThousandFilter",(function(){return P})),n.d(a,"uppercaseFirst",(function(){return R}));n("456d"),n("ac6a"),n("cadf"),n("551c"),n("f751"),n("097d");var i=n("2b0e"),o=n("a78e"),c=n.n(o),s=(n("f5df"),n("5c96")),l=n.n(s),r=(n("24ab"),n("b20f"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("router-view")],1)}),d=[],h={name:"App"},u=h,p=n("2877"),m=Object(p["a"])(u,r,d,!1,null,null,null),v=m.exports,f=n("4360"),w=n("a18c"),g=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isExternal?n("div",e._g({staticClass:"svg-external-icon svg-icon",style:e.styleExternalIcon},e.$listeners)):n("svg",e._g({class:e.svgClass,attrs:{"aria-hidden":"true"}},e.$listeners),[n("use",{attrs:{"xlink:href":e.iconName}})])},b=[],x=n("61f7"),y={name:"SvgIcon",props:{iconClass:{type:String,required:!0},className:{type:String,default:""}},computed:{isExternal:function(){return Object(x["a"])(this.iconClass)},iconName:function(){return"#icon-".concat(this.iconClass)},svgClass:function(){return this.className?"svg-icon "+this.className:"svg-icon"},styleExternalIcon:function(){return{mask:"url(".concat(this.iconClass,") no-repeat 50% 50%"),"-webkit-mask":"url(".concat(this.iconClass,") no-repeat 50% 50%")}}}},z=y,M=(n("64df"),Object(p["a"])(z,g,b,!1,null,"f9f7fefc",null)),V=M.exports;i["default"].component("svg-icon",V);var _=n("51ff"),C=function(e){return e.keys().map(e)};C(_);var k=n("c80c"),H=n("db72"),E=(n("96cf"),n("3b8d")),L=n("323e"),B=n.n(L),F=(n("a5d8"),n("5f87")),O=n("83d6"),A=n.n(O),D=A.a.title||"Vue Element Admin";function S(e){return e?"".concat(e," - ").concat(D):"".concat(D)}B.a.configure({showSpinner:!1});var T=["/login","/auth-redirect"];w["c"].beforeEach(function(){var e=Object(E["a"])(Object(k["a"])().mark((function e(t,n,a){var i,o,c,l,r;return Object(k["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(B.a.start(),document.title=S(t.meta.title),i=Object(F["a"])(),!i){e.next=35;break}if("/login"!==t.path){e.next=9;break}a({path:"/"}),B.a.done(),e.next=33;break;case 9:if(o=f["a"].getters.roles&&f["a"].getters.roles.length>0,!o){e.next=14;break}a(),e.next=33;break;case 14:return e.prev=14,e.next=17,f["a"].dispatch("user/getInfo");case 17:return c=e.sent,l=c.roles,e.next=21,f["a"].dispatch("permission/generateRoutes",l);case 21:r=e.sent,w["c"].addRoutes(r),a(Object(H["a"])(Object(H["a"])({},t),{},{replace:!0})),e.next=33;break;case 26:return e.prev=26,e.t0=e["catch"](14),e.next=30,f["a"].dispatch("user/resetToken");case 30:s["Message"].error(e.t0||"Has Error"),a("/login?redirect=".concat(t.path)),B.a.done();case 33:e.next=36;break;case 35:-1!==T.indexOf(t.path)?a():(a("/login?redirect=".concat(t.path)),B.a.done());case 36:case"end":return e.stop()}}),e,null,[[14,26]])})));return function(t,n,a){return e.apply(this,arguments)}}()),w["c"].afterEach((function(){B.a.done()}));n("6b54"),n("a481"),n("c5f6");var j=n("ed08");function $(e,t){return 1===e?e+t:e+t+"s"}function q(e){var t=Date.now()/1e3-Number(e);return t<3600?$(~~(t/60)," minute"):t<86400?$(~~(t/3600)," hour"):$(~~(t/86400)," day")}function I(e,t){for(var n=[{value:1e18,symbol:"E"},{value:1e15,symbol:"P"},{value:1e12,symbol:"T"},{value:1e9,symbol:"G"},{value:1e6,symbol:"M"},{value:1e3,symbol:"k"}],a=0;a=n[a].value)return(e/n[a].value+.1).toFixed(t).replace(/\.0+$|(\.[0-9]*[1-9])0+$/,"$1")+n[a].symbol;return e.toString()}function P(e){return(+e||0).toString().replace(/^-?\d+/g,(function(e){return e.replace(/(?=(?!\b)(\d{3})+$)/g,",")}))}function R(e){return e.charAt(0).toUpperCase()+e.slice(1)}for(var N=n("313e"),W=n("00e7"),G=n.n(W),U=(n("3b2b"),n("2d63")),J=n("75fc"),Z=n("96eb"),K=n.n(Z),Q={admin:{token:"admin-token"},editor:{token:"editor-token"}},X={"admin-token":{roles:["admin"],introduction:"I am a super administrator",avatar:"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",name:"Super Admin"},"editor-token":{roles:["editor"],introduction:"I am an editor",avatar:"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",name:"Normal Editor"}},Y=[{url:"/user/login",type:"post",response:function(e){var t=e.body.username,n=Q[t];return n?{code:"20000",data:n}:{code:"60204",message:"Account and password are incorrect."}}},{url:"/user/info.*",type:"get",response:function(e){var t=e.query.token,n=X[t];return n?{code:"20000",data:n}:{code:"50008",message:"Login failed, unable to get user details."}}},{url:"/user/logout",type:"post",response:function(e){return{code:"20000",data:"success"}}}],ee=[{path:"/redirect",component:"layout/Layout",hidden:!0,children:[{path:"/redirect/:path*",component:"views/redirect/index"}]},{path:"/login",component:"views/login/index",hidden:!0},{path:"/auth-redirect",component:"views/login/auth-redirect",hidden:!0},{path:"/404",component:"views/error-page/404",hidden:!0},{path:"/401",component:"views/error-page/401",hidden:!0},{path:"",component:"layout/Layout",redirect:"dashboard",children:[{path:"dashboard",component:"views/dashboard/index",name:"Dashboard",meta:{title:"Dashboard",icon:"dashboard",affix:!0}}]},{path:"/documentation",component:"layout/Layout",children:[{path:"index",component:"views/documentation/index",name:"Documentation",meta:{title:"Documentation",icon:"documentation",affix:!0}}]},{path:"/guide",component:"layout/Layout",redirect:"/guide/index",children:[{path:"index",component:"views/guide/index",name:"Guide",meta:{title:"Guide",icon:"guide",noCache:!0}}]}],te=[{path:"/permission",component:"layout/Layout",redirect:"/permission/index",alwaysShow:!0,meta:{title:"Permission",icon:"lock",roles:["admin","editor"]},children:[{path:"page",component:"views/permission/page",name:"PagePermission",meta:{title:"Page Permission11111",roles:["admin"]}},{path:"directive",component:"views/permission/directive",name:"DirectivePermission",meta:{title:"Directive Permission"}},{path:"role",component:"views/permission/role",name:"RolePermission",meta:{title:"Role Permission",roles:["admin"]}}]},{path:"/icon",component:"layout/Layout",children:[{path:"index",component:"views/icons/index",name:"Icons",meta:{title:"Icons",icon:"icon",noCache:!0}}]},{path:"/components",component:"layout/Layout",redirect:"noRedirect",name:"ComponentDemo",meta:{title:"Components",icon:"component"},children:[{path:"tinymce",component:"views/components-demo/tinymce",name:"TinymceDemo",meta:{title:"Tinymce"}},{path:"markdown",component:"views/components-demo/markdown",name:"MarkdownDemo",meta:{title:"Markdown"}},{path:"json-editor",component:"views/components-demo/json-editor",name:"JsonEditorDemo",meta:{title:"Json Editor"}},{path:"split-pane",component:"views/components-demo/split-pane",name:"SplitpaneDemo",meta:{title:"SplitPane"}},{path:"avatar-upload",component:"views/components-demo/avatar-upload",name:"AvatarUploadDemo",meta:{title:"Avatar Upload"}},{path:"dropzone",component:"views/components-demo/dropzone",name:"DropzoneDemo",meta:{title:"Dropzone"}},{path:"sticky",component:"views/components-demo/sticky",name:"StickyDemo",meta:{title:"Sticky"}},{path:"count-to",component:"views/components-demo/count-to",name:"CountToDemo",meta:{title:"Count To"}},{path:"mixin",component:"views/components-demo/mixin",name:"ComponentMixinDemo",meta:{title:"componentMixin"}},{path:"back-to-top",component:"views/components-demo/back-to-top",name:"BackToTopDemo",meta:{title:"Back To Top"}},{path:"drag-dialog",component:"views/components-demo/drag-dialog",name:"DragDialogDemo",meta:{title:"Drag Dialog"}},{path:"drag-select",component:"views/components-demo/drag-select",name:"DragSelectDemo",meta:{title:"Drag Select"}},{path:"dnd-list",component:"views/components-demo/dnd-list",name:"DndListDemo",meta:{title:"Dnd List"}},{path:"drag-kanban",component:"views/components-demo/drag-kanban",name:"DragKanbanDemo",meta:{title:"Drag Kanban"}}]},{path:"/charts",component:"layout/Layout",redirect:"noRedirect",name:"Charts",meta:{title:"Charts",icon:"chart"},children:[{path:"keyboard",component:"views/charts/keyboard",name:"KeyboardChart",meta:{title:"Keyboard Chart",noCache:!0}},{path:"line",component:"views/charts/line",name:"LineChart",meta:{title:"Line Chart",noCache:!0}},{path:"mixchart",component:"views/charts/mixChart",name:"MixChart",meta:{title:"Mix Chart",noCache:!0}}]},{path:"/nested",component:"layout/Layout",redirect:"/nested/menu1/menu1-1",name:"Nested",meta:{title:"Nested",icon:"nested"},children:[{path:"menu1",component:"views/nested/menu1/index",name:"Menu1",meta:{title:"Menu1"},redirect:"/nested/menu1/menu1-1",children:[{path:"menu1-1",component:"views/nested/menu1/menu1-1",name:"Menu1-1",meta:{title:"Menu1-1"}},{path:"menu1-2",component:"views/nested/menu1/menu1-2",name:"Menu1-2",redirect:"/nested/menu1/menu1-2/menu1-2-1",meta:{title:"Menu1-2"},children:[{path:"menu1-2-1",component:"views/nested/menu1/menu1-2/menu1-2-1",name:"Menu1-2-1",meta:{title:"Menu1-2-1"}},{path:"menu1-2-2",component:"views/nested/menu1/menu1-2/menu1-2-2",name:"Menu1-2-2",meta:{title:"Menu1-2-2"}}]},{path:"menu1-3",component:"views/nested/menu1/menu1-3",name:"Menu1-3",meta:{title:"Menu1-3"}}]},{path:"menu2",name:"Menu2",component:"views/nested/menu2/index",meta:{title:"Menu2"}}]},{path:"/example",component:"layout/Layout",redirect:"/example/list",name:"Example",meta:{title:"Example",icon:"example"},children:[{path:"create",component:"views/example/create",name:"CreateArticle",meta:{title:"Create Article",icon:"edit"}},{path:"edit/:id(\\d+)",component:"views/example/edit",name:"EditArticle",meta:{title:"Edit Article",noCache:!0},hidden:!0},{path:"list",component:"views/example/list",name:"ArticleList",meta:{title:"Article List",icon:"list"}}]},{path:"/tab",component:"layout/Layout",children:[{path:"index",component:"views/tab/index",name:"Tab",meta:{title:"Tab",icon:"tab"}}]},{path:"/error",component:"layout/Layout",redirect:"noRedirect",name:"ErrorPages",meta:{title:"Error Pages",icon:"404"},children:[{path:"401",component:"views/error-page/401",name:"Page401",meta:{title:"Page 401",noCache:!0}},{path:"404",component:"views/error-page/404",name:"Page404",meta:{title:"Page 404",noCache:!0}}]},{path:"/error-log",component:"layout/Layout",redirect:"noRedirect",children:[{path:"log",component:"views/error-log/index",name:"ErrorLog",meta:{title:"Error Log",icon:"bug"}}]},{path:"/excel",component:"layout/Layout",redirect:"/excel/export-excel",name:"Excel",meta:{title:"Excel",icon:"excel"},children:[{path:"export-excel",component:"views/excel/export-excel",name:"ExportExcel",meta:{title:"Export Excel"}},{path:"export-selected-excel",component:"views/excel/select-excel",name:"SelectExcel",meta:{title:"Select Excel"}},{path:"export-merge-header",component:"views/excel/merge-header",name:"MergeHeader",meta:{title:"Merge Header"}},{path:"upload-excel",component:"views/excel/upload-excel",name:"UploadExcel",meta:{title:"Upload Excel"}}]},{path:"/zip",component:"layout/Layout",redirect:"/zip/download",alwaysShow:!0,meta:{title:"Zip",icon:"zip"},children:[{path:"download",component:"views/zip/index",name:"ExportZip",meta:{title:"Export Zip"}}]},{path:"/pdf",component:"layout/Layout",redirect:"/pdf/index",children:[{path:"index",component:"views/pdf/index",name:"PDF",meta:{title:"PDF",icon:"pdf"}}]},{path:"/pdf/download",component:"views/pdf/download",hidden:!0},{path:"/theme",component:"layout/Layout",redirect:"noRedirect",children:[{path:"index",component:"views/theme/index",name:"Theme",meta:{title:"Theme",icon:"theme"}}]},{path:"/clipboard",component:"layout/Layout",redirect:"noRedirect",children:[{path:"index",component:"views/clipboard/index",name:"ClipboardDemo",meta:{title:"Clipboard Demo",icon:"clipboard"}}]},{path:"/i18n",component:"layout/Layout",children:[{path:"index",component:"views/i18n-demo/index",name:"I18n",meta:{title:"I18n",icon:"international"}}]},{path:"external-link",component:"layout/Layout",children:[{path:"https://github.com/PanJiaChen/vue-element-admin",meta:{title:"External Link",icon:"link"}}]},{path:"*",redirect:"/404",hidden:!0}],ne=Object(j["b"])([].concat(Object(J["a"])(ee),Object(J["a"])(te))),ae=[{key:"admin",name:"admin",description:"Super Administrator. Have access to view all pages.",routes:ne},{key:"editor",name:"editor",description:"Normal Editor. Can see all pages except permission page",routes:ne.filter((function(e){return"/permission"!==e.path}))},{key:"visitor",name:"visitor",description:"Just a visitor. Can only see the home page and the document page",routes:[{path:"",redirect:"dashboard",children:[{path:"dashboard",name:"Dashboard",meta:{title:"dashboard",icon:"dashboard"}}]}]}],ie=[{url:"/routes",type:"get",response:function(e){return{code:2e4,data:ne}}},{url:"/roles",type:"get",response:function(e){return{code:2e4,data:ae}}},{url:"/role",type:"post",response:{code:2e4,data:{key:K.a.mock("@integer(300, 5000)")}}},{url:"/role/[A-Za-z0-9]",type:"put",response:{code:2e4,data:{status:"success"}}},{url:"/role/[A-Za-z0-9]",type:"delete",response:{code:2e4,data:{status:"success"}}}],oe=(n("7f7f"),[]),ce=100,se=0;se'});c.a.add(s);t["default"]=s},"5f87":function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return l}));var a=n("a78e"),i=n.n(a),o="Admin-Token";function c(){return i.a.get(o)}function s(e){return i.a.set(o,e)}function l(){return i.a.remove(o)}},"61f7":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n("6b54");function a(e){return/^(https?:|mailto:|tel:)/.test(e)}},"62ad":function(e,t,n){"use strict";n("c079")},"64df":function(e,t,n){"use strict";n("78bf")},6599:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-excel",use:"icon-excel-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"659b":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-battery-line",use:"icon-battery-line-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},6683:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-guide",use:"icon-guide-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"67a0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tenant_logo",use:"icon-tenant_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"69e4":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-project",use:"icon-project-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"6ba9":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-log3",use:"icon-log3-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"6e71":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-vessel3",use:"icon-vessel3-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"708a":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-star",use:"icon-star-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"720e":function(e,t,n){"use strict";n("bcdf")},7467:function(e,t,n){"use strict";n("b62e")},7509:function(e,t,n){"use strict";n.r(t);var a=n("75fc"),i=n("768b"),o=(n("ac6a"),n("2d63")),c=(n("7f7f"),n("6762"),n("2fdb"),{visitedViews:[],cachedViews:[]}),s={ADD_VISITED_VIEW:function(e,t){e.visitedViews.some((function(e){return e.path===t.path}))||e.visitedViews.push(Object.assign({},t,{title:t.meta.title||"no-name"}))},ADD_CACHED_VIEW:function(e,t){e.cachedViews.includes(t.name)||t.meta.noCache||e.cachedViews.push(t.name)},DEL_VISITED_VIEW:function(e,t){var n,a=Object(o["a"])(e.visitedViews.entries());try{for(a.s();!(n=a.n()).done;){var c=Object(i["a"])(n.value,2),s=c[0],l=c[1];if(l.path===t.path){e.visitedViews.splice(s,1);break}}}catch(r){a.e(r)}finally{a.f()}},DEL_CACHED_VIEW:function(e,t){var n,a=Object(o["a"])(e.cachedViews);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i===t.name){var c=e.cachedViews.indexOf(i);e.cachedViews.splice(c,1);break}}}catch(s){a.e(s)}finally{a.f()}},DEL_OTHERS_VISITED_VIEWS:function(e,t){e.visitedViews=e.visitedViews.filter((function(e){return e.meta.affix||e.path===t.path}))},DEL_OTHERS_CACHED_VIEWS:function(e,t){var n,a=Object(o["a"])(e.cachedViews);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i===t.name){var c=e.cachedViews.indexOf(i);e.cachedViews=e.cachedViews.slice(c,c+1);break}}}catch(s){a.e(s)}finally{a.f()}},DEL_ALL_VISITED_VIEWS:function(e){var t=e.visitedViews.filter((function(e){return e.meta.affix}));e.visitedViews=t},DEL_ALL_CACHED_VIEWS:function(e){e.cachedViews=[]},UPDATE_VISITED_VIEW:function(e,t){var n,a=Object(o["a"])(e.visitedViews);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i.path===t.path){i=Object.assign(i,t);break}}}catch(c){a.e(c)}finally{a.f()}}},l={addView:function(e,t){var n=e.dispatch;n("addVisitedView",t),n("addCachedView",t)},addVisitedView:function(e,t){var n=e.commit;n("ADD_VISITED_VIEW",t)},addCachedView:function(e,t){var n=e.commit;n("ADD_CACHED_VIEW",t)},delView:function(e,t){var n=e.dispatch,i=e.state;return new Promise((function(e){n("delVisitedView",t),n("delCachedView",t),e({visitedViews:Object(a["a"])(i.visitedViews),cachedViews:Object(a["a"])(i.cachedViews)})}))},delVisitedView:function(e,t){var n=e.commit,i=e.state;return new Promise((function(e){n("DEL_VISITED_VIEW",t),e(Object(a["a"])(i.visitedViews))}))},delCachedView:function(e,t){var n=e.commit,i=e.state;return new Promise((function(e){n("DEL_CACHED_VIEW",t),e(Object(a["a"])(i.cachedViews))}))},delOthersViews:function(e,t){var n=e.dispatch,i=e.state;return new Promise((function(e){n("delOthersVisitedViews",t),n("delOthersCachedViews",t),e({visitedViews:Object(a["a"])(i.visitedViews),cachedViews:Object(a["a"])(i.cachedViews)})}))},delOthersVisitedViews:function(e,t){var n=e.commit,i=e.state;return new Promise((function(e){n("DEL_OTHERS_VISITED_VIEWS",t),e(Object(a["a"])(i.visitedViews))}))},delOthersCachedViews:function(e,t){var n=e.commit,i=e.state;return new Promise((function(e){n("DEL_OTHERS_CACHED_VIEWS",t),e(Object(a["a"])(i.cachedViews))}))},delAllViews:function(e,t){var n=e.dispatch,i=e.state;return new Promise((function(e){n("delAllVisitedViews",t),n("delAllCachedViews",t),e({visitedViews:Object(a["a"])(i.visitedViews),cachedViews:Object(a["a"])(i.cachedViews)})}))},delAllVisitedViews:function(e){var t=e.commit,n=e.state;return new Promise((function(e){t("DEL_ALL_VISITED_VIEWS"),e(Object(a["a"])(n.visitedViews))}))},delAllCachedViews:function(e){var t=e.commit,n=e.state;return new Promise((function(e){t("DEL_ALL_CACHED_VIEWS"),e(Object(a["a"])(n.cachedViews))}))},updateVisitedView:function(e,t){var n=e.commit;n("UPDATE_VISITED_VIEW",t)}};t["default"]={namespaced:!0,state:c,mutations:s,actions:l}},7824:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-task-cfg",use:"icon-task-cfg-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"78bf":function(e,t,n){},"7bb0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-work",use:"icon-work-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"80da":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-wechat",use:"icon-wechat-usage",viewBox:"0 0 128 110",content:''});c.a.add(s);t["default"]=s},8326:function(e,t,n){},"83d6":function(e,t){e.exports={title:"Hippo4J Web",showSettings:!0,tagsView:!0,fixedHeader:!1,sidebarLogo:!0,errorLog:"production"}},8644:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-size",use:"icon-size-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},8811:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_logo4",use:"icon-item_logo4-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"89f5":function(e,t,n){"use strict";n("29aa")},"8aa6":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-zip",use:"icon-zip-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"8e8d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-search",use:"icon-search-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"8fb7":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tab",use:"icon-tab-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"90d2":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-task-tmp",use:"icon-task-tmp-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"90fb":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-documentation",use:"icon-documentation-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"93cd":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tree",use:"icon-tree-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},9448:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-fail",use:"icon-fail-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},9921:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-fullscreen",use:"icon-fullscreen-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"9bbf":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-drag",use:"icon-drag-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"9bc4":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-threadPool_logo2",use:"icon-threadPool_logo2-usage",viewBox:"0 0 1044 1024",content:''});c.a.add(s);t["default"]=s},"9d91":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-icon",use:"icon-icon-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},a14a:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-404",use:"icon-404-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},a18c:function(e,t,n){"use strict";var a,i,o=n("2b0e"),c=n("8c4f"),s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-wrapper",class:e.classObj},["mobile"===e.device&&e.sidebar.opened?n("div",{staticClass:"drawer-bg",on:{click:e.handleClickOutside}}):e._e(),e._v(" "),n("sidebar",{staticClass:"sidebar-container"}),e._v(" "),n("div",{staticClass:"main-container",class:{hasTagsView:e.needTagsView}},[n("div",{class:{"fixed-header":e.fixedHeader}},[n("navbar"),e._v(" "),e.needTagsView?n("tags-view"):e._e()],1),e._v(" "),n("app-main")],1)],1)},l=[],r=n("db72"),d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"app-main"},[n("transition",{attrs:{name:"fade-transform",mode:"out-in"}},[n("keep-alive",{attrs:{include:e.cachedViews}},[n("router-view",{key:e.key})],1)],1)],1)},h=[],u={name:"AppMain",computed:{cachedViews:function(){return this.$store.state.tagsView.cachedViews},key:function(){return this.$route.path}}},p=u,m=(n("bb12"),n("3749"),n("2877")),v=Object(m["a"])(p,d,h,!1,null,"92459f82",null),f=v.exports,w=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"navbar"},[a("hamburger",{staticClass:"hamburger-container",attrs:{id:"hamburger-container","is-active":e.sidebar.opened},on:{toggleClick:e.toggleSideBar}}),e._v(" "),a("breadcrumb",{staticClass:"breadcrumb-container",attrs:{id:"breadcrumb-container"}}),e._v(" "),a("div",{staticClass:"right-menu"},["mobile"!==e.device?void 0:e._e(),e._v(" "),a("el-dropdown",{staticClass:"avatar-container right-menu-item hover-effect",attrs:{trigger:"click"}},[a("div",{staticClass:"avatar-wrapper"},[a("img",{staticClass:"user-avatar",attrs:{src:n("f561")}}),e._v(" "),a("i",{staticClass:"el-icon-caret-bottom"})]),e._v(" "),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("router-link",{attrs:{to:"/"}},[a("el-dropdown-item",[e._v("Dashboard")])],1),e._v(" "),a("el-dropdown-item",{attrs:{divided:""}},[a("span",{staticStyle:{display:"block"},on:{click:e.logout}},[e._v("Log Out")])])],1)],1)],2)],1)},g=[],b=n("c80c"),x=(n("96cf"),n("3b8d")),y=n("2f62"),z=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-breadcrumb",{staticClass:"app-breadcrumb",attrs:{separator:"/"}},[n("transition-group",{attrs:{name:"breadcrumb"}},e._l(e.levelList,(function(t,a){return n("el-breadcrumb-item",{key:t.path},["noRedirect"===t.redirect||a==e.levelList.length-1?n("span",{staticClass:"no-redirect"},[e._v(e._s(t.meta.title))]):n("a",{on:{click:function(n){return n.preventDefault(),e.handleLink(t)}}},[e._v(e._s(t.meta.title))])])})),1)],1)},M=[],V=(n("7f7f"),n("f559"),n("bd11")),_=n.n(V),C={data:function(){return{levelList:null}},watch:{$route:function(e){e.path.startsWith("/redirect/")||this.getBreadcrumb()}},created:function(){this.getBreadcrumb()},methods:{getBreadcrumb:function(){var e=this.$route.matched.filter((function(e){return e.meta&&e.meta.title})),t=e[0];this.isDashboard(t)||(e=[{path:"/dashboard",meta:{title:"Dashboard"}}].concat(e)),this.levelList=e.filter((function(e){return e.meta&&e.meta.title&&!1!==e.meta.breadcrumb}))},isDashboard:function(e){var t=e&&e.name;return!!t&&t.trim().toLocaleLowerCase()==="Dashboard".toLocaleLowerCase()},pathCompile:function(e){var t=this.$route.params,n=_.a.compile(e);return n(t)},handleLink:function(e){var t=e.redirect,n=e.path;t?this.$router.push(t):this.$router.push(this.pathCompile(n))}}},k=C,H=(n("89f5"),Object(m["a"])(k,z,M,!1,null,"1919fc1a",null)),E=H.exports,L=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{padding:"0 15px"},on:{click:e.toggleClick}},[n("svg",{staticClass:"hamburger",class:{"is-active":e.isActive},attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"}},[n("path",{attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"}})])])},B=[],F={name:"Hamburger",props:{isActive:{type:Boolean,default:!1}},methods:{toggleClick:function(){this.$emit("toggleClick")}}},O=F,A=(n("d49d"),Object(m["a"])(O,L,B,!1,null,"49e15297",null)),D=A.exports,S=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.errorLogs.length>0?n("div",[n("el-badge",{staticStyle:{"line-height":"25px","margin-top":"-5px"},attrs:{"is-dot":!0},nativeOn:{click:function(t){e.dialogTableVisible=!0}}},[n("el-button",{staticStyle:{padding:"8px 10px"},attrs:{size:"small",type:"danger"}},[n("svg-icon",{attrs:{"icon-class":"bug"}})],1)],1),e._v(" "),n("el-dialog",{attrs:{visible:e.dialogTableVisible,width:"80%","append-to-body":""},on:{"update:visible":function(t){e.dialogTableVisible=t}}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("span",{staticStyle:{"padding-right":"10px"}},[e._v("Error Log")]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"primary",icon:"el-icon-delete"},on:{click:e.clearAll}},[e._v("Clear All")])],1),e._v(" "),n("el-table",{attrs:{data:e.errorLogs,border:""}},[n("el-table-column",{attrs:{label:"Message"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("div",[n("span",{staticClass:"message-title"},[e._v("Msg:")]),e._v(" "),n("el-tag",{attrs:{type:"danger"}},[e._v("\n "+e._s(a.err.message)+"\n ")])],1),e._v(" "),n("br"),e._v(" "),n("div",[n("span",{staticClass:"message-title",staticStyle:{"padding-right":"10px"}},[e._v("Info: ")]),e._v(" "),n("el-tag",{attrs:{type:"warning"}},[e._v("\n "+e._s(a.vm.$vnode.tag)+" error in "+e._s(a.info)+"\n ")])],1),e._v(" "),n("br"),e._v(" "),n("div",[n("span",{staticClass:"message-title",staticStyle:{"padding-right":"16px"}},[e._v("Url: ")]),e._v(" "),n("el-tag",{attrs:{type:"success"}},[e._v("\n "+e._s(a.url)+"\n ")])],1)]}}],null,!1,3621415002)}),e._v(" "),n("el-table-column",{attrs:{label:"Stack"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.err.stack)+"\n ")]}}],null,!1,1726869048)})],1)],1)],1):e._e()},T=[],j={name:"ErrorLog",data:function(){return{dialogTableVisible:!1}},computed:{errorLogs:function(){return this.$store.getters.errorLogs}},methods:{clearAll:function(){this.dialogTableVisible=!1,this.$store.dispatch("errorLog/clearErrorLog")}}},$=j,q=(n("b36c"),Object(m["a"])($,S,T,!1,null,"be34583a",null)),I=q.exports,P={components:{Breadcrumb:E,Hamburger:D,ErrorLog:I},computed:Object(r["a"])({},Object(y["b"])(["sidebar","avatar","device"])),methods:{toggleSideBar:function(){this.$store.dispatch("app/toggleSideBar")},logout:function(){var e=Object(x["a"])(Object(b["a"])().mark((function e(){return Object(b["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.$cookie.delete("userName"),e.next=3,this.$store.dispatch("user/logout");case 3:this.$router.push("/login?redirect=".concat(this.$route.fullPath));case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}},R=P,N=(n("07c6"),Object(m["a"])(R,w,g,!1,null,"6ab05616",null)),W=N.exports,G=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{"has-logo":e.showLogo}},[e.showLogo?n("logo",{attrs:{collapse:e.isCollapse}}):e._e(),e._v(" "),n("el-scrollbar",{attrs:{"wrap-class":"scrollbar-wrapper"}},[n("el-menu",{attrs:{"default-active":e.activeMenu,collapse:e.isCollapse,"background-color":e.variables.menuBg,"text-color":e.variables.menuText,"unique-opened":!1,"active-text-color":e.variables.menuActiveText,"collapse-transition":!1,mode:"vertical"}},e._l(e.permission_routes,(function(e){return n("sidebar-item",{key:e.path,attrs:{item:e,"base-path":e.path}})})),1)],1)],1)},U=[],J=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sidebar-logo-container",class:{collapse:e.collapse}},[n("transition",{attrs:{name:"sidebarLogoFade"}},[e.collapse?n("router-link",{key:"collapse",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title))])]):n("router-link",{key:"expand",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):e._e(),e._v(" "),n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title))])])],1)],1)},Z=[],K={name:"SidebarLogo",props:{collapse:{type:Boolean,required:!0}},data:function(){return{title:"hippo4j 1.4.1",logo:"https://images-machen.oss-cn-beijing.aliyuncs.com/20220808_hippo4j_logo.PNG"}}},Q=K,X=(n("720e"),Object(m["a"])(Q,J,Z,!1,null,"fe93dce6",null)),Y=X.exports,ee=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.item.hidden?e._e():n("div",{staticClass:"menu-wrapper"},[!e.hasOneShowingChild(e.item.children,e.item)||e.onlyOneChild.children&&!e.onlyOneChild.noShowingChildren||e.item.alwaysShow?n("el-submenu",{ref:"subMenu",attrs:{index:e.resolvePath(e.item.path),"popper-append-to-body":""}},[n("template",{slot:"title"},[e.item.meta?n("item",{attrs:{icon:e.item.meta&&e.item.meta.icon,title:e.item.meta.title}}):e._e()],1),e._v(" "),e._l(e.item.children,(function(t){return n("sidebar-item",{key:t.path,staticClass:"nest-menu",attrs:{"is-nest":!0,item:t,"base-path":e.resolvePath(t.path)}})}))],2):[e.onlyOneChild.meta?n("app-link",{attrs:{to:e.resolvePath(e.onlyOneChild.path)}},[n("el-menu-item",{class:{"submenu-title-noDropdown":!e.isNest},attrs:{index:e.resolvePath(e.onlyOneChild.path)}},[n("item",{attrs:{icon:e.onlyOneChild.meta.icon||e.item.meta&&e.item.meta.icon,title:e.onlyOneChild.meta.title}})],1)],1):e._e()]],2)},te=[],ne=n("df7c"),ae=n.n(ne),ie=n("61f7"),oe={name:"MenuItem",functional:!0,props:{icon:{type:String,default:""},title:{type:String,default:""}},render:function(e,t){var n=t.props,a=n.icon,i=n.title,o=[];return a&&o.push(e("svg-icon",{attrs:{"icon-class":a}})),i&&o.push(e("span",{slot:"title"},[i])),o}},ce=oe,se=Object(m["a"])(ce,a,i,!1,null,null,null),le=se.exports,re=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("component",e._b({},"component",e.linkProps(e.to),!1),[e._t("default")],2)},de=[],he={props:{to:{type:String,required:!0}},methods:{linkProps:function(e){return Object(ie["a"])(e)?{is:"a",href:e,target:"_blank",rel:"noopener"}:{is:"router-link",to:e}}}},ue=he,pe=Object(m["a"])(ue,re,de,!1,null,null,null),me=pe.exports,ve={computed:{device:function(){return this.$store.state.app.device}},mounted:function(){this.fixBugIniOS()},methods:{fixBugIniOS:function(){var e=this,t=this.$refs.subMenu;if(t){var n=t.handleMouseleave;t.handleMouseleave=function(t){"mobile"!==e.device&&n(t)}}}}},fe={name:"SidebarItem",components:{Item:le,AppLink:me},mixins:[ve],props:{item:{type:Object,required:!0},isNest:{type:Boolean,default:!1},basePath:{type:String,default:""}},data:function(){return this.onlyOneChild=null,{}},methods:{hasOneShowingChild:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,a=t.filter((function(t){return!t.hidden&&(e.onlyOneChild=t,!0)}));return 1===a.length||0===a.length&&(this.onlyOneChild=Object(r["a"])(Object(r["a"])({},n),{},{path:"",noShowingChildren:!0}),!0)},resolvePath:function(e){return Object(ie["a"])(e)?e:Object(ie["a"])(this.basePath)?this.basePath:ae.a.resolve(this.basePath,e)}}},we=fe,ge=Object(m["a"])(we,ee,te,!1,null,null,null),be=ge.exports,xe=n("cf1e"),ye=n.n(xe),ze={components:{SidebarItem:be,Logo:Y},computed:Object(r["a"])(Object(r["a"])({},Object(y["b"])(["permission_routes","sidebar"])),{},{activeMenu:function(){var e=this.$route,t=e.meta,n=e.path;return t.activeMenu?t.activeMenu:n},showLogo:function(){return this.$store.state.settings.sidebarLogo},variables:function(){return ye.a},isCollapse:function(){return!this.sidebar.opened}})},Me=ze,Ve=Object(m["a"])(Me,G,U,!1,null,null,null),_e=Ve.exports,Ce=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"tags-view-container",attrs:{id:"tags-view-container"}},[n("scroll-pane",{ref:"scrollPane",staticClass:"tags-view-wrapper"},e._l(e.visitedViews,(function(t){return n("router-link",{key:t.path,ref:"tag",refInFor:!0,staticClass:"tags-view-item",class:e.isActive(t)?"active":"",attrs:{to:{path:t.path,query:t.query,fullPath:t.fullPath},tag:"span"},nativeOn:{mouseup:function(n){return"button"in n&&1!==n.button?null:e.closeSelectedTag(t)},contextmenu:function(n){return n.preventDefault(),e.openMenu(t,n)}}},[e._v("\n "+e._s(t.title)+"\n "),t.meta.affix?e._e():n("span",{staticClass:"el-icon-close",on:{click:function(n){return n.preventDefault(),n.stopPropagation(),e.closeSelectedTag(t)}}})])})),1),e._v(" "),n("ul",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"contextmenu",style:{left:e.left+"px",top:e.top+"px"}},[n("li",{on:{click:function(t){return e.refreshSelectedTag(e.selectedTag)}}},[e._v("Refresh")]),e._v(" "),e.selectedTag.meta&&e.selectedTag.meta.affix?e._e():n("li",{on:{click:function(t){return e.closeSelectedTag(e.selectedTag)}}},[e._v("Close")]),e._v(" "),n("li",{on:{click:e.closeOthersTags}},[e._v("Close Others")]),e._v(" "),n("li",{on:{click:function(t){return e.closeAllTags(e.selectedTag)}}},[e._v("Close All")])])],1)},ke=[],He=(n("a481"),n("2d63")),Ee=n("75fc"),Le=(n("ac6a"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-scrollbar",{ref:"scrollContainer",staticClass:"scroll-container",attrs:{vertical:!1},nativeOn:{wheel:function(t){return t.preventDefault(),e.handleScroll(t)}}},[e._t("default")],2)}),Be=[],Fe=(n("20d6"),4),Oe={name:"ScrollPane",data:function(){return{left:0}},computed:{scrollWrapper:function(){return this.$refs.scrollContainer.$refs.wrap}},methods:{handleScroll:function(e){var t=e.wheelDelta||40*-e.deltaY,n=this.scrollWrapper;n.scrollLeft=n.scrollLeft+t/4},moveToTarget:function(e){var t=this.$refs.scrollContainer.$el,n=t.offsetWidth,a=this.scrollWrapper,i=this.$parent.$refs.tag,o=null,c=null;if(i.length>0&&(o=i[0],c=i[i.length-1]),o===e)a.scrollLeft=0;else if(c===e)a.scrollLeft=a.scrollWidth-n;else{var s=i.findIndex((function(t){return t===e})),l=i[s-1],r=i[s+1],d=r.$el.offsetLeft+r.$el.offsetWidth+Fe,h=l.$el.offsetLeft-Fe;d>a.scrollLeft+n?a.scrollLeft=d-n:h1&&void 0!==arguments[1]?arguments[1]:"/",a=[];return e.forEach((function(e){if(e.meta&&e.meta.affix){var i=ae.a.resolve(n,e.path);a.push({fullPath:i,path:i,name:e.name,meta:Object(r["a"])({},e.meta)})}if(e.children){var o=t.filterAffixTags(e.children,e.path);o.length>=1&&(a=[].concat(Object(Ee["a"])(a),Object(Ee["a"])(o)))}})),a},initTags:function(){var e,t=this.affixTags=this.filterAffixTags(this.routes),n=Object(He["a"])(t);try{for(n.s();!(e=n.n()).done;){var a=e.value;a.name&&this.$store.dispatch("tagsView/addVisitedView",a)}}catch(i){n.e(i)}finally{n.f()}},addTags:function(){var e=this.$route.name;return e&&this.$store.dispatch("tagsView/addView",this.$route),!1},moveToCurrentTag:function(){var e=this,t=this.$refs.tag;this.$nextTick((function(){var n,a=Object(He["a"])(t);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i.to.path===e.$route.path){e.$refs.scrollPane.moveToTarget(i),i.to.fullPath!==e.$route.fullPath&&e.$store.dispatch("tagsView/updateVisitedView",e.$route);break}}}catch(o){a.e(o)}finally{a.f()}}))},refreshSelectedTag:function(e){var t=this;this.$store.dispatch("tagsView/delCachedView",e).then((function(){var n=e.fullPath;t.$nextTick((function(){t.$router.replace({path:"/redirect"+n})}))}))},closeSelectedTag:function(e){var t=this;this.$store.dispatch("tagsView/delView",e).then((function(n){var a=n.visitedViews;t.isActive(e)&&t.toLastView(a,e)}))},closeOthersTags:function(){var e=this;this.$router.push(this.selectedTag),this.$store.dispatch("tagsView/delOthersViews",this.selectedTag).then((function(){e.moveToCurrentTag()}))},closeAllTags:function(e){var t=this;this.$store.dispatch("tagsView/delAllViews").then((function(n){var a=n.visitedViews;t.affixTags.some((function(t){return t.path===e.path}))||t.toLastView(a,e)}))},toLastView:function(e,t){var n=e.slice(-1)[0];n?this.$router.push(n):"Dashboard"===t.name?this.$router.replace({path:"/redirect"+t.fullPath}):this.$router.push("/")},openMenu:function(e,t){var n=105,a=this.$el.getBoundingClientRect().left,i=this.$el.offsetWidth,o=i-n,c=t.clientX-a+15;this.left=c>o?o:c,this.top=t.clientY,this.visible=!0,this.selectedTag=e},closeMenu:function(){this.visible=!1}}},je=Te,$e=(n("595c"),n("62ad"),Object(m["a"])(je,Ce,ke,!1,null,"c64b5a6c",null)),qe=$e.exports,Ie=n("4360"),Pe=document,Re=Pe.body,Ne=992,We={watch:{$route:function(e){"mobile"===this.device&&this.sidebar.opened&&Ie["a"].dispatch("app/closeSideBar",{withoutAnimation:!1})}},beforeMount:function(){window.addEventListener("resize",this.$_resizeHandler)},beforeDestroy:function(){window.removeEventListener("resize",this.$_resizeHandler)},mounted:function(){var e=this.$_isMobile();e&&(Ie["a"].dispatch("app/toggleDevice","mobile"),Ie["a"].dispatch("app/closeSideBar",{withoutAnimation:!0}))},methods:{$_isMobile:function(){var e=Re.getBoundingClientRect();return e.width-1'});c.a.add(s);t["default"]=s},a8cf:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-success",use:"icon-success-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},aa46:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-edit",use:"icon-edit-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},ab00:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-lock",use:"icon-lock-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},ac67:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_logo2",use:"icon-item_logo2-usage",viewBox:"0 0 1027 1024",content:''});c.a.add(s);t["default"]=s},ad1c:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-education",use:"icon-education-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},b20f:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409eff",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},b36c:function(e,t,n){"use strict";n("187a")},b3b5:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-user",use:"icon-user-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},b444:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_logo",use:"icon-item_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},b62e:function(e,t,n){},b6d1:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-threadPool_logo1",use:"icon-threadPool_logo1-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},b775:function(e,t,n){"use strict";var a=n("bc3a"),i=n.n(a),o=n("5c96"),c=n("4360"),s=n("5f87"),l=n("a18c"),r=i.a.create({baseURL:"",timeout:2e4});r.interceptors.request.use((function(e){return c["a"].getters.token&&(e.headers["Authorization"]=Object(s["a"])()),e}),(function(e){return console.log(e),Promise.reject(e)})),r.interceptors.response.use((function(e){var t=e.data;if("A000004"!==t.code){if("20000"!==t.code&&"0"!==t.code&&"200"!==t.code)return Object(o["Message"])({message:t.message||"Error",type:"error",duration:5e3}),"50008"!==t.code&&"50012"!==t.code&&"50014"!==t.code||o["MessageBox"].confirm("You have been logged out, you can cancel to stay on this page, or log in again","Confirm logout",{confirmButtonText:"Re-Login",cancelButtonText:"Cancel",type:"warning"}).then((function(){c["a"].dispatch("user/resetToken").then((function(){location.reload()}))})),Promise.reject(new Error(t.message||"Error"));var n=e.data,a=n.code;if("0"===a){var i=n.data;return i}return"200"===a?n:t}Object(s["b"])(),Object(l["d"])(),alert(t.message),document.location.href="index.html"}),(function(e){return console.log("err"+e),Object(o["Message"])({message:e.message,type:"error",duration:5e3}),Promise.reject(e)})),t["a"]=r},bb12:function(e,t,n){"use strict";n("2b97")},bc35:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-clipboard",use:"icon-clipboard-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},bcdf:function(e,t,n){},bddf:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_three",use:"icon-item_three-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},c079:function(e,t,n){},c309:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-exe-cfg",use:"icon-exe-cfg-usage",viewBox:"0 0 1529 1024",content:''});c.a.add(s);t["default"]=s},c653:function(e,t,n){var a={"./app.js":"d9cd","./errorLog.js":"4d49","./permission.js":"31c2","./settings.js":"0781","./tagsView.js":"7509","./user.js":"0f9a"};function i(e){var t=o(e);return n(t)}function o(e){var t=a[e];if(!(t+1)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return t}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id="c653"},c829:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-chart",use:"icon-chart-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},cbb7:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-email",use:"icon-email-usage",viewBox:"0 0 128 96",content:''});c.a.add(s);t["default"]=s},ce80:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-cfg-datasouce",use:"icon-cfg-datasouce-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},cf1e:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409eff",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},d056:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-people",use:"icon-people-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},d314:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_logo_1",use:"icon-item_logo_1-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},d49d:function(e,t,n){"use strict";n("8326")},d50e:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_two",use:"icon-item_two-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},d7ec:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-eye-open",use:"icon-eye-open-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},d9cd:function(e,t,n){"use strict";n.r(t);var a=n("a78e"),i=n.n(a),o={sidebar:{opened:!i.a.get("sidebarStatus")||!!+i.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop",size:i.a.get("size")||"medium"},c={TOGGLE_SIDEBAR:function(e){e.sidebar.opened=!e.sidebar.opened,e.sidebar.withoutAnimation=!1,e.sidebar.opened?i.a.set("sidebarStatus",1):i.a.set("sidebarStatus",0)},CLOSE_SIDEBAR:function(e,t){i.a.set("sidebarStatus",0),e.sidebar.opened=!1,e.sidebar.withoutAnimation=t},TOGGLE_DEVICE:function(e,t){e.device=t},SET_SIZE:function(e,t){e.size=t,i.a.set("size",t)}},s={toggleSideBar:function(e){var t=e.commit;t("TOGGLE_SIDEBAR")},closeSideBar:function(e,t){var n=e.commit,a=t.withoutAnimation;n("CLOSE_SIDEBAR",a)},toggleDevice:function(e,t){var n=e.commit;n("TOGGLE_DEVICE",t)},setSize:function(e,t){var n=e.commit;n("SET_SIZE",t)}};t["default"]={namespaced:!0,state:o,mutations:c,actions:s}},dbc7:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-exit-fullscreen",use:"icon-exit-fullscreen-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},dbd7:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-lessee",use:"icon-lessee-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},dcf8:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-nested",use:"icon-nested-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},e534:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-theme",use:"icon-theme-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},e7c8:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tree-table",use:"icon-tree-table-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},ea93:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-dashboard2",use:"icon-dashboard2-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},eb1b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-form",use:"icon-form-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},eb7b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-threadpool_logo",use:"icon-threadpool_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},ed08:function(e,t,n){"use strict";n.d(t,"e",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return l}));n("3b2b"),n("4917"),n("4f7f"),n("5df3"),n("1c4c"),n("28a5"),n("ac6a"),n("456d"),n("a481"),n("6b54");var a=n("7618");function i(e,t){if(0===arguments.length)return null;var n,i=t||"{y}-{m}-{d} {h}:{i}:{s}";"object"===Object(a["a"])(e)?n=e:("string"===typeof e&&/^[0-9]+$/.test(e)&&(e=parseInt(e)),"number"===typeof e&&10===e.toString().length&&(e*=1e3),n=new Date(e));var o={y:n.getFullYear(),m:n.getMonth()+1,d:n.getDate(),h:n.getHours(),i:n.getMinutes(),s:n.getSeconds(),a:n.getDay()},c=i.replace(/{(y|m|d|h|i|s|a)+}/g,(function(e,t){var n=o[t];return"a"===t?["日","一","二","三","四","五","六"][n]:(e.length>0&&n<10&&(n="0"+n),n||0)}));return c}function o(e,t){e=10===(""+e).length?1e3*parseInt(e):+e;var n=new Date(e),a=Date.now(),o=(a-n)/1e3;return o<30?"刚刚":o<3600?Math.ceil(o/60)+"分钟前":o<86400?Math.ceil(o/3600)+"小时前":o<172800?"1天前":t?i(e,t):n.getMonth()+1+"月"+n.getDate()+"日"+n.getHours()+"时"+n.getMinutes()+"分"}function c(e){var t=e.split("?")[1];return t?JSON.parse('{"'+decodeURIComponent(t).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"').replace(/\+/g," ")+'"}'):{}}function s(e,t,n){var a,i,o,c,s,l=function l(){var r=+new Date-c;r0?a=setTimeout(l,t-r):(a=null,n||(s=e.apply(o,i),a||(o=i=null)))};return function(){for(var i=arguments.length,r=new Array(i),d=0;d'});c.a.add(s);t["default"]=s},f561:function(e,t,n){e.exports=n.p+"static/img/hippo4j.ecba1844.gif"},f782:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-dashboard",use:"icon-dashboard-usage",viewBox:"0 0 128 100",content:''});c.a.add(s);t["default"]=s},f9a1:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-pdf",use:"icon-pdf-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},fea0:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-log",use:"icon-log-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s}},[[0,"runtime","chunk-elementUI","chunk-libs"]]]); \ No newline at end of file +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["app"],{0:function(e,t,n){e.exports=n("56d7")},"0334":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-batch-create",use:"icon-batch-create-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"034c":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tenant_two",use:"icon-tenant_two-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"0781":function(e,t,n){"use strict";n.r(t);var a=n("24ab"),i=n.n(a),o=n("83d6"),c=n.n(o),s=c.a.showSettings,l=c.a.tagsView,r=c.a.fixedHeader,d=c.a.sidebarLogo,h={theme:i.a.theme,showSettings:s,tagsView:l,fixedHeader:r,sidebarLogo:d},u={CHANGE_SETTING:function(e,t){var n=t.key,a=t.value;e.hasOwnProperty(n)&&(e[n]=a)}},p={changeSetting:function(e,t){var n=e.commit;n("CHANGE_SETTING",t)}};t["default"]={namespaced:!0,state:h,mutations:u,actions:p}},"07c6":function(e,t,n){"use strict";n("48c1")},"096e":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-skill",use:"icon-skill-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"0f9a":function(e,t,n){"use strict";n.r(t);var a=n("c80c"),i=(n("96cf"),n("3b8d")),o=n("b775");function c(e){return Object(o["a"])({url:"/hippo4j/v1/cs/auth/login",method:"post",data:e})}var s=n("5f87"),l=n("a18c"),r={token:Object(s["a"])(),name:"",avatar:"",introduction:"",roles:[]},d={SET_TOKEN:function(e,t){e.token=t},SET_INTRODUCTION:function(e,t){e.introduction=t},SET_NAME:function(e,t){e.name=t},SET_AVATAR:function(e,t){e.avatar=t},SET_ROLES:function(e,t){e.roles=t}},h={login:function(e,t){var n=e.commit,a=t.username,i=t.password;return new Promise((function(e,t){c({username:a.trim(),password:i,rememberMe:1}).then((function(t){var a=t.data,i=t.roles;n("SET_TOKEN",a),localStorage.setItem("roles",JSON.stringify(i)),Object(s["c"])(a),e()})).catch((function(e){alert("登录失败"),t(e)}))}))},getInfo:function(e){var t=e.commit;e.state;return new Promise((function(e,n){var a={};a.roles=JSON.parse(localStorage.getItem("roles")),t("SET_ROLES",a.roles),e(a)}))},logout:function(e){var t=e.commit;e.state;return new Promise((function(e){t("SET_TOKEN",""),t("SET_ROLES",[]),Object(s["b"])(),Object(l["d"])(),e()}))},resetToken:function(e){var t=e.commit;return new Promise((function(e){t("SET_TOKEN",""),t("SET_ROLES",[]),Object(s["b"])(),e()}))},changeRoles:function(e,t){var n=e.commit,o=e.dispatch;return new Promise(function(){var e=Object(i["a"])(Object(a["a"])().mark((function e(i){var c,r,d,h;return Object(a["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return c=t+"-token",n("SET_TOKEN",c),Object(s["c"])(c),e.next=5,o("getInfo");case 5:return r=e.sent,d=r.roles,Object(l["d"])(),e.next=10,o("permission/generateRoutes",d,{root:!0});case 10:h=e.sent,l["c"].addRoutes(h),o("tagsView/delAllViews",null,{root:!0}),i();case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}};t["default"]={namespaced:!0,state:r,mutations:d,actions:h}},"119b":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-other4",use:"icon-other4-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"12a5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-shopping",use:"icon-shopping-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},1424:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tenant_logo2",use:"icon-tenant_logo2-usage",viewBox:"0 0 1331 1024",content:''});c.a.add(s);t["default"]=s},1430:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-qq",use:"icon-qq-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"158d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item",use:"icon-item-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},1695:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-thread_pool_Instance",use:"icon-thread_pool_Instance-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},1779:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-bug",use:"icon-bug-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"187a":function(e,t,n){},"18f0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-link",use:"icon-link-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},1994:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-user-cfg",use:"icon-user-cfg-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"24ab":function(e,t,n){e.exports={theme:"#1890ff"}},2538:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-json",use:"icon-json-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},2580:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-language",use:"icon-language-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"273b":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-running",use:"icon-running-usage",viewBox:"0 0 1129 1024",content:''});c.a.add(s);t["default"]=s},"273d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-user6",use:"icon-user6-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"29aa":function(e,t,n){},"2a3d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-password",use:"icon-password-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"2b97":function(e,t,n){},"2f11":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-peoples",use:"icon-peoples-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},3046:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-money",use:"icon-money-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"30c3":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-example",use:"icon-example-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"31c2":function(e,t,n){"use strict";n.r(t),n.d(t,"filterAsyncRoutes",(function(){return c}));var a=n("db72"),i=(n("ac6a"),n("6762"),n("2fdb"),n("a18c"));function o(e,t){return!t.meta||!t.meta.roles||e.some((function(e){return t.meta.roles.includes(e)}))}function c(e,t){var n=[];return e.forEach((function(e){var i=Object(a["a"])({},e);o(t,i)&&(i.children&&(i.children=c(i.children,t)),n.push(i))})),n}var s={routes:[],addRoutes:[]},l={SET_ROUTES:function(e,t){e.addRoutes=t,e.routes=i["b"].concat(t)}},r={generateRoutes:function(e,t){var n=e.commit;return new Promise((function(e){var a;a=t.includes("ROLE_ADMIN")?i["a"]||[]:c(i["a"],t),n("SET_ROUTES",a),e(a)}))}};t["default"]={namespaced:!0,state:s,mutations:l,actions:r}},3289:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-list",use:"icon-list-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},3743:function(e,t,n){"use strict";n("5b1d")},3749:function(e,t,n){"use strict";n("3f7d")},"3da9":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-thread_logo",use:"icon-thread_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"3f7d":function(e,t,n){},4213:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-link3",use:"icon-link3-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"42e9":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-instance_logo",use:"icon-instance_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},4360:function(e,t,n){"use strict";n("a481"),n("ac6a");var a=n("2b0e"),i=n("2f62"),o=(n("7f7f"),{sidebar:function(e){return e.app.sidebar},size:function(e){return e.app.size},device:function(e){return e.app.device},visitedViews:function(e){return e.tagsView.visitedViews},cachedViews:function(e){return e.tagsView.cachedViews},token:function(e){return e.user.token},avatar:function(e){return e.user.avatar},name:function(e){return e.user.name},introduction:function(e){return e.user.introduction},roles:function(e){return e.user.roles},permission_routes:function(e){return e.permission.routes},errorLogs:function(e){return e.errorLog.logs}}),c=o;a["default"].use(i["a"]);var s=n("c653"),l=s.keys().reduce((function(e,t){var n=t.replace(/^\.\/(.*)\.\w+$/,"$1"),a=s(t);return e[n]=a.default,e}),{}),r=new i["a"].Store({modules:l,getters:c});t["a"]=r},"441c":function(e,t,n){},"47f1":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-table",use:"icon-table-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"47ff":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-message",use:"icon-message-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"48c1":function(e,t,n){},"4d49":function(e,t,n){"use strict";n.r(t);var a={logs:[]},i={ADD_ERROR_LOG:function(e,t){e.logs.push(t)},CLEAR_ERROR_LOG:function(e){e.logs.splice(0)}},o={addErrorLog:function(e,t){var n=e.commit;n("ADD_ERROR_LOG",t)},clearErrorLog:function(e){var t=e.commit;t("CLEAR_ERROR_LOG")}};t["default"]={namespaced:!0,state:a,mutations:i,actions:o}},"4df5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-eye",use:"icon-eye-usage",viewBox:"0 0 128 64",content:''});c.a.add(s);t["default"]=s},"51ff":function(e,t,n){var a={"./404.svg":"a14a","./batch-create.svg":"0334","./battery-line.svg":"659b","./bug.svg":"1779","./cfg-datasouce.svg":"ce80","./chart.svg":"c829","./clipboard.svg":"bc35","./component.svg":"56d6","./dashboard.svg":"f782","./dashboard2.svg":"ea93","./documentation.svg":"90fb","./drag.svg":"9bbf","./edit.svg":"aa46","./education.svg":"ad1c","./email.svg":"cbb7","./example.svg":"30c3","./excel.svg":"6599","./exe-cfg.svg":"c309","./exit-fullscreen.svg":"dbc7","./eye-open.svg":"d7ec","./eye.svg":"4df5","./fail.svg":"9448","./form.svg":"eb1b","./fullscreen.svg":"9921","./guide.svg":"6683","./icon.svg":"9d91","./instance_logo.svg":"42e9","./item.svg":"158d","./item4.svg":"f385","./item_logo.svg":"b444","./item_logo2.svg":"ac67","./item_logo3.svg":"5f29","./item_logo4.svg":"8811","./item_logo_1.svg":"d314","./item_three.svg":"bddf","./item_two.svg":"d50e","./json.svg":"2538","./language.svg":"2580","./lessee.svg":"dbd7","./link.svg":"18f0","./link3.svg":"4213","./list.svg":"3289","./lock.svg":"ab00","./log.svg":"fea0","./log3.svg":"6ba9","./message.svg":"47ff","./money.svg":"3046","./nested.svg":"dcf8","./notify.svg":"5448","./other4.svg":"119b","./password.svg":"2a3d","./pdf.svg":"f9a1","./people.svg":"d056","./peoples.svg":"2f11","./pool3.svg":"a551","./project.svg":"69e4","./qq.svg":"1430","./running.svg":"273b","./search.svg":"8e8d","./shopping.svg":"12a5","./size.svg":"8644","./skill.svg":"096e","./star.svg":"708a","./success.svg":"a8cf","./tab.svg":"8fb7","./table.svg":"47f1","./task-cfg.svg":"7824","./task-tmp.svg":"90d2","./tenant_logo.svg":"67a0","./tenant_logo2.svg":"1424","./tenant_two.svg":"034c","./theme.svg":"e534","./threadPool_logo1.svg":"b6d1","./threadPool_logo2.svg":"9bc4","./thread_logo.svg":"3da9","./thread_pool_Instance.svg":"1695","./threadpool_logo.svg":"eb7b","./tree-table.svg":"e7c8","./tree.svg":"93cd","./user-cfg.svg":"1994","./user.svg":"b3b5","./user6.svg":"273d","./vessel3.svg":"6e71","./wechat.svg":"80da","./work.svg":"7bb0","./zip.svg":"8aa6"};function i(e){var t=o(e);return n(t)}function o(e){var t=a[e];if(!(t+1)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return t}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id="51ff"},5448:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-notify",use:"icon-notify-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"56d6":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-component",use:"icon-component-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"56d7":function(e,t,n){"use strict";n.r(t);var a={};n.r(a),n.d(a,"parseTime",(function(){return j["e"]})),n.d(a,"formatTime",(function(){return j["c"]})),n.d(a,"timeAgo",(function(){return q})),n.d(a,"numberFormatter",(function(){return I})),n.d(a,"toThousandFilter",(function(){return P})),n.d(a,"uppercaseFirst",(function(){return R}));n("456d"),n("ac6a"),n("cadf"),n("551c"),n("f751"),n("097d");var i=n("2b0e"),o=n("a78e"),c=n.n(o),s=(n("f5df"),n("5c96")),l=n.n(s),r=(n("24ab"),n("b20f"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("router-view")],1)}),d=[],h={name:"App"},u=h,p=n("2877"),m=Object(p["a"])(u,r,d,!1,null,null,null),v=m.exports,f=n("4360"),w=n("a18c"),g=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isExternal?n("div",e._g({staticClass:"svg-external-icon svg-icon",style:e.styleExternalIcon},e.$listeners)):n("svg",e._g({class:e.svgClass,attrs:{"aria-hidden":"true"}},e.$listeners),[n("use",{attrs:{"xlink:href":e.iconName}})])},b=[],x=n("61f7"),y={name:"SvgIcon",props:{iconClass:{type:String,required:!0},className:{type:String,default:""}},computed:{isExternal:function(){return Object(x["a"])(this.iconClass)},iconName:function(){return"#icon-".concat(this.iconClass)},svgClass:function(){return this.className?"svg-icon "+this.className:"svg-icon"},styleExternalIcon:function(){return{mask:"url(".concat(this.iconClass,") no-repeat 50% 50%"),"-webkit-mask":"url(".concat(this.iconClass,") no-repeat 50% 50%")}}}},z=y,M=(n("64df"),Object(p["a"])(z,g,b,!1,null,"f9f7fefc",null)),V=M.exports;i["default"].component("svg-icon",V);var _=n("51ff"),C=function(e){return e.keys().map(e)};C(_);var k=n("c80c"),H=n("db72"),E=(n("96cf"),n("3b8d")),L=n("323e"),B=n.n(L),F=(n("a5d8"),n("5f87")),O=n("83d6"),A=n.n(O),D=A.a.title||"Vue Element Admin";function S(e){return e?"".concat(e," - ").concat(D):"".concat(D)}B.a.configure({showSpinner:!1});var T=["/login","/auth-redirect"];w["c"].beforeEach(function(){var e=Object(E["a"])(Object(k["a"])().mark((function e(t,n,a){var i,o,c,l,r;return Object(k["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(B.a.start(),document.title=S(t.meta.title),i=Object(F["a"])(),!i){e.next=35;break}if("/login"!==t.path){e.next=9;break}a({path:"/"}),B.a.done(),e.next=33;break;case 9:if(o=f["a"].getters.roles&&f["a"].getters.roles.length>0,!o){e.next=14;break}a(),e.next=33;break;case 14:return e.prev=14,e.next=17,f["a"].dispatch("user/getInfo");case 17:return c=e.sent,l=c.roles,e.next=21,f["a"].dispatch("permission/generateRoutes",l);case 21:r=e.sent,w["c"].addRoutes(r),a(Object(H["a"])(Object(H["a"])({},t),{},{replace:!0})),e.next=33;break;case 26:return e.prev=26,e.t0=e["catch"](14),e.next=30,f["a"].dispatch("user/resetToken");case 30:s["Message"].error(e.t0||"Has Error"),a("/login?redirect=".concat(t.path)),B.a.done();case 33:e.next=36;break;case 35:-1!==T.indexOf(t.path)?a():(a("/login?redirect=".concat(t.path)),B.a.done());case 36:case"end":return e.stop()}}),e,null,[[14,26]])})));return function(t,n,a){return e.apply(this,arguments)}}()),w["c"].afterEach((function(){B.a.done()}));n("6b54"),n("a481"),n("c5f6");var j=n("ed08");function $(e,t){return 1===e?e+t:e+t+"s"}function q(e){var t=Date.now()/1e3-Number(e);return t<3600?$(~~(t/60)," minute"):t<86400?$(~~(t/3600)," hour"):$(~~(t/86400)," day")}function I(e,t){for(var n=[{value:1e18,symbol:"E"},{value:1e15,symbol:"P"},{value:1e12,symbol:"T"},{value:1e9,symbol:"G"},{value:1e6,symbol:"M"},{value:1e3,symbol:"k"}],a=0;a=n[a].value)return(e/n[a].value+.1).toFixed(t).replace(/\.0+$|(\.[0-9]*[1-9])0+$/,"$1")+n[a].symbol;return e.toString()}function P(e){return(+e||0).toString().replace(/^-?\d+/g,(function(e){return e.replace(/(?=(?!\b)(\d{3})+$)/g,",")}))}function R(e){return e.charAt(0).toUpperCase()+e.slice(1)}for(var N=n("313e"),W=n("00e7"),G=n.n(W),U=(n("3b2b"),n("2d63")),J=n("75fc"),Z=n("96eb"),K=n.n(Z),Q={admin:{token:"admin-token"},editor:{token:"editor-token"}},X={"admin-token":{roles:["admin"],introduction:"I am a super administrator",avatar:"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",name:"Super Admin"},"editor-token":{roles:["editor"],introduction:"I am an editor",avatar:"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",name:"Normal Editor"}},Y=[{url:"/user/login",type:"post",response:function(e){var t=e.body.username,n=Q[t];return n?{code:"20000",data:n}:{code:"60204",message:"Account and password are incorrect."}}},{url:"/user/info.*",type:"get",response:function(e){var t=e.query.token,n=X[t];return n?{code:"20000",data:n}:{code:"50008",message:"Login failed, unable to get user details."}}},{url:"/user/logout",type:"post",response:function(e){return{code:"20000",data:"success"}}}],ee=[{path:"/redirect",component:"layout/Layout",hidden:!0,children:[{path:"/redirect/:path*",component:"views/redirect/index"}]},{path:"/login",component:"views/login/index",hidden:!0},{path:"/auth-redirect",component:"views/login/auth-redirect",hidden:!0},{path:"/404",component:"views/error-page/404",hidden:!0},{path:"/401",component:"views/error-page/401",hidden:!0},{path:"",component:"layout/Layout",redirect:"dashboard",children:[{path:"dashboard",component:"views/dashboard/index",name:"Dashboard",meta:{title:"Dashboard",icon:"dashboard",affix:!0}}]},{path:"/documentation",component:"layout/Layout",children:[{path:"index",component:"views/documentation/index",name:"Documentation",meta:{title:"Documentation",icon:"documentation",affix:!0}}]},{path:"/guide",component:"layout/Layout",redirect:"/guide/index",children:[{path:"index",component:"views/guide/index",name:"Guide",meta:{title:"Guide",icon:"guide",noCache:!0}}]}],te=[{path:"/permission",component:"layout/Layout",redirect:"/permission/index",alwaysShow:!0,meta:{title:"Permission",icon:"lock",roles:["admin","editor"]},children:[{path:"page",component:"views/permission/page",name:"PagePermission",meta:{title:"Page Permission11111",roles:["admin"]}},{path:"directive",component:"views/permission/directive",name:"DirectivePermission",meta:{title:"Directive Permission"}},{path:"role",component:"views/permission/role",name:"RolePermission",meta:{title:"Role Permission",roles:["admin"]}}]},{path:"/icon",component:"layout/Layout",children:[{path:"index",component:"views/icons/index",name:"Icons",meta:{title:"Icons",icon:"icon",noCache:!0}}]},{path:"/components",component:"layout/Layout",redirect:"noRedirect",name:"ComponentDemo",meta:{title:"Components",icon:"component"},children:[{path:"tinymce",component:"views/components-demo/tinymce",name:"TinymceDemo",meta:{title:"Tinymce"}},{path:"markdown",component:"views/components-demo/markdown",name:"MarkdownDemo",meta:{title:"Markdown"}},{path:"json-editor",component:"views/components-demo/json-editor",name:"JsonEditorDemo",meta:{title:"Json Editor"}},{path:"split-pane",component:"views/components-demo/split-pane",name:"SplitpaneDemo",meta:{title:"SplitPane"}},{path:"avatar-upload",component:"views/components-demo/avatar-upload",name:"AvatarUploadDemo",meta:{title:"Avatar Upload"}},{path:"dropzone",component:"views/components-demo/dropzone",name:"DropzoneDemo",meta:{title:"Dropzone"}},{path:"sticky",component:"views/components-demo/sticky",name:"StickyDemo",meta:{title:"Sticky"}},{path:"count-to",component:"views/components-demo/count-to",name:"CountToDemo",meta:{title:"Count To"}},{path:"mixin",component:"views/components-demo/mixin",name:"ComponentMixinDemo",meta:{title:"componentMixin"}},{path:"back-to-top",component:"views/components-demo/back-to-top",name:"BackToTopDemo",meta:{title:"Back To Top"}},{path:"drag-dialog",component:"views/components-demo/drag-dialog",name:"DragDialogDemo",meta:{title:"Drag Dialog"}},{path:"drag-select",component:"views/components-demo/drag-select",name:"DragSelectDemo",meta:{title:"Drag Select"}},{path:"dnd-list",component:"views/components-demo/dnd-list",name:"DndListDemo",meta:{title:"Dnd List"}},{path:"drag-kanban",component:"views/components-demo/drag-kanban",name:"DragKanbanDemo",meta:{title:"Drag Kanban"}}]},{path:"/charts",component:"layout/Layout",redirect:"noRedirect",name:"Charts",meta:{title:"Charts",icon:"chart"},children:[{path:"keyboard",component:"views/charts/keyboard",name:"KeyboardChart",meta:{title:"Keyboard Chart",noCache:!0}},{path:"line",component:"views/charts/line",name:"LineChart",meta:{title:"Line Chart",noCache:!0}},{path:"mixchart",component:"views/charts/mixChart",name:"MixChart",meta:{title:"Mix Chart",noCache:!0}}]},{path:"/nested",component:"layout/Layout",redirect:"/nested/menu1/menu1-1",name:"Nested",meta:{title:"Nested",icon:"nested"},children:[{path:"menu1",component:"views/nested/menu1/index",name:"Menu1",meta:{title:"Menu1"},redirect:"/nested/menu1/menu1-1",children:[{path:"menu1-1",component:"views/nested/menu1/menu1-1",name:"Menu1-1",meta:{title:"Menu1-1"}},{path:"menu1-2",component:"views/nested/menu1/menu1-2",name:"Menu1-2",redirect:"/nested/menu1/menu1-2/menu1-2-1",meta:{title:"Menu1-2"},children:[{path:"menu1-2-1",component:"views/nested/menu1/menu1-2/menu1-2-1",name:"Menu1-2-1",meta:{title:"Menu1-2-1"}},{path:"menu1-2-2",component:"views/nested/menu1/menu1-2/menu1-2-2",name:"Menu1-2-2",meta:{title:"Menu1-2-2"}}]},{path:"menu1-3",component:"views/nested/menu1/menu1-3",name:"Menu1-3",meta:{title:"Menu1-3"}}]},{path:"menu2",name:"Menu2",component:"views/nested/menu2/index",meta:{title:"Menu2"}}]},{path:"/example",component:"layout/Layout",redirect:"/example/list",name:"Example",meta:{title:"Example",icon:"example"},children:[{path:"create",component:"views/example/create",name:"CreateArticle",meta:{title:"Create Article",icon:"edit"}},{path:"edit/:id(\\d+)",component:"views/example/edit",name:"EditArticle",meta:{title:"Edit Article",noCache:!0},hidden:!0},{path:"list",component:"views/example/list",name:"ArticleList",meta:{title:"Article List",icon:"list"}}]},{path:"/tab",component:"layout/Layout",children:[{path:"index",component:"views/tab/index",name:"Tab",meta:{title:"Tab",icon:"tab"}}]},{path:"/error",component:"layout/Layout",redirect:"noRedirect",name:"ErrorPages",meta:{title:"Error Pages",icon:"404"},children:[{path:"401",component:"views/error-page/401",name:"Page401",meta:{title:"Page 401",noCache:!0}},{path:"404",component:"views/error-page/404",name:"Page404",meta:{title:"Page 404",noCache:!0}}]},{path:"/error-log",component:"layout/Layout",redirect:"noRedirect",children:[{path:"log",component:"views/error-log/index",name:"ErrorLog",meta:{title:"Error Log",icon:"bug"}}]},{path:"/excel",component:"layout/Layout",redirect:"/excel/export-excel",name:"Excel",meta:{title:"Excel",icon:"excel"},children:[{path:"export-excel",component:"views/excel/export-excel",name:"ExportExcel",meta:{title:"Export Excel"}},{path:"export-selected-excel",component:"views/excel/select-excel",name:"SelectExcel",meta:{title:"Select Excel"}},{path:"export-merge-header",component:"views/excel/merge-header",name:"MergeHeader",meta:{title:"Merge Header"}},{path:"upload-excel",component:"views/excel/upload-excel",name:"UploadExcel",meta:{title:"Upload Excel"}}]},{path:"/zip",component:"layout/Layout",redirect:"/zip/download",alwaysShow:!0,meta:{title:"Zip",icon:"zip"},children:[{path:"download",component:"views/zip/index",name:"ExportZip",meta:{title:"Export Zip"}}]},{path:"/pdf",component:"layout/Layout",redirect:"/pdf/index",children:[{path:"index",component:"views/pdf/index",name:"PDF",meta:{title:"PDF",icon:"pdf"}}]},{path:"/pdf/download",component:"views/pdf/download",hidden:!0},{path:"/theme",component:"layout/Layout",redirect:"noRedirect",children:[{path:"index",component:"views/theme/index",name:"Theme",meta:{title:"Theme",icon:"theme"}}]},{path:"/clipboard",component:"layout/Layout",redirect:"noRedirect",children:[{path:"index",component:"views/clipboard/index",name:"ClipboardDemo",meta:{title:"Clipboard Demo",icon:"clipboard"}}]},{path:"/i18n",component:"layout/Layout",children:[{path:"index",component:"views/i18n-demo/index",name:"I18n",meta:{title:"I18n",icon:"international"}}]},{path:"external-link",component:"layout/Layout",children:[{path:"https://github.com/PanJiaChen/vue-element-admin",meta:{title:"External Link",icon:"link"}}]},{path:"*",redirect:"/404",hidden:!0}],ne=Object(j["b"])([].concat(Object(J["a"])(ee),Object(J["a"])(te))),ae=[{key:"admin",name:"admin",description:"Super Administrator. Have access to view all pages.",routes:ne},{key:"editor",name:"editor",description:"Normal Editor. Can see all pages except permission page",routes:ne.filter((function(e){return"/permission"!==e.path}))},{key:"visitor",name:"visitor",description:"Just a visitor. Can only see the home page and the document page",routes:[{path:"",redirect:"dashboard",children:[{path:"dashboard",name:"Dashboard",meta:{title:"dashboard",icon:"dashboard"}}]}]}],ie=[{url:"/routes",type:"get",response:function(e){return{code:2e4,data:ne}}},{url:"/roles",type:"get",response:function(e){return{code:2e4,data:ae}}},{url:"/role",type:"post",response:{code:2e4,data:{key:K.a.mock("@integer(300, 5000)")}}},{url:"/role/[A-Za-z0-9]",type:"put",response:{code:2e4,data:{status:"success"}}},{url:"/role/[A-Za-z0-9]",type:"delete",response:{code:2e4,data:{status:"success"}}}],oe=(n("7f7f"),[]),ce=100,se=0;se'});c.a.add(s);t["default"]=s},"5f87":function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return l}));var a=n("a78e"),i=n.n(a),o="Admin-Token";function c(){return i.a.get(o)}function s(e){return i.a.set(o,e)}function l(){return i.a.remove(o)}},"61f7":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n("6b54");function a(e){return/^(https?:|mailto:|tel:)/.test(e)}},"62ad":function(e,t,n){"use strict";n("c079")},"64df":function(e,t,n){"use strict";n("78bf")},6599:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-excel",use:"icon-excel-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"659b":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-battery-line",use:"icon-battery-line-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},6683:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-guide",use:"icon-guide-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"67a0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tenant_logo",use:"icon-tenant_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"69e4":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-project",use:"icon-project-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"6ba9":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-log3",use:"icon-log3-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"6e71":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-vessel3",use:"icon-vessel3-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"708a":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-star",use:"icon-star-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"720e":function(e,t,n){"use strict";n("bcdf")},7467:function(e,t,n){"use strict";n("b62e")},7509:function(e,t,n){"use strict";n.r(t);var a=n("75fc"),i=n("768b"),o=(n("ac6a"),n("2d63")),c=(n("7f7f"),n("6762"),n("2fdb"),{visitedViews:[],cachedViews:[]}),s={ADD_VISITED_VIEW:function(e,t){e.visitedViews.some((function(e){return e.path===t.path}))||e.visitedViews.push(Object.assign({},t,{title:t.meta.title||"no-name"}))},ADD_CACHED_VIEW:function(e,t){e.cachedViews.includes(t.name)||t.meta.noCache||e.cachedViews.push(t.name)},DEL_VISITED_VIEW:function(e,t){var n,a=Object(o["a"])(e.visitedViews.entries());try{for(a.s();!(n=a.n()).done;){var c=Object(i["a"])(n.value,2),s=c[0],l=c[1];if(l.path===t.path){e.visitedViews.splice(s,1);break}}}catch(r){a.e(r)}finally{a.f()}},DEL_CACHED_VIEW:function(e,t){var n,a=Object(o["a"])(e.cachedViews);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i===t.name){var c=e.cachedViews.indexOf(i);e.cachedViews.splice(c,1);break}}}catch(s){a.e(s)}finally{a.f()}},DEL_OTHERS_VISITED_VIEWS:function(e,t){e.visitedViews=e.visitedViews.filter((function(e){return e.meta.affix||e.path===t.path}))},DEL_OTHERS_CACHED_VIEWS:function(e,t){var n,a=Object(o["a"])(e.cachedViews);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i===t.name){var c=e.cachedViews.indexOf(i);e.cachedViews=e.cachedViews.slice(c,c+1);break}}}catch(s){a.e(s)}finally{a.f()}},DEL_ALL_VISITED_VIEWS:function(e){var t=e.visitedViews.filter((function(e){return e.meta.affix}));e.visitedViews=t},DEL_ALL_CACHED_VIEWS:function(e){e.cachedViews=[]},UPDATE_VISITED_VIEW:function(e,t){var n,a=Object(o["a"])(e.visitedViews);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i.path===t.path){i=Object.assign(i,t);break}}}catch(c){a.e(c)}finally{a.f()}}},l={addView:function(e,t){var n=e.dispatch;n("addVisitedView",t),n("addCachedView",t)},addVisitedView:function(e,t){var n=e.commit;n("ADD_VISITED_VIEW",t)},addCachedView:function(e,t){var n=e.commit;n("ADD_CACHED_VIEW",t)},delView:function(e,t){var n=e.dispatch,i=e.state;return new Promise((function(e){n("delVisitedView",t),n("delCachedView",t),e({visitedViews:Object(a["a"])(i.visitedViews),cachedViews:Object(a["a"])(i.cachedViews)})}))},delVisitedView:function(e,t){var n=e.commit,i=e.state;return new Promise((function(e){n("DEL_VISITED_VIEW",t),e(Object(a["a"])(i.visitedViews))}))},delCachedView:function(e,t){var n=e.commit,i=e.state;return new Promise((function(e){n("DEL_CACHED_VIEW",t),e(Object(a["a"])(i.cachedViews))}))},delOthersViews:function(e,t){var n=e.dispatch,i=e.state;return new Promise((function(e){n("delOthersVisitedViews",t),n("delOthersCachedViews",t),e({visitedViews:Object(a["a"])(i.visitedViews),cachedViews:Object(a["a"])(i.cachedViews)})}))},delOthersVisitedViews:function(e,t){var n=e.commit,i=e.state;return new Promise((function(e){n("DEL_OTHERS_VISITED_VIEWS",t),e(Object(a["a"])(i.visitedViews))}))},delOthersCachedViews:function(e,t){var n=e.commit,i=e.state;return new Promise((function(e){n("DEL_OTHERS_CACHED_VIEWS",t),e(Object(a["a"])(i.cachedViews))}))},delAllViews:function(e,t){var n=e.dispatch,i=e.state;return new Promise((function(e){n("delAllVisitedViews",t),n("delAllCachedViews",t),e({visitedViews:Object(a["a"])(i.visitedViews),cachedViews:Object(a["a"])(i.cachedViews)})}))},delAllVisitedViews:function(e){var t=e.commit,n=e.state;return new Promise((function(e){t("DEL_ALL_VISITED_VIEWS"),e(Object(a["a"])(n.visitedViews))}))},delAllCachedViews:function(e){var t=e.commit,n=e.state;return new Promise((function(e){t("DEL_ALL_CACHED_VIEWS"),e(Object(a["a"])(n.cachedViews))}))},updateVisitedView:function(e,t){var n=e.commit;n("UPDATE_VISITED_VIEW",t)}};t["default"]={namespaced:!0,state:c,mutations:s,actions:l}},7824:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-task-cfg",use:"icon-task-cfg-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"78bf":function(e,t,n){},"7bb0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-work",use:"icon-work-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"80da":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-wechat",use:"icon-wechat-usage",viewBox:"0 0 128 110",content:''});c.a.add(s);t["default"]=s},8326:function(e,t,n){},"83d6":function(e,t){e.exports={title:"Hippo4J Web",showSettings:!0,tagsView:!0,fixedHeader:!1,sidebarLogo:!0,errorLog:"production"}},8644:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-size",use:"icon-size-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},8811:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_logo4",use:"icon-item_logo4-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"89f5":function(e,t,n){"use strict";n("29aa")},"8aa6":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-zip",use:"icon-zip-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"8e8d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-search",use:"icon-search-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"8fb7":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tab",use:"icon-tab-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"90d2":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-task-tmp",use:"icon-task-tmp-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},"90fb":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-documentation",use:"icon-documentation-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"93cd":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tree",use:"icon-tree-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},9448:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-fail",use:"icon-fail-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},9921:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-fullscreen",use:"icon-fullscreen-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"9bbf":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-drag",use:"icon-drag-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},"9bc4":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-threadPool_logo2",use:"icon-threadPool_logo2-usage",viewBox:"0 0 1044 1024",content:''});c.a.add(s);t["default"]=s},"9d91":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-icon",use:"icon-icon-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},a14a:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-404",use:"icon-404-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},a18c:function(e,t,n){"use strict";var a,i,o=n("2b0e"),c=n("8c4f"),s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-wrapper",class:e.classObj},["mobile"===e.device&&e.sidebar.opened?n("div",{staticClass:"drawer-bg",on:{click:e.handleClickOutside}}):e._e(),e._v(" "),n("sidebar",{staticClass:"sidebar-container"}),e._v(" "),n("div",{staticClass:"main-container",class:{hasTagsView:e.needTagsView}},[n("div",{class:{"fixed-header":e.fixedHeader}},[n("navbar"),e._v(" "),e.needTagsView?n("tags-view"):e._e()],1),e._v(" "),n("app-main")],1)],1)},l=[],r=n("db72"),d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"app-main"},[n("transition",{attrs:{name:"fade-transform",mode:"out-in"}},[n("keep-alive",{attrs:{include:e.cachedViews}},[n("router-view",{key:e.key})],1)],1)],1)},h=[],u={name:"AppMain",computed:{cachedViews:function(){return this.$store.state.tagsView.cachedViews},key:function(){return this.$route.path}}},p=u,m=(n("bb12"),n("3749"),n("2877")),v=Object(m["a"])(p,d,h,!1,null,"92459f82",null),f=v.exports,w=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"navbar"},[a("hamburger",{staticClass:"hamburger-container",attrs:{id:"hamburger-container","is-active":e.sidebar.opened},on:{toggleClick:e.toggleSideBar}}),e._v(" "),a("breadcrumb",{staticClass:"breadcrumb-container",attrs:{id:"breadcrumb-container"}}),e._v(" "),a("div",{staticClass:"right-menu"},["mobile"!==e.device?void 0:e._e(),e._v(" "),a("el-dropdown",{staticClass:"avatar-container right-menu-item hover-effect",attrs:{trigger:"click"}},[a("div",{staticClass:"avatar-wrapper"},[a("img",{staticClass:"user-avatar",attrs:{src:n("f561")}}),e._v(" "),a("i",{staticClass:"el-icon-caret-bottom"})]),e._v(" "),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("router-link",{attrs:{to:"/"}},[a("el-dropdown-item",[e._v("Dashboard")])],1),e._v(" "),a("el-dropdown-item",{attrs:{divided:""}},[a("span",{staticStyle:{display:"block"},on:{click:e.logout}},[e._v("Log Out")])])],1)],1)],2)],1)},g=[],b=n("c80c"),x=(n("96cf"),n("3b8d")),y=n("2f62"),z=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-breadcrumb",{staticClass:"app-breadcrumb",attrs:{separator:"/"}},[n("transition-group",{attrs:{name:"breadcrumb"}},e._l(e.levelList,(function(t,a){return n("el-breadcrumb-item",{key:t.path},["noRedirect"===t.redirect||a==e.levelList.length-1?n("span",{staticClass:"no-redirect"},[e._v(e._s(t.meta.title))]):n("a",{on:{click:function(n){return n.preventDefault(),e.handleLink(t)}}},[e._v(e._s(t.meta.title))])])})),1)],1)},M=[],V=(n("7f7f"),n("f559"),n("bd11")),_=n.n(V),C={data:function(){return{levelList:null}},watch:{$route:function(e){e.path.startsWith("/redirect/")||this.getBreadcrumb()}},created:function(){this.getBreadcrumb()},methods:{getBreadcrumb:function(){var e=this.$route.matched.filter((function(e){return e.meta&&e.meta.title})),t=e[0];this.isDashboard(t)||(e=[{path:"/dashboard",meta:{title:"Dashboard"}}].concat(e)),this.levelList=e.filter((function(e){return e.meta&&e.meta.title&&!1!==e.meta.breadcrumb}))},isDashboard:function(e){var t=e&&e.name;return!!t&&t.trim().toLocaleLowerCase()==="Dashboard".toLocaleLowerCase()},pathCompile:function(e){var t=this.$route.params,n=_.a.compile(e);return n(t)},handleLink:function(e){var t=e.redirect,n=e.path;t?this.$router.push(t):this.$router.push(this.pathCompile(n))}}},k=C,H=(n("89f5"),Object(m["a"])(k,z,M,!1,null,"1919fc1a",null)),E=H.exports,L=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{padding:"0 15px"},on:{click:e.toggleClick}},[n("svg",{staticClass:"hamburger",class:{"is-active":e.isActive},attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"}},[n("path",{attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"}})])])},B=[],F={name:"Hamburger",props:{isActive:{type:Boolean,default:!1}},methods:{toggleClick:function(){this.$emit("toggleClick")}}},O=F,A=(n("d49d"),Object(m["a"])(O,L,B,!1,null,"49e15297",null)),D=A.exports,S=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.errorLogs.length>0?n("div",[n("el-badge",{staticStyle:{"line-height":"25px","margin-top":"-5px"},attrs:{"is-dot":!0},nativeOn:{click:function(t){e.dialogTableVisible=!0}}},[n("el-button",{staticStyle:{padding:"8px 10px"},attrs:{size:"small",type:"danger"}},[n("svg-icon",{attrs:{"icon-class":"bug"}})],1)],1),e._v(" "),n("el-dialog",{attrs:{visible:e.dialogTableVisible,width:"80%","append-to-body":""},on:{"update:visible":function(t){e.dialogTableVisible=t}}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("span",{staticStyle:{"padding-right":"10px"}},[e._v("Error Log")]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"primary",icon:"el-icon-delete"},on:{click:e.clearAll}},[e._v("Clear All")])],1),e._v(" "),n("el-table",{attrs:{data:e.errorLogs,border:""}},[n("el-table-column",{attrs:{label:"Message"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("div",[n("span",{staticClass:"message-title"},[e._v("Msg:")]),e._v(" "),n("el-tag",{attrs:{type:"danger"}},[e._v("\n "+e._s(a.err.message)+"\n ")])],1),e._v(" "),n("br"),e._v(" "),n("div",[n("span",{staticClass:"message-title",staticStyle:{"padding-right":"10px"}},[e._v("Info: ")]),e._v(" "),n("el-tag",{attrs:{type:"warning"}},[e._v("\n "+e._s(a.vm.$vnode.tag)+" error in "+e._s(a.info)+"\n ")])],1),e._v(" "),n("br"),e._v(" "),n("div",[n("span",{staticClass:"message-title",staticStyle:{"padding-right":"16px"}},[e._v("Url: ")]),e._v(" "),n("el-tag",{attrs:{type:"success"}},[e._v("\n "+e._s(a.url)+"\n ")])],1)]}}],null,!1,3621415002)}),e._v(" "),n("el-table-column",{attrs:{label:"Stack"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.err.stack)+"\n ")]}}],null,!1,1726869048)})],1)],1)],1):e._e()},T=[],j={name:"ErrorLog",data:function(){return{dialogTableVisible:!1}},computed:{errorLogs:function(){return this.$store.getters.errorLogs}},methods:{clearAll:function(){this.dialogTableVisible=!1,this.$store.dispatch("errorLog/clearErrorLog")}}},$=j,q=(n("b36c"),Object(m["a"])($,S,T,!1,null,"be34583a",null)),I=q.exports,P={components:{Breadcrumb:E,Hamburger:D,ErrorLog:I},computed:Object(r["a"])({},Object(y["b"])(["sidebar","avatar","device"])),methods:{toggleSideBar:function(){this.$store.dispatch("app/toggleSideBar")},logout:function(){var e=Object(x["a"])(Object(b["a"])().mark((function e(){return Object(b["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.$cookie.delete("userName"),e.next=3,this.$store.dispatch("user/logout");case 3:this.$router.push("/login?redirect=".concat(this.$route.fullPath));case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}},R=P,N=(n("07c6"),Object(m["a"])(R,w,g,!1,null,"6ab05616",null)),W=N.exports,G=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{"has-logo":e.showLogo}},[e.showLogo?n("logo",{attrs:{collapse:e.isCollapse}}):e._e(),e._v(" "),n("el-scrollbar",{attrs:{"wrap-class":"scrollbar-wrapper"}},[n("el-menu",{attrs:{"default-active":e.activeMenu,collapse:e.isCollapse,"background-color":e.variables.menuBg,"text-color":e.variables.menuText,"unique-opened":!1,"active-text-color":e.variables.menuActiveText,"collapse-transition":!1,mode:"vertical"}},e._l(e.permission_routes,(function(e){return n("sidebar-item",{key:e.path,attrs:{item:e,"base-path":e.path}})})),1)],1)],1)},U=[],J=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sidebar-logo-container",class:{collapse:e.collapse}},[n("transition",{attrs:{name:"sidebarLogoFade"}},[e.collapse?n("router-link",{key:"collapse",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title))])]):n("router-link",{key:"expand",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):e._e(),e._v(" "),n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title))])])],1)],1)},Z=[],K={name:"SidebarLogo",props:{collapse:{type:Boolean,required:!0}},data:function(){return{title:"hippo4j 1.4.1",logo:"https://images-machen.oss-cn-beijing.aliyuncs.com/20220808_hippo4j_logo.PNG"}}},Q=K,X=(n("720e"),Object(m["a"])(Q,J,Z,!1,null,"fe93dce6",null)),Y=X.exports,ee=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.item.hidden?e._e():n("div",{staticClass:"menu-wrapper"},[!e.hasOneShowingChild(e.item.children,e.item)||e.onlyOneChild.children&&!e.onlyOneChild.noShowingChildren||e.item.alwaysShow?n("el-submenu",{ref:"subMenu",attrs:{index:e.resolvePath(e.item.path),"popper-append-to-body":""}},[n("template",{slot:"title"},[e.item.meta?n("item",{attrs:{icon:e.item.meta&&e.item.meta.icon,title:e.item.meta.title}}):e._e()],1),e._v(" "),e._l(e.item.children,(function(t){return n("sidebar-item",{key:t.path,staticClass:"nest-menu",attrs:{"is-nest":!0,item:t,"base-path":e.resolvePath(t.path)}})}))],2):[e.onlyOneChild.meta?n("app-link",{attrs:{to:e.resolvePath(e.onlyOneChild.path)}},[n("el-menu-item",{class:{"submenu-title-noDropdown":!e.isNest},attrs:{index:e.resolvePath(e.onlyOneChild.path)}},[n("item",{attrs:{icon:e.onlyOneChild.meta.icon||e.item.meta&&e.item.meta.icon,title:e.onlyOneChild.meta.title}})],1)],1):e._e()]],2)},te=[],ne=n("df7c"),ae=n.n(ne),ie=n("61f7"),oe={name:"MenuItem",functional:!0,props:{icon:{type:String,default:""},title:{type:String,default:""}},render:function(e,t){var n=t.props,a=n.icon,i=n.title,o=[];return a&&o.push(e("svg-icon",{attrs:{"icon-class":a}})),i&&o.push(e("span",{slot:"title"},[i])),o}},ce=oe,se=Object(m["a"])(ce,a,i,!1,null,null,null),le=se.exports,re=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("component",e._b({},"component",e.linkProps(e.to),!1),[e._t("default")],2)},de=[],he={props:{to:{type:String,required:!0}},methods:{linkProps:function(e){return Object(ie["a"])(e)?{is:"a",href:e,target:"_blank",rel:"noopener"}:{is:"router-link",to:e}}}},ue=he,pe=Object(m["a"])(ue,re,de,!1,null,null,null),me=pe.exports,ve={computed:{device:function(){return this.$store.state.app.device}},mounted:function(){this.fixBugIniOS()},methods:{fixBugIniOS:function(){var e=this,t=this.$refs.subMenu;if(t){var n=t.handleMouseleave;t.handleMouseleave=function(t){"mobile"!==e.device&&n(t)}}}}},fe={name:"SidebarItem",components:{Item:le,AppLink:me},mixins:[ve],props:{item:{type:Object,required:!0},isNest:{type:Boolean,default:!1},basePath:{type:String,default:""}},data:function(){return this.onlyOneChild=null,{}},methods:{hasOneShowingChild:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,a=t.filter((function(t){return!t.hidden&&(e.onlyOneChild=t,!0)}));return 1===a.length||0===a.length&&(this.onlyOneChild=Object(r["a"])(Object(r["a"])({},n),{},{path:"",noShowingChildren:!0}),!0)},resolvePath:function(e){return Object(ie["a"])(e)?e:Object(ie["a"])(this.basePath)?this.basePath:ae.a.resolve(this.basePath,e)}}},we=fe,ge=Object(m["a"])(we,ee,te,!1,null,null,null),be=ge.exports,xe=n("cf1e"),ye=n.n(xe),ze={components:{SidebarItem:be,Logo:Y},computed:Object(r["a"])(Object(r["a"])({},Object(y["b"])(["permission_routes","sidebar"])),{},{activeMenu:function(){var e=this.$route,t=e.meta,n=e.path;return t.activeMenu?t.activeMenu:n},showLogo:function(){return this.$store.state.settings.sidebarLogo},variables:function(){return ye.a},isCollapse:function(){return!this.sidebar.opened}})},Me=ze,Ve=Object(m["a"])(Me,G,U,!1,null,null,null),_e=Ve.exports,Ce=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"tags-view-container",attrs:{id:"tags-view-container"}},[n("scroll-pane",{ref:"scrollPane",staticClass:"tags-view-wrapper"},e._l(e.visitedViews,(function(t){return n("router-link",{key:t.path,ref:"tag",refInFor:!0,staticClass:"tags-view-item",class:e.isActive(t)?"active":"",attrs:{to:{path:t.path,query:t.query,fullPath:t.fullPath},tag:"span"},nativeOn:{mouseup:function(n){return"button"in n&&1!==n.button?null:e.closeSelectedTag(t)},contextmenu:function(n){return n.preventDefault(),e.openMenu(t,n)}}},[e._v("\n "+e._s(t.title)+"\n "),t.meta.affix?e._e():n("span",{staticClass:"el-icon-close",on:{click:function(n){return n.preventDefault(),n.stopPropagation(),e.closeSelectedTag(t)}}})])})),1),e._v(" "),n("ul",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"contextmenu",style:{left:e.left+"px",top:e.top+"px"}},[n("li",{on:{click:function(t){return e.refreshSelectedTag(e.selectedTag)}}},[e._v("Refresh")]),e._v(" "),e.selectedTag.meta&&e.selectedTag.meta.affix?e._e():n("li",{on:{click:function(t){return e.closeSelectedTag(e.selectedTag)}}},[e._v("Close")]),e._v(" "),n("li",{on:{click:e.closeOthersTags}},[e._v("Close Others")]),e._v(" "),n("li",{on:{click:function(t){return e.closeAllTags(e.selectedTag)}}},[e._v("Close All")])])],1)},ke=[],He=(n("a481"),n("2d63")),Ee=n("75fc"),Le=(n("ac6a"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-scrollbar",{ref:"scrollContainer",staticClass:"scroll-container",attrs:{vertical:!1},nativeOn:{wheel:function(t){return t.preventDefault(),e.handleScroll(t)}}},[e._t("default")],2)}),Be=[],Fe=(n("20d6"),4),Oe={name:"ScrollPane",data:function(){return{left:0}},computed:{scrollWrapper:function(){return this.$refs.scrollContainer.$refs.wrap}},methods:{handleScroll:function(e){var t=e.wheelDelta||40*-e.deltaY,n=this.scrollWrapper;n.scrollLeft=n.scrollLeft+t/4},moveToTarget:function(e){var t=this.$refs.scrollContainer.$el,n=t.offsetWidth,a=this.scrollWrapper,i=this.$parent.$refs.tag,o=null,c=null;if(i.length>0&&(o=i[0],c=i[i.length-1]),o===e)a.scrollLeft=0;else if(c===e)a.scrollLeft=a.scrollWidth-n;else{var s=i.findIndex((function(t){return t===e})),l=i[s-1],r=i[s+1],d=r.$el.offsetLeft+r.$el.offsetWidth+Fe,h=l.$el.offsetLeft-Fe;d>a.scrollLeft+n?a.scrollLeft=d-n:h1&&void 0!==arguments[1]?arguments[1]:"/",a=[];return e.forEach((function(e){if(e.meta&&e.meta.affix){var i=ae.a.resolve(n,e.path);a.push({fullPath:i,path:i,name:e.name,meta:Object(r["a"])({},e.meta)})}if(e.children){var o=t.filterAffixTags(e.children,e.path);o.length>=1&&(a=[].concat(Object(Ee["a"])(a),Object(Ee["a"])(o)))}})),a},initTags:function(){var e,t=this.affixTags=this.filterAffixTags(this.routes),n=Object(He["a"])(t);try{for(n.s();!(e=n.n()).done;){var a=e.value;a.name&&this.$store.dispatch("tagsView/addVisitedView",a)}}catch(i){n.e(i)}finally{n.f()}},addTags:function(){var e=this.$route.name;return e&&this.$store.dispatch("tagsView/addView",this.$route),!1},moveToCurrentTag:function(){var e=this,t=this.$refs.tag;this.$nextTick((function(){var n,a=Object(He["a"])(t);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i.to.path===e.$route.path){e.$refs.scrollPane.moveToTarget(i),i.to.fullPath!==e.$route.fullPath&&e.$store.dispatch("tagsView/updateVisitedView",e.$route);break}}}catch(o){a.e(o)}finally{a.f()}}))},refreshSelectedTag:function(e){var t=this;this.$store.dispatch("tagsView/delCachedView",e).then((function(){var n=e.fullPath;t.$nextTick((function(){t.$router.replace({path:"/redirect"+n})}))}))},closeSelectedTag:function(e){var t=this;this.$store.dispatch("tagsView/delView",e).then((function(n){var a=n.visitedViews;t.isActive(e)&&t.toLastView(a,e)}))},closeOthersTags:function(){var e=this;this.$router.push(this.selectedTag),this.$store.dispatch("tagsView/delOthersViews",this.selectedTag).then((function(){e.moveToCurrentTag()}))},closeAllTags:function(e){var t=this;this.$store.dispatch("tagsView/delAllViews").then((function(n){var a=n.visitedViews;t.affixTags.some((function(t){return t.path===e.path}))||t.toLastView(a,e)}))},toLastView:function(e,t){var n=e.slice(-1)[0];n?this.$router.push(n):"Dashboard"===t.name?this.$router.replace({path:"/redirect"+t.fullPath}):this.$router.push("/")},openMenu:function(e,t){var n=105,a=this.$el.getBoundingClientRect().left,i=this.$el.offsetWidth,o=i-n,c=t.clientX-a+15;this.left=c>o?o:c,this.top=t.clientY,this.visible=!0,this.selectedTag=e},closeMenu:function(){this.visible=!1}}},je=Te,$e=(n("595c"),n("62ad"),Object(m["a"])(je,Ce,ke,!1,null,"c64b5a6c",null)),qe=$e.exports,Ie=n("4360"),Pe=document,Re=Pe.body,Ne=992,We={watch:{$route:function(e){"mobile"===this.device&&this.sidebar.opened&&Ie["a"].dispatch("app/closeSideBar",{withoutAnimation:!1})}},beforeMount:function(){window.addEventListener("resize",this.$_resizeHandler)},beforeDestroy:function(){window.removeEventListener("resize",this.$_resizeHandler)},mounted:function(){var e=this.$_isMobile();e&&(Ie["a"].dispatch("app/toggleDevice","mobile"),Ie["a"].dispatch("app/closeSideBar",{withoutAnimation:!0}))},methods:{$_isMobile:function(){var e=Re.getBoundingClientRect();return e.width-1'});c.a.add(s);t["default"]=s},a8cf:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-success",use:"icon-success-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},aa46:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-edit",use:"icon-edit-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},ab00:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-lock",use:"icon-lock-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},ac67:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_logo2",use:"icon-item_logo2-usage",viewBox:"0 0 1027 1024",content:''});c.a.add(s);t["default"]=s},ad1c:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-education",use:"icon-education-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},b20f:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409eff",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},b36c:function(e,t,n){"use strict";n("187a")},b3b5:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-user",use:"icon-user-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},b444:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_logo",use:"icon-item_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},b62e:function(e,t,n){},b6d1:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-threadPool_logo1",use:"icon-threadPool_logo1-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},b775:function(e,t,n){"use strict";var a=n("bc3a"),i=n.n(a),o=n("5c96"),c=n("4360"),s=n("5f87"),l=n("a18c"),r=i.a.create({baseURL:"",timeout:2e4});r.interceptors.request.use((function(e){return c["a"].getters.token&&(e.headers["Authorization"]=Object(s["a"])()),e}),(function(e){return console.log(e),Promise.reject(e)})),r.interceptors.response.use((function(e){var t=e.data;if("A000004"!==t.code){if("20000"!==t.code&&"0"!==t.code&&"200"!==t.code)return Object(o["Message"])({message:t.message||"Error",type:"error",duration:5e3}),"50008"!==t.code&&"50012"!==t.code&&"50014"!==t.code||o["MessageBox"].confirm("You have been logged out, you can cancel to stay on this page, or log in again","Confirm logout",{confirmButtonText:"Re-Login",cancelButtonText:"Cancel",type:"warning"}).then((function(){c["a"].dispatch("user/resetToken").then((function(){location.reload()}))})),Promise.reject(new Error(t.message||"Error"));var n=e.data,a=n.code;if("0"===a){var i=n.data;return i}return"200"===a?n:t}Object(s["b"])(),Object(l["d"])(),alert(t.message),document.location.href="index.html"}),(function(e){return console.log("err"+e),Object(o["Message"])({message:e.message,type:"error",duration:5e3}),Promise.reject(e)})),t["a"]=r},bb12:function(e,t,n){"use strict";n("2b97")},bc35:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-clipboard",use:"icon-clipboard-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},bcdf:function(e,t,n){},bddf:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_three",use:"icon-item_three-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},c079:function(e,t,n){},c309:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-exe-cfg",use:"icon-exe-cfg-usage",viewBox:"0 0 1529 1024",content:''});c.a.add(s);t["default"]=s},c653:function(e,t,n){var a={"./app.js":"d9cd","./errorLog.js":"4d49","./permission.js":"31c2","./settings.js":"0781","./tagsView.js":"7509","./user.js":"0f9a"};function i(e){var t=o(e);return n(t)}function o(e){var t=a[e];if(!(t+1)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return t}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id="c653"},c829:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-chart",use:"icon-chart-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},cbb7:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-email",use:"icon-email-usage",viewBox:"0 0 128 96",content:''});c.a.add(s);t["default"]=s},ce80:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-cfg-datasouce",use:"icon-cfg-datasouce-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},cf1e:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409eff",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},d056:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-people",use:"icon-people-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},d314:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_logo_1",use:"icon-item_logo_1-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},d49d:function(e,t,n){"use strict";n("8326")},d50e:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-item_two",use:"icon-item_two-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},d7ec:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-eye-open",use:"icon-eye-open-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},d9cd:function(e,t,n){"use strict";n.r(t);var a=n("a78e"),i=n.n(a),o={sidebar:{opened:!i.a.get("sidebarStatus")||!!+i.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop",size:i.a.get("size")||"medium"},c={TOGGLE_SIDEBAR:function(e){e.sidebar.opened=!e.sidebar.opened,e.sidebar.withoutAnimation=!1,e.sidebar.opened?i.a.set("sidebarStatus",1):i.a.set("sidebarStatus",0)},CLOSE_SIDEBAR:function(e,t){i.a.set("sidebarStatus",0),e.sidebar.opened=!1,e.sidebar.withoutAnimation=t},TOGGLE_DEVICE:function(e,t){e.device=t},SET_SIZE:function(e,t){e.size=t,i.a.set("size",t)}},s={toggleSideBar:function(e){var t=e.commit;t("TOGGLE_SIDEBAR")},closeSideBar:function(e,t){var n=e.commit,a=t.withoutAnimation;n("CLOSE_SIDEBAR",a)},toggleDevice:function(e,t){var n=e.commit;n("TOGGLE_DEVICE",t)},setSize:function(e,t){var n=e.commit;n("SET_SIZE",t)}};t["default"]={namespaced:!0,state:o,mutations:c,actions:s}},dbc7:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-exit-fullscreen",use:"icon-exit-fullscreen-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},dbd7:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-lessee",use:"icon-lessee-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},dcf8:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-nested",use:"icon-nested-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},e534:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-theme",use:"icon-theme-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},e7c8:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-tree-table",use:"icon-tree-table-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},ea93:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-dashboard2",use:"icon-dashboard2-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},eb1b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-form",use:"icon-form-usage",viewBox:"0 0 128 128",content:''});c.a.add(s);t["default"]=s},eb7b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-threadpool_logo",use:"icon-threadpool_logo-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},ed08:function(e,t,n){"use strict";n.d(t,"e",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return l}));n("3b2b"),n("4917"),n("4f7f"),n("5df3"),n("1c4c"),n("28a5"),n("ac6a"),n("456d"),n("a481"),n("6b54");var a=n("7618");function i(e,t){if(0===arguments.length)return null;var n,i=t||"{y}-{m}-{d} {h}:{i}:{s}";"object"===Object(a["a"])(e)?n=e:("string"===typeof e&&/^[0-9]+$/.test(e)&&(e=parseInt(e)),"number"===typeof e&&10===e.toString().length&&(e*=1e3),n=new Date(e));var o={y:n.getFullYear(),m:n.getMonth()+1,d:n.getDate(),h:n.getHours(),i:n.getMinutes(),s:n.getSeconds(),a:n.getDay()},c=i.replace(/{(y|m|d|h|i|s|a)+}/g,(function(e,t){var n=o[t];return"a"===t?["日","一","二","三","四","五","六"][n]:(e.length>0&&n<10&&(n="0"+n),n||0)}));return c}function o(e,t){e=10===(""+e).length?1e3*parseInt(e):+e;var n=new Date(e),a=Date.now(),o=(a-n)/1e3;return o<30?"刚刚":o<3600?Math.ceil(o/60)+"分钟前":o<86400?Math.ceil(o/3600)+"小时前":o<172800?"1天前":t?i(e,t):n.getMonth()+1+"月"+n.getDate()+"日"+n.getHours()+"时"+n.getMinutes()+"分"}function c(e){var t=e.split("?")[1];return t?JSON.parse('{"'+decodeURIComponent(t).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"').replace(/\+/g," ")+'"}'):{}}function s(e,t,n){var a,i,o,c,s,l=function l(){var r=+new Date-c;r0?a=setTimeout(l,t-r):(a=null,n||(s=e.apply(o,i),a||(o=i=null)))};return function(){for(var i=arguments.length,r=new Array(i),d=0;d'});c.a.add(s);t["default"]=s},f561:function(e,t,n){e.exports=n.p+"static/img/hippo4j.ecba1844.gif"},f782:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-dashboard",use:"icon-dashboard-usage",viewBox:"0 0 128 100",content:''});c.a.add(s);t["default"]=s},f9a1:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-pdf",use:"icon-pdf-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s},fea0:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),c=n.n(o),s=new i.a({id:"icon-log",use:"icon-log-usage",viewBox:"0 0 1024 1024",content:''});c.a.add(s);t["default"]=s}},[[0,"runtime","chunk-elementUI","chunk-libs"]]]); \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/js/chunk-02e8e2bd.48523c0f.js b/hippo4j-console/src/main/resources/static/static/js/chunk-02e8e2bd.48523c0f.js deleted file mode 100644 index 7307ac93..00000000 --- a/hippo4j-console/src/main/resources/static/static/js/chunk-02e8e2bd.48523c0f.js +++ /dev/null @@ -1 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-02e8e2bd"],{"04ca":function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"dashboard-editor-container"},[i("div",{staticClass:"filter-container"},[i("el-select",{staticClass:"filter-item",staticStyle:{width:"220px"},attrs:{placeholder:"租户(必填)",filterable:""},on:{change:function(e){return t.tenantSelectList()}},model:{value:t.listQuery.tenantId,callback:function(e){t.$set(t.listQuery,"tenantId",e)},expression:"listQuery.tenantId"}},t._l(t.tenantOptions,(function(t){return i("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})})),1),t._v(" "),i("el-select",{staticClass:"filter-item",staticStyle:{width:"220px"},attrs:{placeholder:"项目(必填)",filterable:""},on:{change:function(e){return t.itemSelectList()}},model:{value:t.listQuery.itemId,callback:function(e){t.$set(t.listQuery,"itemId",e)},expression:"listQuery.itemId"}},t._l(t.itemOptions,(function(t){return i("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})})),1),t._v(" "),i("el-select",{staticClass:"filter-item",staticStyle:{width:"220px"},attrs:{placeholder:"线程池(必填)",filterable:""},on:{change:function(e){return t.threadPoolSelectList()}},model:{value:t.listQuery.tpId,callback:function(e){t.$set(t.listQuery,"tpId",e)},expression:"listQuery.tpId"}},t._l(t.threadPoolOptions,(function(t){return i("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})})),1),t._v(" "),i("el-select",{staticClass:"filter-item",staticStyle:{width:"220px"},attrs:{placeholder:"IP : Port(必填)",filterable:""},model:{value:t.listQuery.identify,callback:function(e){t.$set(t.listQuery,"identify",e)},expression:"listQuery.identify"}},t._l(t.identifyOptions,(function(t){return i("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})})),1),t._v(" "),i("el-button",{directives:[{name:"waves",rawName:"v-waves"}],staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.fetchData}},[t._v("\n 搜索\n ")]),t._v(" "),i("el-button",{directives:[{name:"waves",rawName:"v-waves"}],staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-refresh"},on:{click:t.refreshData}},[t._v("\n 重置\n ")])],1),t._v(" "),t.temp.coreSize?i("section",[i("el-card",{attrs:{shadow:"hover"}},[i("el-descriptions",{attrs:{column:3,border:""}},[i("el-descriptions-item",{attrs:{label:"实例 ID"}},[t._v(t._s(t.listQuery.identify))]),t._v(" "),i("el-descriptions-item",{attrs:{label:"是否报警"}},[t._v("\n "+t._s(t._f("alarmFilter")(t.temp.isAlarm))+"\n ")]),t._v(" "),i("el-descriptions-item",{attrs:{label:"已完成任务数"}},[t._v(t._s(t.lastTaskCount))]),t._v(" "),i("el-descriptions-item",{attrs:{label:"核心线程超时"}},[t._v("\n "+t._s(t._f("allowCoreThreadTimeOutFilter")(t.temp.allowCoreThreadTimeOut))+"\n ")]),t._v(" "),i("el-descriptions-item",{attrs:{label:"核心线程"}},[t._v(t._s(t.temp.coreSize))]),t._v(" "),i("el-descriptions-item",{attrs:{label:"最大线程"}},[t._v(t._s(t.temp.maxSize))]),t._v(" "),i("el-descriptions-item",{attrs:{label:"队列类型"}},[t._v("\n "+t._s(t._f("queueFilter")(t.temp.queueType))+"\n ")]),t._v(" "),i("el-descriptions-item",{attrs:{label:"队列容量"}},[t._v(t._s(t.temp.capacity))]),t._v(" "),i("el-descriptions-item",{attrs:{label:"拒绝策略"}},[t._v("\n "+t._s(t._f("rejectedFilter")(t.temp.rejectedType))+"\n ")])],1)],1),t._v(" "),i("el-row",{staticStyle:{"margin-top":"16px"},attrs:{gutter:10}},[i("el-col",{attrs:{span:8}},[i("el-card",{attrs:{shadow:"hover"}},[i("line-chart",{attrs:{"chart-data":t.lineChartData1,times:t.times}})],1)],1),t._v(" "),i("el-col",{attrs:{span:8}},[i("el-card",{attrs:{shadow:"hover"}},[i("line-chart",{attrs:{"chart-data":t.lineChartData2,times:t.times}})],1)],1),t._v(" "),i("el-col",{attrs:{span:8}},[i("el-card",{attrs:{shadow:"hover"}},[i("line-chart",{attrs:{"chart-data":t.lineChartData5,times:t.times}})],1)],1)],1),t._v(" "),i("el-row",{staticStyle:{"margin-top":"16px"},attrs:{gutter:10}},[i("el-col",{attrs:{span:8}},[i("el-card",{attrs:{shadow:"hover"}},[i("line-chart",{attrs:{"chart-data":t.lineChartData3,times:t.times}})],1)],1),t._v(" "),i("el-col",{attrs:{span:8}},[i("el-card",{attrs:{shadow:"hover"}},[i("line-chart",{attrs:{"chart-data":t.lineChartData4,times:t.times}})],1)],1),t._v(" "),i("el-col",{attrs:{span:8}},[i("el-card",{attrs:{shadow:"hover"}},[i("line-chart",{attrs:{"chart-data":t.lineChartData6,times:t.times}})],1)],1)],1)],1):i("el-empty",{attrs:{description:"暂无结果"}})],1)},a=[],r=i("c80c"),s=(i("96cf"),i("3b8d")),o=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:t.className,style:{height:t.height,width:t.width}})},l=[],c=(i("7f7f"),i("ed08")),d={data:function(){return{$_sidebarElm:null}},mounted:function(){this.$_initResizeEvent(),this.$_initSidebarResizeEvent()},beforeDestroy:function(){this.$_destroyResizeEvent(),this.$_destroySidebarResizeEvent()},activated:function(){this.$_initResizeEvent(),this.$_initSidebarResizeEvent()},deactivated:function(){this.$_destroyResizeEvent(),this.$_destroySidebarResizeEvent()},methods:{$_resizeHandler:function(){var t=this;return Object(c["a"])((function(){t.chart&&t.chart.resize()}),100)()},$_initResizeEvent:function(){window.addEventListener("resize",this.$_resizeHandler)},$_destroyResizeEvent:function(){window.removeEventListener("resize",this.$_resizeHandler)},$_sidebarResizeHandler:function(t){"width"===t.propertyName&&this.$_resizeHandler()},$_initSidebarResizeEvent:function(){this.$_sidebarElm=document.getElementsByClassName("sidebar-container")[0],this.$_sidebarElm&&this.$_sidebarElm.addEventListener("transitionend",this.$_sidebarResizeHandler)},$_destroySidebarResizeEvent:function(){this.$_sidebarElm&&this.$_sidebarElm.removeEventListener("transitionend",this.$_sidebarResizeHandler)}}},u={mixins:[d],props:{className:{type:String,default:"chart"},width:{type:String,default:"100%"},height:{type:String,default:"300px"},autoResize:{type:Boolean,default:!0},chartData:{type:Array,required:!0},times:{type:Array,required:!0}},data:function(){return{chart:null,chartDataFrom:{}}},watch:{chartData:{deep:!0,handler:function(t){this.setOptions(t)}}},mounted:function(){var t=this;this.$nextTick((function(){t.initChart()}))},beforeDestroy:function(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart:function(){var t=i("313e");this.chart=t.init(this.$el,"macarons"),this.setOptions()},setOptions:function(){var t=this.chartData.map((function(t){return{name:t.name,type:"line",stack:"Total",areaStyle:{},label:{position:"top"},color:t.color,emphasis:{focus:"series"},smooth:!0,data:t.data,showSymbol:!1}}));this.chart.setOption({tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}},legend:{data:this.chartData},toolbox:{feature:{}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:this.times}],yAxis:[{type:"value"}],series:t})}}},h=u,p=i("2877"),f=Object(p["a"])(h,o,l,!1,null,null,null),m=f.exports,v=i("6724"),y=i("3737"),b=i("dd71"),_=i("4d85"),w=i("397f"),g=i("b775");function O(t){return Object(g["a"])({url:"/hippo4j/v1/cs/monitor/info",method:"post",data:t})}function j(t){return Object(g["a"])({url:"/hippo4j/v1/cs/monitor/last/task/count",method:"post",data:t})}var k={name:"Monitor",components:{LineChart:m},directives:{waves:v["a"]},filters:{queueFilter:function(t){var e={1:"ArrayBlockingQueue",2:"LinkedBlockingQueue",3:"LinkedBlockingDeque",4:"SynchronousQueue",5:"LinkedTransferQueue",6:"PriorityBlockingQueue",9:"ResizableLinkedBlockingQueue"};return e[t]},rejectedFilter:function(t){var e={1:"CallerRunsPolicy",2:"AbortPolicy",3:"DiscardPolicy",4:"DiscardOldestPolicy",5:"RunsOldestTaskPolicy",6:"SyncPutQueuePolicy"};return t&&e[t]?e[t]:t?"CustomRejectedPolicy-".concat(t):""},alarmFilter:function(t){return"1"===t?"报警":"忽略"},allowCoreThreadTimeOutFilter:function(t){return"1"===t?"超时":"不超时"}},data:function(){return{lineChartData1:[{name:"activeSizeList",data:[],color:"#e76f51"}],lineChartData2:[{name:"poolSizeList",data:[],color:"#e9c46a"}],lineChartData3:[{name:"queueSizeList",data:[],color:"#e9c46a"}],lineChartData4:[{name:"queueRemainingCapacityList",data:[],color:"#f4a261"}],lineChartData5:[{name:"completedTaskCountList",data:[],color:"#264653"}],lineChartData6:[{name:"rejectCountList",data:[],color:"#e63946"}],times:[],size:500,tenantOptions:[],threadPoolOptions:[],itemOptions:[],identifyOptions:[],listQuery:{current:1,size:10,itemId:"",tpId:"",tenantId:"",identify:"",instanceId:""},temp:{},lastTaskCount:null}},created:function(){var t=Object(s["a"])(Object(r["a"])().mark((function t(){return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:this.initSelect();case 1:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),methods:{fetchData:function(){var t=this;this.listQuery.tenantId?this.listQuery.itemId?this.listQuery.tpId?this.listQuery.identify?(this.listQuery.instanceId=this.listQuery.identify,_["d"](this.listQuery).then((function(e){t.temp=e})),j(this.listQuery).then((function(e){t.lastTaskCount=e.completedTaskCount})),this.initChart()):this.$message.warning("IP : PORT 不允许为空"):this.$message.warning("线程池不允许为空"):this.$message.warning("项目不允许为空"):this.$message.warning("租户不允许为空")},refreshData:function(){this.listQuery.tenantId=null,this.listQuery.itemId=null,this.listQuery.tpId=null,this.listQuery.identify=null,this.itemOptions=[],this.threadPoolOptions=[],this.identifyOptions=[]},initSelect:function(){var t=this;b["c"]({size:this.size}).then((function(e){var i=e||{},n=i.records;t.tenantOptions=n&&n.map((function(t){return{key:t.tenantId,display_name:t.tenantId+" "+t.tenantName}}))}))},tenantSelectList:function(){var t=this;this.listQuery.itemId=null,this.listQuery.tpId=null,this.listQuery.identify=null,this.itemOptions=[],this.threadPoolOptions=[],this.identifyOptions=[];var e={tenantId:this.listQuery.tenantId,size:this.size};y["c"](e).then((function(e){var i=e||{},n=i.records;t.itemOptions=n&&n.map((function(t){return{key:t.itemId,display_name:t.itemId+" "+t.itemName}}))}))},itemSelectList:function(){var t=this;this.listQuery.tpId=null,this.listQuery.identify=null,this.threadPoolOptions=[],this.identifyOptions=[];var e={itemId:this.listQuery.itemId,size:this.size};_["e"](e).then((function(e){var i=e||{},n=i.records;t.threadPoolOptions=n&&n.map((function(t){return{key:t.tpId,display_name:t.tpId}}))}))},threadPoolSelectList:function(){var t=this;this.listQuery.identify=null,this.identifyOptions=[];var e=[this.listQuery.itemId,this.listQuery.tpId];w["a"](e).then((function(e){t.identifyOptions=e&&e.map((function(t){return{key:t.identify,display_name:t.clientAddress}}))}))},initChart:function(){var t=this;O(this.listQuery).then((function(e){var i=e||{},n=i.poolSizeList,a=i.activeSizeList,r=i.queueSizeList,s=i.queueRemainingCapacityList,o=i.completedTaskCountList,l=i.rejectCountList,c=i.times;t.times=c,t.lineChartData1[0].data=a,t.lineChartData2[0].data=n,t.lineChartData3[0].data=r,t.lineChartData4[0].data=s,t.lineChartData5[0].data=o,t.lineChartData6[0].data=l}))}}},C=k,I=(i("6e81"),Object(p["a"])(C,n,a,!1,null,"490e92e5",null));e["default"]=I.exports},3737:function(t,e,i){"use strict";i.d(e,"c",(function(){return a})),i.d(e,"d",(function(){return r})),i.d(e,"a",(function(){return s})),i.d(e,"b",(function(){return o}));var n=i("b775");function a(t){return Object(n["a"])({url:"/hippo4j/v1/cs/item/query/page",method:"post",data:t})}function r(t){return Object(n["a"])({url:"/hippo4j/v1/cs/item/update",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/hippo4j/v1/cs/item/save",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/hippo4j/v1/cs/item/delete/"+t[0]+"/"+t[1],method:"delete"})}},"397f":function(t,e,i){"use strict";i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return r}));var n=i("b775");function a(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/list/instance/"+t[0]+"/"+t[1],method:"get"})}function r(t){return Object(n["a"])({url:"/hippo4j/v1/cs/configs?identify="+t.identify,method:"post",data:t})}},"4d85":function(t,e,i){"use strict";i.d(e,"e",(function(){return a})),i.d(e,"f",(function(){return r})),i.d(e,"d",(function(){return s})),i.d(e,"g",(function(){return o})),i.d(e,"h",(function(){return l})),i.d(e,"j",(function(){return c})),i.d(e,"k",(function(){return d})),i.d(e,"i",(function(){return u})),i.d(e,"b",(function(){return h})),i.d(e,"c",(function(){return p})),i.d(e,"a",(function(){return f}));var n=i("b775");function a(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/query/page",method:"post",data:t})}function r(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/list/client/instance/"+t.itemId,method:"get",data:t})}function s(t){return Object(n["a"])({url:"/hippo4j/v1/cs/configs?tpId="+t.tpId+"&itemId="+t.itemId+"&namespace="+t.tenantId+"&instanceId="+t.identify,method:"get"})}function o(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/run/state/"+t.tpId+"?clientAddress="+t.clientAddress,method:"get"})}function l(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/run/thread/state/"+t.tpId+"?clientAddress="+t.clientAddress,method:"get"})}function c(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/web/run/state?clientAddress="+t.clientAddress,method:"get"})}function d(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/web/update/pool",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/save_or_update",method:"post",data:t})}function h(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/save_or_update",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/delete",method:"delete",data:t})}function f(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/alarm/enable/"+t.id+"/"+t.isAlarm,method:"post"})}},6724:function(t,e,i){"use strict";i("8d41");var n="@@wavesContext";function a(t,e){function i(i){var n=Object.assign({},e.value),a=Object.assign({ele:t,type:"hit",color:"rgba(0, 0, 0, 0.15)"},n),r=a.ele;if(r){r.style.position="relative",r.style.overflow="hidden";var s=r.getBoundingClientRect(),o=r.querySelector(".waves-ripple");switch(o?o.className="waves-ripple":(o=document.createElement("span"),o.className="waves-ripple",o.style.height=o.style.width=Math.max(s.width,s.height)+"px",r.appendChild(o)),a.type){case"center":o.style.top=s.height/2-o.offsetHeight/2+"px",o.style.left=s.width/2-o.offsetWidth/2+"px";break;default:o.style.top=(i.pageY-s.top-o.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",o.style.left=(i.pageX-s.left-o.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return o.style.backgroundColor=a.color,o.className="waves-ripple z-active",!1}}return t[n]?t[n].removeHandle=i:t[n]={removeHandle:i},i}var r={bind:function(t,e){t.addEventListener("click",a(t,e),!1)},update:function(t,e){t.removeEventListener("click",t[n].removeHandle,!1),t.addEventListener("click",a(t,e),!1)},unbind:function(t){t.removeEventListener("click",t[n].removeHandle,!1),t[n]=null,delete t[n]}},s=function(t){t.directive("waves",r)};window.Vue&&(window.waves=r,Vue.use(s)),r.install=s;e["a"]=r},"6e81":function(t,e,i){"use strict";i("e972")},"8d41":function(t,e,i){},dd71:function(t,e,i){"use strict";i.d(e,"c",(function(){return a})),i.d(e,"d",(function(){return r})),i.d(e,"a",(function(){return s})),i.d(e,"b",(function(){return o}));var n=i("b775");function a(t){return Object(n["a"])({url:"/hippo4j/v1/cs/tenant/query/page",method:"post",data:t})}function r(t){return Object(n["a"])({url:"/hippo4j/v1/cs/tenant/update",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/hippo4j/v1/cs/tenant/save",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/hippo4j/v1/cs/tenant/delete/"+t,method:"delete"})}},e972:function(t,e,i){}}]); \ No newline at end of file diff --git a/hippo4j-console/src/main/resources/static/static/js/chunk-70528506.18aa1627.js b/hippo4j-console/src/main/resources/static/static/js/chunk-70528506.18aa1627.js new file mode 100644 index 00000000..a298f0bd --- /dev/null +++ b/hippo4j-console/src/main/resources/static/static/js/chunk-70528506.18aa1627.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-70528506"],{"04ca":function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"dashboard-editor-container"},[i("div",{staticClass:"filter-container"},[i("el-select",{staticClass:"filter-item",staticStyle:{width:"220px"},attrs:{placeholder:"租户(必填)",filterable:""},on:{change:function(e){return t.tenantSelectList()}},model:{value:t.listQuery.tenantId,callback:function(e){t.$set(t.listQuery,"tenantId",e)},expression:"listQuery.tenantId"}},t._l(t.tenantOptions,(function(t){return i("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})})),1),t._v(" "),i("el-select",{staticClass:"filter-item",staticStyle:{width:"220px"},attrs:{placeholder:"项目(必填)",filterable:""},on:{change:function(e){return t.itemSelectList()}},model:{value:t.listQuery.itemId,callback:function(e){t.$set(t.listQuery,"itemId",e)},expression:"listQuery.itemId"}},t._l(t.itemOptions,(function(t){return i("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})})),1),t._v(" "),i("el-select",{staticClass:"filter-item",staticStyle:{width:"220px"},attrs:{placeholder:"线程池(必填)",filterable:""},on:{change:function(e){return t.threadPoolSelectList()}},model:{value:t.listQuery.tpId,callback:function(e){t.$set(t.listQuery,"tpId",e)},expression:"listQuery.tpId"}},t._l(t.threadPoolOptions,(function(t){return i("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})})),1),t._v(" "),i("el-select",{staticClass:"filter-item",staticStyle:{width:"220px"},attrs:{placeholder:"IP : Port(必填)",filterable:""},model:{value:t.listQuery.identify,callback:function(e){t.$set(t.listQuery,"identify",e)},expression:"listQuery.identify"}},t._l(t.identifyOptions,(function(t){return i("el-option",{key:t.key,attrs:{label:t.display_name,value:t.key}})})),1),t._v(" "),i("el-button",{directives:[{name:"waves",rawName:"v-waves"}],staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.fetchData}},[t._v("\n 搜索\n ")]),t._v(" "),i("el-button",{directives:[{name:"waves",rawName:"v-waves"}],staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-refresh"},on:{click:t.refreshData}},[t._v("\n 重置\n ")])],1),t._v(" "),t.temp.coreSize?i("section",[i("el-card",{attrs:{shadow:"hover"}},[i("el-descriptions",{attrs:{column:3,border:""}},[i("el-descriptions-item",{attrs:{label:"实例 ID"}},[t._v(t._s(t.listQuery.identify))]),t._v(" "),i("el-descriptions-item",{attrs:{label:"核心线程"}},[t._v(t._s(t.temp.coreSize))]),t._v(" "),i("el-descriptions-item",{attrs:{label:"最大线程"}},[t._v(t._s(t.temp.maxSize))]),t._v(" "),i("el-descriptions-item",{attrs:{label:"队列类型"}},[t._v("\n "+t._s(t._f("queueFilter")(t.temp.queueType))+"\n ")]),t._v(" "),i("el-descriptions-item",{attrs:{label:"队列容量"}},[t._v(t._s(t.temp.capacity))]),t._v(" "),i("el-descriptions-item",{attrs:{label:"已完成任务数"}},[t._v(t._s(t.lastTaskCount))]),t._v(" "),i("el-descriptions-item",{attrs:{label:"拒绝策略"}},[t._v("\n "+t._s(t._f("rejectedFilter")(t.temp.rejectedType))+"\n ")]),t._v(" "),i("el-descriptions-item",{attrs:{label:"是否报警"}},[t._v("\n "+t._s(t._f("alarmFilter")(t.temp.isAlarm))+"\n ")]),t._v(" "),i("el-descriptions-item",{attrs:{label:"任务拒绝次数"}},[t._v("\n "+t._s(t.rejectCount)+"\n ")])],1)],1),t._v(" "),i("el-row",{staticStyle:{"margin-top":"16px"},attrs:{gutter:10}},[i("el-col",{attrs:{span:12}},[i("el-card",{attrs:{shadow:"hover"}},[i("line-chart",{attrs:{"chart-data":t.lineChartData1,times:t.times}})],1)],1),t._v(" "),i("el-col",{attrs:{span:12}},[i("el-card",{attrs:{shadow:"hover"}},[i("line-chart",{attrs:{"chart-data":t.lineChartData3,times:t.times}})],1)],1)],1),t._v(" "),i("el-row",{staticStyle:{"margin-top":"16px"},attrs:{gutter:10}},[i("el-col",{attrs:{span:12}},[i("el-card",{attrs:{shadow:"hover"}},[i("line-chart",{attrs:{"chart-data":t.lineChartData5,times:t.times}})],1)],1),t._v(" "),i("el-col",{attrs:{span:12}},[i("el-card",{attrs:{shadow:"hover"}},[i("line-chart",{attrs:{"chart-data":t.lineChartData6,times:t.times}})],1)],1)],1)],1):i("el-empty",{attrs:{description:"暂无结果"}})],1)},a=[],r=i("c80c"),s=(i("96cf"),i("3b8d")),o=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:t.className,style:{height:t.height,width:t.width}})},l=[],c=(i("7f7f"),i("ed08")),u={data:function(){return{$_sidebarElm:null}},mounted:function(){this.$_initResizeEvent(),this.$_initSidebarResizeEvent()},beforeDestroy:function(){this.$_destroyResizeEvent(),this.$_destroySidebarResizeEvent()},activated:function(){this.$_initResizeEvent(),this.$_initSidebarResizeEvent()},deactivated:function(){this.$_destroyResizeEvent(),this.$_destroySidebarResizeEvent()},methods:{$_resizeHandler:function(){var t=this;return Object(c["a"])((function(){t.chart&&t.chart.resize()}),100)()},$_initResizeEvent:function(){window.addEventListener("resize",this.$_resizeHandler)},$_destroyResizeEvent:function(){window.removeEventListener("resize",this.$_resizeHandler)},$_sidebarResizeHandler:function(t){"width"===t.propertyName&&this.$_resizeHandler()},$_initSidebarResizeEvent:function(){this.$_sidebarElm=document.getElementsByClassName("sidebar-container")[0],this.$_sidebarElm&&this.$_sidebarElm.addEventListener("transitionend",this.$_sidebarResizeHandler)},$_destroySidebarResizeEvent:function(){this.$_sidebarElm&&this.$_sidebarElm.removeEventListener("transitionend",this.$_sidebarResizeHandler)}}},d={mixins:[u],props:{className:{type:String,default:"chart"},width:{type:String,default:"100%"},height:{type:String,default:"300px"},autoResize:{type:Boolean,default:!0},chartData:{type:Array,required:!0},times:{type:Array,required:!0}},data:function(){return{chart:null,chartDataFrom:{}}},watch:{chartData:{deep:!0,handler:function(t){this.setOptions(t)}}},mounted:function(){var t=this;this.$nextTick((function(){t.initChart()}))},beforeDestroy:function(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart:function(){var t=i("313e");this.chart=t.init(this.$el,"macarons"),this.setOptions()},setOptions:function(){var t=this.chartData.map((function(t){return{name:t.name,type:"line",stack:"Total",areaStyle:{},label:{position:"top"},color:t.color,emphasis:{focus:"series"},smooth:!0,data:t.data,showSymbol:!1}}));this.chart.setOption({tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}},legend:{data:this.chartData},toolbox:{feature:{}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:this.times}],yAxis:[{type:"value"}],series:t})}}},h=d,p=i("2877"),f=Object(p["a"])(h,o,l,!1,null,null,null),m=f.exports,v=i("6724"),y=i("3737"),b=i("dd71"),_=i("4d85"),j=i("397f"),g=i("b775");function w(t){return Object(g["a"])({url:"/hippo4j/v1/cs/monitor/info",method:"post",data:t})}function O(t){return Object(g["a"])({url:"/hippo4j/v1/cs/monitor/last/task/count",method:"post",data:t})}var k={name:"Monitor",components:{LineChart:m},directives:{waves:v["a"]},filters:{queueFilter:function(t){var e={1:"ArrayBlockingQueue",2:"LinkedBlockingQueue",3:"LinkedBlockingDeque",4:"SynchronousQueue",5:"LinkedTransferQueue",6:"PriorityBlockingQueue",9:"ResizableLinkedBlockingQueue"};return e[t]},rejectedFilter:function(t){var e={1:"CallerRunsPolicy",2:"AbortPolicy",3:"DiscardPolicy",4:"DiscardOldestPolicy",5:"RunsOldestTaskPolicy",6:"SyncPutQueuePolicy"};return t&&e[t]?e[t]:t?"CustomRejectedPolicy-".concat(t):""},alarmFilter:function(t){return"1"===t?"报警":"忽略"},allowCoreThreadTimeOutFilter:function(t){return"1"===t?"超时":"不超时"}},data:function(){return{lineChartData1:[{name:"activeSizeList",data:[],color:"#709775"}],lineChartData2:[{name:"poolSizeList",data:[],color:"#e9c46a"}],lineChartData3:[{name:"queueSizeList",data:[],color:"#003049"}],lineChartData4:[{name:"queueRemainingCapacityList",data:[],color:"#f4a261"}],lineChartData5:[{name:"completedTaskCountList",data:[],color:"#023e8a"}],lineChartData6:[{name:"rejectCountList",data:[],color:"#dd1c1a"}],times:[],size:500,tenantOptions:[],threadPoolOptions:[],itemOptions:[],identifyOptions:[],listQuery:{current:1,size:10,itemId:"",tpId:"",tenantId:"",identify:"",instanceId:""},temp:{},rejectCount:null,lastTaskCount:null}},created:function(){var t=Object(s["a"])(Object(r["a"])().mark((function t(){return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:this.initSelect();case 1:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),methods:{fetchData:function(){var t=this;this.listQuery.tenantId?this.listQuery.itemId?this.listQuery.tpId?this.listQuery.identify?(this.listQuery.instanceId=this.listQuery.identify,_["d"](this.listQuery).then((function(e){t.temp=e})),O(this.listQuery).then((function(e){t.rejectCount=e.rejectCount,t.lastTaskCount=e.completedTaskCount})),this.initChart()):this.$message.warning("IP : PORT 不允许为空"):this.$message.warning("线程池不允许为空"):this.$message.warning("项目不允许为空"):this.$message.warning("租户不允许为空")},refreshData:function(){this.listQuery.tenantId=null,this.listQuery.itemId=null,this.listQuery.tpId=null,this.listQuery.identify=null,this.itemOptions=[],this.threadPoolOptions=[],this.identifyOptions=[]},initSelect:function(){var t=this;b["c"]({size:this.size}).then((function(e){var i=e||{},n=i.records;t.tenantOptions=n&&n.map((function(t){return{key:t.tenantId,display_name:t.tenantId+" "+t.tenantName}}))}))},tenantSelectList:function(){var t=this;this.listQuery.itemId=null,this.listQuery.tpId=null,this.listQuery.identify=null,this.itemOptions=[],this.threadPoolOptions=[],this.identifyOptions=[];var e={tenantId:this.listQuery.tenantId,size:this.size};y["c"](e).then((function(e){var i=e||{},n=i.records;t.itemOptions=n&&n.map((function(t){return{key:t.itemId,display_name:t.itemId+" "+t.itemName}}))}))},itemSelectList:function(){var t=this;this.listQuery.tpId=null,this.listQuery.identify=null,this.threadPoolOptions=[],this.identifyOptions=[];var e={itemId:this.listQuery.itemId,size:this.size};_["e"](e).then((function(e){var i=e||{},n=i.records;t.threadPoolOptions=n&&n.map((function(t){return{key:t.tpId,display_name:t.tpId}}))}))},threadPoolSelectList:function(){var t=this;this.listQuery.identify=null,this.identifyOptions=[];var e=[this.listQuery.itemId,this.listQuery.tpId];j["a"](e).then((function(e){t.identifyOptions=e&&e.map((function(t){return{key:t.identify,display_name:t.clientAddress}}))}))},initChart:function(){var t=this;w(this.listQuery).then((function(e){var i=e||{},n=i.poolSizeList,a=i.activeSizeList,r=i.queueSizeList,s=i.queueRemainingCapacityList,o=i.completedTaskCountList,l=i.rejectCountList,c=i.times;t.times=c,t.lineChartData1[0].data=a,t.lineChartData2[0].data=n,t.lineChartData3[0].data=r,t.lineChartData4[0].data=s,t.lineChartData5[0].data=o,t.lineChartData6[0].data=l}))}}},C=k,I=(i("985c"),Object(p["a"])(C,n,a,!1,null,"a25e0782",null));e["default"]=I.exports},1639:function(t,e,i){},3737:function(t,e,i){"use strict";i.d(e,"c",(function(){return a})),i.d(e,"d",(function(){return r})),i.d(e,"a",(function(){return s})),i.d(e,"b",(function(){return o}));var n=i("b775");function a(t){return Object(n["a"])({url:"/hippo4j/v1/cs/item/query/page",method:"post",data:t})}function r(t){return Object(n["a"])({url:"/hippo4j/v1/cs/item/update",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/hippo4j/v1/cs/item/save",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/hippo4j/v1/cs/item/delete/"+t[0]+"/"+t[1],method:"delete"})}},"397f":function(t,e,i){"use strict";i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return r}));var n=i("b775");function a(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/list/instance/"+t[0]+"/"+t[1],method:"get"})}function r(t){return Object(n["a"])({url:"/hippo4j/v1/cs/configs?identify="+t.identify,method:"post",data:t})}},"4d85":function(t,e,i){"use strict";i.d(e,"e",(function(){return a})),i.d(e,"f",(function(){return r})),i.d(e,"d",(function(){return s})),i.d(e,"g",(function(){return o})),i.d(e,"h",(function(){return l})),i.d(e,"j",(function(){return c})),i.d(e,"k",(function(){return u})),i.d(e,"i",(function(){return d})),i.d(e,"b",(function(){return h})),i.d(e,"c",(function(){return p})),i.d(e,"a",(function(){return f}));var n=i("b775");function a(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/query/page",method:"post",data:t})}function r(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/list/client/instance/"+t.itemId,method:"get",data:t})}function s(t){return Object(n["a"])({url:"/hippo4j/v1/cs/configs?tpId="+t.tpId+"&itemId="+t.itemId+"&namespace="+t.tenantId+"&instanceId="+t.identify,method:"get"})}function o(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/run/state/"+t.tpId+"?clientAddress="+t.clientAddress,method:"get"})}function l(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/run/thread/state/"+t.tpId+"?clientAddress="+t.clientAddress,method:"get"})}function c(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/web/run/state?clientAddress="+t.clientAddress,method:"get"})}function u(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/web/update/pool",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/save_or_update",method:"post",data:t})}function h(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/save_or_update",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/delete",method:"delete",data:t})}function f(t){return Object(n["a"])({url:"/hippo4j/v1/cs/thread/pool/alarm/enable/"+t.id+"/"+t.isAlarm,method:"post"})}},6724:function(t,e,i){"use strict";i("8d41");var n="@@wavesContext";function a(t,e){function i(i){var n=Object.assign({},e.value),a=Object.assign({ele:t,type:"hit",color:"rgba(0, 0, 0, 0.15)"},n),r=a.ele;if(r){r.style.position="relative",r.style.overflow="hidden";var s=r.getBoundingClientRect(),o=r.querySelector(".waves-ripple");switch(o?o.className="waves-ripple":(o=document.createElement("span"),o.className="waves-ripple",o.style.height=o.style.width=Math.max(s.width,s.height)+"px",r.appendChild(o)),a.type){case"center":o.style.top=s.height/2-o.offsetHeight/2+"px",o.style.left=s.width/2-o.offsetWidth/2+"px";break;default:o.style.top=(i.pageY-s.top-o.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",o.style.left=(i.pageX-s.left-o.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return o.style.backgroundColor=a.color,o.className="waves-ripple z-active",!1}}return t[n]?t[n].removeHandle=i:t[n]={removeHandle:i},i}var r={bind:function(t,e){t.addEventListener("click",a(t,e),!1)},update:function(t,e){t.removeEventListener("click",t[n].removeHandle,!1),t.addEventListener("click",a(t,e),!1)},unbind:function(t){t.removeEventListener("click",t[n].removeHandle,!1),t[n]=null,delete t[n]}},s=function(t){t.directive("waves",r)};window.Vue&&(window.waves=r,Vue.use(s)),r.install=s;e["a"]=r},"8d41":function(t,e,i){},"985c":function(t,e,i){"use strict";i("1639")},dd71:function(t,e,i){"use strict";i.d(e,"c",(function(){return a})),i.d(e,"d",(function(){return r})),i.d(e,"a",(function(){return s})),i.d(e,"b",(function(){return o}));var n=i("b775");function a(t){return Object(n["a"])({url:"/hippo4j/v1/cs/tenant/query/page",method:"post",data:t})}function r(t){return Object(n["a"])({url:"/hippo4j/v1/cs/tenant/update",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/hippo4j/v1/cs/tenant/save",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/hippo4j/v1/cs/tenant/delete/"+t,method:"delete"})}}}]); \ No newline at end of file