Skip to content

Commit

Permalink
Merge commit '6da3182ad084eda6369e1b7f04b02a431da4c7ad' into integracion
Browse files Browse the repository at this point in the history
  • Loading branch information
dioh committed Jun 6, 2014
2 parents a1f52c4 + 6da3182 commit f9d068d
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 94 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ nosetests.xml
.mr.developer.cfg
.project
.pydevproject

# ui_mranea
lib-ubuntu13-10-i686.tgz
lib-ubuntu13-10-i686/
views/reports/_attachments/reports/push.sh
views/upload
17 changes: 0 additions & 17 deletions views/_design/hosts/views/services/map.js

This file was deleted.

19 changes: 1 addition & 18 deletions views/_design/hosts/views/vulns/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,6 @@

function(doc) {
if(doc.type=="Vulnerability" || doc.type=="VulnerabilityWeb") {
var label = "5";
var sev = doc.severity;
if(sev == "Information") {
label = "0";
} else if(sev == "Low") {
label = "1";
} else if(sev == "Medium") {
label = "2";
} else if(sev == "High") {
label = "3";
} else if(sev == "Critical") {
label = "4";
} else if(sev=="") {
label = "5";
} else if(sev >= 0 && sev <= 4) {
label = sev;
}
emit(label, 1);
emit(doc.severity, 1);
}
}
17 changes: 11 additions & 6 deletions views/reports/_attachments/estilos.css
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,7 @@ aside {
-moz-transition: all .3s ease;
-webkit-transition: all .3s ease;
}
aside nav a.activo, aside nav a:hover {
background: #DF3936;
}


.seccion {
background: #E8EFF0;
Expand Down Expand Up @@ -475,12 +473,10 @@ table.tablesorter tbody tr td:first-child {
margin-bottom: .5em !important;
}
.formu .input, .formu textarea, .formu select, .input {
/*
border-radius:5px;
border-radius:5px;
-ms-border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
*/
}
.formu .input:focus, .formu textarea:focus, .formu select:focus, .input:focus {
border-color: #aaa;
Expand Down Expand Up @@ -524,3 +520,12 @@ label {
color: #2D333D;
font-size: 13px;
}
.left {
float: left;
}
#sec {
float: right;
}
* { /* compatibilidad entre nuestros estilos y los de bootstrap */
-moz-box-sizing: content-box !important;
}
118 changes: 65 additions & 53 deletions views/reports/_attachments/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

<!-- !CSS -->
<link rel="stylesheet" type="text/css" href="estilos.css" />
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">

<link href="favicon.ico" rel="shortcut icon">
<link href="favicon.ico" type="image/vnd.microsoft.icon" rel="icon" />
Expand All @@ -30,30 +32,14 @@
<script type="text/javascript" src="/_utils/script/jquery.js"></script>
<script type="text/javascript" src="/_utils/script/jquery.couch.js"></script>
<script type="text/javascript" src="script/jquery.tablesorter.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
</head>

<body>
<div id="cont">
<div class="wrapper">
<header class="head">
<a href="#"><img class="logo" src="images/logo-faraday.png"/></a>
<!-- <nav> -->
<!-- <ul class="menu"> -->
<!-- <li> -->
<!-- <a href="#">Opción 1</a> -->
<!-- </li> -->
<!-- <li> -->
<!-- <a href="#">Opción 1</a> -->
<!-- </li> -->
<!-- <li> -->
<!-- <a href="#" class="activo">Username</a> -->
<!-- <ul> -->
<!-- <li><a href="#">Sub opción 1</a></li> -->
<!-- <li><a href="#">Sub opción 2</a></li> -->
<!-- </ul> -->
<!-- </li> -->
<!-- </ul> -->
<!-- </nav> -->
</header>

<aside>
Expand All @@ -68,7 +54,17 @@
</nav>
</aside>

<section class="seccion clearfix">
<section id="main" class="seccion clearfix">
<div id="sec" class="btn-group">
<button id="refresh" type="button" class="btn btn-danger" title="Refresh current workspace">
<span class="glyphicon glyphicon-refresh"></span>
</button>
<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" title="Change current workspace">
Change workspace <span class="caret"></span>
</button>
<ul id="nav" class="dropdown-menu" role="menu">
</ul><!-- navegacion de WS -->
</div>
<div id="reportes" class="fila clearfix">
</div><!-- fin fila -->
</section>
Expand All @@ -77,43 +73,59 @@
</div><!--!/#wrapper -->
</div><!--!/#container -->
<script type="text/javascript">
loaded = false;
counter = 0;
$.couch.allDbs({
success : function(dbs) {
dbs.filter(function(db_name){
return db_name.search(/^_/) < 0 && db_name.search("reports") < 0;})
//return db_name == "ws0";})
.forEach(function(db) {
var iframes = [];
reports.forEach( function(reps) {
var iframe = "/reports/_design/reports/reports/"+reps+".html?workspace="+db+"&design="+designs[reps]+"&view="+views[reps];
// alto del iframe fijo
//iframes.push("<iframe src="+iframe+" height=\""+sizes[reps]+"\" width=\"800\"></iframe>");
// sin alto de iframe
$(document).ready(function() {
var counter = 0;
var h = 0;
$.couch.allDbs({
success : function(dbs) {
dbs.filter(function(db_name){
return db_name.search(/^_/) < 0 && db_name.search("reports") < 0;})
.forEach(function(db) {
// armo la lista con todos los WSs
$("#sec #nav").append('<li><a href="#'+db+'" class="ws">'+db+'</a></li>');
// navegación entre WSs
if(window.location.hash === "" && counter === 0) {
window.location.hash = db;
}
counter +=1;
});
if(counter < 1) {
$("#reportes").empty();
$("#reportes").append("<div id=\"no-workspace\" class=\"workspace\">No Workspaces installed, please start working to get some data</div><!-- .workspace -->");
}
// seteo el WS actual
var current = window.location.hash.substr(1);
// armo los iframes que le corresponden
var iframes = get_iframes(current);
// los cargo
$("#reportes").append(iframes);
// calculo la altura del sidebar
$("aside").height($("#main").height()+40);
}
});
// navegacion entre WSs en el dropdown
$(document).on("click", "a.ws", function(e) {
e.preventDefault();
var hash = $(this).attr("href").substr(1);
$("#reportes").empty().append(get_iframes(hash));
window.location.hash = hash;
});
$(document).on("click", "#refresh", function() {
location.reload();
});
});
// genera los iframes correspondientes a un WS
function get_iframes(db) {
var iframes = [];
reports.forEach(function(rep) {
var iframe = "/reports/_design/reports/reports/"+rep+".html?workspace="+db+"&design="+designs[rep]+"&view="+views[rep];
iframes.push("<iframe class=\"iframe\" src="+iframe+" width=\"800\" height=\"500\"></iframe>");
});
$("#reportes").append("<div id=\"workspace-"+db+"\" class=\"workspace\"><h2>"+db+"</h2>"+iframes.join("")+"</div><!-- .workspace -->");
// cuando termina de cargar los datos de los workspaces setea el alto del menu de la izquierda
var h = $("div#reportes").height();
$("aside").height(h);
counter +=1;
});
if(counter < 1){
$("#reportes").empty();
$("#reportes").append("<div id=\"no-workspace\" class=\"workspace\">No Workspaces installed, please start working to get some data</div><!-- .workspace -->");
}
}
});

});
var ret = "<div id=\"workspace-"+db+"\" class=\"workspace\"><div class=\"left\"><h2>Viewing "+
db+"</h2></div>"+iframes.join("")+"</div><!-- .workspace -->";
return ret;
}
</script>

<script type="text/javascript">
$(function(){
// Table sorter
$("#myTable").tablesorter();
//
});
</script>
</body>
</html>
6 changes: 6 additions & 0 deletions views/reports/_attachments/script/jquery.ui.tabs.min.js

Large diffs are not rendered by default.

0 comments on commit f9d068d

Please sign in to comment.