FELIX-1988 Apply 6.vmstat.patch by Valentin Valchev (thanks) with the following change: The WebConsoleUtil.getVariableResolver now presets the default resolver created with the appRoot and pluginRoot properties from the respective request attributes
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@910873 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/resources/templates/vmstat.html b/webconsole/src/main/resources/templates/vmstat.html
new file mode 100644
index 0000000..bf1d09a
--- /dev/null
+++ b/webconsole/src/main/resources/templates/vmstat.html
@@ -0,0 +1,108 @@
+<script type="text/javascript" src="res/ui/vmstat.js"></script>
+<script type="text/javascript">
+// <![CDATA[
+var statData = ${startData};
+// ]]>
+</script>
+
+<!-- status line -->
+<p class="statline">${vmstat.running}</p>
+
+<table class="nicetable">
+ <thead>
+ <tr>
+ <th colspan="2">${vmstat.sl.title}</th>
+ </tr>
+ </thead>
+
+ <tr>
+ <td>${vmstat.sl.system}</td>
+ <td>
+ <form method="post" action="${pluginRoot}">
+ <div>
+ <input type="hidden" name="action" value="setStartLevel"/>
+ <input type="text" size="3" name="systemStartLevel" id="systemStartLevel" value="-1"/>
+ <input type="submit" name="Set Start Level" value="${change}"/>
+ </div>
+ </form>
+ </td>
+ </tr>
+ <tr>
+ <td>${vmstat.sl.bundle}</td>
+ <td>
+ <form method="post" action="${pluginRoot}">
+ <div>
+ <input type="hidden" name="action" value="setStartLevel"/>
+ <input type="text" size="3" name="bundleStartLevel" id="bundleStartLevel" value="-1"/>
+ <input type="submit" name="Set Start Level" value="${change}"/>
+ </div>
+ </form>
+ </td>
+ </tr>
+
+ <tr><td colspan="2"> </td></tr>
+ <tr>
+ <th colspan="2">${vmstat.info.title}</th>
+ </tr>
+ <tr>
+ <td>${vmstat.lastStarted}</td>
+ <td id="lastStarted">---</td>
+ </tr>
+ <tr>
+ <td>${vmstat.framework}</td>
+ <td>
+ <form id="shutdownform" method="post" action="${pluginRoot}">
+ <div>
+ <input type="hidden" name="shutdown_timer" value="shutdown_timer" />
+ <!-- NOTE: don't translate value="Restart" & value="Stop" - will break the operation type -->
+ <input class="ui-state-error" type="submit" name="shutdown_type" value="Restart" onclick="return confirm('This will stop and restart the framework and all bundles. Please confirm to continue.');" />
+ <input class="ui-state-error" type="submit" name="shutdown_type" value="Stop" onclick="return confirm('This will stop the framework and all bundles. Please confirm to continue.')" />
+ </div>
+ </form>
+ <form id="shutdownform2" method="post" action="${pluginRoot}">
+ <div>
+ <input type="hidden" name="shutdown_type" id="shutdown_type" value="" />
+ <input class="ui-state-error" type="button" value="${abort}" onclick="abort('${pluginRoot}')" />
+ ${vmstat.shutdown.in} <span id='countdowncell'> </span>
+ <script type="text/javascript">if(statData.shutdownTimer) shutdown(3, 'shutdownform2', 'countdowncell');</script>
+ </div>
+ </form>
+ </td>
+ </tr>
+
+ <tr><td colspan="2"> </td></tr>
+ <tr>
+ <th colspan="2">${vmstat.java.title}</th>
+ </tr>
+ <tr>
+ <td>${vmstat.java.runtime}</td>
+ <td id="runtime">-</td>
+ </tr>
+ <tr>
+ <td>${vmstat.java.jvm}</td>
+ <td id="jvm">-</td>
+ </tr>
+ <tr>
+ <td>${vmstat.mem.total}</td>
+ <td id="mem_total">-</td>
+ </tr>
+ <tr>
+ <td>${vmstat.mem.used}</td>
+ <td id="mem_used">-</td>
+ </tr>
+ <tr>
+ <td>${vmstat.mem.free}</td>
+ <td id="mem_free">-</td>
+ </tr>
+ <tr>
+ <td>${vmstat.gc.title}</td>
+ <td>
+ <form method="post" action="${pluginRoot}">
+ <div>
+ <input type="hidden" name="action" value="gc" />
+ <input class="submit" type="submit" name="Collect Garbage" value="${vmstat.gc.button}" />
+ </div>
+ </form>
+ </td>
+ </tr>
+</table>