From 1ad677cfdd2b72a547f30d93b6265c7fc8d87970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=98=84=EC=84=B1=ED=95=84?= Date: Wed, 17 May 2023 10:03:03 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=9C=EB=B2=84=20=EA=B4=80=EB=A6=AC=20-=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D=20=EA=B5=AC=ED=98=84=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/dto/ServerSearch.java | 27 ++- .../httpmockserver/server/entity/Server.java | 10 +- .../templates/page/servers/serverList.html | 159 ++++++++++++++++++ 3 files changed, 185 insertions(+), 11 deletions(-) create mode 100644 src/main/resources/templates/page/servers/serverList.html diff --git a/src/main/java/com/eactive/httpmockserver/server/dto/ServerSearch.java b/src/main/java/com/eactive/httpmockserver/server/dto/ServerSearch.java index 9693c38..13ab3cb 100644 --- a/src/main/java/com/eactive/httpmockserver/server/dto/ServerSearch.java +++ b/src/main/java/com/eactive/httpmockserver/server/dto/ServerSearch.java @@ -5,6 +5,7 @@ import com.eactive.httpmockserver.common.search.ColumnSearchModel; import com.eactive.httpmockserver.common.search.SearchCondition; import com.eactive.httpmockserver.common.search.SearchModel; import com.eactive.httpmockserver.server.entity.Server; +import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.List; @@ -17,17 +18,29 @@ public class ServerSearch implements BaseSearch { private String basePath; - private int port; + private String port; private List checkedIdForDel; @Override public List buildSearchCondition() { List models = new ArrayList<>(); - models.add(new ColumnSearchModel("name", SearchCondition.LIKE, name)); - models.add(new ColumnSearchModel("hostname", SearchCondition.LIKE, hostname)); - models.add(new ColumnSearchModel("basePath", SearchCondition.LIKE, basePath)); - models.add(new ColumnSearchModel("port", SearchCondition.EQUAL, port)); + + if (StringUtils.isNotEmpty(name)) { + models.add(new ColumnSearchModel("name", SearchCondition.LIKE, name)); + } + + if (StringUtils.isNotEmpty(hostname)) { + models.add(new ColumnSearchModel("hostname", SearchCondition.LIKE, hostname)); + } + + if (StringUtils.isNotEmpty(basePath)) { + models.add(new ColumnSearchModel("basePath", SearchCondition.LIKE, basePath)); + } + if (StringUtils.isNotEmpty(port)) { + models.add(new ColumnSearchModel("port", SearchCondition.EQUAL, Integer.parseInt(port))); + } + return models; } @@ -56,11 +69,11 @@ public class ServerSearch implements BaseSearch { this.basePath = basePath; } - public int getPort() { + public String getPort() { return port; } - public void setPort(int port) { + public void setPort(String port) { this.port = port; } diff --git a/src/main/java/com/eactive/httpmockserver/server/entity/Server.java b/src/main/java/com/eactive/httpmockserver/server/entity/Server.java index f3e3783..e2cc5db 100644 --- a/src/main/java/com/eactive/httpmockserver/server/entity/Server.java +++ b/src/main/java/com/eactive/httpmockserver/server/entity/Server.java @@ -71,10 +71,6 @@ public class Server { this.port = port; } - @Transient - public String getFullHostAddress() { - return scheme + "://" + hostname + (port == null ? "" : ":" + port) + basePath; - } public boolean isEnabled() { return enabled; @@ -83,4 +79,10 @@ public class Server { public void setEnabled(boolean enabled) { this.enabled = enabled; } + + @Transient + public String getFullHostAddress() { + return scheme + "://" + hostname + (port == null ? "" : ":" + port) + basePath; + } + } diff --git a/src/main/resources/templates/page/servers/serverList.html b/src/main/resources/templates/page/servers/serverList.html new file mode 100644 index 0000000..f60ac10 --- /dev/null +++ b/src/main/resources/templates/page/servers/serverList.html @@ -0,0 +1,159 @@ + + + + + + +
+ +
+
+
+

서버 목록

+
+
+
+
+ +
+
+ +
+
+ + + +
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
번호이름주소사용 중비고
+ + + + + + + + + + +
+
+
+ +
+
+ +
+ + + + + + + + + +