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"/>
+					&nbsp;&nbsp;<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"/>
+					&nbsp;&nbsp;<input type="submit" name="Set Start Level" value="${change}"/>
+				</div>
+			</form>
+		</td>
+	</tr>
+
+	<tr><td colspan="2">&nbsp;</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'>&nbsp;</span>
+				<script type="text/javascript">if(statData.shutdownTimer) shutdown(3, 'shutdownform2', 'countdowncell');</script>
+				</div>
+			</form>
+		</td>
+	</tr>
+
+	<tr><td colspan="2">&nbsp;</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>
diff --git a/webconsole/src/main/resources/templates/vmstat_restart.html b/webconsole/src/main/resources/templates/vmstat_restart.html
new file mode 100644
index 0000000..bb1f933
--- /dev/null
+++ b/webconsole/src/main/resources/templates/vmstat_restart.html
@@ -0,0 +1,13 @@
+<script type="text/javascript" src="res/ui/vmstat.js"></script>
+
+<!-- status line -->
+<p class="statline">${vmstat.restarting}</p>
+
+<form id="reloadform" method="get" action="">
+	<div style="width:100%; text-align: center">
+		<input class="ui-state-error" type="submit" value="${reload}" />
+		${vmstat.reloading.in} <span id="reloadcountdowncell">&nbsp;</span>
+		<script type="text/javascript">shutdown(10, "reloadform", "reloadcountdowncell");</script>
+	</div>
+</form>
+
diff --git a/webconsole/src/main/resources/templates/vmstat_stop.html b/webconsole/src/main/resources/templates/vmstat_stop.html
new file mode 100644
index 0000000..ce054c2
--- /dev/null
+++ b/webconsole/src/main/resources/templates/vmstat_stop.html
@@ -0,0 +1,5 @@
+<script type="text/javascript" src="res/ui/vmstat.js"></script>
+
+<!-- status line -->
+<p class="statline">${vmstat.stopped}</p>
+