mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
migrated four files from js to ts
This commit is contained in:
parent
b752cfee1f
commit
015932fd02
@ -1,9 +0,0 @@
|
|||||||
define([
|
|
||||||
'./inspect_ctrl',
|
|
||||||
'./json_editor_ctrl',
|
|
||||||
'./login_ctrl',
|
|
||||||
'./invited_ctrl',
|
|
||||||
'./signup_ctrl',
|
|
||||||
'./reset_password_ctrl',
|
|
||||||
'./error_ctrl',
|
|
||||||
], function () {});
|
|
7
public/app/core/controllers/all.ts
Normal file
7
public/app/core/controllers/all.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import './inspect_ctrl';
|
||||||
|
import './json_editor_ctrl';
|
||||||
|
import './login_ctrl';
|
||||||
|
import './invited_ctrl';
|
||||||
|
import './signup_ctrl';
|
||||||
|
import './reset_password_ctrl';
|
||||||
|
import './error_ctrl';
|
@ -1,13 +1,10 @@
|
|||||||
define([
|
import config from 'app/core/config';
|
||||||
'angular',
|
import coreModule from '../core_module';
|
||||||
'app/core/config',
|
|
||||||
'../core_module',
|
|
||||||
],
|
|
||||||
function (angular, config, coreModule) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
coreModule.default.controller('ErrorCtrl', function($scope, contextSrv, navModelSrv) {
|
export class ErrorCtrl {
|
||||||
|
|
||||||
|
/** @ngInject */
|
||||||
|
constructor($scope, contextSrv, navModelSrv) {
|
||||||
$scope.navModel = navModelSrv.getNotFoundNav();
|
$scope.navModel = navModelSrv.getNotFoundNav();
|
||||||
$scope.appSubUrl = config.appSubUrl;
|
$scope.appSubUrl = config.appSubUrl;
|
||||||
|
|
||||||
@ -17,7 +14,7 @@ function (angular, config, coreModule) {
|
|||||||
$scope.$on('$destroy', function() {
|
$scope.$on('$destroy', function() {
|
||||||
contextSrv.sidemenu = showSideMenu;
|
contextSrv.sidemenu = showSideMenu;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
coreModule.controller('ErrorCtrl', ErrorCtrl);
|
||||||
|
|
||||||
});
|
|
@ -1,12 +1,10 @@
|
|||||||
define([
|
import angular from 'angular';
|
||||||
'angular',
|
import coreModule from '../core_module';
|
||||||
'../core_module',
|
|
||||||
],
|
|
||||||
function (angular, coreModule) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
coreModule.default.controller('JsonEditorCtrl', function($scope) {
|
export class JsonEditorCtrl {
|
||||||
|
|
||||||
|
/** @ngInject */
|
||||||
|
constructor($scope) {
|
||||||
$scope.json = angular.toJson($scope.object, true);
|
$scope.json = angular.toJson($scope.object, true);
|
||||||
$scope.canUpdate = $scope.updateHandler !== void 0 && $scope.contextSrv.isEditor;
|
$scope.canUpdate = $scope.updateHandler !== void 0 && $scope.contextSrv.isEditor;
|
||||||
|
|
||||||
@ -14,7 +12,7 @@ function (angular, coreModule) {
|
|||||||
var newObject = angular.fromJson($scope.json);
|
var newObject = angular.fromJson($scope.json);
|
||||||
$scope.updateHandler(newObject, $scope.object);
|
$scope.updateHandler(newObject, $scope.object);
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
coreModule.controller('JsonEditorCtrl', JsonEditorCtrl);
|
||||||
|
|
||||||
});
|
|
@ -1,11 +1,9 @@
|
|||||||
define([
|
import coreModule from '../core_module';
|
||||||
'angular',
|
|
||||||
'../core_module',
|
|
||||||
],
|
|
||||||
function (angular, coreModule) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
coreModule.default.controller('ResetPasswordCtrl', function($scope, contextSrv, backendSrv, $location) {
|
export class ResetPasswordCtrl {
|
||||||
|
|
||||||
|
/** @ngInject */
|
||||||
|
constructor($scope, contextSrv, backendSrv, $location) {
|
||||||
contextSrv.sidemenu = false;
|
contextSrv.sidemenu = false;
|
||||||
$scope.formModel = {};
|
$scope.formModel = {};
|
||||||
$scope.mode = 'send';
|
$scope.mode = 'send';
|
||||||
@ -37,7 +35,7 @@ function (angular, coreModule) {
|
|||||||
$location.path('login');
|
$location.path('login');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
coreModule.controller('ResetPasswordCtrl', ResetPasswordCtrl);
|
||||||
|
|
||||||
});
|
|
Loading…
Reference in New Issue
Block a user