mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(apps): changed edit apps view to use plugin-component for apps config view
This commit is contained in:
parent
9fc0a83b83
commit
0fab210ad2
@ -141,6 +141,17 @@ function pluginDirectiveLoader($compile, datasourceSrv, $rootScope, $q, $http, $
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// AppConfigCtrl
|
||||||
|
case 'app-config-ctrl': {
|
||||||
|
return System.import(scope.ctrl.appModel.module).then(function(appModule) {
|
||||||
|
return {
|
||||||
|
name: 'app-config-' + scope.ctrl.appModel.appId,
|
||||||
|
bindings: {appModel: "=", appEditCtrl: "="},
|
||||||
|
attrs: {"app-model": "ctrl.appModel", "app-edit-ctrl": "ctrl"},
|
||||||
|
Component: appModule.ConfigCtrl,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
// Panel
|
// Panel
|
||||||
case 'panel': {
|
case 'panel': {
|
||||||
return loadPanelComponentInfo(scope, attrs);
|
return loadPanelComponentInfo(scope, attrs);
|
||||||
|
@ -1,3 +1,2 @@
|
|||||||
import './edit_ctrl';
|
import './edit_ctrl';
|
||||||
import './list_ctrl';
|
import './list_ctrl';
|
||||||
import './config_view';
|
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
///<reference path="../../headers/common.d.ts" />
|
|
||||||
|
|
||||||
import angular from 'angular';
|
|
||||||
|
|
||||||
/** @ngInject */
|
|
||||||
function appConfigView(dynamicDirectiveSrv) {
|
|
||||||
return dynamicDirectiveSrv.create({
|
|
||||||
scope: {
|
|
||||||
appModel: "="
|
|
||||||
},
|
|
||||||
directive: scope => {
|
|
||||||
return System.import(scope.appModel.module).then(function(appModule) {
|
|
||||||
return {
|
|
||||||
name: 'app-config-' + scope.appModel.appId,
|
|
||||||
fn: appModule.configView,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
angular.module('grafana.directives').directive('appConfigView', appConfigView);
|
|
@ -97,7 +97,7 @@
|
|||||||
<h3 class="simple-box-header">Configuration:</h3>
|
<h3 class="simple-box-header">Configuration:</h3>
|
||||||
<div class="simple-box-body">
|
<div class="simple-box-body">
|
||||||
<div ng-if="ctrl.appModel.appId">
|
<div ng-if="ctrl.appModel.appId">
|
||||||
<app-config-view app-model="ctrl.appModel"></app-config-view>
|
<plugin-component type="app-config-ctrl"></plugin-component>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
<button type="submit" class="btn btn-success" ng-click="ctrl.update()">Save</button>
|
<button type="submit" class="btn btn-success" ng-click="ctrl.update()">Save</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,8 +6,8 @@ import _ from 'lodash';
|
|||||||
import kbn from 'app/core/utils/kbn';
|
import kbn from 'app/core/utils/kbn';
|
||||||
import {PanelCtrl} from './panel_ctrl';
|
import {PanelCtrl} from './panel_ctrl';
|
||||||
|
|
||||||
import * as rangeUtil from '../../core/utils/rangeutil';
|
import * as rangeUtil from 'app/core/utils/rangeutil';
|
||||||
import * as dateMath from '../../core/utils/datemath';
|
import * as dateMath from 'app/core/utils/datemath';
|
||||||
|
|
||||||
class MetricsPanelCtrl extends PanelCtrl {
|
class MetricsPanelCtrl extends PanelCtrl {
|
||||||
error: boolean;
|
error: boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user