FELIX-3027 : Make download links for single configuration status file (or ZIP file) more prominent
FELIX-3040 : Configuration status dump should contain a timestamp when the dump has been taken

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1146651 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java
index af20a82..d838ee2 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java
@@ -205,7 +205,9 @@
             pw.println(DISPLAY_DATE_FORMAT.format(currentTime));
         }
 
-        synchronized ( FILE_NAME_FORMAT )
+        pw.print("<button type=\"button\" class=\"downloadZip\" style=\"float: right; margin-right: 30px; margin-top: 5px;\">Download Zip</button>");
+        pw.print("<button type=\"button\" class=\"downloadTxt\" style=\"float: right; margin-right: 30px; margin-top: 5px;\">Download Text</button>");
+/*        synchronized ( FILE_NAME_FORMAT )
         {
             String fileName = FILE_NAME_FORMAT.format( currentTime );
             pw.print("<br/>Download as <a href='");
@@ -213,9 +215,9 @@
             pw.print(".txt'>[Single File]</a> or as <a href='");
             pw.print(fileName);
             pw.println(".zip'>[ZIP]</a>");
-        }
+        }*/
 
-        pw.println("</p>"); // status line
+        pw.println("<br/>&nbsp;</p>"); // status line
 
         // display some information while the data is loading
         // load the data (hidden to begin with)
@@ -529,7 +531,7 @@
             write(chars, 0, chars.length);
         }
 
-        
+
         private final char[] oneChar = new char[1];
 
         // always delegate to write(char[], int, int) otherwise in some VM
diff --git a/webconsole/src/main/resources/res/ui/configurationrender.js b/webconsole/src/main/resources/res/ui/configurationrender.js
index da70d26..49039cc 100644
--- a/webconsole/src/main/resources/res/ui/configurationrender.js
+++ b/webconsole/src/main/resources/res/ui/configurationrender.js
@@ -1,3 +1,32 @@
+/*

+ * Licensed to the Apache Software Foundation (ASF) under one or more

+ * contributor license agreements.  See the NOTICE file distributed with

+ * this work for additional information regarding copyright ownership.

+ * The ASF licenses this file to You under the Apache License, Version 2.0

+ * (the "License"); you may not use this file except in compliance with

+ * the License.  You may obtain a copy of the License at

+ *

+ *	  http://www.apache.org/licenses/LICENSE-2.0

+ *

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ */

+function pad(value) {

+	if ( value < 10 ) {

+		return "0" + value;

+	}

+	return "" + value;

+}

+

+function downloadDump(ext) {

+	var now = new Date();

+	var name = "configuration-status-" + now.getUTCFullYear() + pad(now.getUTCMonth() + 1) + pad(now.getUTCDate()) + "-" + pad(now.getUTCHours()) + pad(now.getUTCMinutes()) + pad(now.getUTCSeconds()) + ".";

+    location.href = location.href + "/" + name + ext;

+}

+

 $(document).ready(function() {

 	var dlg = $('#waitDlg').dialog({

 		modal    : true,

@@ -11,4 +40,7 @@
 		beforeSend : function() { dlg.dialog('open') },

 		complete   : function() { dlg.dialog('close')}

 	}}).tabs('paging');

+

+	$('.downloadTxt').click(function() { downloadDump('txt')});

+	$('.downloadZip').click(function() { downloadDump('zip')});

 });
\ No newline at end of file
diff --git a/webconsole/src/main/resources/res/ui/vmstat.js b/webconsole/src/main/resources/res/ui/vmstat.js
index 5ad9961..c808e08 100644
--- a/webconsole/src/main/resources/res/ui/vmstat.js
+++ b/webconsole/src/main/resources/res/ui/vmstat.js
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *	  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 /* shuts down server after [num] seconds */
 function shutdown(num, formname, elemid) {
 	var elem = $('#' + elemid);