Commit b752cfee by Patrick O'Carroll Committed by Torkel Ödegaard

migrated four files to ts, addd some code to config to make it work (#9980)

parent 8ce05a7c
...@@ -17,6 +17,10 @@ class Settings { ...@@ -17,6 +17,10 @@ class Settings {
alertingEnabled: boolean; alertingEnabled: boolean;
authProxyEnabled: boolean; authProxyEnabled: boolean;
ldapEnabled: boolean; ldapEnabled: boolean;
oauth: any;
disableUserSignUp: boolean;
loginHint: any;
loginError: any;
constructor(options) { constructor(options) {
var defaults = { var defaults = {
......
define([ import coreModule from '../core_module';
'angular', import config from 'app/core/config';
'../core_module',
'app/core/config',
],
function (angular, coreModule, config) {
'use strict';
config = config.default; export class InvitedCtrl {
coreModule.default.controller('InvitedCtrl', function($scope, $routeParams, contextSrv, backendSrv) { /** @ngInject */
constructor($scope, $routeParams, contextSrv, backendSrv) {
contextSrv.sidemenu = false; contextSrv.sidemenu = false;
$scope.formModel = {}; $scope.formModel = {};
...@@ -35,6 +31,7 @@ function (angular, coreModule, config) { ...@@ -35,6 +31,7 @@ function (angular, coreModule, config) {
}; };
$scope.init(); $scope.init();
}
}
}); coreModule.controller('InvitedCtrl', InvitedCtrl);
});
define([ import _ from 'lodash';
'angular', import coreModule from '../core_module';
'lodash', import config from 'app/core/config';
'../core_module',
'app/core/config', export class LoginCtrl {
],
function (angular, _, coreModule, config) { /** @ngInject */
'use strict'; constructor($scope, backendSrv, contextSrv, $location) {
config = config.default;
coreModule.default.controller('LoginCtrl', function($scope, backendSrv, contextSrv, $location) {
$scope.formModel = { $scope.formModel = {
user: '', user: '',
email: '', email: '',
...@@ -74,8 +70,7 @@ function (angular, _, coreModule, config) { ...@@ -74,8 +70,7 @@ function (angular, _, coreModule, config) {
if (params.redirect && params.redirect[0] === '/') { if (params.redirect && params.redirect[0] === '/') {
window.location.href = config.appSubUrl + params.redirect; window.location.href = config.appSubUrl + params.redirect;
} } else if (result.redirectUrl) {
else if (result.redirectUrl) {
window.location.href = result.redirectUrl; window.location.href = result.redirectUrl;
} else { } else {
window.location.href = config.appSubUrl + '/'; window.location.href = config.appSubUrl + '/';
...@@ -84,5 +79,7 @@ function (angular, _, coreModule, config) { ...@@ -84,5 +79,7 @@ function (angular, _, coreModule, config) {
}; };
$scope.init(); $scope.init();
}); }
}); }
coreModule.controller('LoginCtrl', LoginCtrl);
define(['angular', import angular from 'angular';
'lodash', import moment from 'moment';
'jquery', import config from 'app/core/config';
'moment',
'app/core/config',
],
function (angular, _, $, moment, config) {
'use strict';
config = config.default; export class ShareModalCtrl {
var module = angular.module('grafana.controllers');
module.controller('ShareModalCtrl', function($scope, $rootScope, $location, $timeout, timeSrv, templateSrv, linkSrv) {
/** @ngInject */
constructor($scope, $rootScope, $location, $timeout, timeSrv, templateSrv, linkSrv) {
$scope.options = { forCurrent: true, includeTemplateVars: true, theme: 'current' }; $scope.options = { forCurrent: true, includeTemplateVars: true, theme: 'current' };
$scope.editor = { index: $scope.tabIndex || 0}; $scope.editor = { index: $scope.tabIndex || 0};
...@@ -93,7 +86,7 @@ function (angular, _, $, moment, config) { ...@@ -93,7 +86,7 @@ function (angular, _, $, moment, config) {
$scope.getShareUrl = function() { $scope.getShareUrl = function() {
return $scope.shareUrl; return $scope.shareUrl;
}; };
}
}
}); angular.module('grafana.controllers').controller('ShareModalCtrl', ShareModalCtrl);
});
define([ import angular from 'angular';
'angular', import $ from 'jquery';
'jquery',
],
function (angular, $) {
"use strict";
var module = angular.module('grafana.routes'); export class SoloPanelCtrl {
module.controller('SoloPanelCtrl', function($scope, $routeParams, $location, dashboardLoaderSrv, contextSrv) {
/** @ngInject */
constructor($scope, $routeParams, $location, dashboardLoaderSrv, contextSrv) {
var panelId; var panelId;
$scope.init = function() { $scope.init = function() {
...@@ -47,5 +43,7 @@ function (angular, $) { ...@@ -47,5 +43,7 @@ function (angular, $) {
}; };
$scope.init(); $scope.init();
}); }
}); }
angular.module('grafana.routes').controller('SoloPanelCtrl', SoloPanelCtrl);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment