[Pkg-nagios-changes] [SCM] UNNAMED PROJECT branch, debian/master, updated. 810edbdd3feedbfe37f4a65bee50b57b2f60fa2a

Naparuba naparuba at gmail.com
Tue Feb 28 22:14:47 UTC 2012


The following commit has been merged in the debian/master branch:
commit 1c374d01c78b2765828057ef5d6c50e54390df03
Author: Naparuba <naparuba at gmail.com>
Date:   Thu Jan 19 14:46:45 2012 +0100

    Add : SKONF forms for discovered hosts. Need to get the action page now.

diff --git a/shinken/daemons/skonfdaemon.py b/shinken/daemons/skonfdaemon.py
index 9293d50..117f9ac 100644
--- a/shinken/daemons/skonfdaemon.py
+++ b/shinken/daemons/skonfdaemon.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-#Copyright (C) 2009-2010 :
+#Copyright (C) 2009-2012 :
 #    Gabes Jean, naparuba at gmail.com
 #    Gerhard Lausser, Gerhard.Lausser at consol.de
 #    Gregory Starck, g.starck at gmail.com
diff --git a/shinken/webui/plugins_skonf/newhosts/htdocs/css/results.css b/shinken/webui/plugins_skonf/newhosts/htdocs/css/results.css
new file mode 100644
index 0000000..53ce220
--- /dev/null
+++ b/shinken/webui/plugins_skonf/newhosts/htdocs/css/results.css
@@ -0,0 +1,11 @@
+
+.discovered_host {
+    padding: 5;
+    border : 1px;
+}
+
+
+.form_button_image {
+    width : 48px;
+    height : 48px;
+}
\ No newline at end of file
diff --git a/shinken/webui/plugins/eltdetail/htdocs/js/graphs.js b/shinken/webui/plugins_skonf/newhosts/htdocs/js/results.js
similarity index 84%
copy from shinken/webui/plugins/eltdetail/htdocs/js/graphs.js
copy to shinken/webui/plugins_skonf/newhosts/htdocs/js/results.js
index 828eb6b..aedc93c 100644
--- a/shinken/webui/plugins/eltdetail/htdocs/js/graphs.js
+++ b/shinken/webui/plugins_skonf/newhosts/htdocs/js/results.js
@@ -1,4 +1,4 @@
-/*Copyright (C) 2009-2011 :
+/*Copyright (C) 2009-2012 :
      Gabes Jean, naparuba at gmail.com
      Gerhard Lausser, Gerhard.Lausser at consol.de
      Gregory Starck, g.starck at gmail.com
@@ -21,8 +21,9 @@
  along with Shinken.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-/* When the page load, we will look at the graph tab to show up
-   all element graph */
 
-window.addEvent('domready', function(){
-});
+
+
+function validatehostform(name) {
+    document.forms[name].submit();
+}
diff --git a/shinken/webui/plugins_skonf/newhosts/views/newhosts_results.tpl b/shinken/webui/plugins_skonf/newhosts/views/newhosts_results.tpl
index 5252616..fcb36fa 100644
--- a/shinken/webui/plugins_skonf/newhosts/views/newhosts_results.tpl
+++ b/shinken/webui/plugins_skonf/newhosts/views/newhosts_results.tpl
@@ -1,5 +1,5 @@
 
-%rebase layout_skonf globals()
+%rebase layout_skonf globals(), title="Discovery scan results", css=['newhosts/css/results.css']
 
 <div> <h1> Discover your new hosts </h1> </div>
 
@@ -11,16 +11,23 @@
 <p>Here are the results :</p>
 
 %for h in pending_hosts:
+     <div id="host-{{h['host_name']}}" class="grid_10 discovered_host">
      <br/>{{h}}
-     <form method="get" id="host-{{h['host_name']}}" action="/add">
+     <form method="post" id="form-{{h['host_name']}}" action="/newhosts/validatehost">
        <span class="table">
 	 <span class="row">
+	   <input name="_id" type="hidden" value="{{h['_id']}}"/>
 	   <span class="cell">
-	     <input name="tags" type="text" tabindex="1" value="{{h['use']}}" id="use-{{h['host_name']}}"/>
+             <label for="hostname">Hostname:</label>
+             <input name="hostname" type="text" tabindex="1" value="{{h['host_name']}}" id="form-host_name-{{h['host_name']}}"/>
+           </span>
+	   <span class="cell">
+	     <label for="tags">Tags:</label>
+	     <input name="tags" type="text" tabindex="2" value="{{h['use']}}" id="form-use-{{h['host_name']}}"/>
 	   </span>
 	   <span class="cell">
-	     <a tabindex="4" href="javascript: submitform()">
-	       <img src="/static/images/search.png" alt="search"/>
+	     <a tabindex="4" href='javascript: validatehostform("form-{{h['host_name']}}")'>
+	       <img class='form_button_image' src="/static/images/big_ack.png" alt="Validate"/>
 	     </a>
 	   </span>
 	 </span>
@@ -30,7 +37,7 @@
      %# " Add the auto copleter in the search input form"
      <script type="text/javascript">
        document.addEvent('domready', function() {
-         var tags = $("use-{{h['host_name']}}");
+         var tags = $("form-use-{{h['host_name']}}");
  
          // Our instance for the element with id "use-"
          new Autocompleter.Request.JSON(tags, '/lookup/tag', {
@@ -41,6 +48,7 @@
        
        });
      </script>
+     </div>
 
 
 %end

-- 
UNNAMED PROJECT



More information about the Pkg-nagios-changes mailing list