Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
afede880
Commit
afede880
authored
Jun 01, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added url validation when adding data source, Fixes #2043
parent
e2f6633d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletions
+17
-1
public/app/features/org/partials/datasourceHttpConfig.html
+1
-1
public/app/plugins/datasource/influxdb/datasource.js
+16
-0
No files found.
public/app/features/org/partials/datasourceHttpConfig.html
View file @
afede880
...
...
@@ -6,7 +6,7 @@
Url
</li>
<li>
<input
type=
"text"
class=
"tight-form-input input-xlarge"
ng-model=
'current.url'
placeholder=
"http://my.server.com:8080"
required
></input>
<input
type=
"text"
class=
"tight-form-input input-xlarge"
ng-model=
'current.url'
placeholder=
"http://my.server.com:8080"
ng-pattern=
"/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/"
required
></input>
</li>
<li
class=
"tight-form-item"
>
Access
<tip>
Direct = url is used directly from browser, Proxy = Grafana backend will proxy the request
</label>
...
...
public/app/plugins/datasource/influxdb/datasource.js
View file @
afede880
...
...
@@ -126,6 +126,22 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
return
this
.
_influxRequest
(
'GET'
,
'/query'
,
{
q
:
query
});
};
InfluxDatasource
.
prototype
.
testDatasource
=
function
()
{
return
this
.
metricFindQuery
(
'SHOW MEASUREMENTS LIMIT 1'
).
then
(
function
()
{
return
{
status
:
"success"
,
message
:
"Data source is working"
,
title
:
"Success"
};
},
function
(
err
)
{
var
message
,
title
;
if
(
err
.
statusText
)
{
message
=
err
.
statusText
;
title
=
"HTTP Error"
;
}
else
{
message
=
err
;
title
=
"Unknown error"
;
}
return
{
status
:
"error"
,
message
:
message
,
title
:
title
};
});
};
InfluxDatasource
.
prototype
.
_influxRequest
=
function
(
method
,
url
,
data
)
{
var
self
=
this
;
var
deferred
=
$q
.
defer
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment