Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript support #4

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ uiModule.directive('basePopoverTarget', function(dialogService) {
// ** base.d3filters -- D3 filters.

var d3filtersModule = angular.module('base.d3filters', []);
var d3filters = require('../common/d3filters.js');
var d3filters = require('../common/d3filters');

d3filtersModule.service('d3service', function() {
this.number = d3filters.number;
Expand Down
25 changes: 19 additions & 6 deletions client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,28 @@ const angularModule = angular.module('investigator', [
'ngRoute',
'investigator.Search',
'investigator.Routes',
'investigator.Templates',
'angular-websocket',
]);

// All submodules
var d3 = require('d3');
require('./routes.js');
require('./search.js');
require('./base.js');
require('./routes');
require('./search');
require('./base');
require('./template');
require('./partials/ldap');
require('./partials/logs');
require('./partials/netflow');
require('./partials/wiki');
require('./partials/users');
require('./partials/cylance');

// All CSS (for now)
require('./www/js/app.css');
require('bootswatch/paper/bootstrap.min.css');
require('codemirror/lib/codemirror.css');
require('codemirror/addon/hint/show-hint.css');
require('angular/angular-csp.css');

const extend = require('extend');

Expand Down Expand Up @@ -442,7 +455,7 @@ angularModule.service('appSocket', function AppSocket($websocket, $rootScope, $t
});

angularModule.service('app', function(appSocket, d3service, alerts, $rootScope, $log) {
var utilService = require('../common/util.js');
var utilService = require('../common/util');

function compareStringsCI(a, b) {
a = a.toLowerCase();
Expand Down Expand Up @@ -967,7 +980,7 @@ angularModule.directive('searchHighlighter', function($document, $window) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
var textile = require('../common/textile.js');
var textile = require('../common/textile');

scope.$watch(attrs.searchHighlighter, function(value) {
// Empty the element
Expand Down
5 changes: 0 additions & 5 deletions client/partials/cluster/index.js

This file was deleted.

5 changes: 0 additions & 5 deletions client/partials/cylance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ var angular = require('angular');
var module = angular.module('investigator');
var d3 = require('d3');

// Require all the template pages; browserify will turn these into angular templates
//require('./machine/summary.html');
require('./device/object.html');
require('./device/search.html');

function uncollapseArray(val) {
if(!val || angular.isArray(val))
return val;
Expand Down
13 changes: 2 additions & 11 deletions client/partials/ldap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ var angular = require('angular');
var module = angular.module('investigator');
var d3 = require('d3');

// Require all the template pages; browserify will turn these into angular templates
require('./object.html');
require('./search.html');
require('./reports/admins.html');
require('./reports/unused-accounts.html');
require('./reports/dc-roles.html');
require('./template/ldap-object-link.html');
require('./template/ldap-short-view.html');

module.directive('ldapObjectLink', function($rootScope, app, $log) {
// List of lookups to be done on the next digest cycle
var _upcomingLookups = [];
Expand Down Expand Up @@ -95,7 +86,7 @@ module.directive('ldapObjectLink', function($rootScope, app, $log) {
return {
restrict: 'E',
scope: {distinguishedName: '=?', objectGuid: '=?', summary: '=?', showDomain: '@'},
templateUrl: 'partials/ldap/template/ldap-object-link.html',
template: require('./template/ldap-object-link.html'),
link: function(scope, element) {
scope.$watch('fetchData.summary', function(newValue) {
populateScope(scope, newValue);
Expand Down Expand Up @@ -378,7 +369,7 @@ module.controller('views.ldap.reports.dc-roles', function LdapDCRolesController(
});

module.component('ldapShortView', {
templateUrl: 'partials/ldap/template/ldap-short-view.html',
template: require('./template/ldap-short-view.html'),
bindings: {
ldapSource: '<ldap',
},
Expand Down
18 changes: 2 additions & 16 deletions client/partials/logs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,7 @@ var angular = require('angular');
var module = angular.module('investigator');
var d3 = require('d3');

// Require all the template pages; browserify will turn these into angular templates
require('./bunyan/entry.html');
require('./wsa/entry.html');
require('./wsa/search.html');
require('./cylance/entry.html');
require('./cylance/search.html');
require('./msvista/entry.html');
require('./msvista/search.html');
require('./msvista/stats.html');
require('./sql/search.html');
require('./sql/entry.html');
require('./syslog/search.html');
require('./running-programs.html');

const logColumns = require('../../../common/logcolumns.js');
const logColumns = require('../../../common/logcolumns');

module.directive('logTable', function factory($log, $location, $sniffer, $parse, app, d3service) {
return {
Expand Down Expand Up @@ -482,7 +468,7 @@ module.controller('views.logs.msvista.search', function LogVistaSearchController
});

module.component('msvistaEntry', {
templateUrl: require('./msvista/entry-template.html'),
template: require('./msvista/entry-template.html'),
controller: function() {
this.$onChanges = function onChanges() {
this.eventTime = this.entry && new Date(this.entry.log.eventTime);
Expand Down
5 changes: 0 additions & 5 deletions client/partials/netflow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ var angular = require('angular');
var module = angular.module('investigator');
var d3 = require('d3');

// Require all the template pages; browserify will turn these into angular templates
require('./health.html');
require('./search.html');
require('./search-raw.html');

module.directive('netflowGraph', function factory($log, $location, $sniffer, $parse, app) {
var lastId = 0;

Expand Down
4 changes: 0 additions & 4 deletions client/partials/users/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ var angular = require('angular');
var module = angular.module('investigator');
var d3 = require('d3');

require('./list.html');
require('./user.html');
require('./new.html');

module.controller('views.users.list', function UsersListController($scope, $routeParams, userList, app, alerts) {
$scope.users = userList;
$scope.editWikiOptions = [
Expand Down
20 changes: 4 additions & 16 deletions client/partials/wiki/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,10 @@
var angular = require('angular');
var module = angular.module('investigator');
var d3 = require('d3');
var wikiUtil = require('../../../common/util.js');
var wikiUtil = require('../../../common/util');
var diff = require('diff');
var CodeMirror = require('codemirror');
require('codemirror/addon/hint/show-hint.js');

// Require all the template pages; browserify will turn these into angular templates
require('./article.html');
require('./new.html');
require('./search.html');
require('./tags-list.html');
require('./tag-report.html');
require('./wiki-merge.html');
require('./wiki-review.html');
require('./format-help.html');
require('./history.html');
require('./duplicate-tag-report.html');
require('codemirror/addon/hint/show-hint');

module.service('wikiHinter', function(app, alerts, $log) {
var _knownTags = d3.map();
Expand Down Expand Up @@ -253,7 +241,7 @@ function diffTags(oldTags, newTags) {

// Textile-parsing service
module.service('textile', function($window, $document, app) {
var textile = require('../../../common/textile.js');
var textile = require('../../../common/textile');

var attrWhitelist = d3.set([
'class', 'lang', 'id', 'align', 'colspan', 'rowspan',
Expand Down Expand Up @@ -1409,7 +1397,7 @@ module.directive('wikiTagEditor', function($rootScope, wikiHinter, $timeout) {
});

module.component('wikiMiniEditor', {
templateUrl: require('./wiki-mini-editor.html'),
template: require('./wiki-mini-editor.html'),
bindings: {
recommendations: '<',
providedArticle: '<article',
Expand Down
Loading