Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
160 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
moskito-webui/src/main/java/net/anotheria/moskito/webui/more/action/RemoveRemoteAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package net.anotheria.moskito.webui.more.action; | ||
|
||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
import net.anotheria.maf.action.ActionCommand; | ||
import net.anotheria.maf.action.ActionMapping; | ||
import net.anotheria.moskito.webui.util.WebUIConfig; | ||
|
||
public class RemoveRemoteAction extends ShowRemotesAction{ | ||
@Override | ||
public ActionCommand execute(ActionMapping actionMapping, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception { | ||
String remoteName = httpServletRequest.getParameter("pName"); | ||
WebUIConfig.getInstance().removeRemote(remoteName); | ||
return actionMapping.redirect(); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
moskito-webui/src/main/java/net/anotheria/moskito/webui/more/action/ShowRemotesAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package net.anotheria.moskito.webui.more.action; | ||
|
||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
import net.anotheria.maf.action.ActionCommand; | ||
import net.anotheria.maf.action.ActionMapping; | ||
import net.anotheria.moskito.core.util.MoskitoWebUi; | ||
import net.anotheria.moskito.webui.plugins.action.BasePluginAction; | ||
import net.anotheria.moskito.webui.shared.api.PluginAO; | ||
import net.anotheria.moskito.webui.shared.bean.LabelValueBean; | ||
import net.anotheria.moskito.webui.shared.bean.NaviItem; | ||
import net.anotheria.moskito.webui.util.RemoteInstance; | ||
import net.anotheria.moskito.webui.util.WebUIConfig; | ||
|
||
import java.awt.*; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
|
||
public class ShowRemotesAction extends BaseAdditionalAction { | ||
@Override | ||
protected String getLinkToCurrentPage(HttpServletRequest req) { | ||
return "mskRemotes"; | ||
} | ||
|
||
@Override | ||
public ActionCommand execute(ActionMapping actionMapping, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception { | ||
|
||
RemoteInstance[] remotes = WebUIConfig.getInstance().getRemotes(); | ||
List<LabelValueBean> beans = new LinkedList<>(); | ||
if (remotes.length>0){ | ||
for (RemoteInstance remote : remotes){ | ||
beans.add(new LabelValueBean(remote.toString(), remote.getSelectKey())); | ||
} | ||
} | ||
httpServletRequest.setAttribute("remotes", beans); | ||
|
||
return actionMapping.success(); | ||
} | ||
|
||
protected NaviItem getCurrentSubNaviItem() { | ||
return NaviItem.MORE_REMOTES; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
moskito-webui/src/main/java/net/anotheria/moskito/webui/more/jsp/Remotes.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<%@ page language="java" contentType="text/html;charset=UTF-8" session="true" %> | ||
<%@ taglib prefix="ano" uri="http://www.anotheria.net/ano-tags" %> | ||
<%@ taglib prefix="mos" uri="http://www.moskito.org/inspect/tags" %> | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<jsp:include page="../../shared/jsp/Header.jsp" flush="false"/> | ||
<section id="main"> | ||
<jsp:include page="../../shared/jsp/Alerts.jsp"/> | ||
|
||
<div class="content"> | ||
|
||
<div class="box"> | ||
<div class="box-title"> | ||
<a class="accordion-toggle tooltip-bottom" title="Close/Open" data-toggle="collapse" href="#collapse1"><i class="fa fa-caret-down"></i></a> | ||
<h3 class="pull-left"> | ||
MoSKito Remotes. | ||
</h3> | ||
</div> | ||
<div id="collapse1" class="box-content accordion-body collapse in"> | ||
<div class="paddner"> | ||
Remotes are preconfigured connections or connections you added via the left bottom connect box. You can remove unwanted remotes here. | ||
Remotes should only work in local mode. Removing remotes only alert the runtime, after a restart the remotes are back. | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="box"> | ||
<div class="box-title"> | ||
<a class="accordion-toggle tooltip-bottom" title="Close/Open" data-toggle="collapse" href="#collapse2"><i class="fa fa-caret-down"></i></a> | ||
<h3 class="pull-left"> | ||
Remotes | ||
</h3> | ||
</div> | ||
<div id="collapse2" class="box-content accordion-body collapse in"> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Link</th> | ||
<th class="th-actions"></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<ano:iterate name="remotes" type="net.anotheria.moskito.webui.shared.bean.LabelValueBean" id="remote" indexId="index"> | ||
<tr> | ||
<td>${remote.label}</td> | ||
<td><mos:deepLink href="mskRemoveRemote?pName=${remote.value}" class="action-icon delete-icon tooltip-bottom" title="Remove"><i class="fa fa-ban"></i></mos:deepLink ></td> | ||
</tr> | ||
</ano:iterate> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<jsp:include page="../../shared/jsp/Footer.jsp" flush="false"/> | ||
|
||
</section> | ||
</body> | ||
</html> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters