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
a361d1f4
Commit
a361d1f4
authored
Dec 16, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(panel): refinements for panel help text, made the inspector the home for the model version
parent
2c05237d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
40 deletions
+31
-40
public/app/core/controllers/inspect_ctrl.js
+2
-2
public/app/features/dashboard/partials/inspector.html
+7
-5
public/app/features/dashboard/partials/panel_info.html
+0
-17
public/app/features/panel/panel_ctrl.ts
+9
-11
public/app/features/panel/panel_directive.ts
+13
-5
No files found.
public/app/core/controllers/inspect_ctrl.js
View file @
a361d1f4
...
...
@@ -48,13 +48,13 @@ function (angular, _, $, coreModule) {
}
if
(
model
.
error
.
stack
)
{
$scope
.
editor
.
index
=
2
;
$scope
.
editor
.
index
=
3
;
$scope
.
stack_trace
=
model
.
error
.
stack
;
$scope
.
message
=
model
.
error
.
message
;
}
if
(
model
.
error
.
config
&&
model
.
error
.
config
.
data
)
{
$scope
.
editor
.
index
=
1
;
$scope
.
editor
.
index
=
2
;
if
(
_
.
isString
(
model
.
error
.
config
.
data
))
{
$scope
.
request_parameters
=
getParametersFromQueryString
(
model
.
error
.
config
.
data
);
...
...
public/app/features/dashboard/partials/inspector.html
View file @
a361d1f4
<div
class=
"modal-body"
ng-controller=
"InspectCtrl"
ng-init=
"init()"
>
<div
class=
"modal-header"
>
<h2
class=
"modal-header-title"
>
<i
class=
"fa fa-
frown-o
"
></i>
<i
class=
"fa fa-
info-circle
"
></i>
<span
class=
"p-l-1"
>
Inspector
</span>
</h2>
<ul
class=
"gf-tabs"
>
<li
class=
"gf-tabs-item"
ng-repeat=
"tab in ['Request', 'Response', 'JS Error']"
>
<li
class=
"gf-tabs-item"
ng-repeat=
"tab in ['
Panel Description', '
Request', 'Response', 'JS Error']"
>
<a
class=
"gf-tabs-link"
ng-click=
"editor.index = $index"
ng-class=
"{active: editor.index === $index}"
>
{{::tab}}
</a>
...
...
@@ -19,8 +19,10 @@
</div>
<div
class=
"modal-content"
>
<div
ng-if=
"editor.index == 0"
ng-bind-html=
"panelInfoHtml"
>
</div>
<div
ng-if=
"editor.index ==
0
"
>
<div
ng-if=
"editor.index ==
1
"
>
<h5
class=
"section-heading"
>
Request details
</h5>
<table
class=
"filter-table gf-form-group"
>
<tr>
...
...
@@ -54,14 +56,14 @@
</table>
</div>
<div
ng-if=
"editor.index ==
1
"
>
<div
ng-if=
"editor.index ==
2
"
>
<h5
ng-show=
"message"
>
{{message}}
</h5>
<pre
class=
"small"
>
{{response}}
</pre>
</div>
<div
ng-if=
"editor.index ==
2
"
>
<div
ng-if=
"editor.index ==
3
"
>
<label>
Message:
</label>
<pre>
...
...
public/app/features/dashboard/partials/panel_info.html
deleted
100644 → 0
View file @
2c05237d
<div
class=
"modal-body"
>
<div
class=
"modal-header"
>
<h2
class=
"modal-header-title"
>
<i
class=
"fa fa-info-circle"
></i>
<span
class=
"p-l-1"
>
Panel Description
</span>
</h2>
<a
class=
"modal-header-close"
ng-click=
"dismiss();"
>
<i
class=
"fa fa-remove"
></i>
</a>
</div>
<div
class=
"modal-content markdown-html"
ng-bind-html=
"html"
>
</div>
</div>
public/app/features/panel/panel_ctrl.ts
View file @
a361d1f4
...
...
@@ -258,8 +258,13 @@ export class PanelCtrl {
return
''
;
}
getInfoContent
()
{
var
markdown
=
this
.
error
||
this
.
panel
.
description
;
getInfoContent
(
options
)
{
var
markdown
=
this
.
panel
.
description
;
if
(
options
.
mode
===
'tooltip'
)
{
markdown
=
this
.
error
||
this
.
panel
.
description
;
}
var
linkSrv
=
this
.
$injector
.
get
(
'linkSrv'
);
var
templateSrv
=
this
.
$injector
.
get
(
'templateSrv'
);
var
interpolatedMarkdown
=
templateSrv
.
replace
(
markdown
,
this
.
panel
.
scopedVars
);
...
...
@@ -279,23 +284,16 @@ export class PanelCtrl {
return
html
+
'</div>'
;
}
openIn
fo
()
{
openIn
spector
()
{
var
modalScope
=
this
.
$scope
.
$new
();
modalScope
.
panel
=
this
.
panel
;
modalScope
.
dashboard
=
this
.
dashboard
;
modalScope
.
panelInfoHtml
=
this
.
getInfoContent
({
mode
:
'inspector'
});
if
(
this
.
error
)
{
modalScope
.
inspector
=
$
.
extend
(
true
,
{},
this
.
inspector
);
this
.
publishAppEvent
(
'show-modal'
,
{
src
:
'public/app/features/dashboard/partials/inspector.html'
,
scope
:
modalScope
});
}
else
{
modalScope
.
html
=
this
.
getInfoContent
();
this
.
publishAppEvent
(
'show-modal'
,
{
src
:
'public/app/features/dashboard/partials/panel_info.html'
,
scope
:
modalScope
});
}
}
}
public/app/features/panel/panel_directive.ts
View file @
a361d1f4
...
...
@@ -10,7 +10,7 @@ var module = angular.module('grafana.directives');
var
panelTemplate
=
`
<div class="panel-container">
<div class="panel-header">
<span class="panel-info-corner"
ng-click="ctrl.openInfo()"
>
<span class="panel-info-corner">
<i class="fa"></i>
<span class="panel-info-corner-inner"></span>
</span>
...
...
@@ -65,7 +65,7 @@ module.directive('grafanaPanel', function($rootScope) {
scope
:
{
ctrl
:
"="
},
link
:
function
(
scope
,
elem
)
{
var
panelContainer
=
elem
.
find
(
'.panel-container'
);
var
cornerInfoElem
=
elem
.
find
(
'.panel-info-corner'
)
[
0
]
;
var
cornerInfoElem
=
elem
.
find
(
'.panel-info-corner'
);
var
ctrl
=
scope
.
ctrl
;
var
infoDrop
;
...
...
@@ -144,7 +144,7 @@ module.directive('grafanaPanel', function($rootScope) {
function
updatePanelCornerInfo
()
{
var
cornerMode
=
ctrl
.
getInfoMode
();
cornerInfoElem
.
className
=
'panel-info-corner + panel-info-corner--'
+
cornerMode
;
cornerInfoElem
[
0
]
.
className
=
'panel-info-corner + panel-info-corner--'
+
cornerMode
;
if
(
cornerMode
)
{
if
(
infoDrop
)
{
...
...
@@ -152,8 +152,10 @@ module.directive('grafanaPanel', function($rootScope) {
}
infoDrop
=
new
Drop
({
target
:
cornerInfoElem
,
content
:
ctrl
.
getInfoContent
.
bind
(
ctrl
),
target
:
cornerInfoElem
[
0
],
content
:
function
()
{
return
ctrl
.
getInfoContent
({
mode
:
'tooltip'
});
},
position
:
'right middle'
,
classes
:
ctrl
.
error
?
'drop-error'
:
'drop-help'
,
openOn
:
'hover'
,
...
...
@@ -165,11 +167,17 @@ module.directive('grafanaPanel', function($rootScope) {
scope
.
$watchGroup
([
'ctrl.error'
,
'ctrl.panel.description'
],
updatePanelCornerInfo
);
scope
.
$watchCollection
(
'ctrl.panel.links'
,
updatePanelCornerInfo
);
cornerInfoElem
.
on
(
'click'
,
function
()
{
infoDrop
.
close
();
scope
.
$apply
(
ctrl
.
openInspector
.
bind
(
ctrl
));
});
elem
.
on
(
'mouseenter'
,
mouseEnter
);
elem
.
on
(
'mouseleave'
,
mouseLeave
);
scope
.
$on
(
'$destroy'
,
function
()
{
elem
.
off
();
cornerInfoElem
.
off
();
if
(
infoDrop
)
{
infoDrop
.
destroy
();
...
...
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