-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JSON editor #1
Conversation
So we are gonna do that in this repo I guess :) I'll put my work into master so we can continue on top of that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rebase on simPod:master?
@@ -30,6 +30,13 @@ export class GenericDatasource { | |||
query.adhocFilters = []; | |||
} | |||
|
|||
// strip empty json | |||
query.targets = _.map(query.targets, d => { | |||
if (d.data.trim() == "") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use ===
|
||
// special handling when in table panel | ||
if (!this.target.format) { | ||
this.target.format = this.panelCtrl.panel.type === 'table' ? 'table' : 'timeseries'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed it to time_series
according to grafana/simple-json-datasource#103 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If ok I've prefer timeseries for readability. With the mysql source its only internal while with JSON its actually being sent to the data source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So shall we use timeseries
then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes :)
this.target.format = this.panelCtrl.panel.type === 'table' ? 'table' : 'timeseries'; | ||
} | ||
|
||
this.formats = [{ text: 'Time series', value: 'timeseries' }, { text: 'Table', value: 'table' }]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same
} | ||
|
||
getOptions(query) { | ||
return this.datasource.metricFindQuery(query || ''); | ||
} | ||
|
||
// not used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not used, can we toss it away?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't want to do that since its still in upstream? If remove then we can also scrap the part in the query editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's skip this for now.
Pleas don't. IMHO master should stay at upstream level- rather create a new |
@andig very well, |
Replaced by #2 |
Add json editor control