{"size": 1746, "ext": "js", "max_stars_repo_path": "sources/modules/control-panel/src/main/resources/static/dataflow/3.3.0/common/administration/sdcConfiguration/sdcConfiguration.js", "max_stars_repo_name": "bmunozi/onesaitplatform-cloud", "max_stars_repo_stars_event_min_datetime": "2019-09-24T14:55:00.000Z", "max_stars_repo_stars_event_max_datetime": "2019-10-07T11:48:24.000Z", "max_issues_repo_path": "sources/modules/control-panel/src/main/resources/static/dataflow/3.3.0/common/administration/sdcConfiguration/sdcConfiguration.js", "max_issues_repo_name": "bmunozi/onesaitplatform-cloud", "max_issues_repo_issues_event_min_datetime": "2019-11-29T18:03:15.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-21T23:27:39.000Z", "max_forks_repo_path": "sources/modules/control-panel/src/main/resources/static/dataflow/3.3.0/common/administration/sdcConfiguration/sdcConfiguration.js", "max_forks_repo_name": "bmunozi/onesaitplatform-cloud", "max_forks_repo_forks_event_min_datetime": "2021-09-27T10:04:06.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-27T10:04:06.000Z"}
{"max_stars_count": 4, "max_issues_count": 7, "max_forks_count": 1, "avg_line_length": 32.9433962264, "max_line_length": 108, "alphanum_fraction": 0.6586483391}
/*
 * Copyright 2017 StreamSets Inc.
 *
 * 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.
 */
/**
 * SDC Configuration module.
 */

angular
  .module('commonUI.sdcConfiguration')
  .config(['$routeProvider', function ($routeProvider) {
    $routeProvider.when('/collector/configuration',
      {
        templateUrl: 'common/administration/sdcConfiguration/sdcConfiguration.tpl.html',
        controller: 'SDCConfigurationController',
        resolve: {
          myVar: function(authService) {
            return authService.init();
          }
        },
        data: {
          authorizedRoles: ['admin', 'creator', 'manager']
        }
      }
    );
  }])
  .controller('SDCConfigurationController', function ($scope, $rootScope, $q, Analytics, configuration, _) {
    angular.extend($scope, {
      initDefer: undefined,
      configKeys: [],
      sdcConfiguration: {}
    });

    $scope.initDefer = $q.all([configuration.init()]).then(function() {
      if(configuration.isAnalyticsEnabled()) {
        Analytics.trackPage('/collector/configuration');
      }
      $scope.sdcConfiguration = configuration.getConfiguration();
      $scope.configKeys = _.keys($scope.sdcConfiguration);
      $scope.configKeys.sort();
    });
  });