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
89eedd59
Commit
89eedd59
authored
Oct 28, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3008 from mtanda/prometheus_link
Revert prometheus graph view link
parents
89ce1a51
c1d592b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
public/app/plugins/datasource/prometheus/datasource.js
+1
-0
public/app/plugins/datasource/prometheus/partials/query.editor.html
+5
-0
public/app/plugins/datasource/prometheus/query_ctrl.js
+15
-0
No files found.
public/app/plugins/datasource/prometheus/datasource.js
View file @
89eedd59
...
...
@@ -21,6 +21,7 @@ function (angular, _, moment, dateMath) {
this
.
name
=
datasource
.
name
;
this
.
supportMetrics
=
true
;
this
.
url
=
datasource
.
url
;
this
.
directUrl
=
datasource
.
directUrl
;
this
.
basicAuth
=
datasource
.
basicAuth
;
this
.
lastErrors
=
{};
}
...
...
public/app/plugins/datasource/prometheus/partials/query.editor.html
View file @
89eedd59
...
...
@@ -110,6 +110,11 @@
ng-change=
"refreshMetricData()"
>
</select>
</li>
<li
class=
"tight-form-item"
>
<a
href=
"{{linkToPrometheus()}}"
target=
"_blank"
bs-tooltip=
"'Link to Graph in Prometheus'"
>
<i
class=
"fa fa-share-square-o"
></i>
</a>
</li>
</ul>
<div
class=
"clearfix"
></div>
...
...
public/app/plugins/datasource/prometheus/query_ctrl.js
View file @
89eedd59
...
...
@@ -44,6 +44,21 @@ function (angular, _) {
.
then
(
callback
);
};
$scope
.
linkToPrometheus
=
function
()
{
var
range
=
Math
.
ceil
((
$scope
.
range
.
to
.
valueOf
()
-
$scope
.
range
.
from
.
valueOf
())
/
1000
);
var
endTime
=
$scope
.
range
.
to
.
utc
().
format
(
'YYYY-MM-DD HH:MM'
);
var
expr
=
{
expr
:
$scope
.
target
.
expr
,
range_input
:
range
+
's'
,
end_input
:
endTime
,
step_input
:
''
,
stacked
:
$scope
.
panel
.
stack
,
tab
:
0
};
var
hash
=
encodeURIComponent
(
JSON
.
stringify
([
expr
]));
return
$scope
.
datasource
.
directUrl
+
'/graph#'
+
hash
;
};
$scope
.
init
();
});
...
...
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