You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2011/07/14 13:13:24 UTC

svn commit: r1146651 - in /felix/trunk/webconsole/src/main: java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java resources/res/ui/configurationrender.js resources/res/ui/vmstat.js

Author: cziegeler
Date: Thu Jul 14 11:13:23 2011
New Revision: 1146651

URL: http://svn.apache.org/viewvc?rev=1146651&view=rev
Log:
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

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java
    felix/trunk/webconsole/src/main/resources/res/ui/configurationrender.js
    felix/trunk/webconsole/src/main/resources/res/ui/vmstat.js

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java?rev=1146651&r1=1146650&r2=1146651&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java (original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/ConfigurationRender.java Thu Jul 14 11:13:23 2011
@@ -205,7 +205,9 @@ public class ConfigurationRender extends
             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 @@ public class ConfigurationRender extends
             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 @@ public class ConfigurationRender extends
             write(chars, 0, chars.length);
         }
 
-        
+
         private final char[] oneChar = new char[1];
 
         // always delegate to write(char[], int, int) otherwise in some VM

Modified: felix/trunk/webconsole/src/main/resources/res/ui/configurationrender.js
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/res/ui/configurationrender.js?rev=1146651&r1=1146650&r2=1146651&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/res/ui/configurationrender.js (original)
+++ felix/trunk/webconsole/src/main/resources/res/ui/configurationrender.js Thu Jul 14 11:13:23 2011
@@ -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 @@ $(document).ready(function() {
 		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

Modified: felix/trunk/webconsole/src/main/resources/res/ui/vmstat.js
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/res/ui/vmstat.js?rev=1146651&r1=1146650&r2=1146651&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/res/ui/vmstat.js (original)
+++ felix/trunk/webconsole/src/main/resources/res/ui/vmstat.js Thu Jul 14 11:13:23 2011
@@ -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);