Skip to content

Commit 5b52225

Browse files
committed
wip: panel options idea2
1 parent 3c7e544 commit 5b52225

File tree

6 files changed

+42
-23
lines changed

6 files changed

+42
-23
lines changed

public/app/features/panel/metrics_panel_ctrl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class MetricsPanelCtrl extends PanelCtrl {
5656
}
5757

5858
private onInitMetricsPanelEditMode() {
59-
this.addEditorTab('Time range', 'public/app/features/panel/partials/panelTime.html');
59+
// this.addCommonTab('Time range', 'public/app/features/panel/partials/panelTime.html');
6060
}
6161

6262
private onMetricsPanelRefresh() {

public/app/features/panel/panel_ctrl.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,12 @@ export class PanelCtrl {
100100
this.optionTabs = [];
101101
this.addCommonTab('Queries', metricsTabDirective, 0, 'fa fa-database');
102102
this.addCommonTab('Visualization', vizTabDirective, 1, 'fa fa-line-chart');
103-
this.addCommonTab('General', 'public/app/partials/panelgeneral.html');
104103

105104
this.editModeInitiated = true;
106105
this.events.emit('init-edit-mode', null);
107106

107+
// this.addEditorTab('General', 'public/app/partials/panelgeneral.html');
108+
108109
const urlTab = (this.$injector.get('$routeParams').tab || '').toLowerCase();
109110
if (urlTab) {
110111
this.editorTabs.forEach((tab, i) => {

public/app/features/panel/panel_editor_tab.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ function panelEditorTab(dynamicDirectiveSrv) {
1313
},
1414
directive: scope => {
1515
const pluginId = scope.ctrl.pluginId;
16-
const tabName = scope.editorTab.title.toLowerCase();
16+
const tabName = scope.editorTab.title.toLowerCase().replace(' ', '-');
1717

18-
console.log('panelEditorTab', pluginId, tabName);
1918
if (directiveCache[pluginId]) {
2019
if (directiveCache[pluginId][tabName]) {
2120
return directiveCache[pluginId][tabName];

public/app/features/panel/partials/metrics_tab.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
<div class="gf-form-group">
22
<div class="gf-form-inline">
33
<div class="gf-form">
4-
<label class="gf-form-label gf-query-ds-label">
5-
<i class="icon-gf icon-gf-datasources"></i>
6-
</label>
74
<label class="gf-form-label">Data Source</label>
8-
95
<gf-form-dropdown model="ctrl.panelDsValue" css-class="gf-size-auto"
106
lookup-text="true"
117
get-options="ctrl.getOptions(true)"

public/app/features/panel/viz_tab.ts

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,42 @@ export class VizTabCtrl {
2222
}
2323

2424
const template = `
25-
<div class="viz-editor">
26-
<div class="viz-editor-col1">
27-
<viz-type-picker currentType="ctrl.panelCtrl.panel.type" onTypeChanged="ctrl.onTypeChanged"></viz-type-picker>
28-
</div>
29-
<div class="viz-editor-col2">
30-
<div ng-repeat="tab in ctrl.panelCtrl.optionTabs" >
31-
<h5 class="page-heading">{{tab.title}}</h5>
32-
<panel-editor-tab editor-tab="tab" ctrl="ctrl.panelCtrl" index="$index"></panel-editor-tab>
33-
</div>
34-
</div>
35-
</div>
36-
`;
25+
<div class="gf-form-group ">
26+
<div class="gf-form-query">
27+
<div class="gf-form">
28+
<label class="gf-form-label">
29+
<img src="public/app/plugins/panel/graph/img/icn-graph-panel.svg" style="width: 16px; height: 16px" />
30+
Graph
31+
<i class="fa fa-caret-down" />
32+
</label>
33+
</div>
34+
35+
<div class="gf-form gf-form--grow">
36+
<label class="gf-form-label gf-form-label--grow"></label>
37+
</div>
38+
</div>
39+
40+
<br />
41+
<br />
42+
43+
<div class="query-editor-rows gf-form-group">
44+
<div ng-repeat="tab in ctrl.panelCtrl.optionTabs">
45+
<div class="gf-form-query">
46+
<div class="gf-form gf-form-query-letter-cell">
47+
<label class="gf-form-label">
48+
<span class="gf-form-query-letter-cell-carret">
49+
<i class="fa fa-caret-down"></i>
50+
</span>
51+
<span class="gf-form-query-letter-cell-letter">{{tab.title}}</span>
52+
</label>
53+
</div>
54+
<div class="gf-form gf-form--grow">
55+
<label class="gf-form-label gf-form-label--grow"></label>
56+
</div>
57+
</div>
58+
</div>
59+
</div>
60+
</div>`;
3761

3862
/** @ngInject */
3963
export function vizTabDirective() {
@@ -46,5 +70,4 @@ export function vizTabDirective() {
4670
}
4771

4872
react2AngularDirective('vizTypePicker', VizTypePicker, ['currentType', ['onTypeChanged', { watchDepth: 'reference' }]]);
49-
5073
coreModule.directive('vizTab', vizTabDirective);

public/app/plugins/panel/graph/module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ class GraphCtrl extends MetricsPanelCtrl {
134134
}
135135

136136
onInitEditMode() {
137+
this.addEditorTab('Display', 'public/app/plugins/panel/graph/tab_display.html', 4);
137138
this.addEditorTab('Axes', axesEditorComponent, 2);
138139
this.addEditorTab('Legend', 'public/app/plugins/panel/graph/tab_legend.html', 3);
139-
this.addEditorTab('Display', 'public/app/plugins/panel/graph/tab_display.html', 4);
140140

141141
if (config.alertingEnabled) {
142-
this.addEditorTab('Alert', alertTab, 5);
142+
this.addCommonTab('Alert', alertTab, 5);
143143
}
144144

145145
this.subTabIndex = 0;

0 commit comments

Comments
 (0)