Skip to content

Commit c5576cc

Browse files
committed
Fix from Grafana's feedback on PR #595
1 parent 95b0b28 commit c5576cc

File tree

5 files changed

+24
-16
lines changed

5 files changed

+24
-16
lines changed

dist/module.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/module.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
{"name": "Panel", "path": "img/panel.png"}
2222
],
2323
"version": "0.2.1",
24-
"updated": "2020-08-28"
24+
"updated": "2020-09-01"
2525
},
2626

2727
"dependencies": {

src/SimpleEditor.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,77 +66,82 @@ export class SimpleEditor extends PureComponent<PanelEditorProps<SimpleOptions>>
6666
<div>
6767
{/*<FormField label="Title" value={this.props.options.title} onChange={this.onTextChanged} />*/}
6868

69-
<div className="section gf-form-group">
69+
<div className="section gf-form-group" style={{width:'100%'}}>
7070
<h5 className="section-heading">Data</h5>
7171
<div className="gf-form-inline">
72-
<div className="gf-form">
72+
<div className="gf-form" style={{width:'100%'}}>
7373
<AceEditor
7474
mode="javascript"
7575
theme={theme}
7676
name="dashboard_data"
7777
height="150px"
78+
width="100%"
7879
value={JSON.stringify(this.props.options.data, null, 4)}
7980
onBlur={this.onDataChanged}
8081
/>
8182
</div>
8283
</div>
8384
</div>
84-
<div className="section gf-form-group">
85+
<div className="section gf-form-group" style={{width:'100%'}}>
8586
<h5 className="section-heading">Layout</h5>
8687
<div className="gf-form-inline">
87-
<div className="gf-form">
88+
<div className="gf-form" style={{width:'100%'}}>
8889
<AceEditor
8990
mode="javascript"
9091
theme={theme}
9192
name="dashboard_layout"
9293
height="150px"
94+
width="100%"
9395
value={JSON.stringify(this.props.options.layout, null, 4)}
9496
onBlur={this.onLayoutChanged}
9597
/>
9698
</div>
9799
</div>
98100
</div>
99-
<div className="section gf-form-group">
101+
<div className="section gf-form-group" style={{width:'100%'}}>
100102
<h5 className="section-heading">Config</h5>
101103
<div className="gf-form-inline">
102-
<div className="gf-form">
104+
<div className="gf-form" style={{width:'100%'}}>
103105
<AceEditor
104106
mode="javascript"
105107
theme={theme}
106108
name="dashboard_config"
107109
height="150px"
110+
width="100%"
108111
value={JSON.stringify(this.props.options.config, null, 4)}
109112
onBlur={this.onConfigChanged}
110113
/>
111114
</div>
112115
</div>
113116
</div>
114117

115-
<div className="section gf-form-group">
118+
<div className="section gf-form-group" style={{width:'100%'}}>
116119
<h5 className="section-heading">Script</h5>
117120
<div className="gf-form-inline">
118-
<div className="gf-form">
121+
<div className="gf-form" style={{width:'100%'}}>
119122
<AceEditor
120123
mode="javascript"
121124
theme={theme}
122125
name="dashboard_script"
123126
height="150px"
127+
width="100%"
124128
value={this.props.options.script}
125129
onBlur={this.onScriptChanged}
126130
/>
127131
</div>
128132
</div>
129133
</div>
130134

131-
<div className="section gf-form-group">
132-
<h5 className="section-heading">on Click Function</h5>
135+
<div className="section gf-form-group" style={{width:'100%'}}>
136+
<h5 className="section-heading">Click script</h5>
133137
<div className="gf-form-inline">
134-
<div className="gf-form">
138+
<div className="gf-form" style={{width:'100%'}}>
135139
<AceEditor
136140
mode="javascript"
137141
theme={theme}
138142
name="dashboard_onclick"
139143
height="150px"
144+
width="100%"
140145
value={this.props.options.onclick}
141146
onBlur={this.onClickChanged}
142147
/>

src/types.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ export const defaults: SimpleOptions = {
1515
},
1616
"paper_bgcolor": "rgba(0,0,0,0)",
1717
"plot_bgcolor": "rgba(0,0,0,0)",
18+
"margin":{
19+
"t":30,
20+
"b":20
21+
},
1822
"xaxis": {
1923
"type": "date"
2024
}
@@ -37,6 +41,5 @@ var trace = {
3741
3842
return {data:[trace],layout:{title:'My Chart'}};`,
3943
onclick:`console.log(data)
40-
//Not working if variable is a Textbox : Maximum call stack size exceeded. Grafana bug?
41-
window.updateVariables({query:{'var-project':'toti'}, partial: true})`
44+
window.updateVariables({query:{'var-project':'test'}, partial: true})`
4245
};

0 commit comments

Comments
 (0)