You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metron.apache.org by ce...@apache.org on 2016/06/17 14:37:49 UTC
[44/46] incubator-metron git commit: METRON-237 Remove metron-ui from
the code base. (mmiklavcic via cestella) closes apache/incubator-metron#159
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/dashboards/pcap5.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/dashboards/pcap5.js b/metron-ui/lib/public/app/dashboards/pcap5.js
deleted file mode 100644
index 08fa5cb..0000000
--- a/metron-ui/lib/public/app/dashboards/pcap5.js
+++ /dev/null
@@ -1,280 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* global _ */
-
-/*
- * Complex scripted Logstash dashboard
- * This script generates a dashboard object that Kibana can load. It also takes a number of user
- * supplied URL parameters, none are required:
- *
- * index :: Which index to search? If this is specified, interval is set to 'none'
- * pattern :: Does nothing if index is specified. Set a timestamped index pattern. Default: [logstash-]YYYY.MM.DD
- * interval :: Sets the index interval (eg: day,week,month,year), Default: day
- *
- * split :: The character to split the queries on Default: ','
- * query :: By default, a comma separated list of queries to run. Default: *
- *
- * from :: Search this amount of time back, eg 15m, 1h, 2d. Default: 15m
- * timefield :: The field containing the time to filter on, Default: message.timestamp
- *
- * fields :: comma separated list of fields to show in the table
- * sort :: comma separated field to sort on, and direction, eg sort=message.timestamp,desc
- *
- */
-
-'use strict';
-
-// Setup some variables
-var dashboard, queries, _d_timespan;
-
-// All url parameters are available via the ARGS object
-var ARGS;
-
-// Set a default timespan if one isn't specified
-_d_timespan = '3d';
-
-// Intialize a skeleton with nothing but a rows array and service object
-dashboard = {
- rows : [],
- services : {}
-};
-
-// Set a title
-dashboard.title = 'GoodBig Co. with PCAP';
-
-dashboard.failover = false;
-dashboard.index = {
- default: 'bro,fireeye,qosmos,sourcefire,qradar,lancope',
- interval: 'none'
-};
-
-
-// In this dashboard we let users pass queries as comma separated list to the query parameter.
-// Or they can specify a split character using the split aparameter
-// If query is defined, split it into a list of query objects
-// NOTE: ids must be integers, hence the parseInt()s
-if(!_.isUndefined(ARGS.query)) {
- queries = _.object(_.map(ARGS.query.split(ARGS.split||','), function(v,k) {
- return [k,{
- query: v,
- id: parseInt(k,10),
- alias: v
- }];
- }));
-} else {
- // No queries passed? Initialize a single query to match everything
- queries = {
- 0: {
- "query": "enrichment.alert.priority:1",
- "alias": "Severe",
- "color": "#FF0000",
- "id": 0,
- "pin": true,
- "type": "lucene",
- "enable": true
- },
- 1: {
- "query": "enrichment.alert.priority:2",
- "alias": "Urgent",
- "color": "#FF9900",
- "id": 1,
- "pin": true,
- "type": "lucene",
- "enable": true
- },
- 2: {
- "query": "enrichment.alert.priority:3",
- "alias": "Warning",
- "color": "#FFFF00",
- "id": 2,
- "pin": true,
- "type": "lucene",
- "enable": true
- }
- };
-}
-
-
-// Now populate the query service with our objects
-dashboard.services.query = {
- list : queries,
- ids : _.map(_.keys(queries),function(v){return parseInt(v,10);})
-};
-
-// Lets also add a default time filter, the value of which can be specified by the user
-
-dashboard.services.filter = {
- list: {
- 0: {
- from: "now-"+(ARGS.from||_d_timespan),
- to: "now",
- field: ARGS.timefield||"enrichment.message.timestamp",
- type: "time",
- active: true,
- id: 0,
- }
- },
- ids: [0]
-};
-
-
-
-
-// Ok, lets make some rows. The Filters row is collapsed by default
-dashboard.rows = [
- {
- title: "Alerts Queue Overview",
- height: "200px"
- },
- {
- title: "Alerts Query Results",
- height: "200px"
- }
-];
-
-// And a table row where you can specify field and sort order
-dashboard.rows[0].panels = [
- {
- title: 'Alerts Count type',
- type: 'terms',
- field: '_type',
- span: 2,
- other: false,
- missing: false,
- chart: 'table',
- locked: true
- },
- {
- title: 'Alerts Count priority',
- type: 'terms',
- field: 'enrichment.alert.priority',
- span: 2,
- other: false,
- missing: false,
- chart: 'table',
- locked: true
- },
- {
- title: 'Source of All Alerts',
- type: 'terms',
- fields: !_.isUndefined(ARGS.fields) ? ARGS.fields.split(',') : ['_type'],
- chart: 'pie',
- span: 4,
- other: false,
- missing: false,
- locked: true
- },
- {
- "span": 3,
- "editable": true,
- "type": "hits",
- "loadingEditor": false,
- "style": {
- "font-size": "10pt"
- },
- "arrangement": "horizontal",
- "chart": "bar",
- "counter_pos": "above",
- "donut": false,
- "tilt": false,
- "labels": true,
- "spyable": true,
- "queries": {
- "mode": "selected",
- "ids": [
- 0,
- 1,
- 2
- ]
- },
- "locked": true,
- "title": "Alerts Severity"
- },
- {
- title: 'Alerts Severity Timeline',
- type: 'histogram',
- fields: !_.isUndefined(ARGS.fields) ? ARGS.fields.split(',') : ['_type'],
- mode: 'count',
- span: 10,
- time_field: 'enrichment.message.timestamp'
- },
- {
- title: 'Top Alerts',
- type: 'table',
- fields: !_.isUndefined(ARGS.fields) ? ARGS.fields.split(',') : [
- "enrichment.message.timestamp",
- "enrichment.alert.priority",
- "_type",
- "enrichment.message.ip_src_addr",
- "enrichment.message.ip_dst_addr",
- "enrichment.message.original_string"
- ],
- size: 10,
- sort: !_.isUndefined(ARGS.sort) ? ARGS.sort.split(',') : [ARGS.timefield||'enrichment.alert.priority','desc'],
- overflow: 'expand',
- span: 12,
- field_list: false,
- timeField: 'enrichment.message.timestamp',
- localTime: true,
- locked: true,
- sortable: false
- }
-];
-
-// And Query Results
-dashboard.rows[1].panels = [
- {
- title: 'Alert Query Resuts',
- type: 'table',
- fields: !_.isUndefined(ARGS.fields) ? ARGS.fields.split(',') : [
- "enrichment.message.timestamp",
- "enrichment.alert.priority",
- "_type",
- "enrichment.message.ip_src_addr",
- "enrichment.message.ip_dst_addr",
- "enrichment.message.original_string"
- ],
- size: 30,
- sort: !_.isUndefined(ARGS.sort) ? ARGS.sort.split(',') : [ARGS.timefield||'enrichment.message.timestamp','asc'],
- overflow: 'expand',
- span: 12,
- field_list: false,
- timeField: 'enrichment.message.timestamp',
- localTime: true
- },
- {
- title: 'PCAP Panel',
- type: 'pcap',
- span: 12
- }
-];
-
-// And a PCAP Panel
-/*dashboard.rows[2].panels = [
- {
- title: 'PCAP Panel',
- type: 'pcap',
- span: 12
- }
-];*/
-
-
-
-// Now return the object and we're good!
-return dashboard;
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/directives/addPanel.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/directives/addPanel.js b/metron-ui/lib/public/app/directives/addPanel.js
deleted file mode 100755
index 2565595..0000000
--- a/metron-ui/lib/public/app/directives/addPanel.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-define([
- 'angular',
- 'app',
- 'lodash'
-],
-function (angular, app, _) {
- 'use strict';
-
- angular
- .module('kibana.directives')
- .directive('addPanel', function($compile) {
- return {
- restrict: 'A',
- link: function($scope, elem) {
-
- $scope.$on("$destroy",function() {
- elem.remove();
- });
-
- $scope.$watch('panel.type', function() {
- var _type = $scope.panel.type;
- $scope.reset_panel(_type);
- if(!_.isUndefined($scope.panel.type)) {
- $scope.panel.loadingEditor = true;
- $scope.require(['panels/'+$scope.panel.type.replace(".","/") +'/module'], function () {
- var template = '<div ng-controller="'+$scope.panel.type+'" ng-include="\'app/partials/paneladd.html\'"></div>';
- elem.html($compile(angular.element(template))($scope));
- $scope.panel.loadingEditor = false;
- });
- }
- });
- }
- };
- });
-});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/directives/all.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/directives/all.js b/metron-ui/lib/public/app/directives/all.js
deleted file mode 100755
index eb59269..0000000
--- a/metron-ui/lib/public/app/directives/all.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-define([
- './addPanel',
- './arrayJoin',
- './dashUpload',
- './kibanaPanel',
- './kibanaSimplePanel',
- './ngBlur',
- './ngModelOnBlur',
- './tip',
- './confirmClick',
- './esVersion',
- './configModal'
-], function () {});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/directives/arrayJoin.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/directives/arrayJoin.js b/metron-ui/lib/public/app/directives/arrayJoin.js
deleted file mode 100755
index 80fc5c3..0000000
--- a/metron-ui/lib/public/app/directives/arrayJoin.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-define([
- 'angular',
- 'app',
- 'lodash'
-],
-function (angular, app, _) {
- 'use strict';
-
- angular
- .module('kibana.directives')
- .directive('arrayJoin', function() {
- return {
- restrict: 'A',
- require: 'ngModel',
- link: function(scope, element, attr, ngModel) {
-
- function split_array(text) {
- return (text || '').split(',');
- }
-
- function join_array(text) {
- if(_.isArray(text)) {
- return (text || '').join(',');
- } else {
- return text;
- }
- }
-
- ngModel.$parsers.push(split_array);
- ngModel.$formatters.push(join_array);
- }
- };
- });
-});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/directives/configModal.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/directives/configModal.js b/metron-ui/lib/public/app/directives/configModal.js
deleted file mode 100755
index 14b765d..0000000
--- a/metron-ui/lib/public/app/directives/configModal.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-define([
- 'angular',
- 'lodash'
-],
-function (angular,_) {
- 'use strict';
-
- angular
- .module('kibana.directives')
- .directive('configModal', function($modal,$q) {
- return {
- restrict: 'A',
- link: function(scope, elem, attrs) {
- var
- model = attrs.kbnModel,
- partial = attrs.configModal;
-
-
- // create a new modal. Can't reuse one modal unforunately as the directive will not
- // re-render on show.
- elem.bind('click',function(){
-
- // Create a temp scope so we can discard changes to it if needed
- var tmpScope = scope.$new();
- tmpScope[model] = angular.copy(scope[model]);
-
- tmpScope.editSave = function(panel) {
- // Correctly set the top level properties of the panel object
- _.each(panel,function(v,k) {
- scope[model][k] = panel[k];
- });
- };
-
- var panelModal = $modal({
- //template: './app/partials/paneleditor.html',
- template: partial,
- persist: true,
- show: false,
- scope: tmpScope,
- keyboard: false
- });
-
- // and show it
- $q.when(panelModal).then(function(modalEl) {
- modalEl.modal('show');
- });
- scope.$apply();
- });
- }
- };
- });
-});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/directives/confirmClick.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/directives/confirmClick.js b/metron-ui/lib/public/app/directives/confirmClick.js
deleted file mode 100755
index a661520..0000000
--- a/metron-ui/lib/public/app/directives/confirmClick.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-define([
- 'angular',
- 'kbn'
-],
-function (angular) {
- 'use strict';
-
- var module = angular.module('kibana.directives');
-
- module.directive('confirmClick', function() {
- return {
- restrict: 'A',
- link: function(scope, elem, attrs) {
- elem.bind('click', function() {
- var message = attrs.confirmation || "Are you sure you want to do that?";
- if (window.confirm(message)) {
- var action = attrs.confirmClick;
- if (action) {
- scope.$apply(scope.$eval(action));
- }
- }
- });
- },
- };
- });
-});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/directives/dashUpload.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/directives/dashUpload.js b/metron-ui/lib/public/app/directives/dashUpload.js
deleted file mode 100755
index 77e4673..0000000
--- a/metron-ui/lib/public/app/directives/dashUpload.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-define([
- 'angular'
-],
-function (angular) {
- 'use strict';
-
- var module = angular.module('kibana.directives');
-
- module.directive('dashUpload', function(timer, dashboard, alertSrv){
- return {
- restrict: 'A',
- link: function(scope) {
- function file_selected(evt) {
- var files = evt.target.files; // FileList object
- var readerOnload = function() {
- return function(e) {
- dashboard.dash_load(JSON.parse(e.target.result));
- scope.$apply();
- };
- };
- for (var i = 0, f; f = files[i]; i++) {
- var reader = new FileReader();
- reader.onload = (readerOnload)(f);
- reader.readAsText(f);
- }
- }
- // Check for the various File API support.
- if (window.File && window.FileReader && window.FileList && window.Blob) {
- // Something
- document.getElementById('dashupload').addEventListener('change', file_selected, false);
- } else {
- alertSrv.set('Oops','Sorry, the HTML5 File APIs are not fully supported in this browser.','error');
- }
- }
- };
- });
-});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/directives/esVersion.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/directives/esVersion.js b/metron-ui/lib/public/app/directives/esVersion.js
deleted file mode 100755
index 35c6324..0000000
--- a/metron-ui/lib/public/app/directives/esVersion.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- Only show an element if it meets an Elasticsearch version requirement
-*/
-
-define([
- 'angular',
- 'app',
-],
-function (angular) {
- 'use strict';
-
- angular
- .module('kibana.directives')
- .directive('esVersion', function(esVersion) {
- return {
- restrict: 'A',
- link: function(scope, elem, attr) {
- if(!esVersion.is(attr.esVersion)) {
- elem.hide();
- }
- }
- };
- });
-});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/directives/kibanaPanel.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/directives/kibanaPanel.js b/metron-ui/lib/public/app/directives/kibanaPanel.js
deleted file mode 100755
index c5bf266..0000000
--- a/metron-ui/lib/public/app/directives/kibanaPanel.js
+++ /dev/null
@@ -1,149 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-define([
- 'angular',
- 'jquery'
-],
-function (angular,$) {
- 'use strict';
-
- angular
- .module('kibana.directives')
- .directive('kibanaPanel', function($compile) {
- var container = '<div class="panel-container" ng-style="{\'min-height\':row.height}"></div>';
- var content = '<div class="panel-content"></div>';
-
- var panelHeader =
- '<div class="panel-header">'+
- '<div class="row-fluid">' +
- '<div class="span12 alert-error panel-error" ng-hide="!panel.error">' +
- '<a class="close" ng-click="panel.error=false">×</a>' +
- '<i class="icon-exclamation-sign"></i> <strong>Oops!</strong> {{panel.error}}' +
- '</div>' +
- '</div>\n' +
-
- '<div class="row-fluid panel-extra">' +
- '<div class="panel-extra-container">' +
-
- '<span class="extra row-button" ng-show="panel.editable != false && panel.removable != false">' +
- '<span confirm-click="row.panels = _.without(row.panels,panel)" '+
- 'confirmation="Are you sure you want to remove this {{panel.type}} panel?" class="pointer">'+
- '<i class="icon-remove pointer" bs-tooltip="\'Remove\'"></i></span>'+
- '</span>' +
-
- '<span class="extra row-button" ng-hide="panel.draggable == false">' +
- '<span class="pointer" bs-tooltip="\'Drag here to move\'"' +
- 'data-drag=true data-jqyoui-options="kbnJqUiDraggableOptions"'+
- ' jqyoui-draggable="'+
- '{'+
- 'animate:false,'+
- 'mutate:false,'+
- 'index:{{$index}},'+
- 'onStart:\'panelMoveStart\','+
- 'onStop:\'panelMoveStop\''+
- '}" ng-model="row.panels"><i class="icon-move"></i></span>'+
- '</span>' +
-
- '<span class="row-button extra" ng-show="panel.editable != false">' +
- '<span config-modal="./app/partials/paneleditor.html" kbn-model="panel" class="pointer">'+
- '<i class="icon-cog pointer" bs-tooltip="\'Configure\'"></i></span>'+
- '</span>' +
-
- '<span ng-repeat="task in panelMeta.modals" class="row-button extra" ng-show="task.show">' +
- '<span bs-modal="task.partial" class="pointer"><i ' +
- 'bs-tooltip="task.description" ng-class="task.icon" class="pointer"></i></span>'+
- '</span>' +
-
- '<span class="row-button extra" ng-show="panelMeta.loading == true">' +
- '<span>'+
- '<i class="icon-spinner icon-spin icon-large"></i>' +
- '</span>'+
- '</span>' +
-
- '<span class="panel-text panel-title">' +
- '{{panel.title?panel.title:panel.type}}' +
- '</span>'+
-
- '</div>'+
- '</div>\n'+
- '</div>';
- return {
- restrict: 'E',
- link: function($scope, elem, attr) {
- // once we have the template, scan it for controllers and
- // load the module.js if we have any
- var newScope = $scope.$new();
-
- $scope.kbnJqUiDraggableOptions = {
- revert: 'invalid',
- helper: function() {
- return $('<div style="width:200px;height:100px;background: rgba(100,100,100,0.50);"/>');
- },
- placeholder: 'keep'
- };
-
- // compile the module and uncloack. We're done
- function loadModule($module) {
- $module.appendTo(elem);
- elem.wrap(container);
- /* jshint indent:false */
- $compile(elem.contents())(newScope);
- elem.removeClass("ng-cloak");
- }
-
- newScope.$on('$destroy',function(){
- elem.unbind();
- elem.remove();
- });
-
- $scope.$watch(attr.type, function (name) {
- elem.addClass("ng-cloak");
- // load the panels module file, then render it in the dom.
- var nameAsPath = name.replace(".", "/");
- $scope.require([
- 'jquery',
- 'text!panels/'+nameAsPath+'/module.html',
- 'text!panels/'+nameAsPath+'/editor.html'
- ], function ($, moduleTemplate) {
- var $module = $(moduleTemplate);
- // top level controllers
- var $controllers = $module.filter('ngcontroller, [ng-controller], .ng-controller');
- // add child controllers
- $controllers = $controllers.add($module.find('ngcontroller, [ng-controller], .ng-controller'));
-
- if ($controllers.length) {
- $controllers.first().prepend(panelHeader);
-
- $controllers.first().find('.panel-header').nextAll().wrapAll(content);
-
- $scope.require([
- 'panels/'+nameAsPath+'/module'
- ], function() {
- loadModule($module);
- });
- } else {
- loadModule($module);
- }
- });
- });
- }
- };
- });
-
-});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/directives/kibanaSimplePanel.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/directives/kibanaSimplePanel.js b/metron-ui/lib/public/app/directives/kibanaSimplePanel.js
deleted file mode 100755
index 3cf81fe..0000000
--- a/metron-ui/lib/public/app/directives/kibanaSimplePanel.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-define([
- 'angular',
- 'lodash'
-],
-function (angular, _) {
- 'use strict';
-
- angular
- .module('kibana.directives')
- .directive('kibanaSimplePanel', function($compile) {
- var panelLoading = '<span ng-show="panelMeta.loading == true">' +
- '<span style="font-size:24px;font-weight:200">'+
- '<i class="icon-spinner icon-spin"></i> loading ...' +
- '</span>'+
- '</span>';
-
- return {
- restrict: 'E',
- link: function($scope, elem, attr) {
-
- // once we have the template, scan it for controllers and
- // load the module.js if we have any
-
- // compile the module and uncloack. We're done
- function loadModule($module) {
- $module.appendTo(elem);
- /* jshint indent:false */
- $compile(elem.contents())($scope);
- elem.removeClass("ng-cloak");
- }
-
- function loadController(name) {
- elem.addClass("ng-cloak");
- // load the panels module file, then render it in the dom.
- var nameAsPath = name.replace(".", "/");
- $scope.require([
- 'jquery',
- 'text!panels/'+nameAsPath+'/module.html'
- ], function ($, moduleTemplate) {
- var $module = $(moduleTemplate);
- // top level controllers
- var $controllers = $module.filter('ngcontroller, [ng-controller], .ng-controller');
- // add child controllers
- $controllers = $controllers.add($module.find('ngcontroller, [ng-controller], .ng-controller'));
-
- if ($controllers.length) {
- $controllers.first().prepend(panelLoading);
- $scope.require([
- 'panels/'+nameAsPath+'/module'
- ], function() {
- loadModule($module);
- });
- } else {
- loadModule($module);
- }
- });
- }
-
- $scope.$watch(attr.type, function (name) {
- loadController(name);
- });
-
- if(attr.panel) {
- $scope.$watch(attr.panel, function (panel) {
- // If the panel attribute is specified, create a new scope. This ruins configuration
- // so don't do it with anything that needs to use editor.html
- if(!_.isUndefined(panel)) {
- $scope = $scope.$new();
- $scope.panel = angular.fromJson(panel);
- }
- });
- }
- }
- };
- });
-
-});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/directives/ngBlur.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/directives/ngBlur.js b/metron-ui/lib/public/app/directives/ngBlur.js
deleted file mode 100755
index ed6d7c2..0000000
--- a/metron-ui/lib/public/app/directives/ngBlur.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-define([
- 'angular'
-],
-function (angular) {
- 'use strict';
-
- angular
- .module('kibana.directives')
- .directive('ngBlur', ['$parse', function($parse) {
- return function(scope, element, attr) {
- var fn = $parse(attr['ngBlur']);
- element.bind('blur', function(event) {
- scope.$apply(function() {
- fn(scope, {$event:event});
- });
- });
- };
- }]);
-
-});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/directives/ngModelOnBlur.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/directives/ngModelOnBlur.js b/metron-ui/lib/public/app/directives/ngModelOnBlur.js
deleted file mode 100755
index 178cf3a..0000000
--- a/metron-ui/lib/public/app/directives/ngModelOnBlur.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-define(['angular'],
-function (angular) {
- 'use strict';
-
- angular
- .module('kibana.directives')
- .directive('ngModelOnblur', function() {
- return {
- restrict: 'A',
- require: 'ngModel',
- link: function(scope, elm, attr, ngModelCtrl) {
- if (attr.type === 'radio' || attr.type === 'checkbox') {
- return;
- }
-
- elm.unbind('input').unbind('keydown').unbind('change');
- elm.bind('blur', function() {
- scope.$apply(function() {
- ngModelCtrl.$setViewValue(elm.val());
- });
- });
- }
- };
- });
-});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/directives/tip.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/directives/tip.js b/metron-ui/lib/public/app/directives/tip.js
deleted file mode 100755
index cd946f9..0000000
--- a/metron-ui/lib/public/app/directives/tip.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-define([
- 'angular',
- 'kbn'
-],
-function (angular, kbn) {
- 'use strict';
-
- angular
- .module('kibana.directives')
- .directive('tip', function($compile) {
- return {
- restrict: 'E',
- link: function(scope, elem, attrs) {
- var _t = '<i class="icon-'+(attrs.icon||'question-sign')+'" bs-tooltip="\''+
- kbn.addslashes(elem.text())+'\'"></i>';
- elem.replaceWith($compile(angular.element(_t))(scope));
- }
- };
- });
-});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/factories/store.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/factories/store.js b/metron-ui/lib/public/app/factories/store.js
deleted file mode 100755
index 990d4f4..0000000
--- a/metron-ui/lib/public/app/factories/store.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-define([
- 'angular',
- 'lodash'
-],
-function (angular, _) {
- 'use strict';
-
- var module = angular.module('kibana.factories');
- module.factory('storeFactory', function() {
-
- return function storeFactory($scope, name, defaults) {
- if (!_.isFunction($scope.$watch)) {
- throw new TypeError('Invalid scope.');
- }
- if (!_.isString(name)) {
- throw new TypeError('Invalid name, expected a string that the is unique to this store.');
- }
- if (defaults && !_.isPlainObject(defaults)) {
- throw new TypeError('Invalid defaults, expected a simple object or nothing');
- }
-
- defaults = defaults || {};
-
- // get the current value, parse if it exists
- var current = localStorage.getItem(name);
- if (current != null) {
- try {
- current = JSON.parse(current);
- } catch (e) {
- current = null;
- }
- }
-
- if (current == null) {
- current = _.clone(defaults);
- } else if (_.isPlainObject(current)) {
- _.defaults(current, defaults);
- } else {
- throw new TypeError('Invalid store value' + current);
- }
-
- $scope[name] = current;
-
- // listen for changes and store them in localStorage.
- // delete the value to reset to the defaults, ie. `delete $scope[name]` -> digest cycle -> `$scope[name] == defaults`
- $scope.$watch(name, function (val) {
- if (val === void 0) {
- localStorage.removeItem(name);
- $scope[name] = _.clone(defaults);
- } else {
- localStorage.setItem(name, JSON.stringify(val));
- }
- }, true);
-
- return current;
- };
- });
-
-});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/filters/all.js
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/filters/all.js b/metron-ui/lib/public/app/filters/all.js
deleted file mode 100755
index 55808fd..0000000
--- a/metron-ui/lib/public/app/filters/all.js
+++ /dev/null
@@ -1,151 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-define([
- 'angular',
- 'jquery',
- 'lodash',
- 'moment'
-], function (angular, $, _, moment) {
- 'use strict';
-
- var module = angular.module('kibana.filters');
-
- module.filter('stringSort', function() {
- return function(input) {
- return input.sort();
- };
- });
-
- module.filter('pinnedQuery', function(querySrv) {
- return function( items, pinned) {
- var ret = _.filter(querySrv.ids(),function(id){
- var v = querySrv.list()[id];
- if(!_.isUndefined(v.pin) && v.pin === true && pinned === true) {
- return true;
- }
- if((_.isUndefined(v.pin) || v.pin === false) && pinned === false) {
- return true;
- }
- });
- return ret;
- };
- });
-
- module.filter('slice', function() {
- return function(arr, start, end) {
- if(!_.isUndefined(arr)) {
- return arr.slice(start, end);
- }
- };
- });
-
- module.filter('stringify', function() {
- return function(arr) {
- if(_.isObject(arr) && !_.isArray(arr)) {
- return angular.toJson(arr);
- } else {
- return _.isNull(arr) ? null : arr.toString();
- }
- };
- });
-
- module.filter('moment', function() {
- return function(date,mode) {
- switch(mode) {
- case 'ago':
- return moment(date).fromNow();
- }
- return moment(date).fromNow();
- };
- });
-
- module.filter('noXml', function() {
- var noXml = function(text) {
- return _.isString(text)
- ? text
- .replace(/&/g, '&')
- .replace(/</g, '<')
- .replace(/>/g, '>')
- .replace(/'/g, ''')
- .replace(/"/g, '"')
- : text;
- };
- return function(text) {
- return _.isArray(text)
- ? _.map(text, noXml)
- : noXml(text);
- };
- });
-
- module.filter('urlLink', function() {
- var //URLs starting with http://, https://, or ftp://
- r1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,
- //URLs starting with "www." (without // before it, or it'd re-link the ones done above).
- r2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim,
- //Change email addresses to mailto:: links.
- r3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim;
-
- var urlLink = function(text) {
- var t1,t2,t3;
- if(!_.isString(text)) {
- return text;
- } else {
- _.each(text.match(r1), function() {
- t1 = text.replace(r1, "<a href=\"$1\" target=\"_blank\">$1</a>");
- });
- text = t1 || text;
- _.each(text.match(r2), function() {
- t2 = text.replace(r2, "$1<a href=\"http://$2\" target=\"_blank\">$2</a>");
- });
- text = t2 || text;
- _.each(text.match(r3), function() {
- t3 = text.replace(r3, "<a href=\"mailto:$1\">$1</a>");
- });
- text = t3 || text;
- return text;
- }
- };
- return function(text) {
- return _.isArray(text)
- ? _.map(text, urlLink)
- : urlLink(text);
- };
- });
-
- module.filter('editable', function () {
- return function (data) {
- return _.filter(data, function (item) {
- return item.editable !== false;
- });
- };
- });
-
- module.filter('gistid', function() {
- var gist_pattern = /(\d{5,})|([a-z0-9]{10,})|(gist.github.com(\/*.*)\/[a-z0-9]{5,}\/*$)/;
- return function(input) {
- if(!(_.isUndefined(input))) {
- var output = input.match(gist_pattern);
- if(!_.isNull(output) && !_.isUndefined(output)) {
- return output[0].replace(/.*\//, '');
- }
- }
- };
- });
-
-});
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/panels/bettermap/editor.html
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/panels/bettermap/editor.html b/metron-ui/lib/public/app/panels/bettermap/editor.html
deleted file mode 100755
index 8e0fde4..0000000
--- a/metron-ui/lib/public/app/panels/bettermap/editor.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-
- <div class="editor-row">
- <div class="editor-option">
- <form>
- <h6>Coordinate Field <tip>geoJSON array! Long,Lat NOT Lat,Long</tip></h6>
- <input bs-typeahead="fields.list" type="text" class="input-small" ng-model="panel.field">
- </form>
- </div>
- <div class="editor-option">
- <form>
- <h6>Tooltip Field</h6>
- <input bs-typeahead="fields.list" type="text" class="input-small" ng-model="panel.tooltip">
- </form>
- </div>
- <div class="editor-option"><h6>Max Points</h6>
- <input type="number" class="input-small" ng-model="panel.size">
- </div>
- </div>
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/panels/bettermap/leaflet/images/layers-2x.png
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/panels/bettermap/leaflet/images/layers-2x.png b/metron-ui/lib/public/app/panels/bettermap/leaflet/images/layers-2x.png
deleted file mode 100755
index a2cf7f9..0000000
Binary files a/metron-ui/lib/public/app/panels/bettermap/leaflet/images/layers-2x.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/panels/bettermap/leaflet/images/layers.png
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/panels/bettermap/leaflet/images/layers.png b/metron-ui/lib/public/app/panels/bettermap/leaflet/images/layers.png
deleted file mode 100755
index bca0a0e..0000000
Binary files a/metron-ui/lib/public/app/panels/bettermap/leaflet/images/layers.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/panels/bettermap/leaflet/images/marker-icon-2x.png
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/panels/bettermap/leaflet/images/marker-icon-2x.png b/metron-ui/lib/public/app/panels/bettermap/leaflet/images/marker-icon-2x.png
deleted file mode 100755
index 0015b64..0000000
Binary files a/metron-ui/lib/public/app/panels/bettermap/leaflet/images/marker-icon-2x.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/panels/bettermap/leaflet/images/marker-icon.png
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/panels/bettermap/leaflet/images/marker-icon.png b/metron-ui/lib/public/app/panels/bettermap/leaflet/images/marker-icon.png
deleted file mode 100755
index e2e9f75..0000000
Binary files a/metron-ui/lib/public/app/panels/bettermap/leaflet/images/marker-icon.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/40aadab8/metron-ui/lib/public/app/panels/bettermap/leaflet/images/marker-shadow.png
----------------------------------------------------------------------
diff --git a/metron-ui/lib/public/app/panels/bettermap/leaflet/images/marker-shadow.png b/metron-ui/lib/public/app/panels/bettermap/leaflet/images/marker-shadow.png
deleted file mode 100755
index d1e773c..0000000
Binary files a/metron-ui/lib/public/app/panels/bettermap/leaflet/images/marker-shadow.png and /dev/null differ