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

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


The following commit has been merged in the debian/master branch:
commit 63d35b55172ba1c52ded9ed431c48143189456ac
Author: Naparuba <naparuba at gmail.com>
Date:   Thu Jan 19 15:22:02 2012 +0100

    Add : skonfui: raw addition for discovered hosts.

diff --git a/shinken/webui/plugins_skonf/newhosts/newhosts.py b/shinken/webui/plugins_skonf/newhosts/newhosts.py
index 02e1bad..a736883 100644
--- a/shinken/webui/plugins_skonf/newhosts/newhosts.py
+++ b/shinken/webui/plugins_skonf/newhosts/newhosts.py
@@ -96,6 +96,30 @@ def get_results():
     return {'app' : app, 'pending_hosts' : pending_hosts, 'scans' : scans}
 
 
+
+def post_validatehost():
+    print "Got forms in /newhosts/validatehost call"
+    _id = app.request.forms.get('_id', 'unknown-host')
+    tags = app.request.forms.get('tags', '')
+    host_name = app.request.forms.get('host_name', 'unamed')
+
+    print "DUMP FORMS", app.request.forms
+    print "Got in request form", _id, host_name, tags
+
+    host = {'_id' : _id, 'host_name' : host_name, 'use' : tags}
+    print "Saving", host, "in", app.db.hosts
+    r = app.db.hosts.save(host)
+    print "result", r
+
+    # Now we can remove the one in the discovered part
+    print "And deleting the discovered host"
+    r = app.db.discovered_hosts.remove({'_id' : _id})
+    print "result", r
+
+    return None#{'app' : app}
+
+
+
 # This is the dict teh webui will try to "load".
 #  *here we register one page with both adresses /dummy/:arg1 and /dummy/, both addresses
 #   will call the function get_page.
@@ -108,5 +132,6 @@ pages = {get_newhosts : { 'routes' : ['/newhosts'], 'view' : 'newhosts', 'static
          get_launch : { 'routes' : ['/newhosts/launch'], 'view' : 'newhosts_launch', 'static' : True, 'method' : 'POST'},
          get_scans : { 'routes' : ['/newhosts/scans'], 'view' : 'newhosts_scans', 'static' : True},
          get_results : { 'routes' : ['/newhosts/results'], 'view' : 'newhosts_results', 'static' : True},
+         post_validatehost : { 'routes' : ['/newhosts/validatehost'], 'view' : None, 'method' : 'POST'},
          }
 
diff --git a/shinken/webui/plugins_skonf/newhosts/views/newhosts_results.tpl b/shinken/webui/plugins_skonf/newhosts/views/newhosts_results.tpl
index fcb36fa..77dafa3 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(), title="Discovery scan results", css=['newhosts/css/results.css']
+%rebase layout_skonf globals(), title="Discovery scan results", css=['newhosts/css/results.css'], js=['newhosts/js/results.js']
 
 <div> <h1> Discover your new hosts </h1> </div>
 

-- 
UNNAMED PROJECT



More information about the Pkg-nagios-changes mailing list