added requirejs
Change-Id: I590a9b75c6842f0ece16f89ec31a38035360eb84
This commit is contained in:
parent
1e7b4d7a77
commit
a74e8ab014
@ -19,54 +19,13 @@
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="assets/css/shelf.css">
|
||||
|
||||
<script type="text/javascript" src="vendor/jquery/jquery-1.11.1.min.js"></script>
|
||||
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- AngularJS v1.2.16 -->
|
||||
<script type="text/javascript" src="vendor/angular/angular.min.js"></script>
|
||||
<script type="text/javascript" src="vendor/angular/angular-animate.min.js"></script>
|
||||
<script type="text/javascript" src="vendor/angular/angular-mocks.js"></script>
|
||||
<script type="text/javascript" src="vendor/angular/angular-touch.js"></script>
|
||||
|
||||
<!--<script type="text/javascript" src="../vendor/angular/angular-resource.min.js"></script>-->
|
||||
<script type="text/javascript" src="vendor/angular-ui-router/angular-ui-router.min.js"></script>
|
||||
<script type="text/javascript" src="vendor/angular-bootstrap/ui-bootstrap-tpls-0.11.0.min.js"></script>
|
||||
<script type="text/javascript" src="vendor/angular-dragdrop/draganddrop.js"></script>
|
||||
<script type="text/javascript" src="vendor/ng-table/ng-table.min.js"></script>
|
||||
<script type="text/javascript" src="vendor/d3/d3.min.js"></script>
|
||||
<script type="text/javascript" src="vendor/nvd3/nv.d3.min.js"></script>
|
||||
<script type="text/javascript" src="vendor/angular-nvd3/angularjs-nvd3-directives.min.js"></script>
|
||||
<script type="text/javascript" src="vendor/angular-ui-tree/angular-ui-tree.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="vendor/rickshaw/rickshaw.min.js"></script>
|
||||
<script type="text/javascript" src="vendor/angular-rickshaw/rickshaw.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="vendor/angular-spinner/spin.min.js"></script>
|
||||
<script type="text/javascript" src="vendor/angular-spinner/angular-spinner.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="vendor/angular-daterangepicker/moment.min.js"></script>
|
||||
<script type="text/javascript" src="vendor/angular-daterangepicker/daterangepicker.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="vendor/angular-daterangepicker/daterangepicker-bs3.css">
|
||||
<script type="text/javascript" src="vendor/angular-daterangepicker/ng-bs-daterangepicker.js"></script>
|
||||
|
||||
<script type="text/javascript" src="src/app/app.js"></script>
|
||||
<script type="text/javascript" src="src/app/appDev.js"></script>
|
||||
<script type="text/javascript" src="src/app/login/login.js"></script>
|
||||
<script type="text/javascript" src="src/app/services.js"></script>
|
||||
<script type="text/javascript" src="src/app/topnav/topnav.js"></script>
|
||||
<script type="text/javascript" src="src/app/wizard/wizard.js"></script>
|
||||
<script type="text/javascript" src="src/app/cluster/cluster.js"></script>
|
||||
<script type="text/javascript" src="src/app/cluster/clusterlist.js"></script>
|
||||
<script type="text/javascript" src="src/app/monitoring/monitoring.js"></script>
|
||||
<script type="text/javascript" src="src/app/server/server.js"></script>
|
||||
<script type="text/javascript" src="src/common/charts.js"></script>
|
||||
<script type="text/javascript" src="src/common/findservers/findservers.js"></script>
|
||||
<script type="text/javascript" src="src/common/gantt-chart-d3v2.js"></script>
|
||||
<script type="text/javascript" src="src/app/user/usersetting.js"></script>
|
||||
<script type="text/javascript" src="src/app/user/userprofile.js"></script>
|
||||
<script data-main="src/main.js" src="vendor/require.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body ng-app="compass" ng-controller="appController">
|
||||
<body ng-controller="appController">
|
||||
<div ng-if="isAuthenticated && !state.includes('login')">
|
||||
<div ng-controller="topnavCtrl">
|
||||
<div topnav></div>
|
||||
|
@ -1,33 +1,46 @@
|
||||
var app = angular.module('compass', [
|
||||
define([
|
||||
'angular',
|
||||
'login',
|
||||
'services',
|
||||
'appDev',
|
||||
'clusterList',
|
||||
'cluster',
|
||||
'monitoring',
|
||||
'wizard',
|
||||
'topnav',
|
||||
'server',
|
||||
'userProfile',
|
||||
'charts',
|
||||
'userSetting',
|
||||
'findservers'
|
||||
], function(ng) {
|
||||
'use strict';
|
||||
var compassModule = ng.module('app', [
|
||||
'compass.login',
|
||||
'compass.services',
|
||||
'compass.topnav',
|
||||
'compass.wizard',
|
||||
'compass.cluster',
|
||||
// 'compassAppDev',
|
||||
'compass.clusterlist',
|
||||
'compass.monitoring',
|
||||
'compass.cluster',
|
||||
'compass.wizard',
|
||||
'compass.topnav',
|
||||
'compass.server',
|
||||
'compass.userSetting',
|
||||
'compass.userProfile',
|
||||
'ui.router',
|
||||
'ui.bootstrap',
|
||||
//'compassAppDev',
|
||||
'ngAnimate'
|
||||
]);
|
||||
|
||||
app.constant('settings', {
|
||||
'compass.userSetting',
|
||||
'compass.monitoring',
|
||||
'compass.charts',
|
||||
'compass.findservers'
|
||||
]);
|
||||
compassModule.constant('settings', {
|
||||
apiUrlBase: '/api',
|
||||
metadataUrlBase: 'data',
|
||||
//monitoringUrlBase: 'http://metrics-api/monit/api/v1'
|
||||
monitoringUrlBase: '/monit/api/v1'
|
||||
});
|
||||
|
||||
app.config(function($stateProvider, $urlRouterProvider) {
|
||||
app.stateProvider = $stateProvider;
|
||||
});
|
||||
compassModule.config(function($stateProvider, $urlRouterProvider) {
|
||||
compassModule.stateProvider = $stateProvider;
|
||||
$urlRouterProvider.otherwise('/login');
|
||||
});
|
||||
|
||||
app.run(function($rootScope, $state, authService) {
|
||||
});
|
||||
compassModule.run(function($rootScope, $state, authService) {
|
||||
$rootScope.$on("$stateChangeStart", function(event, toState, toParams, fromState, fromParams) {
|
||||
if (toState.authenticate && !authService.isAuthenticated) {
|
||||
// User isn't authenticated
|
||||
@ -35,9 +48,8 @@ app.run(function($rootScope, $state, authService) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
app.controller('appController', function($scope, authService, $state) {
|
||||
});
|
||||
compassModule.controller('appController', function($scope, authService, $state) {
|
||||
$scope.currentUser = null;
|
||||
$scope.isAuthenticated = authService.isAuthenticated;
|
||||
$scope.state = $state;
|
||||
@ -52,4 +64,6 @@ app.controller('appController', function($scope, authService, $state) {
|
||||
authService.isAuthenticated = false;
|
||||
$state.transitionTo("login");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
@ -1,4 +1,5 @@
|
||||
var compassAppDev = angular.module('compassAppDev', ['compass', 'ngMockE2E']);
|
||||
define(['angular','angularMocks'],function(){
|
||||
var compassAppDev = angular.module('compassAppDev', ['ngMockE2E']);
|
||||
|
||||
compassAppDev.run(function($httpBackend, settings, $http) {
|
||||
var progressPercent = 0;
|
||||
@ -1739,3 +1740,4 @@ compassAppDev.run(function($httpBackend, settings, $http) {
|
||||
return [200, metricData, {}];
|
||||
});
|
||||
});
|
||||
});
|
@ -1,13 +1,14 @@
|
||||
angular.module('compass.cluster', [
|
||||
'ui.router',
|
||||
'ui.bootstrap',
|
||||
'compass.charts',
|
||||
'ngAnimate',
|
||||
'ngTable',
|
||||
'angular-rickshaw'
|
||||
])
|
||||
define(['angular'], function() {
|
||||
var clusterModule = angular.module('compass.cluster', [
|
||||
//'ui.router',
|
||||
//'ui.bootstrap',
|
||||
//'compass.charts',
|
||||
//'ngAnimate',
|
||||
//'ngTable',
|
||||
//'angular-rickshaw'
|
||||
]);
|
||||
|
||||
.config(function($stateProvider, $urlRouterProvider) {
|
||||
clusterModule.config(function($stateProvider, $urlRouterProvider) {
|
||||
$stateProvider
|
||||
.state('cluster', {
|
||||
url: '/cluster/{id}',
|
||||
@ -63,9 +64,9 @@ angular.module('compass.cluster', [
|
||||
templateUrl: 'src/app/cluster/cluster-log.tpl.html',
|
||||
authenticate: true
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
.controller('clusterCtrl', function($scope, $state, dataService, $stateParams) {
|
||||
clusterModule.controller('clusterCtrl', function($scope, $state, dataService, $stateParams) {
|
||||
$scope.clusterId = $stateParams.id;
|
||||
$scope.state = $state;
|
||||
|
||||
@ -73,7 +74,8 @@ angular.module('compass.cluster', [
|
||||
$scope.clusterInfo = data;
|
||||
});
|
||||
|
||||
}).directive('clusternav', function($timeout) {
|
||||
});
|
||||
clusterModule.directive('clusternav', function($timeout) {
|
||||
return {
|
||||
restrict: 'EAC',
|
||||
templateUrl: 'src/app/cluster/cluster-nav.tpl.html',
|
||||
@ -91,13 +93,13 @@ angular.module('compass.cluster', [
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
.controller('clusterLogCtrl', function() {
|
||||
clusterModule.controller('clusterLogCtrl', function() {
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
.controller('clusterProgressCtrl', function($scope, dataService, $stateParams, $filter, ngTableParams, $timeout, $modal, clusterhostsData) {
|
||||
clusterModule.controller('clusterProgressCtrl', function($scope, dataService, $stateParams, $filter, ngTableParams, $timeout, $modal, clusterhostsData) {
|
||||
var clusterId = $stateParams.id;
|
||||
var progressTimer;
|
||||
var fireTimer = true;
|
||||
@ -176,10 +178,10 @@ angular.module('compass.cluster', [
|
||||
$timeout.cancel(progressTimer);
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
.controller('createClusterCtrl', ['$scope', '$state', '$modal', '$log', 'dataService', 'wizardFactory','$rootScope',
|
||||
function($scope, $state, $modal, $log, dataService, wizardFactory,$rootScope) {
|
||||
clusterModule.controller('createClusterCtrl', ['$scope', '$state', '$modal', '$log', 'dataService', 'wizardFactory', '$rootScope',
|
||||
function($scope, $state, $modal, $log, dataService, wizardFactory, $rootScope) {
|
||||
dataService.getAdapters().success(function(data) {
|
||||
$scope.allAdapters = data;
|
||||
$scope.cluster = {};
|
||||
@ -210,7 +212,7 @@ angular.module('compass.cluster', [
|
||||
}
|
||||
dataService.createCluster(postClusterData).success(function(data, status) {
|
||||
$scope.clusters.push(data);
|
||||
$rootScope.$emit('clusters',$scope.clusters);
|
||||
$rootScope.$emit('clusters', $scope.clusters);
|
||||
wizardFactory.setClusterInfo(data);
|
||||
angular.forEach($scope.allAdapters, function(adapter) {
|
||||
if (adapter.id == $scope.cluster.adapter_id) {
|
||||
@ -229,9 +231,9 @@ angular.module('compass.cluster', [
|
||||
};
|
||||
});
|
||||
}
|
||||
])
|
||||
]);
|
||||
|
||||
.controller('configurationCtrl', function($scope, dataService, $stateParams, $filter, ngTableParams, clusterhostsData) {
|
||||
clusterModule.controller('configurationCtrl', function($scope, dataService, $stateParams, $filter, ngTableParams, clusterhostsData) {
|
||||
var clusterId = $stateParams.id;
|
||||
$scope.partitionarray = [];
|
||||
dataService.getClusterConfig(clusterId).success(function(data) {
|
||||
@ -267,9 +269,9 @@ angular.module('compass.cluster', [
|
||||
$defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
var ClusterModalCtrl = function($scope, $modalInstance, allAdapters, cluster) {
|
||||
var ClusterModalCtrl = function($scope, $modalInstance, allAdapters, cluster) {
|
||||
$scope.allAdapters = allAdapters;
|
||||
$scope.cluster = cluster;
|
||||
|
||||
@ -291,9 +293,9 @@ var ClusterModalCtrl = function($scope, $modalInstance, allAdapters, cluster) {
|
||||
$modalInstance.dismiss('cancel');
|
||||
$scope.result = 'cancel';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
var deleteHostModalCtrl = function($scope, $modalInstance, host) {
|
||||
var deleteHostModalCtrl = function($scope, $modalInstance, host) {
|
||||
$scope.host = host;
|
||||
$scope.ok = function() {
|
||||
$modalInstance.close();
|
||||
@ -301,4 +303,5 @@ var deleteHostModalCtrl = function($scope, $modalInstance, host) {
|
||||
$scope.cancel = function() {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
}
|
||||
};
|
||||
});
|
@ -1,10 +1,11 @@
|
||||
var app = angular.module('compass.clusterlist', [
|
||||
'ui.router',
|
||||
'ui.bootstrap',
|
||||
'ngTable'
|
||||
])
|
||||
define(['angular'], function() {
|
||||
var clusterlistModule = angular.module('compass.clusterlist', [
|
||||
//'ui.router',
|
||||
//'ui.bootstrap',
|
||||
//'ngTable'
|
||||
]);
|
||||
|
||||
.config(function($stateProvider, $urlRouterProvider) {
|
||||
clusterlistModule.config(function($stateProvider, $urlRouterProvider) {
|
||||
$stateProvider
|
||||
.state('clusterList', {
|
||||
url: '/clusterlist',
|
||||
@ -21,10 +22,10 @@ var app = angular.module('compass.clusterlist', [
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
.controller('clustersListCtrl', function($scope, $state, ngTableParams, $filter, dataService, allClusterData) {
|
||||
$scope.clusters = allClusterData
|
||||
clusterlistModule.controller('clustersListCtrl', function($scope, $state, ngTableParams, $filter, dataService, allClusterData) {
|
||||
$scope.clusters = allClusterData;
|
||||
angular.forEach($scope.clusters, function(cluster) {
|
||||
dataService.getClusterProgress(cluster.id).success(function(data) {
|
||||
cluster.progress = data.status;
|
||||
@ -49,7 +50,10 @@ var app = angular.module('compass.clusterlist', [
|
||||
|
||||
$scope.goToCluster = function(id, state) {
|
||||
if (state == "UNINITIALIZED") {
|
||||
$state.go("wizard", {"id": id, "config": "true"});
|
||||
$state.go("wizard", {
|
||||
"id": id,
|
||||
"config": "true"
|
||||
});
|
||||
} else {
|
||||
$state.go("cluster.overview", {
|
||||
"id": id
|
||||
@ -66,4 +70,5 @@ var app = angular.module('compass.clusterlist', [
|
||||
alert('export?');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
})
|
@ -1,10 +1,10 @@
|
||||
angular.module('compass.login', [
|
||||
'compass.services',
|
||||
define(['uiRouter'], function() {
|
||||
'use strict';
|
||||
var loginModule = angular.module('compass.login', [
|
||||
'ui.router',
|
||||
'ui.bootstrap'
|
||||
])
|
||||
|
||||
.config(function config($stateProvider) {
|
||||
]);
|
||||
loginModule.config(function config($stateProvider) {
|
||||
$stateProvider
|
||||
.state('login', {
|
||||
url: '/login',
|
||||
@ -12,9 +12,9 @@ angular.module('compass.login', [
|
||||
templateUrl: 'src/app/login/login.tpl.html',
|
||||
authenticate: false
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
.controller('loginCtrl', function($scope, authService, $state) {
|
||||
loginModule.controller('loginCtrl', function($scope, authService, $state) {
|
||||
$scope.alerts = [];
|
||||
|
||||
$scope.login = function() {
|
||||
@ -36,19 +36,20 @@ angular.module('compass.login', [
|
||||
$scope.alerts = [];
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
.directive('setFocus', function() {
|
||||
return function(scope, element){ element[0].focus();};
|
||||
})
|
||||
loginModule.directive('setFocus', function() {
|
||||
return function(scope, element) {
|
||||
element[0].focus();
|
||||
};
|
||||
});
|
||||
|
||||
.directive('ngEnter', function() {
|
||||
loginModule.directive('ngEnter', function() {
|
||||
return function(scope, element, attrs) {
|
||||
element.bind("keydown keypress", function(event) {
|
||||
if(event.which === 13) { // 13 is enter key
|
||||
if (event.which === 13) { // 13 is enter key
|
||||
|
||||
if(scope.email.trim() !="" && scope.password.trim() != "")
|
||||
{
|
||||
if (scope.email.trim() != "" && scope.password.trim() != "") {
|
||||
scope.$eval(attrs.ngEnter);
|
||||
}
|
||||
|
||||
@ -56,4 +57,5 @@ angular.module('compass.login', [
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
});
|
@ -1,4 +1,6 @@
|
||||
angular.module('compass.monitoring', [
|
||||
define(['angularAnimate', 'angularRickshaw', 'angularUiTree', 'nvd3Directive'], function() {
|
||||
|
||||
var monitoringModule = angular.module('compass.monitoring', [
|
||||
'ui.router',
|
||||
'ui.bootstrap',
|
||||
'compass.charts',
|
||||
@ -6,9 +8,9 @@ angular.module('compass.monitoring', [
|
||||
'angular-rickshaw',
|
||||
'nvd3ChartDirectives',
|
||||
'ui.tree'
|
||||
])
|
||||
]);
|
||||
|
||||
.config(function($stateProvider, $urlRouterProvider) {
|
||||
monitoringModule.config(function($stateProvider, $urlRouterProvider) {
|
||||
$stateProvider
|
||||
.state('cluster.monitoring', {
|
||||
url: '/monitoring',
|
||||
@ -44,9 +46,9 @@ angular.module('compass.monitoring', [
|
||||
templateUrl: 'src/app/monitoring/charts.tpl.html',
|
||||
authenticate: true
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
.controller('moniOverviewCtrl', function($scope, dataService, $stateParams) {
|
||||
monitoringModule.controller('moniOverviewCtrl', function($scope, dataService, $stateParams) {
|
||||
var clusterId = $stateParams.id;
|
||||
|
||||
$scope.goDash = function(locs) {
|
||||
@ -63,9 +65,9 @@ angular.module('compass.monitoring', [
|
||||
// TODO: error handle
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
.controller('topologyCtrl', function($scope, dataService, $stateParams) {
|
||||
monitoringModule.controller('topologyCtrl', function($scope, dataService, $stateParams) {
|
||||
var clusterId = $stateParams.id;
|
||||
|
||||
$scope.physicalTopoData = {};
|
||||
@ -89,9 +91,9 @@ angular.module('compass.monitoring', [
|
||||
// TODO: error handling
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
.controller('alertsCtrl', function($scope, dataService, $stateParams) {
|
||||
monitoringModule.controller('alertsCtrl', function($scope, dataService, $stateParams) {
|
||||
var clusterId = $stateParams.id;
|
||||
|
||||
$scope.alerts = [];
|
||||
@ -104,9 +106,9 @@ angular.module('compass.monitoring', [
|
||||
//TODO: error handling
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
.controller('metricsCtrl', function($scope, dataService, $stateParams) {
|
||||
monitoringModule.controller('metricsCtrl', function($scope, dataService, $stateParams) {
|
||||
var clusterId = $stateParams.id;
|
||||
|
||||
$scope.metricsTree = [];
|
||||
@ -180,4 +182,5 @@ angular.module('compass.monitoring', [
|
||||
}
|
||||
*/
|
||||
|
||||
})
|
||||
})
|
||||
});
|
@ -1,12 +1,13 @@
|
||||
angular.module('compass.server', [
|
||||
define(['uiRouter', 'uiBootstrap', 'angularTable'], function() {
|
||||
var serverModule = angular.module('compass.server', [
|
||||
'ui.router',
|
||||
'ui.bootstrap',
|
||||
'compass.charts',
|
||||
'compass.findservers',
|
||||
'ngTable'
|
||||
])
|
||||
]);
|
||||
|
||||
.config(function config($stateProvider) {
|
||||
serverModule.config(function config($stateProvider) {
|
||||
$stateProvider
|
||||
.state('serverList', {
|
||||
url: '/serverlist',
|
||||
@ -23,9 +24,9 @@ angular.module('compass.server', [
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
.controller('serverCtrl', function($scope, dataService, $filter, ngTableParams, sortingService, machinesHostsData) {
|
||||
serverModule.controller('serverCtrl', function($scope, dataService, $filter, ngTableParams, sortingService, machinesHostsData) {
|
||||
$scope.hideunselected = '';
|
||||
$scope.search = {};
|
||||
$scope.allservers = machinesHostsData;
|
||||
@ -118,4 +119,5 @@ angular.module('compass.server', [
|
||||
}
|
||||
}, true);
|
||||
|
||||
})
|
||||
});
|
||||
});
|
@ -1,8 +1,7 @@
|
||||
angular.module('compass.services', [])
|
||||
|
||||
// stateService is used for dynamically add/edit state
|
||||
/*
|
||||
.service('stateService', ['$state',
|
||||
define(['angular'], function() {
|
||||
var servicesModule = angular.module('compass.services', []);
|
||||
// stateService is used for dynamically add/edit state
|
||||
/* .service('stateService', ['$state',
|
||||
function($state) {
|
||||
this.addStates = function(pendingStates) {
|
||||
var existingStates = $state.get(); // get all the current existing states
|
||||
@ -25,11 +24,10 @@ angular.module('compass.services', [])
|
||||
});
|
||||
}
|
||||
}
|
||||
])
|
||||
])
|
||||
*/
|
||||
|
||||
// dataService is used for http calls
|
||||
.service('dataService', ['$http', 'settings',
|
||||
// dataService is used for http calls
|
||||
servicesModule.service('dataService', ['$http', 'settings', //settings is global constant
|
||||
function($http, settings) {
|
||||
|
||||
this.login = function(user) {
|
||||
@ -210,7 +208,7 @@ angular.module('compass.services', [])
|
||||
this.deleteHost = function(id) {
|
||||
return $http.delete(settings.apiUrlBase + '/hosts/' + id);
|
||||
};
|
||||
/*
|
||||
/*
|
||||
this.deleteHost = function(clusterId, hostId) {
|
||||
return $http.delete(settings.apiUrlBase + '/clusters/' + clusterId + '/hosts/' + hostId);
|
||||
};
|
||||
@ -222,7 +220,7 @@ angular.module('compass.services', [])
|
||||
return $http.get(settings.monitoringUrlBase + '/clusters/' + id + '/hosts');
|
||||
};
|
||||
|
||||
/* this.monitorProxy = function(px_url) {
|
||||
/* this.monitorProxy = function(px_url) {
|
||||
// Leave for now may delete later
|
||||
// /monit/api/proxy/<path:url>
|
||||
return $http.get(settings.monitoringUrlBase + '/proxy/' + px_url);
|
||||
@ -300,9 +298,9 @@ angular.module('compass.services', [])
|
||||
return $http.get(settings.monitoringUrlBase + '/clusters/' + clusterId + '/user' + userName);
|
||||
};
|
||||
}
|
||||
])
|
||||
])
|
||||
|
||||
.service('sortingService', function() {
|
||||
servicesModule.service('sortingService', function() {
|
||||
this.ipAddressPre = function(a) {
|
||||
var m = a.split("."),
|
||||
x = "";
|
||||
@ -319,10 +317,10 @@ angular.module('compass.services', [])
|
||||
}
|
||||
return x;
|
||||
};
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
.factory('wizardFactory', [
|
||||
servicesModule.factory('wizardFactory', [
|
||||
|
||||
function() {
|
||||
var wizard = {};
|
||||
@ -397,7 +395,7 @@ angular.module('compass.services', [])
|
||||
wizard.getServers = function() {
|
||||
return angular.copy(wizard.servers);
|
||||
};
|
||||
/*
|
||||
/*
|
||||
wizard.setAdapter = function(adapter) { ////
|
||||
wizard.adapter = adapter;
|
||||
};
|
||||
@ -482,9 +480,9 @@ angular.module('compass.services', [])
|
||||
|
||||
return wizard;
|
||||
}
|
||||
])
|
||||
])
|
||||
|
||||
.service('authService', ['$http', 'dataService',
|
||||
servicesModule.service('authService', ['$http', 'dataService',
|
||||
function($http, dataService) {
|
||||
this.isAuthenticated = false;
|
||||
|
||||
@ -500,4 +498,5 @@ angular.module('compass.services', [])
|
||||
this.isAuthenticated = false;
|
||||
};
|
||||
}
|
||||
])
|
||||
])
|
||||
})
|
@ -1,18 +1,21 @@
|
||||
angular.module('compass.topnav', [
|
||||
define(['angular'], function() {
|
||||
var topNavModule = angular.module('compass.topnav', [
|
||||
'ui.router',
|
||||
'ui.bootstrap'
|
||||
])
|
||||
]);
|
||||
|
||||
.controller('topnavCtrl', function($scope, $http, dataService, $rootScope) {
|
||||
topNavModule.controller('topnavCtrl', function($scope, $http, dataService, $rootScope) {
|
||||
// get all clusters
|
||||
dataService.getClusters().success(function(data) {
|
||||
$scope.clusters = data;
|
||||
});
|
||||
$rootScope.$on('clusters', function(event, data) {
|
||||
$scope.clusters = data;
|
||||
})
|
||||
}).directive('topnav', function() {
|
||||
});
|
||||
});
|
||||
topNavModule.directive('topnav', function() {
|
||||
return {
|
||||
templateUrl: 'src/app/topnav/topnav.tpl.html'
|
||||
};
|
||||
});
|
||||
});
|
@ -163,6 +163,7 @@
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr ng-repeat="userLog in $data | filter:searchActivity | timeStampFilter:dateRange">
|
||||
<td sortable="'user_id'">
|
||||
|
@ -1,9 +1,10 @@
|
||||
var app = angular.module('compass.userProfile', [
|
||||
define(['angular'], function() {
|
||||
var userProfileModule = angular.module('compass.userProfile', [
|
||||
'ui.router',
|
||||
'ui.bootstrap'
|
||||
])
|
||||
]);
|
||||
|
||||
.config(function($stateProvider, $urlRouterProvider) {
|
||||
userProfileModule.config(function($stateProvider, $urlRouterProvider) {
|
||||
$stateProvider
|
||||
.state('userProfile', {
|
||||
url: '/userProfile',
|
||||
@ -12,6 +13,6 @@ var app = angular.module('compass.userProfile', [
|
||||
authenticate: true,
|
||||
//resolve: {}
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
//combine usersetting and userprofile into a single file?
|
@ -1,11 +1,14 @@
|
||||
var app = angular.module('compass.userSetting', [
|
||||
define(['ngBsDaterangepicker', 'uiRouter', 'uiBootstrap', 'angularTable'], function() {
|
||||
'use strict';
|
||||
|
||||
var userSettingModule = angular.module('compass.userSetting', [
|
||||
'ui.router',
|
||||
'ui.bootstrap',
|
||||
'ngTable',
|
||||
'ngBootstrap'
|
||||
])
|
||||
]);
|
||||
|
||||
.config(function($stateProvider, $urlRouterProvider) {
|
||||
userSettingModule.config(function($stateProvider, $urlRouterProvider) {
|
||||
$stateProvider
|
||||
.state('userSetting', {
|
||||
url: '/userSetting',
|
||||
@ -30,9 +33,9 @@ var app = angular.module('compass.userSetting', [
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
.controller('userSettingCtrl', function($scope, $state, ngTableParams, $filter, dataService, userSettingData, $modal) {
|
||||
userSettingModule.controller('userSettingCtrl', function($scope, $state, ngTableParams, $filter, dataService, userSettingData, $modal) {
|
||||
$scope.userSetting = userSettingData;
|
||||
var data = userSettingData;
|
||||
$scope.tableParams = new ngTableParams({
|
||||
@ -93,9 +96,9 @@ var app = angular.module('compass.userSetting', [
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
.directive('match', function() {
|
||||
userSettingModule.directive('match', function() {
|
||||
return {
|
||||
require: 'ngModel',
|
||||
restrict: 'A',
|
||||
@ -110,9 +113,9 @@ var app = angular.module('compass.userSetting', [
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
app.filter('timeStampFilter', function () {
|
||||
userSettingModule.filter('timeStampFilter', function() {
|
||||
return function(items, dateRange) {
|
||||
if (items !== undefined) {
|
||||
var filtered = [];
|
||||
@ -128,9 +131,9 @@ app.filter('timeStampFilter', function () {
|
||||
return filtered;
|
||||
}
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
var UserModalCtrl = function($scope, $modalInstance, newUser) {
|
||||
var UserModalCtrl = function($scope, $modalInstance, newUser) {
|
||||
$scope.newUser = newUser;
|
||||
|
||||
$scope.ok = function() {
|
||||
@ -142,4 +145,5 @@ var UserModalCtrl = function($scope, $modalInstance, newUser) {
|
||||
$modalInstance.dismiss('cancel');
|
||||
$scope.result = 'cancel';
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
@ -1,16 +1,16 @@
|
||||
angular.module('compass.wizard', [
|
||||
define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinner', 'angularAnimate'], function() {
|
||||
var wizardModule = angular.module('compass.wizard', [
|
||||
'ui.router',
|
||||
'ui.bootstrap',
|
||||
'ngTable',
|
||||
'compass.charts',
|
||||
'compass.findservers',
|
||||
//'compass.charts',
|
||||
//'compass.findservers',
|
||||
'ngDragDrop',
|
||||
'ngTouch',
|
||||
'angularSpinner',
|
||||
'ngAnimate'
|
||||
])
|
||||
|
||||
.config(function config($stateProvider) {
|
||||
]);
|
||||
wizardModule.config(function config($stateProvider) {
|
||||
$stateProvider
|
||||
.state('wizard', {
|
||||
url: '/wizard/{id}?config',
|
||||
@ -50,9 +50,9 @@ angular.module('compass.wizard', [
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
.controller('wizardCtrl', function($scope, dataService, wizardFactory, $stateParams, $state, $modal, clusterData, machinesHostsData, wizardStepsData, clusterConfigData, usSpinnerService) {
|
||||
wizardModule.controller('wizardCtrl', function($scope, dataService, wizardFactory, $stateParams, $state, $modal, clusterData, machinesHostsData, wizardStepsData, clusterConfigData) {
|
||||
$scope.loading = false;
|
||||
$scope.clusterId = $stateParams.id;
|
||||
$scope.cluster = clusterData;
|
||||
@ -61,7 +61,7 @@ angular.module('compass.wizard', [
|
||||
|
||||
var oldConfig = clusterConfigData;
|
||||
|
||||
$scope.$on('loading',function(event,data){
|
||||
$scope.$on('loading', function(event, data) {
|
||||
$scope.loading = data;
|
||||
});
|
||||
|
||||
@ -246,13 +246,13 @@ angular.module('compass.wizard', [
|
||||
|
||||
$scope.stepForward = function() {
|
||||
$scope.pendingStep = $scope.currentStep + 1;;
|
||||
$scope.triggerCommit($scope.currentStep,$scope.pendingStep);
|
||||
$scope.triggerCommit($scope.currentStep, $scope.pendingStep);
|
||||
};
|
||||
|
||||
// go to previous step
|
||||
$scope.stepBackward = function() {
|
||||
$scope.pendingStep = $scope.currentStep - 1;
|
||||
$scope.triggerCommit($scope.currentStep,$scope.pendingStep);
|
||||
$scope.triggerCommit($scope.currentStep, $scope.pendingStep);
|
||||
};
|
||||
|
||||
// go to step by stepId
|
||||
@ -283,9 +283,9 @@ angular.module('compass.wizard', [
|
||||
dataService.getSubnetConfig().success(function(data) {
|
||||
wizardFactory.setSubnetworks(data);
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
.animation('.fade-animation', function() {
|
||||
wizardModule.animation('.fade-animation', function() {
|
||||
return {
|
||||
enter: function(element, done) {
|
||||
element.css('display', 'none');
|
||||
@ -301,9 +301,9 @@ angular.module('compass.wizard', [
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
.controller('svSelectCtrl', function($scope, wizardFactory, dataService, $filter, ngTableParams, sortingService) {
|
||||
wizardModule.controller('svSelectCtrl', function($scope, wizardFactory, dataService, $filter, ngTableParams, sortingService) {
|
||||
$scope.hideunselected = '';
|
||||
$scope.search = {};
|
||||
|
||||
@ -392,7 +392,7 @@ angular.module('compass.wizard', [
|
||||
});
|
||||
|
||||
$scope.commit = function() {
|
||||
$scope.$emit("loading",true);
|
||||
$scope.$emit("loading", true);
|
||||
var selectedServers = [];
|
||||
var noSelection = true;
|
||||
angular.forEach($scope.allservers, function(sv) {
|
||||
@ -474,9 +474,9 @@ angular.module('compass.wizard', [
|
||||
}
|
||||
}, true);
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
.controller('globalCtrl', function($scope, wizardFactory, dataService, $q) {
|
||||
wizardModule.controller('globalCtrl', function($scope, wizardFactory, dataService, $q) {
|
||||
var cluster = wizardFactory.getClusterInfo();
|
||||
|
||||
$scope.general = wizardFactory.getGeneralConfig();
|
||||
@ -538,7 +538,7 @@ angular.module('compass.wizard', [
|
||||
wizardFactory.setCommitState(commitState);
|
||||
return;
|
||||
}
|
||||
$scope.$emit("loading",true);
|
||||
$scope.$emit("loading", true);
|
||||
var os_global_general = {
|
||||
"os_config": {
|
||||
"general": $scope.general
|
||||
@ -602,9 +602,9 @@ angular.module('compass.wizard', [
|
||||
})
|
||||
};
|
||||
*/
|
||||
})
|
||||
});
|
||||
|
||||
.controller('networkCtrl', function($scope, $timeout, wizardFactory, dataService, $filter, ngTableParams, sortingService, $q, $modal) {
|
||||
wizardModule.controller('networkCtrl', function($scope, $timeout, wizardFactory, dataService, $filter, ngTableParams, sortingService, $q, $modal) {
|
||||
var cluster = wizardFactory.getClusterInfo();
|
||||
$scope.subnetworks = wizardFactory.getSubnetworks();
|
||||
$scope.interfaces = wizardFactory.getInterfaces();
|
||||
@ -708,7 +708,7 @@ angular.module('compass.wizard', [
|
||||
wizardFactory.setCommitState(commitState);
|
||||
return;
|
||||
}
|
||||
$scope.$emit("loading",true);
|
||||
$scope.$emit("loading", true);
|
||||
wizardFactory.setInterfaces($scope.interfaces);
|
||||
|
||||
|
||||
@ -891,9 +891,9 @@ angular.module('compass.wizard', [
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
.controller('partitionCtrl', function($scope, wizardFactory, dataService) {
|
||||
wizardModule.controller('partitionCtrl', function($scope, wizardFactory, dataService) {
|
||||
var cluster = wizardFactory.getClusterInfo();
|
||||
$scope.partition = wizardFactory.getPartition();
|
||||
$scope.partitionInforArray = [];
|
||||
@ -1013,7 +1013,7 @@ angular.module('compass.wizard', [
|
||||
wizardFactory.setCommitState(commitState);
|
||||
return;
|
||||
}
|
||||
$scope.$emit("loading",true);
|
||||
$scope.$emit("loading", true);
|
||||
if ($scope.duplicated == true) {
|
||||
var message = {
|
||||
"message": "Mount Point cannot be the same"
|
||||
@ -1058,9 +1058,9 @@ angular.module('compass.wizard', [
|
||||
});
|
||||
}
|
||||
};
|
||||
})
|
||||
})
|
||||
|
||||
.controller('securityCtrl', function($scope, wizardFactory, dataService) {
|
||||
wizardModule.controller('securityCtrl', function($scope, wizardFactory, dataService) {
|
||||
var cluster = wizardFactory.getClusterInfo();
|
||||
$scope.server_credentials = wizardFactory.getServerCredentials();
|
||||
$scope.service_credentials = wizardFactory.getServiceCredentials();
|
||||
@ -1173,7 +1173,7 @@ angular.module('compass.wizard', [
|
||||
wizardFactory.setCommitState(commitState);
|
||||
return;
|
||||
}
|
||||
$scope.$emit("loading",true);
|
||||
$scope.$emit("loading", true);
|
||||
var securityData = {
|
||||
"os_config": {
|
||||
"server_credentials": {
|
||||
@ -1204,9 +1204,9 @@ angular.module('compass.wizard', [
|
||||
wizardFactory.setCommitState(commitState);
|
||||
});
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
.controller('roleAssignCtrl', function($scope, wizardFactory, dataService, $filter, ngTableParams, sortingService, $q) {
|
||||
wizardModule.controller('roleAssignCtrl', function($scope, wizardFactory, dataService, $filter, ngTableParams, sortingService, $q) {
|
||||
var cluster = wizardFactory.getClusterInfo();
|
||||
$scope.servers = wizardFactory.getServers();
|
||||
var colors = ['#8EA16C', '#C2CF30', '#FEC700', '#FF8900', '#D3432B', '#BB2952', '#8E1E5F', '#DE4AB6', '#9900EC', '#3A1AA8', '#3932FE', '#278BC0', '#35B9F6', '#91E0CB', '#42BC6A', '#5B4141'];
|
||||
@ -1385,7 +1385,7 @@ angular.module('compass.wizard', [
|
||||
wizardFactory.setCommitState(commitState);
|
||||
return;
|
||||
}
|
||||
$scope.$emit("loading",true);
|
||||
$scope.$emit("loading", true);
|
||||
var promises = [];
|
||||
angular.forEach($scope.servers, function(server) {
|
||||
var roles = [];
|
||||
@ -1464,9 +1464,9 @@ angular.module('compass.wizard', [
|
||||
$scope.servers[key].dropChannel = $scope.existingRoles[key].toString();
|
||||
});
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
.controller('networkMappingCtrl', function($scope, wizardFactory, dataService) {
|
||||
wizardModule.controller('networkMappingCtrl', function($scope, wizardFactory, dataService) {
|
||||
var cluster = wizardFactory.getClusterInfo();
|
||||
$scope.interfaces = wizardFactory.getInterfaces();
|
||||
$scope.original_networking = wizardFactory.getNetworkMapping();
|
||||
@ -1527,7 +1527,7 @@ angular.module('compass.wizard', [
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.$emit("loading",true);
|
||||
$scope.$emit("loading", true);
|
||||
var networks = {};
|
||||
angular.forEach($scope.networking, function(value, key) {
|
||||
networks[key] = value.mapping_interface;
|
||||
@ -1554,9 +1554,9 @@ angular.module('compass.wizard', [
|
||||
wizardFactory.setCommitState(commitState);
|
||||
});
|
||||
};
|
||||
})
|
||||
})
|
||||
|
||||
.controller('reviewCtrl', function($scope, wizardFactory, dataService, $filter, ngTableParams, sortingService) {
|
||||
wizardModule.controller('reviewCtrl', function($scope, wizardFactory, dataService, $filter, ngTableParams, sortingService) {
|
||||
var cluster = wizardFactory.getClusterInfo();
|
||||
$scope.servers = wizardFactory.getServers();
|
||||
$scope.interfaces = wizardFactory.getInterfaces();
|
||||
@ -1678,9 +1678,9 @@ angular.module('compass.wizard', [
|
||||
}
|
||||
};
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
.directive('ngKeypress', function() {
|
||||
wizardModule.directive('ngKeypress', function() {
|
||||
return function(scope, element, attrs) {
|
||||
element.bind("keydown keypress", function(event) {
|
||||
if (event.which === 9) { // 9 is tab key
|
||||
@ -1697,15 +1697,15 @@ angular.module('compass.wizard', [
|
||||
}
|
||||
});
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
//Used for roles panel on Role Assignment page
|
||||
.directive("rolepanelscroll", function($window) {
|
||||
//Used for roles panel on Role Assignment page
|
||||
wizardModule.directive("rolepanelscroll", function($window) {
|
||||
return function(scope, element, attrs) {
|
||||
angular.element($window).bind("scroll", function() {
|
||||
var window_top = this.pageYOffset;
|
||||
var sticky_anchor_elem = angular.element($('#sticky-anchor'));
|
||||
if(sticky_anchor_elem.length != 0) {
|
||||
if (sticky_anchor_elem.length != 0) {
|
||||
var div_top = sticky_anchor_elem.offset().top;
|
||||
if (window_top > div_top) {
|
||||
$('.role-panel').addClass('stick');
|
||||
@ -1716,17 +1716,18 @@ angular.module('compass.wizard', [
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
var wizardModalInstanceCtrl = function($scope, $modalInstance, warning) {
|
||||
var wizardModalInstanceCtrl = function($scope, $modalInstance, warning) {
|
||||
$scope.warning = warning;
|
||||
|
||||
$scope.ok = function() {
|
||||
$modalInstance.close();
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
var addSubnetModalInstanceCtrl = function($scope, $modalInstance, $q, subnets, dataService, $filter) {
|
||||
|
||||
var addSubnetModalInstanceCtrl = function($scope, $modalInstance, $q, subnets, dataService, $filter) {
|
||||
$scope.subnetworks = angular.copy(subnets);
|
||||
$scope.subnetAllValid = true;
|
||||
|
||||
@ -1834,4 +1835,5 @@ var addSubnetModalInstanceCtrl = function($scope, $modalInstance, $q, subnets, d
|
||||
}
|
||||
}, true);
|
||||
|
||||
};
|
||||
};
|
||||
});
|
@ -3,7 +3,7 @@
|
||||
<div class="page-content" ng-swipe-disable-mouse ng-swipe-right="stepForward()" ng-swipe-left="stepBackward()" >
|
||||
<div class="page-header">
|
||||
<h1>Create Cluster Wizard</h1>
|
||||
<span us-spinner="{radius:30, length: 20, lines:13, width:10}" spinner-key="spinner-1"></span>
|
||||
<!-- <span us-spinner="{radius:30, length: 20, lines:13, width:10}" spinner-key="spinner-1"></span> -->
|
||||
</div>
|
||||
<div id="create-cluster-wizard">
|
||||
<ul class="wizard-steps">
|
||||
@ -26,7 +26,7 @@
|
||||
<div class="widget-body">
|
||||
<div class="widget-main padding-32">
|
||||
<span us-spinner ng-if="loading == true" style="position: relative !important; left: 47%"></span>
|
||||
<div ng-hide = "loading == true" ng-include="steps[currentStep-1].template"></div>
|
||||
<div ng-hide="loading == true" ng-include="steps[currentStep-1].template"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
6
v2/src/bootstrap.js
vendored
Normal file
6
v2/src/bootstrap.js
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
define(['angular', 'app/app'], function(ng) {
|
||||
'use strict';
|
||||
ng.element(document).ready(function() {
|
||||
ng.bootstrap(document, ['app']);
|
||||
})
|
||||
});
|
@ -1,6 +1,7 @@
|
||||
angular.module('compass.charts', [])
|
||||
define(['angular', 'ganttChart'], function(angular, ganttChart) {
|
||||
var chartsModule = angular.module('compass.charts', []);
|
||||
|
||||
.directive('piechart', function() {
|
||||
chartsModule.directive('piechart', function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
@ -67,9 +68,9 @@ angular.module('compass.charts', [])
|
||||
}, true)
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
.directive('hostprogressbar', function(dataService, $timeout) {
|
||||
chartsModule.directive('hostprogressbar', function(dataService, $timeout) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
@ -117,9 +118,9 @@ angular.module('compass.charts', [])
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
.directive('circlepacking', function() {
|
||||
chartsModule.directive('circlepacking', function() {
|
||||
return {
|
||||
restrict: 'EAC',
|
||||
scope: {
|
||||
@ -276,9 +277,9 @@ angular.module('compass.charts', [])
|
||||
|
||||
}
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
.directive('treechart', function() {
|
||||
chartsModule.directive('treechart', function() {
|
||||
return {
|
||||
restrict: 'EAC',
|
||||
scope: {
|
||||
@ -516,22 +517,16 @@ angular.module('compass.charts', [])
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
app.directive('ganttchart', function() {
|
||||
chartsModule.directive('ganttchart', function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
data: '=',
|
||||
dataready: '='
|
||||
},
|
||||
template: '<div class="pull-right"><button type="button" class="btn btn-xs side-margin-3" ng-click="changeTimeDomain(\'1hr\')">1 HR</button>'
|
||||
+ '<button type="button" class="btn btn-xs side-margin-3" ng-click="changeTimeDomain(\'3hr\')">3 HR</button>'
|
||||
+ '<button type="button" class="btn btn-xs side-margin-3" ng-click="changeTimeDomain(\'6hr\')">6 HR</button>'
|
||||
+ '<button type="button" class="btn btn-xs side-margin-3" ng-click="changeTimeDomain(\'1day\')">1 DAY</button>'
|
||||
+ '<button type="button" class="btn btn-xs side-margin-3" ng-click="changeTimeDomain(\'1week\')">1 WEEK</button>'
|
||||
+ '</div>'
|
||||
+ '<div class="clear-fix"></div>',
|
||||
template: '<div class="pull-right"><button type="button" class="btn btn-xs side-margin-3" ng-click="changeTimeDomain(\'1hr\')">1 HR</button>' + '<button type="button" class="btn btn-xs side-margin-3" ng-click="changeTimeDomain(\'3hr\')">3 HR</button>' + '<button type="button" class="btn btn-xs side-margin-3" ng-click="changeTimeDomain(\'6hr\')">6 HR</button>' + '<button type="button" class="btn btn-xs side-margin-3" ng-click="changeTimeDomain(\'1day\')">1 DAY</button>' + '<button type="button" class="btn btn-xs side-margin-3" ng-click="changeTimeDomain(\'1week\')">1 WEEK</button>' + '</div>' + '<div class="clear-fix"></div>',
|
||||
// BUG: svg not appended initially if using templateUrl
|
||||
//templateUrl: "src/common/ganttchart.tpl.html",
|
||||
link: function(scope, element, attrs) {
|
||||
@ -543,12 +538,12 @@ app.directive('ganttchart', function() {
|
||||
}
|
||||
}, true);
|
||||
|
||||
function drawChart () {
|
||||
function drawChart() {
|
||||
var tasks = scope.data;
|
||||
var hostnames = [];
|
||||
|
||||
angular.forEach(tasks, function(task) {
|
||||
if(hostnames.indexOf(task) == -1) {
|
||||
if (hostnames.indexOf(task) == -1) {
|
||||
hostnames.push(task.name);
|
||||
}
|
||||
});
|
||||
@ -573,8 +568,9 @@ app.directive('ganttchart', function() {
|
||||
var format = "%H:%M";
|
||||
var timeDomainString = "1day";
|
||||
|
||||
var gantt = d3.gantt().taskTypes(hostnames).taskStatus(taskStatus).tickFormat(format).height(450).width(800);
|
||||
//var gantt = d3.gantt().taskTypes(hostnames).taskStatus(taskStatus).tickFormat(format).height(450).width(800);
|
||||
|
||||
var gantt = ganttChart().taskTypes(hostnames).taskStatus(taskStatus).tickFormat(format).height(450).width(800);
|
||||
scope.changeTimeDomain = function(timeDomainString) {
|
||||
this.timeDomainString = timeDomainString;
|
||||
switch (timeDomainString) {
|
||||
@ -630,4 +626,5 @@ app.directive('ganttchart', function() {
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
});
|
@ -1,5 +1,6 @@
|
||||
angular.module('compass.findservers', [])
|
||||
.directive('switchrow', function(dataService, $timeout) {
|
||||
define(['angular'], function() {
|
||||
var findserversModule = angular.module('compass.findservers', []);
|
||||
findserversModule.directive('switchrow', function(dataService, $timeout) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope: {
|
||||
@ -66,9 +67,9 @@ angular.module('compass.findservers', [])
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
.directive('findservers', function(dataService, $modal, $log) {
|
||||
findserversModule.directive('findservers', function(dataService, $modal, $log) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
@ -97,7 +98,7 @@ angular.module('compass.findservers', [])
|
||||
|
||||
modalInstance.result.then(function(targetSwitch) {
|
||||
scope.alerts = [];
|
||||
dataService.putSwitches(targetSwitch.id,targetSwitch).success(function() {
|
||||
dataService.putSwitches(targetSwitch.id, targetSwitch).success(function() {
|
||||
|
||||
scope.switches[index] = angular.copy(targetSwitch);
|
||||
|
||||
@ -188,14 +189,15 @@ angular.module('compass.findservers', [])
|
||||
};
|
||||
}
|
||||
};
|
||||
})
|
||||
var modifySwitchModalInstanceCtrl = function ($scope, $modalInstance,targetSwitch) {
|
||||
});
|
||||
var modifySwitchModalInstanceCtrl = function($scope, $modalInstance, targetSwitch) {
|
||||
$scope.targetSwitch = angular.copy(targetSwitch);
|
||||
$scope.ok = function () {
|
||||
$scope.ok = function() {
|
||||
$modalInstance.close($scope.targetSwitch);
|
||||
};
|
||||
|
||||
$scope.cancel = function () {
|
||||
$scope.cancel = function() {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
@ -2,24 +2,24 @@
|
||||
* @author Dimitry Kudrayvtsev
|
||||
* @version 2.0
|
||||
*/
|
||||
|
||||
d3.gantt = function() {
|
||||
define(['d3'], function() {
|
||||
d3.gantt = function() {
|
||||
var FIT_TIME_DOMAIN_MODE = "fit";
|
||||
var FIXED_TIME_DOMAIN_MODE = "fixed";
|
||||
|
||||
var margin = {
|
||||
top : 20,
|
||||
right : 40,
|
||||
bottom : 20,
|
||||
left : 150
|
||||
top: 20,
|
||||
right: 40,
|
||||
bottom: 20,
|
||||
left: 150
|
||||
};
|
||||
var timeDomainStart = d3.time.day.offset(new Date(),-3);
|
||||
var timeDomainEnd = d3.time.hour.offset(new Date(),+3);
|
||||
var timeDomainMode = FIT_TIME_DOMAIN_MODE;// fixed or fit
|
||||
var timeDomainStart = d3.time.day.offset(new Date(), -3);
|
||||
var timeDomainEnd = d3.time.hour.offset(new Date(), +3);
|
||||
var timeDomainMode = FIT_TIME_DOMAIN_MODE; // fixed or fit
|
||||
var taskTypes = [];
|
||||
var taskStatus = [];
|
||||
var height = document.body.clientHeight - margin.top - margin.bottom-5;
|
||||
var width = document.body.clientWidth - margin.right - margin.left-5;
|
||||
var height = document.body.clientHeight - margin.top - margin.bottom - 5;
|
||||
var width = document.body.clientWidth - margin.right - margin.left - 5;
|
||||
|
||||
var tickFormat = "%H:%M";
|
||||
|
||||
@ -31,9 +31,9 @@ d3.gantt = function() {
|
||||
return "translate(" + x(d.startDate) + "," + y(d.name) + ")";
|
||||
};
|
||||
|
||||
var x = d3.time.scale().domain([ timeDomainStart, timeDomainEnd ]).range([ 0, width ]).clamp(true);
|
||||
var x = d3.time.scale().domain([timeDomainStart, timeDomainEnd]).range([0, width]).clamp(true);
|
||||
|
||||
var y = d3.scale.ordinal().domain(taskTypes).rangeRoundBands([ 0, height - margin.top - margin.bottom ], .1);
|
||||
var y = d3.scale.ordinal().domain(taskTypes).rangeRoundBands([0, height - margin.top - margin.bottom], .1);
|
||||
|
||||
var xAxis = d3.svg.axis().scale(x).orient("bottom").tickFormat(d3.time.format(tickFormat)).tickSubdivide(true)
|
||||
.tickSize(8).tickPadding(8);
|
||||
@ -59,8 +59,8 @@ d3.gantt = function() {
|
||||
};
|
||||
|
||||
var initAxis = function() {
|
||||
x = d3.time.scale().domain([ timeDomainStart, timeDomainEnd ]).range([ 0, width ]).clamp(true);
|
||||
y = d3.scale.ordinal().domain(taskTypes).rangeRoundBands([ 0, height - margin.top - margin.bottom ], .1);
|
||||
x = d3.time.scale().domain([timeDomainStart, timeDomainEnd]).range([0, width]).clamp(true);
|
||||
y = d3.scale.ordinal().domain(taskTypes).rangeRoundBands([0, height - margin.top - margin.bottom], .1);
|
||||
xAxis = d3.svg.axis().scale(x).orient("bottom").tickFormat(d3.time.format(tickFormat)).tickSubdivide(true)
|
||||
.tickSize(8).tickPadding(8);
|
||||
|
||||
@ -88,13 +88,17 @@ d3.gantt = function() {
|
||||
.append("rect")
|
||||
.attr("rx", 5)
|
||||
.attr("ry", 5)
|
||||
.attr("class", function(d){
|
||||
if(taskStatus[d.status] == null){ return "bar";}
|
||||
.attr("class", function(d) {
|
||||
if (taskStatus[d.status] == null) {
|
||||
return "bar";
|
||||
}
|
||||
return taskStatus[d.status];
|
||||
})
|
||||
.attr("y", 0)
|
||||
.attr("transform", rectTransform)
|
||||
.attr("height", function(d) { return y.rangeBand(); })
|
||||
.attr("height", function(d) {
|
||||
return y.rangeBand();
|
||||
})
|
||||
.attr("width", function(d) {
|
||||
return (x(d.endDate) - x(d.startDate));
|
||||
});
|
||||
@ -123,24 +127,30 @@ d3.gantt = function() {
|
||||
var rect = ganttChartGroup.selectAll("rect").data(tasks, keyFunction);
|
||||
|
||||
rect.enter()
|
||||
.insert("rect",":first-child")
|
||||
.insert("rect", ":first-child")
|
||||
.attr("rx", 5)
|
||||
.attr("ry", 5)
|
||||
.attr("class", function(d){
|
||||
if(taskStatus[d.status] == null){ return "bar";}
|
||||
.attr("class", function(d) {
|
||||
if (taskStatus[d.status] == null) {
|
||||
return "bar";
|
||||
}
|
||||
return taskStatus[d.status];
|
||||
})
|
||||
.transition()
|
||||
.attr("y", 0)
|
||||
.attr("transform", rectTransform)
|
||||
.attr("height", function(d) { return y.rangeBand(); })
|
||||
.attr("height", function(d) {
|
||||
return y.rangeBand();
|
||||
})
|
||||
.attr("width", function(d) {
|
||||
return (x(d.endDate) - x(d.startDate));
|
||||
});
|
||||
|
||||
rect.transition()
|
||||
.attr("transform", rectTransform)
|
||||
.attr("height", function(d) { return y.rangeBand(); })
|
||||
.attr("height", function(d) {
|
||||
return y.rangeBand();
|
||||
})
|
||||
.attr("width", function(d) {
|
||||
return (x(d.endDate) - x(d.startDate));
|
||||
});
|
||||
@ -162,7 +172,7 @@ d3.gantt = function() {
|
||||
|
||||
gantt.timeDomain = function(value) {
|
||||
if (!arguments.length)
|
||||
return [ timeDomainStart, timeDomainEnd ];
|
||||
return [timeDomainStart, timeDomainEnd];
|
||||
timeDomainStart = +value[0], timeDomainEnd = +value[1];
|
||||
return gantt;
|
||||
};
|
||||
@ -218,4 +228,6 @@ d3.gantt = function() {
|
||||
|
||||
|
||||
return gantt;
|
||||
};
|
||||
};
|
||||
return d3.gantt;
|
||||
})
|
127
v2/src/main.js
Normal file
127
v2/src/main.js
Normal file
@ -0,0 +1,127 @@
|
||||
require.config({
|
||||
baseUrl: "src",
|
||||
paths: {
|
||||
'jquery': '../vendor/jquery/jquery-1.11.1.min',
|
||||
'twitterBootstrap': '../vendor/bootstrap/js/bootstrap.min',
|
||||
'angular': '../vendor/angular/angular.min',
|
||||
'uiRouter': '../vendor/angular-ui-router/angular-ui-router.min',
|
||||
'angularMocks': '../vendor/angular/angular-mocks',
|
||||
'angularTouch': '../vendor/angular/angular-touch',
|
||||
'uiBootstrap': '../vendor/angular-bootstrap/ui-bootstrap-tpls-0.11.0.min',
|
||||
'angularTable': '../vendor/ng-table/ng-table.min',
|
||||
'angularDragDrop': '../vendor/angular-dragdrop/draganddrop',
|
||||
'spin': '../vendor/angular-spinner/spin.min',
|
||||
'ngSpinner': '../vendor/angular-spinner/angular-spinner.min',
|
||||
'angularAnimate': '../vendor/angular/angular-animate.min',
|
||||
'd3': '../vendor/d3/d3.min',
|
||||
'nvD3': '../vendor/nvd3/nv.d3.min',
|
||||
'ganttChart':'common/gantt-chart-d3v2',
|
||||
'rickshaw': '../vendor/rickshaw/rickshaw.min',
|
||||
'angularRickshaw': '../vendor/angular-rickshaw/rickshaw.min',
|
||||
'moment': '../vendor/angular-daterangepicker/moment.min',
|
||||
'daterangepicker': '../vendor/angular-daterangepicker/daterangepicker',
|
||||
'ngBsDaterangepicker': '../vendor/angular-daterangepicker/ng-bs-daterangepicker',
|
||||
'angularUiTree': '../vendor/angular-ui-tree/angular-ui-tree.min',
|
||||
'nvd3Directive': '../vendor/angular-nvd3/angularjs-nvd3-directives.min',
|
||||
|
||||
|
||||
'login': 'app/login/login',
|
||||
'services': 'app/services',
|
||||
'appDev': 'app/appDev',
|
||||
'clusterList': 'app/cluster/clusterList',
|
||||
'cluster': 'app/cluster/cluster',
|
||||
'wizard': 'app/wizard/wizard',
|
||||
'topnav': 'app/topnav/topnav',
|
||||
'server': 'app/server/server',
|
||||
'userProfile': 'app/user/userprofile',
|
||||
'userSetting': 'app/user/usersetting',
|
||||
'monitoring': 'app/monitoring/monitoring',
|
||||
'charts': 'common/charts',
|
||||
'findservers': 'common/findservers/findservers'
|
||||
},
|
||||
shim: {
|
||||
"jquery": {
|
||||
exports: "jquery"
|
||||
},
|
||||
"twitterBootstrap": {
|
||||
deps: ["jquery"],
|
||||
exports: "twitterBootstrap"
|
||||
},
|
||||
"angular": {
|
||||
deps: ['jquery'],
|
||||
exports: "angular"
|
||||
},
|
||||
"angularTable": {
|
||||
deps: ["angular"],
|
||||
exports: "angularTable"
|
||||
},
|
||||
"angularMocks": {
|
||||
deps: ["angular"],
|
||||
exports: "angularMocks"
|
||||
},
|
||||
"angularTouch": {
|
||||
deps: ["angular"],
|
||||
exports: "angularTouch"
|
||||
},
|
||||
"uiBootstrap": {
|
||||
deps: ["angular"],
|
||||
exports: "uiBootstrap"
|
||||
},
|
||||
"angularDragDrop": {
|
||||
deps: ["angular"],
|
||||
exports: "angularDragDrop"
|
||||
},
|
||||
"uiRouter": {
|
||||
deps: ["angular"],
|
||||
exports: "uiRouter"
|
||||
|
||||
},
|
||||
"spin": {
|
||||
//deps:["angular"],
|
||||
exports: "spin"
|
||||
},
|
||||
"ngSpinner": {
|
||||
deps: ["angular", "spin"], // may depends on angularspin
|
||||
exports: "ngSpinner"
|
||||
},
|
||||
"angularAnimate": {
|
||||
deps: ["angular"],
|
||||
exports: "angularAnimate"
|
||||
},
|
||||
"d3": {
|
||||
exports: "d3"
|
||||
},
|
||||
"nvD3": {
|
||||
deps: ["d3"],
|
||||
exports: "nvD3"
|
||||
},
|
||||
"nvd3Directive": {
|
||||
deps: ["nvD3"],
|
||||
exports: "nvd3Directive"
|
||||
},
|
||||
"rickshaw": {
|
||||
exports: "rickshaw"
|
||||
},
|
||||
"angularUiTree": {
|
||||
deps: ["angular"],
|
||||
exports: "angularUiTree"
|
||||
},
|
||||
"angularRickshaw": {
|
||||
deps: ["angular", "rickshaw", "d3"],
|
||||
exports: "angularRickshaw"
|
||||
},
|
||||
"moment": {
|
||||
exports: "moment"
|
||||
},
|
||||
"daterangepicker": {
|
||||
deps: ["twitterBootstrap", "angular", "moment"],
|
||||
exports: "daterangepicker"
|
||||
},
|
||||
"ngBsDaterangepicker": {
|
||||
deps: ["daterangepicker"],
|
||||
exports: "ngBsDaterangepicker"
|
||||
}
|
||||
},
|
||||
|
||||
deps: ['./bootstrap']
|
||||
});
|
36
v2/vendor/require.js
vendored
Executable file
36
v2/vendor/require.js
vendored
Executable file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
RequireJS 2.1.15 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
|
||||
Available via the MIT or new BSD license.
|
||||
see: http://github.com/jrburke/requirejs for details
|
||||
*/
|
||||
var requirejs,require,define;
|
||||
(function(ba){function G(b){return"[object Function]"===K.call(b)}function H(b){return"[object Array]"===K.call(b)}function v(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function T(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));d-=1);}}function t(b,c){return fa.call(b,c)}function m(b,c){return t(b,c)&&b[c]}function B(b,c){for(var d in b)if(t(b,d)&&c(b[d],d))break}function U(b,c,d,e){c&&B(c,function(c,g){if(d||!t(b,g))e&&"object"===typeof c&&c&&!H(c)&&!G(c)&&!(c instanceof
|
||||
RegExp)?(b[g]||(b[g]={}),U(b[g],c,d,e)):b[g]=c});return b}function u(b,c){return function(){return c.apply(b,arguments)}}function ca(b){throw b;}function da(b){if(!b)return b;var c=ba;v(b.split("."),function(b){c=c[b]});return c}function C(b,c,d,e){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=e;d&&(c.originalError=d);return c}function ga(b){function c(a,k,b){var f,l,c,d,e,g,i,p,k=k&&k.split("/"),h=j.map,n=h&&h["*"];if(a){a=a.split("/");l=a.length-1;j.nodeIdCompat&&
|
||||
Q.test(a[l])&&(a[l]=a[l].replace(Q,""));"."===a[0].charAt(0)&&k&&(l=k.slice(0,k.length-1),a=l.concat(a));l=a;for(c=0;c<l.length;c++)if(d=l[c],"."===d)l.splice(c,1),c-=1;else if(".."===d&&!(0===c||1==c&&".."===l[2]||".."===l[c-1])&&0<c)l.splice(c-1,2),c-=2;a=a.join("/")}if(b&&h&&(k||n)){l=a.split("/");c=l.length;a:for(;0<c;c-=1){e=l.slice(0,c).join("/");if(k)for(d=k.length;0<d;d-=1)if(b=m(h,k.slice(0,d).join("/")))if(b=m(b,e)){f=b;g=c;break a}!i&&(n&&m(n,e))&&(i=m(n,e),p=c)}!f&&i&&(f=i,g=p);f&&(l.splice(0,
|
||||
g,f),a=l.join("/"))}return(f=m(j.pkgs,a))?f:a}function d(a){z&&v(document.getElementsByTagName("script"),function(k){if(k.getAttribute("data-requiremodule")===a&&k.getAttribute("data-requirecontext")===i.contextName)return k.parentNode.removeChild(k),!0})}function e(a){var k=m(j.paths,a);if(k&&H(k)&&1<k.length)return k.shift(),i.require.undef(a),i.makeRequire(null,{skipMap:!0})([a]),!0}function n(a){var k,c=a?a.indexOf("!"):-1;-1<c&&(k=a.substring(0,c),a=a.substring(c+1,a.length));return[k,a]}function p(a,
|
||||
k,b,f){var l,d,e=null,g=k?k.name:null,j=a,p=!0,h="";a||(p=!1,a="_@r"+(K+=1));a=n(a);e=a[0];a=a[1];e&&(e=c(e,g,f),d=m(r,e));a&&(e?h=d&&d.normalize?d.normalize(a,function(a){return c(a,g,f)}):-1===a.indexOf("!")?c(a,g,f):a:(h=c(a,g,f),a=n(h),e=a[0],h=a[1],b=!0,l=i.nameToUrl(h)));b=e&&!d&&!b?"_unnormalized"+(O+=1):"";return{prefix:e,name:h,parentMap:k,unnormalized:!!b,url:l,originalName:j,isDefine:p,id:(e?e+"!"+h:h)+b}}function s(a){var k=a.id,b=m(h,k);b||(b=h[k]=new i.Module(a));return b}function q(a,
|
||||
k,b){var f=a.id,c=m(h,f);if(t(r,f)&&(!c||c.defineEmitComplete))"defined"===k&&b(r[f]);else if(c=s(a),c.error&&"error"===k)b(c.error);else c.on(k,b)}function w(a,b){var c=a.requireModules,f=!1;if(b)b(a);else if(v(c,function(b){if(b=m(h,b))b.error=a,b.events.error&&(f=!0,b.emit("error",a))}),!f)g.onError(a)}function x(){R.length&&(ha.apply(A,[A.length,0].concat(R)),R=[])}function y(a){delete h[a];delete V[a]}function F(a,b,c){var f=a.map.id;a.error?a.emit("error",a.error):(b[f]=!0,v(a.depMaps,function(f,
|
||||
d){var e=f.id,g=m(h,e);g&&(!a.depMatched[d]&&!c[e])&&(m(b,e)?(a.defineDep(d,r[e]),a.check()):F(g,b,c))}),c[f]=!0)}function D(){var a,b,c=(a=1E3*j.waitSeconds)&&i.startTime+a<(new Date).getTime(),f=[],l=[],g=!1,h=!0;if(!W){W=!0;B(V,function(a){var i=a.map,j=i.id;if(a.enabled&&(i.isDefine||l.push(a),!a.error))if(!a.inited&&c)e(j)?g=b=!0:(f.push(j),d(j));else if(!a.inited&&(a.fetched&&i.isDefine)&&(g=!0,!i.prefix))return h=!1});if(c&&f.length)return a=C("timeout","Load timeout for modules: "+f,null,
|
||||
f),a.contextName=i.contextName,w(a);h&&v(l,function(a){F(a,{},{})});if((!c||b)&&g)if((z||ea)&&!X)X=setTimeout(function(){X=0;D()},50);W=!1}}function E(a){t(r,a[0])||s(p(a[0],null,!0)).init(a[1],a[2])}function I(a){var a=a.currentTarget||a.srcElement,b=i.onScriptLoad;a.detachEvent&&!Y?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=i.onScriptError;(!a.detachEvent||Y)&&a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function J(){var a;
|
||||
for(x();A.length;){a=A.shift();if(null===a[0])return w(C("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));E(a)}}var W,Z,i,L,X,j={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},h={},V={},$={},A=[],r={},S={},aa={},K=1,O=1;L={require:function(a){return a.require?a.require:a.require=i.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?r[a.map.id]=a.exports:a.exports=r[a.map.id]={}},module:function(a){return a.module?
|
||||
a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return m(j.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};Z=function(a){this.events=m($,a.id)||{};this.map=a;this.shim=m(j.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};Z.prototype={init:function(a,b,c,f){f=f||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=u(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=
|
||||
c;this.inited=!0;this.ignore=f.ignore;f.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;i.startTime=(new Date).getTime();var a=this.map;if(this.shim)i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],u(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=
|
||||
this.map.url;S[a]||(S[a]=!0,i.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var f=this.exports,l=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(G(l)){if(this.events.error&&this.map.isDefine||g.onError!==ca)try{f=i.execCb(c,l,b,f)}catch(d){a=d}else f=i.execCb(c,l,b,f);this.map.isDefine&&void 0===f&&((b=this.module)?f=b.exports:this.usingExports&&
|
||||
(f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=l;this.exports=f;if(this.map.isDefine&&!this.ignore&&(r[c]=f,g.onResourceLoad))g.onResourceLoad(i,this.map,this.depMaps);y(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=
|
||||
this.map,b=a.id,d=p(a.prefix);this.depMaps.push(d);q(d,"defined",u(this,function(f){var l,d;d=m(aa,this.map.id);var e=this.map.name,P=this.map.parentMap?this.map.parentMap.name:null,n=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(e=f.normalize(e,function(a){return c(a,P,!0)})||""),f=p(a.prefix+"!"+e,this.map.parentMap),q(f,"defined",u(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=m(h,f.id)){this.depMaps.push(f);
|
||||
if(this.events.error)d.on("error",u(this,function(a){this.emit("error",a)}));d.enable()}}else d?(this.map.url=i.nameToUrl(d),this.load()):(l=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),l.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(h,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),l.fromText=u(this,function(f,c){var d=a.name,e=p(d),P=M;c&&(f=c);P&&(M=!1);s(e);t(j.config,b)&&(j.config[d]=j.config[b]);try{g.exec(f)}catch(h){return w(C("fromtexteval",
|
||||
"fromText eval for "+b+" failed: "+h,h,[b]))}P&&(M=!0);this.depMaps.push(e);i.completeLoad(d);n([d],l)}),f.load(a.name,n,l,j))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){V[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,u(this,function(a,b){var c,f;if("string"===typeof a){a=p(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=m(L,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;q(a,"defined",u(this,function(a){this.defineDep(b,
|
||||
a);this.check()}));this.errback&&q(a,"error",u(this,this.errback))}c=a.id;f=h[c];!t(L,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,u(this,function(a){var b=m(h,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:j,contextName:b,registry:h,defined:r,urlFetched:S,defQueue:A,Module:Z,makeModuleMap:p,
|
||||
nextTick:g.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=j.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(j[b]||(j[b]={}),U(j[b],a,!0,!0)):j[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(aa[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);b[c]=a}),j.shim=b);a.packages&&v(a.packages,function(a){var b,
|
||||
a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(j.paths[b]=a.location);j.pkgs[b]=a.name+"/"+(a.main||"main").replace(ia,"").replace(Q,"")});B(h,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=p(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ba,arguments));return b||a.exports&&da(a.exports)}},makeRequire:function(a,e){function j(c,d,m){var n,q;e.enableBuildCallback&&(d&&G(d))&&(d.__requireJsBuild=
|
||||
!0);if("string"===typeof c){if(G(d))return w(C("requireargs","Invalid require call"),m);if(a&&t(L,c))return L[c](h[a.id]);if(g.get)return g.get(i,c,a,j);n=p(c,a,!1,!0);n=n.id;return!t(r,n)?w(C("notloaded",'Module name "'+n+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[n]}J();i.nextTick(function(){J();q=s(p(null,a));q.skipMap=e.skipMap;q.init(c,d,m,{enabled:!0});D()});return j}e=e||{};U(j,{isBrowser:z,toUrl:function(b){var d,e=b.lastIndexOf("."),k=b.split("/")[0];if(-1!==
|
||||
e&&(!("."===k||".."===k)||1<e))d=b.substring(e,b.length),b=b.substring(0,e);return i.nameToUrl(c(b,a&&a.id,!0),d,!0)},defined:function(b){return t(r,p(b,a,!1,!0).id)},specified:function(b){b=p(b,a,!1,!0).id;return t(r,b)||t(h,b)}});a||(j.undef=function(b){x();var c=p(b,a,!0),e=m(h,b);d(b);delete r[b];delete S[c.url];delete $[b];T(A,function(a,c){a[0]===b&&A.splice(c,1)});e&&(e.events.defined&&($[b]=e.events),y(b))});return j},enable:function(a){m(h,a.id)&&s(a).enable()},completeLoad:function(a){var b,
|
||||
c,d=m(j.shim,a)||{},g=d.exports;for(x();A.length;){c=A.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);E(c)}c=m(h,a);if(!b&&!t(r,a)&&c&&!c.inited){if(j.enforceDefine&&(!g||!da(g)))return e(a)?void 0:w(C("nodefine","No define call for "+a,null,[a]));E([a,d.deps||[],d.exportsFn])}D()},nameToUrl:function(a,b,c){var d,e,h;(d=m(j.pkgs,a))&&(a=d);if(d=m(aa,a))return i.nameToUrl(d,b,c);if(g.jsExtRegExp.test(a))d=a+(b||"");else{d=j.paths;a=a.split("/");for(e=a.length;0<e;e-=1)if(h=a.slice(0,
|
||||
e).join("/"),h=m(d,h)){H(h)&&(h=h[0]);a.splice(0,e,h);break}d=a.join("/");d+=b||(/^data\:|\?/.test(d)||c?"":".js");d=("/"===d.charAt(0)||d.match(/^[\w\+\.\-]+:/)?"":j.baseUrl)+d}return j.urlArgs?d+((-1===d.indexOf("?")?"?":"&")+j.urlArgs):d},load:function(a,b){g.load(i,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ja.test((a.currentTarget||a.srcElement).readyState))N=null,a=I(a),i.completeLoad(a.id)},onScriptError:function(a){var b=I(a);if(!e(b.id))return w(C("scripterror",
|
||||
"Script error for: "+b.id,a,[b.id]))}};i.require=i.makeRequire();return i}var g,x,y,D,I,E,N,J,s,O,ka=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,la=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,Q=/\.js$/,ia=/^\.\//;x=Object.prototype;var K=x.toString,fa=x.hasOwnProperty,ha=Array.prototype.splice,z=!!("undefined"!==typeof window&&"undefined"!==typeof navigator&&window.document),ea=!z&&"undefined"!==typeof importScripts,ja=z&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,
|
||||
Y="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),F={},q={},R=[],M=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(G(requirejs))return;q=requirejs;requirejs=void 0}"undefined"!==typeof require&&!G(require)&&(q=require,require=void 0);g=requirejs=function(b,c,d,e){var n,p="_";!H(b)&&"string"!==typeof b&&(n=b,H(c)?(b=c,c=d,d=e):b=[]);n&&n.context&&(p=n.context);(e=m(F,p))||(e=F[p]=g.s.newContext(p));n&&e.configure(n);return e.require(b,c,d)};g.config=function(b){return g(b)};
|
||||
g.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version="2.1.15";g.jsExtRegExp=/^\/|:|\?|\.js$/;g.isBrowser=z;x=g.s={contexts:F,newContext:ga};g({});v(["toUrl","undef","defined","specified"],function(b){g[b]=function(){var c=F._;return c.require[b].apply(c,arguments)}});if(z&&(y=x.head=document.getElementsByTagName("head")[0],D=document.getElementsByTagName("base")[0]))y=x.head=D.parentNode;g.onError=ca;g.createNode=function(b){var c=
|
||||
b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};g.load=function(b,c,d){var e=b&&b.config||{};if(z)return e=g.createNode(e,c,d),e.setAttribute("data-requirecontext",b.contextName),e.setAttribute("data-requiremodule",c),e.attachEvent&&!(e.attachEvent.toString&&0>e.attachEvent.toString().indexOf("[native code"))&&!Y?(M=!0,e.attachEvent("onreadystatechange",b.onScriptLoad)):
|
||||
(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)),e.src=d,J=e,D?y.insertBefore(e,D):y.appendChild(e),J=null,e;if(ea)try{importScripts(d),b.completeLoad(c)}catch(m){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,m,[c]))}};z&&!q.skipDataMain&&T(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(I=b.getAttribute("data-main"))return s=I,q.baseUrl||(E=s.split("/"),s=E.pop(),O=E.length?E.join("/")+"/":"./",q.baseUrl=
|
||||
O),s=s.replace(Q,""),g.jsExtRegExp.test(s)&&(s=I),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(ka,"").replace(la,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(M){if(!(e=J))N&&"interactive"===N.readyState||T(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return N=b}),e=N;e&&(b||
|
||||
(b=e.getAttribute("data-requiremodule")),g=F[e.getAttribute("data-requirecontext")])}(g?g.defQueue:R).push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(q)}})(this);
|
Loading…
x
Reference in New Issue
Block a user