Skip to content

Commit

Permalink
Add kibana as a submodule.
Browse files Browse the repository at this point in the history
Configure app to work with submodule.
  • Loading branch information
rammie committed Oct 30, 2014
1 parent 5a1a849 commit 07d1fcf
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 36 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "kibana"]
path = kibana
url = https://github.com/OpenSOC/kibana
1 change: 1 addition & 0 deletions kibana
Submodule kibana added at 9ebc74
File renamed without changes.
13 changes: 11 additions & 2 deletions lib/opensoc-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ try {
config = _.merge(config, require('../config'));
console.log('Loaded config overrides');
} catch(err) {
console.log(err);
console.log('No config overrides provided');
}

Expand Down Expand Up @@ -95,9 +96,17 @@ passport.deserializeUser(function (ldapUser, done) {
pcap(app, config);
login(app, config);

// Serve static assets
app.use(connect.static(path.join(__dirname, 'public')));
app.get('/config.js', function (req, res) {
if (!req.user) {
res.send(403, 'Forbidden!');
return;
}

res.sendfile('config-kibana.js', {root: 'lib'});
});

// Serve static assets
app.use(connect.static(path.join(__dirname, 'static')));

// Start server
var server = http.createServer(app);
Expand Down
6 changes: 3 additions & 3 deletions lib/public/app/panels/table/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,11 @@ function (angular, app, _, kbn, moment) {
$scope.field_title = $filter('fieldTitle');

$scope.events_filter = null;
$scope.filter_events = function(reference_id) {
$scope.reference_id = reference_id;
$scope.filter_events = function(alert_id) {
$scope.alert_id = alert_id;
$scope.events_filter = filterSrv.set({
type:'querystring',
query: reference_id,
query: alert_id,
mandate: 'must'
});
}
Expand Down
1 change: 1 addition & 0 deletions lib/static
57 changes: 32 additions & 25 deletions lib/views/index.jade
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
doctype html
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
html
head
meta(charset='utf-8')
Expand All @@ -9,35 +13,38 @@ html
link(rel='stylesheet', href='css/timepicker.css')
link(rel='stylesheet', href='css/animate.min.css')
link(rel='stylesheet', href='css/normalize.min.css')
link(rel='stylesheet', href='css/opensoc.css')
//
load the root require context
// load the root require context
script(src='vendor/require/require.js')
script(src='app/components/require.config.js')
script.
user=!{user}
config=!{config}
require(['app'], function () {})
style
body
noscript
.container
center
h3 You must enable javascript to use Kibana
link(rel='stylesheet', ng-href='css/bootstrap.{{dashboard.current.style||\'dark\'}}.min.css')
link(rel='stylesheet', href='css/bootstrap-responsive.min.css')
link(rel='stylesheet', href='css/font-awesome.min.css')
div(class='alert-{{alert.severity}} dashboard-notice', ng-cloak='ng-cloak', ng-repeat='alert in dashAlerts.list', ng-show='$last')
button.close(type='button', ng-click='dashAlerts.clear(alert)', style='padding-right: 50px;') ×
strong {{alert.title}}
span(ng-bind-html='alert.text')
.pull-right.small(style='padding-right: 10px;') {{$index + 1}} alert(s)
.navbar.navbar-static-top(ng-cloak='ng-cloak')
.navbar-inner
.container-fluid
span.brand
img(src='img/small.png', bs-tooltip='\'Kibana \'+(kbnVersion==\'@REV@\'?\'master\':kbnVersion)', data-placement='bottom')
| {{dashboard.current.title}}
ul.nav.pull-right(ng-controller='dashLoader', ng-init='init()', ng-include='\'app/partials/dashLoader.html\'')
div(ng-cloak='ng-cloak', ng-view='ng-view')
body.
<noscript>
<div class="container">
<center><h3>You must enable javascript to use Kibana</h3></center>
</div>
</noscript>
<!--<link rel="stylesheet" ng-href="css/bootstrap.{{dashboard.current.style||'dark'}}.min.css">-->
<link rel="stylesheet" ng-href="css/bootstrap.{{dashboard.current.style||'dark'}}.min.css">
<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">

<div ng-cloak ng-repeat='alert in dashAlerts.list' class="alert-{{alert.severity}} dashboard-notice" ng-show="$last">
<button type="button" class="close" ng-click="dashAlerts.clear(alert)" style="padding-right:50px">&times;</button>
<strong>{{alert.title}}</strong> <span ng-bind-html='alert.text'></span> <div style="padding-right:10px" class='pull-right small'> {{$index + 1}} alert(s) </div>
</div>
<div ng-cloak class="navbar navbar-static-top">
<div class="navbar-inner">
<div class="container-fluid">
<span class="brand"><img src="img/small.png" bs-tooltip="'Kibana '+(kbnVersion=='@REV@'?'master':kbnVersion)" data-placement="bottom"> {{dashboard.current.title}}</span>

<ul class="nav pull-right" ng-controller='dashLoader' ng-init="init()" ng-include="'app/partials/dashLoader.html'">
</ul>
</div>
</div>
</div>

<div ng-cloak ng-view></div>
19 changes: 13 additions & 6 deletions lib/views/login.jade
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@ html
link(rel='stylesheet', href='css/timepicker.css')
link(rel='stylesheet', href='css/animate.min.css')
link(rel='stylesheet', href='css/normalize.min.css')
link(rel='stylesheet', href='css/opensoc.css')
style
style.
.login-form {
margin-top: 60px;
border: 1px solid #666;
padding: 20px;
}

td.count {
background-color: #ee0000;
}
body
noscript
.container
Expand All @@ -27,17 +35,16 @@ html
legend Login
if flash.error
.alert.alert-error=flash.error
div(class="#{flash.error ? 'control-group error' : 'control-group'}")
div(class="#{flash.error ? 'control-group error' : 'control-group'}")
label.control-label(for='inputEmail') Email
.controls
input#inputEmail(type='text', name='email', placeholder='Email')

div(class="#{flash.error ? 'control-group error' : 'control-group'}")
div(class="#{flash.error ? 'control-group error' : 'control-group'}")
label.control-label(for='inputPassword') Password
.controls
input#inputPassword(type='password', name='password', placeholder='Password')
.control-group
.controls
button.btn(type='submit') Sign in
//
<div ng-cloak ng-view></div>
// <div ng-cloak ng-view></div>

0 comments on commit 07d1fcf

Please sign in to comment.