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
bb5eeee8
Commit
bb5eeee8
authored
Mar 17, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed small issue with share modal
parent
42232472
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
18 deletions
+17
-18
src/app/directives/tip.js
+3
-2
src/app/features/dashboard/partials/shareModal.html
+3
-3
src/app/features/dashboard/sharePanelCtrl.js
+8
-10
src/test/specs/sharePanelCtrl-specs.js
+3
-3
No files found.
src/app/directives/tip.js
View file @
bb5eeee8
...
...
@@ -57,14 +57,15 @@ function (angular, kbn) {
angular
.
module
(
'grafana.directives'
)
.
directive
(
'editorCheckbox'
,
function
(
$compile
)
{
.
directive
(
'editorCheckbox'
,
function
(
$compile
,
$interpolate
)
{
return
{
restrict
:
'E'
,
link
:
function
(
scope
,
elem
,
attrs
)
{
var
text
=
$interpolate
(
attrs
.
text
)(
scope
);
var
ngchange
=
attrs
.
change
?
(
' ng-change="'
+
attrs
.
change
+
'"'
)
:
''
;
var
tip
=
attrs
.
tip
?
(
' <tip>'
+
attrs
.
tip
+
'</tip>'
)
:
''
;
var
label
=
'<label for="'
+
scope
.
$id
+
attrs
.
model
+
'" class="checkbox-label">'
+
attrs
.
text
+
tip
+
'</label>'
;
text
+
tip
+
'</label>'
;
var
template
=
'<input class="cr1" id="'
+
scope
.
$id
+
attrs
.
model
+
'" type="checkbox" '
+
' ng-model="'
+
attrs
.
model
+
'"'
+
ngchange
+
...
...
src/app/features/dashboard/partials/shareModal.html
View file @
bb5eeee8
...
...
@@ -20,17 +20,17 @@
<br>
<div
class=
"gf-form"
>
<div
class=
"gf-form-row"
>
<editor-checkbox
text=
"Current time range"
model=
"forCurrent"
change=
"buildUrl()"
></editor-checkbox>
<editor-checkbox
text=
"Current time range"
model=
"
options.
forCurrent"
change=
"buildUrl()"
></editor-checkbox>
</div>
</div>
<div
class=
"gf-form"
ng-if=
"panel"
>
<div
class=
"gf-form-row"
>
<editor-checkbox
text=
"This panel only"
model=
"toPanel"
change=
"buildUrl()"
></editor-checkbox>
<editor-checkbox
text=
"This panel only"
model=
"
options.
toPanel"
change=
"buildUrl()"
></editor-checkbox>
</div>
</div>
<div
class=
"gf-form"
>
<div
class=
"gf-form-row"
>
<editor-checkbox
text=
"Include template variables"
model=
"includeTemplateVars"
change=
"buildUrl()"
></editor-checkbox>
<editor-checkbox
text=
"Include template variables"
model=
"
options.
includeTemplateVars"
change=
"buildUrl()"
></editor-checkbox>
</div>
</div>
...
...
src/app/features/dashboard/sharePanelCtrl.js
View file @
bb5eeee8
...
...
@@ -13,15 +13,13 @@ function (angular, _, require, config) {
$scope
.
init
=
function
()
{
$scope
.
editor
=
{
index
:
0
};
$scope
.
forCurrent
=
true
;
$scope
.
options
=
{
forCurrent
:
true
,
toPanel
:
$scope
.
panel
?
true
:
false
,
includeTemplateVars
:
true
};
if
(
$scope
.
panel
)
{
$scope
.
toPanel
=
true
;
}
$scope
.
includeTemplateVars
=
true
;
$scope
.
buildUrl
();
};
$scope
.
buildUrl
=
function
()
{
...
...
@@ -38,7 +36,7 @@ function (angular, _, require, config) {
params
.
from
=
range
.
from
;
params
.
to
=
range
.
to
;
if
(
$scope
.
includeTemplateVars
)
{
if
(
$scope
.
options
.
includeTemplateVars
)
{
_
.
each
(
templateSrv
.
variables
,
function
(
variable
)
{
params
[
'var-'
+
variable
.
name
]
=
variable
.
current
.
text
;
});
...
...
@@ -49,12 +47,12 @@ function (angular, _, require, config) {
});
}
if
(
!
$scope
.
forCurrent
)
{
if
(
!
$scope
.
options
.
forCurrent
)
{
delete
params
.
from
;
delete
params
.
to
;
}
if
(
$scope
.
toPanel
)
{
if
(
$scope
.
options
.
toPanel
)
{
params
.
panelId
=
$scope
.
panel
.
id
;
params
.
fullscreen
=
true
;
}
else
{
...
...
src/test/specs/sharePanelCtrl-specs.js
View file @
bb5eeee8
...
...
@@ -42,7 +42,7 @@ define([
it
(
'should remove panel id when toPanel is false'
,
function
()
{
ctx
.
$location
.
path
(
'/test'
);
ctx
.
scope
.
panel
=
{
id
:
22
};
ctx
.
scope
.
toPanel
=
false
;
ctx
.
scope
.
options
=
{
toPanel
:
false
,
forCurrent
:
true
}
;
setTime
({
from
:
'now-1h'
,
to
:
'now'
});
ctx
.
scope
.
buildUrl
();
...
...
@@ -52,8 +52,8 @@ define([
it
(
'should include template variables in url'
,
function
()
{
ctx
.
$location
.
path
(
'/test'
);
ctx
.
scope
.
panel
=
{
id
:
22
};
ctx
.
scope
.
includeTemplateVars
=
true
;
ctx
.
scope
.
toPanel
=
false
;
ctx
.
scope
.
options
=
{
includeTemplateVars
:
true
,
toPanel
:
false
,
forCurrent
:
true
}
;
ctx
.
templateSrv
.
variables
=
[{
name
:
'app'
,
current
:
{
text
:
'mupp'
}},
{
name
:
'server'
,
current
:
{
text
:
'srv-01'
}}];
setTime
({
from
:
'now-1h'
,
to
:
'now'
});
...
...
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