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 @@ + + + + + + +
+ +
+
+
+

서버 목록

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