Skip to content
Permalink
Browse files

Merge remote-tracking branch 'origin/master' into testing_kibanaurl

  • Loading branch information...
pwnbus committed May 15, 2019
2 parents 32ecffb + 2f31e06 commit b1ed4d3f0e479462d7bc0ac67cfb5f45390de789
@@ -98,7 +98,7 @@ templating-compiler@1.3.3
templating-runtime@1.3.2
templating-tools@1.1.2
tracker@1.2.0
twbs:bootstrap@3.3.6
twbs:bootstrap@3.3.5
ui@1.0.13
underscore@1.0.10
url@1.2.0
@@ -0,0 +1,8 @@
<!--a nice greeting-->
<template name="hello">
<div class="container">
<div class="row center">
<p class="welcome"><img class="mozdeflogo" src="/images/moz_defense-platform_01.png"><br/> {{greeting}}</p>
</div>
</div>
</template>
@@ -0,0 +1,17 @@
if ( Meteor.isClient ) {

Template.hello.helpers( {
greeting: function() {
if ( typeof console !== 'undefined' )
console.log( "mozdef starting" );
return "Hand made by Mozilla";
}
} );

Template.hello.events( {
'click': function() {
// template data, if any, is available in 'this'
Session.set( 'displayMessage', 'Welcome to mozdef.' )
}
} );
};
@@ -0,0 +1,3 @@
<template name='loading'>
loading...
</template>
@@ -5,11 +5,16 @@ import { Mongo } from 'meteor/mongo';
import { Session } from 'meteor/session';
import { _ } from 'meteor/underscore';
import { Blaze } from 'meteor/blaze';
import '/client/loading.html';
import '/client/greeting.html';
import '/client/greeting.js';
import '/imports/settings.js';
import '/imports/collections.js';
import '/imports/helpers.js';
import '/imports/models.js';
import '/client/about.html';
import '/client/mozdef.html';
import '/client/layout.js';
import '/client/router.js';
import '/client/alertdetails.html';
import '/client/alertdetails.js';
import '/client/alertssummary.html';
@@ -54,11 +59,12 @@ import '/client/logincounts.html';
import '/client/logincounts.js';
import '/client/mozdefhealth.html';
import '/client/mozdefhealth.js';
import '/client/about.html';
import '/client/nameplate.html';
import '/client/nameplate.js';
import '/client/verisTags.html';
import '/client/preferences.html';
import '/client/preferences.js'
import '/client/router.js';
import '/public/css/dropdowns.css';
import '/client/mozdef.js';

@@ -2,15 +2,20 @@ import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { Tracker } from 'meteor/tracker'

Template.menu.rendered = function () {
Tracker.autorun(function() {
Meteor.subscribe("features");
});
Template.menu.rendered = function() {
Tracker.autorun( function() {
Meteor.subscribe( "features" );
} );
};

Template.menu.helpers({
haveFeatures: function(){
Template.menu.helpers( {
haveFeatures: function() {
//subscription has records?
return features.find().count() >0;
return features.find().count() > 0;
},
// loads kibana dashboards
kibanadashboards: function() {
Meteor.call( 'loadKibanaDashboards' );
return kibanadashboards.find();
}
});
} );
@@ -17,53 +17,27 @@
<!--begin layout templates-->
<!--the main, simple layout for the router to target-->
<template name="layout">
{{> menu}}

{{#if loggingIn}}
<div class="row center">
<div class="col-xs-5 col-xs-offset-3 alert alert-info alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
<div class="col-xs-5 col-xs-offset-3 alert alert-info" role="alert">
<strong>loading</strong>
</div>
</div>
{{else}}
{{#if currentUser}}
{{>yield}}
{{> Template.dynamic template=menuName }}
{{> yield }}
{{> whoismodal}}
{{> dshieldmodal}}
{{> blockIPModal}}
{{> intelmodal}}
{{> blockFQDNModal}}
{{> watchItemModal}}
{{else}}
<div class="row center">
<div class="col-xs-5 col-xs-offset-3 alert alert-info alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
<strong>Please login</strong>
</div>
</div>
{{> loginmenu}}
{{/if}}
{{/if}}

{{>whoismodal}}
{{>dshieldmodal}}
{{>blockIPModal}}
{{>intelmodal}}
{{>blockFQDNModal}}
{{>watchItemModal}}

</template>

<!--a nice greeting-->
<template name="hello">
<div class="container">
<div class="row center">
<!--a nice greeting-->
<p class="welcome"><img class="mozdeflogo" src="/images/moz_defense-platform_01.png"><br/>{{greeting}}</p>
</div>
</div>
</template>

<template name='loading'>
loading...
</template>

@@ -5,20 +5,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright (c) 2014 Mozilla Corporation
*/
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import validator from 'validator';
import '/imports/collections.js';
import '/imports/settings.js';
import '/imports/helpers.js';
import '/client/js/jquery.highlight.js';
import PNotify from 'pnotify';
import 'pnotify/dist/pnotify.css';
import './mozdef.html';
import './menu.html';
import './menu.js';
import '/client/layout.js';
import '/public/css/dropdowns.css';

import PNotify from 'pnotify';


if ( Meteor.isClient ) {
@@ -35,9 +24,9 @@ if ( Meteor.isClient ) {
Session.set( 'blockIPipaddress', '' );
Session.set( 'blockFQDN', '' );
Session.set( 'watchItemwatchcontent', '' );
Session.set( 'menuname', 'menu' );
getAllPlugins();
// use a default theme, overridden later by login per user
require( '/imports/themes/classic/mozdef.css' );

} );

prefs = function() {
@@ -170,29 +159,6 @@ if ( Meteor.isClient ) {
return result
};

Template.hello.helpers( {
greeting: function() {
if ( typeof console !== 'undefined' )
console.log( "mozdef starting" );
return "Hand Made by Mozilla";
}
} );

Template.hello.events( {
'click': function() {
// template data, if any, is available in 'this'
Session.set( 'displayMessage', 'Welcome to mozdef.' )
}
} );

// loads kibana dashboards
Template.menu.helpers( {
kibanadashboards: function() {
Meteor.call( 'loadKibanaDashboards' );
return kibanadashboards.find();
}
} );

UI.registerHelper( 'isFeature', function( featureName ) {
return isFeature( featureName );
} );
@@ -384,6 +350,10 @@ if ( Meteor.isClient ) {
}
} )

UI.registerHelper( 'menuName', function() {
return Session.get( 'menuname' );
} )

//Notify messages for the UI
Deps.autorun( function() {
//set Session.set('displayMessage','title&text')
@@ -502,17 +472,30 @@ if ( Meteor.isClient ) {

} else {
//console.log( 'client found preferences', preferenceRecord );

// import the preferred theme elements
// html must be 'imported' from somewhere other than the 'import'
// directory (hence the duplicate themes directory)
if ( preferenceRecord.theme == 'Dark' ) {
require( '/imports/themes/dark/mozdef.css' );
} else if ( preferenceRecord.theme == 'Light' ) {
require( '/imports/themes/light/mozdef.css' )
} else if ( preferenceRecord.theme == 'Dark Side Nav' ) {
require( '/client/themes/side_nav_dark/menu.html' )
require( '/imports/themes/side_nav_dark/menu.js' )
Session.set( 'menuname', 'side_nav_menu' );
require( '/imports/themes/side_nav_dark/mozdef.css' );
} else {
require( '/imports/themes/classic/mozdef.css' );
}
}
} );

} );

// finally,load the default starting point
// use a default theme and menu, overridden later by login per user preference
require( '/client/themes/none/menu-start.html' );
require( '/client/themes/none/menu-start.css' );
require( '/client/menu.html' );
require( '/client/menu.js' );
}
Oops, something went wrong.

0 comments on commit b1ed4d3

Please sign in to comment.
You can’t perform that action at this time.