From a794cfbb5e8bb26ed98a90a2e37a955370a61a6a Mon Sep 17 00:00:00 2001 From: Yang Date: Wed, 31 May 2017 14:28:27 +0800 Subject: [PATCH 1/6] add ui of schedule --- ui/js/app.js | 19 +++ ui/js/bs.js | 19 +++ ui/js/controllers/bigChart-ctrl.js | 21 ++- ui/js/controllers/createdataasset-ctrl.js | 19 +++ ui/js/controllers/createjob-ac-ctrl.js | 144 ++++++++++++++++++ ui/js/controllers/createjob0.js | 27 ++++ ui/js/controllers/createrule-ac-ctrl.js | 19 +++ ui/js/controllers/createrule-an-ctrl.js | 19 +++ ui/js/controllers/createrule-pu-ctrl.js | 19 +++ ui/js/controllers/createrule-va-ctrl.js | 19 +++ ui/js/controllers/createrule0-ctrl.js | 19 +++ ui/js/controllers/dataassets-ctrl.js | 19 +++ ui/js/controllers/downloadSample-ctrl.js | 21 ++- ui/js/controllers/editdataasset-ctrl.js | 19 +++ ui/js/controllers/footer-ctrl.js | 19 +++ ui/js/controllers/health-ctrl.js | 19 +++ ui/js/controllers/index.js | 21 +++ ui/js/controllers/job-ctrl.js | 111 ++++++++++++++ ui/js/controllers/main-ctrl.js | 21 ++- ui/js/controllers/metrics-ctrl.js | 24 ++- ui/js/controllers/module.js | 19 +++ ui/js/controllers/mydashboard-ctrl.js | 19 +++ ui/js/controllers/nav-ctrl.js | 19 +++ ui/js/controllers/rule-ctrl.js | 19 +++ ui/js/controllers/sidebar-ctrl.js | 19 +++ ui/js/controllers/subscribemodel-ctrl.js | 19 +++ ui/js/controllers/viewrule-ctrl.js | 19 +++ ui/js/directives/bigchart.js | 19 +++ ui/js/directives/index.js | 19 +++ ui/js/directives/module.js | 19 +++ ui/js/directives/treeview.js | 19 +++ ui/js/filters/index.js | 19 +++ ui/js/filters/module.js | 19 +++ ui/js/filters/strmap.js | 19 +++ ui/js/filters/strshorten.js | 19 +++ ui/js/main.js | 19 +++ ui/js/routes.js | 47 ++++-- ui/js/services/bark-chart.js | 19 +++ ui/js/services/index.js | 19 +++ ui/js/services/module.js | 19 +++ ui/js/services/services.js | 37 ++++- .../dataassets/confirmation-dataasset.html | 21 +++ .../confirmation-delete-dataasset.html | 21 +++ ui/pages/dataassets/createdataasset.html | 21 +++ ui/pages/dataassets/dataassets.html | 21 +++ ui/pages/dataassets/editdataasset.html | 21 +++ ui/pages/health/health.html | 21 +++ ui/pages/jobs/confirmation-ac.html | 67 ++++++++ ui/pages/jobs/createjob-ac.html | 120 +++++++++++++++ ui/pages/jobs/createjob0.html | 10 ++ ui/pages/jobs/delete-confirm.html | 76 +++++++++ ui/pages/jobs/job.css | 0 ui/pages/jobs/jobs.html | 66 ++++++++ .../{rules => measures}/confirmation-ac.html | 21 +++ .../{rules => measures}/confirmation-an.html | 21 +++ .../{rules => measures}/confirmation-pu.html | 21 +++ .../{rules => measures}/confirmation-va.html | 21 +++ .../{rules => measures}/createrule-ac.html | 28 +++- .../{rules => measures}/createrule-an.html | 27 +++- .../{rules => measures}/createrule-pu.html | 29 +++- .../{rules => measures}/createrule-va.html | 29 +++- ui/pages/{rules => measures}/createrule0.html | 21 +++ .../{rules => measures}/delete-confirm.html | 21 +++ .../{rules/rule.css => measures/measure.css} | 19 +++ .../rules.html => measures/measures.html} | 27 +++- .../{rules => measures}/va-explaination.html | 21 +++ ui/pages/{rules => measures}/viewrule.html | 21 +++ ui/pages/metrics/dashboard.html | 21 +++ ui/pages/metrics/download-sample.html | 21 +++ ui/pages/metrics/metrics.css | 19 +++ .../mydashboard/confirmation-subscribe.html | 21 +++ ui/pages/mydashboard/mydashboard.html | 21 +++ ui/pages/mydashboard/subscribemodel.html | 21 +++ ui/pages/template/bigchart.css | 19 +++ ui/pages/template/bigchart.html | 21 +++ ui/pages/template/undercons.html | 21 +++ ui/tests/ut/karma.conf.js | 19 +++ .../controllers/createjob-ac-ctrl.spec.js | 43 ++++++ .../controllers/createrule-ac-ctrl.spec.js | 19 +++ .../controllers/createrule-pu-ctrl.spec.js | 19 +++ .../controllers/createrule-va-ctrl.spec.js | 19 +++ .../controllers/createrule0-ctrl.spec.js | 19 +++ .../ut/specs/controllers/health-ctrl.spec.js | 19 +++ .../ut/specs/controllers/job-ctrl.spec.js | 43 ++++++ .../ut/specs/controllers/metrics-ctrl.spec.js | 19 +++ .../ut/specs/controllers/nav-ctrl_spec.js | 19 +++ .../ut/specs/controllers/rule-ctrl.spec.js | 19 +++ .../ut/specs/controllers/sidebar-ctrl_spec.js | 19 +++ .../specs/controllers/viewrule-ctrl.spec.js | 19 +++ ui/tests/ut/specs/filters/strmap_spec.js | 19 +++ ui/tests/ut/specs/filters/strshorten_spec.js | 19 +++ ui/tests/ut/specs/services/services_spec.js | 19 +++ ui/tests/ut/test-main.js | 19 +++ 93 files changed, 2375 insertions(+), 36 deletions(-) create mode 100644 ui/js/controllers/createjob-ac-ctrl.js create mode 100644 ui/js/controllers/createjob0.js create mode 100644 ui/js/controllers/job-ctrl.js create mode 100644 ui/pages/jobs/confirmation-ac.html create mode 100644 ui/pages/jobs/createjob-ac.html create mode 100644 ui/pages/jobs/createjob0.html create mode 100644 ui/pages/jobs/delete-confirm.html create mode 100644 ui/pages/jobs/job.css create mode 100644 ui/pages/jobs/jobs.html rename ui/pages/{rules => measures}/confirmation-ac.html (85%) rename ui/pages/{rules => measures}/confirmation-an.html (87%) rename ui/pages/{rules => measures}/confirmation-pu.html (88%) rename ui/pages/{rules => measures}/confirmation-va.html (88%) rename ui/pages/{rules => measures}/createrule-ac.html (95%) rename ui/pages/{rules => measures}/createrule-an.html (95%) rename ui/pages/{rules => measures}/createrule-pu.html (92%) rename ui/pages/{rules => measures}/createrule-va.html (95%) rename ui/pages/{rules => measures}/createrule0.html (94%) rename ui/pages/{rules => measures}/delete-confirm.html (81%) rename ui/pages/{rules/rule.css => measures/measure.css} (90%) rename ui/pages/{rules/rules.html => measures/measures.html} (84%) rename ui/pages/{rules => measures}/va-explaination.html (96%) rename ui/pages/{rules => measures}/viewrule.html (92%) create mode 100644 ui/tests/ut/specs/controllers/createjob-ac-ctrl.spec.js create mode 100644 ui/tests/ut/specs/controllers/job-ctrl.spec.js diff --git a/ui/js/app.js b/ui/js/app.js index e2dc9fe0d..03452f4f3 100644 --- a/ui/js/app.js +++ b/ui/js/app.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/bs.js b/ui/js/bs.js index f6f67d3c4..0cd866e33 100644 --- a/ui/js/bs.js +++ b/ui/js/bs.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/bigChart-ctrl.js b/ui/js/controllers/bigChart-ctrl.js index 5525cd243..56a506a06 100644 --- a/ui/js/controllers/bigChart-ctrl.js +++ b/ui/js/controllers/bigChart-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); @@ -55,4 +74,4 @@ define(['./module'], function(controllers) { } }]); -}); \ No newline at end of file +}); diff --git a/ui/js/controllers/createdataasset-ctrl.js b/ui/js/controllers/createdataasset-ctrl.js index d951851e1..1fa2a17f1 100644 --- a/ui/js/controllers/createdataasset-ctrl.js +++ b/ui/js/controllers/createdataasset-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/createjob-ac-ctrl.js b/ui/js/controllers/createjob-ac-ctrl.js new file mode 100644 index 000000000..428fcc4ea --- /dev/null +++ b/ui/js/controllers/createjob-ac-ctrl.js @@ -0,0 +1,144 @@ +define(['./module'], function(controllers) { + 'use strict'; + controllers.controller('CreateJobACCtrl', ['$scope', '$http', '$config', '$location', 'toaster', '$timeout', '$route', '$filter', function($scope, $http, $config, $location, toaster, $timeout, $route, $filter) { + console.log('Create job controller'); + $scope.currentStep = 1; + + $scope.Measures = []; + $scope.$on('$viewContentLoaded', function() { + // console.log($('#footerwrap').css('height')); + // console.log($('.formStep').offset()); + $scope.$emit('initReq'); + resizeWindow(); + + // $('#confirm').on('hidden.bs.modal', function (e) { + // console.log('hidden'); + // // $('#confirm').off('hidden.bs.modal'); + // $location.path('/rules'); + // }); + + // $('.formStep').css({height: 800}); + }); + var getMeasureUrl = $config.uri.getMeasuresByOwner+$scope.ntAccount; + $http.get(getMeasureUrl).success(function(res){ + angular.forEach(res,function(measure){ + $scope.Measures.push(measure); + }) + console.log($scope.Measures); + }) + + + + $scope.$on('resizeHandler', function(e) { + if ($route.current.$$route.controller == "CreateRuleACCtrl") { + $scope.$emit('initReq'); + resizeWindow(); + } + }); + + + function resizeWindow() { + var stepSelection = '.formStep[id=step-' + $scope.currentStep + ']'; + $(stepSelection).css({ + height: window.innerHeight - $(stepSelection).offset().top - $('#footerwrap').outerHeight() + }); + $('fieldset').height($(stepSelection).height() - $(stepSelection + '>.stepDesc').height() - $('.btn-container').height() - 80); + $('.y-scrollable').css({ + 'max-height': $('fieldset').height()- $('.add-dataset').outerHeight() + }); + + } + + // Initial Value + $scope.form = { + submit: function(form) { + if (!form.$valid) { + var field = null + , firstError = null ; + for (field in form) { + if (field[0] != '$') { + if (firstError === null && !form[field].$valid) { + firstError = form[field].$name; + } + + if (form[field].$invalid) { + form[field].$dirty = true; + } + } + } + angular.element('.ng-invalid[name=' + firstError + ']').focus(); + errorMessage($scope.currentStep); + } else { + // $location.path('/rules'); + form.$setPristine(); + var rule = ''; + this.data={ + "sourcePat":$scope.sourcePat, + "targetPat":$scope.targetPat, + "jobStartTime":$scope.jobStartTime, + "periodTime":$scope.periodTime, + "groupName":'BA', + }; + $('#confirm-job').modal('show'); + } + }, + + save: function() { + + + //::TODO: Need to save the data to backend with POST/PUT method + console.log(JSON.stringify($scope.form.data)); + +// var newModel = $config.uri.newAccuracyModel; +// var BACKEND_SERVER = ''; + var date = new Date(); + var month = date.getMonth()+1; + var timestamp = Date.parse(date); + timestamp = timestamp / 1000; + var jobName = $scope.Measures[$scope.measure] + '-BA-' + $scope.ntAccount + '-' + date.getFullYear() + '-'+ month + '-'+date.getDate(); + var newJob = $config.uri.addJobs + this.data.groupName + '/' + jobName + '/' + $scope.Measures[$scope.measure]; + console.log(newJob); + console.log(this.data); + $http.post(newJob, this.data).success(function(data) { + // if(data.status=='0') + // { + console.log(data); + if(data=='fail'){ + toaster.pop('error', 'Please modify the name of job, because there is already a same model in database ', data.message); + return; + } + + $('#confirm-job').on('hidden.bs.modal', function(e) { + $('#confirm-job').off('hidden.bs.modal'); + $location.path('/jobs').replace(); + $scope.$apply(); + }); + $('#confirm-job').modal('hide'); + // } + // else + // { + // errorMessage(0, data.result); + // } + + }).error(function(data){ + // errorMessage(0, 'Save model failed, please try again!'); + toaster.pop('error', 'Save model failed, please try again!', data.message); + }); + + }, + + } + + var errorMessage = function(i, msg) { + var errorMsgs = ['Please select at least one attribute!', 'Please select at least one attribute in target, make sure target is different from source!', 'Please make sure to map each target to a unique source.', 'please complete the form in this step before proceeding']; + if (!msg) { + toaster.pop('error', 'Error', errorMsgs[i - 1], 0); + } else { + toaster.pop('error', 'Error', msg, 0); + } + }; + } + ]); + + +}); diff --git a/ui/js/controllers/createjob0.js b/ui/js/controllers/createjob0.js new file mode 100644 index 000000000..a63f07414 --- /dev/null +++ b/ui/js/controllers/createjob0.js @@ -0,0 +1,27 @@ +define(['./module'], function (controllers) { + 'use strict'; + controllers.controller('CreateJob0Ctrl', ['$scope', '$http', '$config', '$location', 'toaster', '$timeout', '$route', function ($scope, $http, $config, $location, toaster, $timeout, $route) { + console.log('Create job 0 controller'); + $scope.publishURL = document.location.origin; + + $scope.click = function(type){ + $location.path('/createjob-' + type); + } + $scope.$on('$viewContentLoaded', function(){ + $scope.$emit('initReq'); + resizeWindow(); + }); + + $scope.$on('resizeHandler', function(e) { + if($route.current.$$route.controller == 'CreateJob0Ctrl'){ + console.log('createjob0 resize'); + resizeWindow(); + } + }); + + function resizeWindow(){ + $('#panel-2 >.panel-body').css({height: $('#panel-1 >.panel-body').outerHeight() + $('#panel-1 >.panel-footer').outerHeight() - $('#panel-2 >.panel-footer').outerHeight()}); + $('#panel-4 >.panel-body').css({height: $('#panel-3 >.panel-body').outerHeight() + $('#panel-3 >.panel-footer').outerHeight() - $('#panel-4 >.panel-footer').outerHeight()}); + } + }]); +}); diff --git a/ui/js/controllers/createrule-ac-ctrl.js b/ui/js/controllers/createrule-ac-ctrl.js index 4e0074978..f6fb91d00 100644 --- a/ui/js/controllers/createrule-ac-ctrl.js +++ b/ui/js/controllers/createrule-ac-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/createrule-an-ctrl.js b/ui/js/controllers/createrule-an-ctrl.js index 891c23e19..925f0f1d6 100644 --- a/ui/js/controllers/createrule-an-ctrl.js +++ b/ui/js/controllers/createrule-an-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/createrule-pu-ctrl.js b/ui/js/controllers/createrule-pu-ctrl.js index 1786fb3b9..cc8a5e524 100644 --- a/ui/js/controllers/createrule-pu-ctrl.js +++ b/ui/js/controllers/createrule-pu-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/createrule-va-ctrl.js b/ui/js/controllers/createrule-va-ctrl.js index 882f80794..20cb7291a 100644 --- a/ui/js/controllers/createrule-va-ctrl.js +++ b/ui/js/controllers/createrule-va-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/createrule0-ctrl.js b/ui/js/controllers/createrule0-ctrl.js index 241445a03..be40e809e 100644 --- a/ui/js/controllers/createrule0-ctrl.js +++ b/ui/js/controllers/createrule0-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/dataassets-ctrl.js b/ui/js/controllers/dataassets-ctrl.js index 110da44a7..897662878 100644 --- a/ui/js/controllers/dataassets-ctrl.js +++ b/ui/js/controllers/dataassets-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/downloadSample-ctrl.js b/ui/js/controllers/downloadSample-ctrl.js index aa1ad899e..1799673fb 100644 --- a/ui/js/controllers/downloadSample-ctrl.js +++ b/ui/js/controllers/downloadSample-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); @@ -33,4 +52,4 @@ define(['./module'], function(controllers) { } ]); -}); \ No newline at end of file +}); diff --git a/ui/js/controllers/editdataasset-ctrl.js b/ui/js/controllers/editdataasset-ctrl.js index 718525cde..1c6ea9713 100644 --- a/ui/js/controllers/editdataasset-ctrl.js +++ b/ui/js/controllers/editdataasset-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/footer-ctrl.js b/ui/js/controllers/footer-ctrl.js index 7eb9e1366..923141c38 100644 --- a/ui/js/controllers/footer-ctrl.js +++ b/ui/js/controllers/footer-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/health-ctrl.js b/ui/js/controllers/health-ctrl.js index 3c0c66208..85e2c4c0b 100644 --- a/ui/js/controllers/health-ctrl.js +++ b/ui/js/controllers/health-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/index.js b/ui/js/controllers/index.js index a374161f7..8d6083eb6 100644 --- a/ui/js/controllers/index.js +++ b/ui/js/controllers/index.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,6 +37,8 @@ define([ './sidebar-ctrl', './health-ctrl', './rule-ctrl', + './job-ctrl', + './createjob-ac-ctrl', './createrule0-ctrl', './createrule-ac-ctrl', './createrule-va-ctrl', diff --git a/ui/js/controllers/job-ctrl.js b/ui/js/controllers/job-ctrl.js new file mode 100644 index 000000000..8ac03a64a --- /dev/null +++ b/ui/js/controllers/job-ctrl.js @@ -0,0 +1,111 @@ +define(['./module'], function (controllers) { + 'use strict'; + controllers.controller('JobCtrl', ['$scope', '$http', '$config', '$location', '$timeout', '$route', 'toaster', '$filter', function ($scope, $http, $config, $location, $timeout, $route, toaster, $filter) { + console.log('job controller'); + console.log($scope.ntAccount); + var allJobs = $config.uri.allJobs; + var ts = null; + var start = 0; + var number = 10; + var originalRowCollection = undefined; + + $scope.paging = function(tableState){ + console.log(tableState); + ts = tableState; + + // tableState.pagination.numberOfPages = $scope.rowCollection.length/10 + 1; + start = tableState.pagination.start || 0; + number = tableState.pagination.number || 10; + + if(start == 0 && !$scope.rowCollection){ + $http.get(allJobs).success(function(data) { + originalRowCollection = angular.copy(data); + $scope.rowCollection = angular.copy(data); + + $scope.displayed = $scope.rowCollection.slice(start, start+number); + tableState.pagination.numberOfPages = Math.ceil($scope.rowCollection.length/number); + }); + }else{ + $scope.displayed = $scope.rowCollection.slice(start, start+number); + } + }; + + + + + $scope.remove = function remove(row) { +// var getJobUrl = $config.uri.getJob + '/' +row.name; +// $http.get(getJobUrl).success(function(data){ +// $scope.deletedRow = data; +// +// }); + $scope.deletedRow = row; + $scope.deletedBriefRow = row; + $('#deleteJobConfirmation').modal('show'); + } + + $scope.confirmDelete = function(){ + var row = $scope.deletedBriefRow; + var deleteModelUrl = $config.uri.deleteJob + row.groupName+'/jobs/'+row.jobName; + $http.delete(deleteModelUrl).success(function(){ + + var index = $scope.rowCollection.indexOf(row); + $scope.rowCollection.splice(index, 1); + + index = $scope.displayed.indexOf(row); + $scope.displayed.splice(index, 1); + + $('#deleteJobConfirmation').modal('hide'); + + }).error(function(data, status){ + toaster.pop('error', 'Error when deleting record', data); + }); + } + + + + $scope.edit = function edit() { + } + + + $scope.$on('$viewContentLoaded', function() { + $scope.$emit('initReq'); + }); + + +/* + function createRowCollection(){ + var data = []; + for (var j = 0; j < 22; j++) { + data.push(createRandomItem()); + } + + return data; + } + + function createRandomItem() { + var nameList = ['ViewItem', 'Search', 'BidEvent', 'user_dna', 'LAST_ITEMS_VIEWED'], + systemList = ['Bullseye', 'PDS', 'GPS', 'IDLS', 'Hadoop'], + dateList = ['2016-03-10', '2016-03-12', '2016-03-15', '2016-03-19', '2016-03-20'], + statusList = [0, 1, 2]; + + var + name = nameList[Math.floor(Math.random() * 5)], + system = Math.floor(Math.random() * 7), + type = Math.floor(Math.random() * 4), + description = 'Only for demo purpose', + createDate = dateList[Math.floor(Math.random() * 5)], + status = Math.floor(Math.random() * 3); + + return{ + name: name, + system: system, + type: type, + description: description, + createDate: createDate, + status:status + }; + } +*/ + }]); +}); \ No newline at end of file diff --git a/ui/js/controllers/main-ctrl.js b/ui/js/controllers/main-ctrl.js index 37274afab..95dcf1050 100644 --- a/ui/js/controllers/main-ctrl.js +++ b/ui/js/controllers/main-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); @@ -33,4 +52,4 @@ define(['./module'], function(controllers) { }) } ]); -}); \ No newline at end of file +}); diff --git a/ui/js/controllers/metrics-ctrl.js b/ui/js/controllers/metrics-ctrl.js index 5452f27ac..1c4e5acd7 100644 --- a/ui/js/controllers/metrics-ctrl.js +++ b/ui/js/controllers/metrics-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); @@ -37,10 +56,7 @@ define(['./module'], function(controllers) { orgNode.assetMap = value; }); $scope.originalOrgs = angular.copy($scope.orgs); - - var url_briefmetrics = $config.uri.dashboard; - $http.post(url_dashboard, {"query": {"match_all":{}}, "sort": [{"tmst": {"order": "asc"}}], "size": 1000}).success(function(data) { - $scope.briefmetrics = data; + $http.post(url_dashboard, {"query": {"match_all":{}}, "sort": [{"tmst": {"order": "asc"}}],"size":1000}).success(function(data) { angular.forEach(data.hits.hits, function(sys) { var chartData = sys._source; chartData.sort = function(a,b){ diff --git a/ui/js/controllers/module.js b/ui/js/controllers/module.js index 624c962f6..2673b29e6 100644 --- a/ui/js/controllers/module.js +++ b/ui/js/controllers/module.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/mydashboard-ctrl.js b/ui/js/controllers/mydashboard-ctrl.js index 3cc215d4b..606f9f838 100644 --- a/ui/js/controllers/mydashboard-ctrl.js +++ b/ui/js/controllers/mydashboard-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/nav-ctrl.js b/ui/js/controllers/nav-ctrl.js index 880800065..a3aabd2ec 100644 --- a/ui/js/controllers/nav-ctrl.js +++ b/ui/js/controllers/nav-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/rule-ctrl.js b/ui/js/controllers/rule-ctrl.js index a202c2c4c..8d73ea139 100644 --- a/ui/js/controllers/rule-ctrl.js +++ b/ui/js/controllers/rule-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/sidebar-ctrl.js b/ui/js/controllers/sidebar-ctrl.js index 7cf4945af..c613274e1 100644 --- a/ui/js/controllers/sidebar-ctrl.js +++ b/ui/js/controllers/sidebar-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/subscribemodel-ctrl.js b/ui/js/controllers/subscribemodel-ctrl.js index e13bfd1d4..b645ebcd8 100644 --- a/ui/js/controllers/subscribemodel-ctrl.js +++ b/ui/js/controllers/subscribemodel-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/controllers/viewrule-ctrl.js b/ui/js/controllers/viewrule-ctrl.js index 0c8c7e5a2..2b66a7d84 100644 --- a/ui/js/controllers/viewrule-ctrl.js +++ b/ui/js/controllers/viewrule-ctrl.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/directives/bigchart.js b/ui/js/directives/bigchart.js index c8e3fc5f1..be5015303 100644 --- a/ui/js/directives/bigchart.js +++ b/ui/js/directives/bigchart.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/directives/index.js b/ui/js/directives/index.js index 7bbb0e46e..915c0310f 100644 --- a/ui/js/directives/index.js +++ b/ui/js/directives/index.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/directives/module.js b/ui/js/directives/module.js index 36569555d..16f2c409c 100644 --- a/ui/js/directives/module.js +++ b/ui/js/directives/module.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/directives/treeview.js b/ui/js/directives/treeview.js index fe409954b..0d2a618e8 100644 --- a/ui/js/directives/treeview.js +++ b/ui/js/directives/treeview.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* The MIT License (MIT) diff --git a/ui/js/filters/index.js b/ui/js/filters/index.js index bcd414c05..1f6f96ef1 100644 --- a/ui/js/filters/index.js +++ b/ui/js/filters/index.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/filters/module.js b/ui/js/filters/module.js index 3b35aeb7b..9a731885a 100644 --- a/ui/js/filters/module.js +++ b/ui/js/filters/module.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/filters/strmap.js b/ui/js/filters/strmap.js index daa8df76d..f5d77db5e 100644 --- a/ui/js/filters/strmap.js +++ b/ui/js/filters/strmap.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/filters/strshorten.js b/ui/js/filters/strshorten.js index f4dadf7eb..c5436e872 100644 --- a/ui/js/filters/strshorten.js +++ b/ui/js/filters/strshorten.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/main.js b/ui/js/main.js index 81033588b..e16787618 100644 --- a/ui/js/main.js +++ b/ui/js/main.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/routes.js b/ui/js/routes.js index 099e3ee6c..7843a4b98 100644 --- a/ui/js/routes.js +++ b/ui/js/routes.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,46 +45,56 @@ define(['./app'], function(app) { controller: 'HealthCtrl' }); - $routeProvider.when('/rules', { - templateUrl: '/pages/rules/rules.html', + $routeProvider.when('/measures', { + templateUrl: '/pages/measures/measures.html', controller: 'RuleCtrl' }); $routeProvider.when('/createrule0', { - templateUrl: '/pages/rules/createrule0.html', + templateUrl: '/pages/measures/createrule0.html', controller: 'CreateRule0Ctrl' }); $routeProvider.when('/createrule-ac', { - templateUrl: '/pages/rules/createrule-ac.html', + templateUrl: '/pages/measures/createrule-ac.html', controller: 'CreateRuleACCtrl' }); $routeProvider.when('/createrule-va', { - templateUrl: '/pages/rules/createrule-va.html', + templateUrl: '/pages/measures/createrule-va.html', controller: 'CreateRuleVACtrl' }); $routeProvider.when('/createrule-an', { - templateUrl: '/pages/rules/createrule-an.html', + templateUrl: '/pages/measures/createrule-an.html', controller: 'CreateRuleANCtrl' }); $routeProvider.when('/createrule-pu', { - templateUrl: '/pages/rules/createrule-pu.html', + templateUrl: '/pages/measures/createrule-pu.html', controller: 'CreateRulePUCtrl' }); $routeProvider.when('/viewrule/:modelname/:modeltype', { - templateUrl: '/pages/rules/viewrule.html', + templateUrl: '/pages/measures/viewrule.html', controller: 'ViewRuleCtrl' }); $routeProvider.when('/viewrule/:modelname', { - templateUrl: '/pages/rules/viewrule.html', + templateUrl: '/pages/measures/viewrule.html', controller: 'ViewRuleCtrl' }); + $routeProvider.when('/jobs',{ + templateUrl:'pages/jobs/jobs.html', + controller:'JobCtrl' + }); + + $routeProvider.when('/createjob-ac', { + templateUrl: '/pages/jobs/createjob-ac.html', + controller: 'CreateJobACCtrl' + }); + $routeProvider.when('/metrics', { templateUrl: '/pages/metrics/dashboard.html', controller: 'MetricsCtrl' diff --git a/ui/js/services/bark-chart.js b/ui/js/services/bark-chart.js index 2df874877..19acbb285 100644 --- a/ui/js/services/bark-chart.js +++ b/ui/js/services/bark-chart.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/services/index.js b/ui/js/services/index.js index 17a5aa783..35b61c20e 100644 --- a/ui/js/services/index.js +++ b/ui/js/services/index.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/services/module.js b/ui/js/services/module.js index f8fbecb64..317ce3308 100644 --- a/ui/js/services/module.js +++ b/ui/js/services/module.js @@ -1,3 +1,22 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ui/js/services/services.js b/ui/js/services/services.js index 39b0df7bc..7118a0a20 100644 --- a/ui/js/services/services.js +++ b/ui/js/services/services.js @@ -1,9 +1,31 @@ +/*- + * #%L + * Apache Griffin + * %% + * Copyright (C) 2017 The Apache Software Foundation + * %% + * Licensed 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. + * #L% + */ /* Copyright (c) 2016 eBay Software Foundation. Licensed 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. @@ -19,8 +41,8 @@ define(['./module'], function (services) { // var BACKEND_SERVER = 'http://10.149.247.156:38080'; -// var BACKEND_SERVER = 'http://localhost:8080'; - var BACKEND_SERVER = ''; + var BACKEND_SERVER = 'http://localhost:8080'; +// var BACKEND_SERVER = ''; var API_ROOT_PATH = '/api/v1'; // var ES_SERVER = 'http://10.149.247.156:59200'; @@ -59,7 +81,8 @@ define(['./module'], function (services) { metricsByOrg:'', // organization:'/org.json', // dashboard:'/dashboard.json', - organization: BACKEND_SERVER + '/orgWithMetrics', + + organization:BACKEND_SERVER + '/orgWithMetrics', dashboard:ES_SERVER+'/griffin/accuracy/_search?pretty&filter_path=hits.hits._source', metricsample: BACKEND_SERVER + API_ROOT_PATH + '/metrics/sample', metricdownload: BACKEND_SERVER + API_ROOT_PATH + '/metrics/download', @@ -70,6 +93,12 @@ define(['./module'], function (services) { getModel: BACKEND_SERVER + '/measures/findByName', enableModel: BACKEND_SERVER + API_ROOT_PATH + '/models/enableModel', + //Jobs + allJobs:BACKEND_SERVER + '/jobs/', + addJobs:BACKEND_SERVER+'/jobs/add/', + getMeasuresByOwner:BACKEND_SERVER+'/measures/owner/', + deleteJob:BACKEND_SERVER + '/jobs/groups/', +// allJobs:'/jobs.json', newAccuracyModel: BACKEND_SERVER + API_ROOT_PATH + '/models' , newValidityModel: BACKEND_SERVER + API_ROOT_PATH + '/models' , newAnomalyModel: BACKEND_SERVER + API_ROOT_PATH + '/models' , @@ -91,4 +120,4 @@ define(['./module'], function (services) { return config; }); -}); \ No newline at end of file +}); diff --git a/ui/pages/dataassets/confirmation-dataasset.html b/ui/pages/dataassets/confirmation-dataasset.html index 93f5145d2..b5c60a2d8 100644 --- a/ui/pages/dataassets/confirmation-dataasset.html +++ b/ui/pages/dataassets/confirmation-dataasset.html @@ -1,3 +1,24 @@ + +
+ +
+
+
+ + +
+ {{sourcePat}} +
+
+ +
+ + +
+ {{targetPat}} +
+
+ +
+ + +
+ {{Measures[measure]}} +
+
+ +
+ + +
+ {{jobStartTime}} +
+
+ +
+ + +
{{periodTime}} + +
+
+
+
+ + +
+ +
+ + + \ No newline at end of file diff --git a/ui/pages/jobs/createjob-ac.html b/ui/pages/jobs/createjob-ac.html new file mode 100644 index 000000000..78d865301 --- /dev/null +++ b/ui/pages/jobs/createjob-ac.html @@ -0,0 +1,120 @@ +
+
+
Create Job
+
+
+
+
+ +
+ + +
+
+ + Required Information + +
+
+
+ + +
+ + Model Name is required + Only letter, number, "-" and "_" are allowed +
+
+
+
+
+ + +
+ +
+
+
+ +
+
+ + +
+ +
+
+
+
+
+ + +
+ +
+
+
+
+
+ + +
+ +
+
+
+
+ +
+

+ After submitted, please go to "Jobs" to check the job status +

+
+ +
+
+ +
+ + +
+
+
+ + +
+
+
\ No newline at end of file diff --git a/ui/pages/jobs/createjob0.html b/ui/pages/jobs/createjob0.html new file mode 100644 index 000000000..566549bdf --- /dev/null +++ b/ui/pages/jobs/createjob0.html @@ -0,0 +1,10 @@ + + + + + Title + + + + + \ No newline at end of file diff --git a/ui/pages/jobs/delete-confirm.html b/ui/pages/jobs/delete-confirm.html new file mode 100644 index 000000000..8b09b4c9a --- /dev/null +++ b/ui/pages/jobs/delete-confirm.html @@ -0,0 +1,76 @@ +
+
+
Basic information
+
+
+ +
+
+
+ + +
+ {{deletedRow.jobName}} +
+
+
+ + +
+ {{deletedRow.sourcePat}} +
+
+ +
+ + +
+ {{deletedRow.targetPat}} +
+
+ +
+ + +
+ {{deletedRow.nextFireTime}} +
+
+ +
+ + +
+ {{deletedRow.periodTime}} +
+
+ +
+ + +
+ {{deletedRow.groupName}} +
+
+ + +
+
+ + +
+ + +
\ No newline at end of file diff --git a/ui/pages/jobs/job.css b/ui/pages/jobs/job.css new file mode 100644 index 000000000..e69de29bb diff --git a/ui/pages/jobs/jobs.html b/ui/pages/jobs/jobs.html new file mode 100644 index 000000000..c26c55c02 --- /dev/null +++ b/ui/pages/jobs/jobs.html @@ -0,0 +1,66 @@ +
+

+ Create Job +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Job NameSource PartitionTarget PartitionNext Fire TimeIntervalAction
No content!
{{row.jobName}}{{row.sourcePat}}{{row.targetPat|strmap:'modeltype'}}{{(row.nextFireTime | date: 'short':'-0700') || 'N/A' }}{{row.periodTime}} +   + + + +   + + + +
+
+
+
+ +
diff --git a/ui/pages/rules/confirmation-ac.html b/ui/pages/measures/confirmation-ac.html similarity index 85% rename from ui/pages/rules/confirmation-ac.html rename to ui/pages/measures/confirmation-ac.html index bc8ec2fa6..8302bb2ec 100644 --- a/ui/pages/rules/confirmation-ac.html +++ b/ui/pages/measures/confirmation-ac.html @@ -1,3 +1,24 @@ + @@ -224,7 +245,7 @@
Advanced Statistics
- + Model Name is required Only letter, number, "-" and "_" are allowed
@@ -362,7 +383,7 @@
Advanced Statistics

- After submitted, please go to "Models" to check the model status + After submitted, please go to "Models" to check the model status

@@ -389,7 +410,7 @@
Advanced Statistics