feat(export): fixed refactoring issue with dynamic dashbord srv
This commit is contained in:
@@ -6,7 +6,6 @@ import moment from 'moment';
|
||||
import _ from 'lodash';
|
||||
|
||||
import coreModule from 'app/core/core_module';
|
||||
import {DynamicDashboardSrv} from './dynamic_dashboard_srv';
|
||||
|
||||
export class DashboardCtrl {
|
||||
|
||||
@@ -19,13 +18,13 @@ export class DashboardCtrl {
|
||||
templateValuesSrv,
|
||||
dashboardSrv,
|
||||
unsavedChangesSrv,
|
||||
dynamicDashboardSrv,
|
||||
dashboardViewStateSrv,
|
||||
contextSrv,
|
||||
$timeout) {
|
||||
|
||||
$scope.editor = { index: 0 };
|
||||
$scope.panels = config.panels;
|
||||
$scope.dynamicDashboardSrv = new DynamicDashboardSrv();
|
||||
|
||||
var resizeEventTimeout;
|
||||
|
||||
@@ -43,7 +42,7 @@ export class DashboardCtrl {
|
||||
// template values service needs to initialize completely before
|
||||
// the rest of the dashboard can load
|
||||
templateValuesSrv.init(dashboard).finally(function() {
|
||||
$scope.dynamicDashboardSrv.init(dashboard);
|
||||
dynamicDashboardSrv.init(dashboard);
|
||||
|
||||
unsavedChangesSrv.init(dashboard, $scope);
|
||||
|
||||
@@ -64,7 +63,7 @@ export class DashboardCtrl {
|
||||
};
|
||||
|
||||
$scope.templateVariableUpdated = function() {
|
||||
$scope.dynamicDashboardSrv.update($scope.dashboard);
|
||||
dynamicDashboardSrv.update($scope.dashboard);
|
||||
};
|
||||
|
||||
$scope.updateSubmenuVisibility = function() {
|
||||
|
||||
@@ -184,3 +184,5 @@ export class DynamicDashboardSrv {
|
||||
}
|
||||
}
|
||||
|
||||
coreModule.service('dynamicDashboardSrv', DynamicDashboardSrv);
|
||||
|
||||
|
||||
@@ -23,28 +23,8 @@
|
||||
<i class="fa fa-check"></i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="gf-form gf-form--grow">
|
||||
<label class="gf-form-label width-8">Description</label>
|
||||
<input type="text" class="gf-form-input" ng-model="ctrl.dash.description" ng-change="ctrl.titleChanged()">
|
||||
<label class="gf-form-label text-success" ng-show="ctrl.dash.description">
|
||||
<i class="fa fa-check"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <h3 class="section-heading"> -->
|
||||
<!-- Dashboard data sources -->
|
||||
<!-- </h3> -->
|
||||
<!-- -->
|
||||
<!-- <div class="gf-form-group"> -->
|
||||
<!-- <div class="gf-form-inline" ng-repeat="input in ctrl.dash.__inputs"> -->
|
||||
<!-- <div class="gf-form width-25"> -->
|
||||
<!-- <label class="gf-form-label width-8">Name</label> -->
|
||||
<!-- <input type="text" class="gf-form-input" ng-model="input.name"> -->
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="gf-form-button-row">
|
||||
<button type="button" class="btn gf-form-btn width-10 btn-success" ng-click="ctrl.save()">
|
||||
<i class="fa fa-save"></i> Save to file
|
||||
|
||||
@@ -12,7 +12,6 @@ export class SubmenuCtrl {
|
||||
constructor(private $rootScope,
|
||||
private templateValuesSrv,
|
||||
private templateSrv,
|
||||
private dynamicDashboardSrv,
|
||||
private $location) {
|
||||
this.annotations = this.dashboard.templating.list;
|
||||
this.variables = this.dashboard.templating.list;
|
||||
@@ -45,7 +44,6 @@ export class SubmenuCtrl {
|
||||
|
||||
variableUpdated(variable) {
|
||||
this.templateValuesSrv.variableUpdated(variable).then(() => {
|
||||
this.dynamicDashboardSrv.update(this.dashboard);
|
||||
this.updateUrlParamsWithCurrentVariables();
|
||||
this.$rootScope.$emit('template-variable-value-updated');
|
||||
this.$rootScope.$broadcast('refresh');
|
||||
|
||||
Reference in New Issue
Block a user