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
878121bb
Commit
878121bb
authored
May 19, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: templating variable name validation detecting global variable naming wrongly, fixes #8423
parent
9045be56
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
24 deletions
+11
-24
public/app/features/templating/editor_ctrl.ts
+1
-1
public/app/features/templating/partials/editor.html
+6
-4
public/sass/components/_gf-form.scss
+4
-19
No files found.
public/app/features/templating/editor_ctrl.ts
View file @
878121bb
...
@@ -10,7 +10,7 @@ export class VariableEditorCtrl {
...
@@ -10,7 +10,7 @@ export class VariableEditorCtrl {
constructor
(
private
$scope
,
private
datasourceSrv
,
private
variableSrv
,
templateSrv
)
{
constructor
(
private
$scope
,
private
datasourceSrv
,
private
variableSrv
,
templateSrv
)
{
$scope
.
variableTypes
=
variableTypes
;
$scope
.
variableTypes
=
variableTypes
;
$scope
.
ctrl
=
{};
$scope
.
ctrl
=
{};
$scope
.
namePattern
=
/^
(
(?!
__
)
.
)
*$/
;
$scope
.
namePattern
=
/^
(
?!
__
)
.
*$/
;
$scope
.
refreshOptions
=
[
$scope
.
refreshOptions
=
[
{
value
:
0
,
text
:
"Never"
},
{
value
:
0
,
text
:
"Never"
},
...
...
public/app/features/templating/partials/editor.html
View file @
878121bb
...
@@ -93,10 +93,7 @@
...
@@ -93,10 +93,7 @@
<form
ng-if=
"mode === 'edit' || mode === 'new'"
name=
"ctrl.form"
>
<form
ng-if=
"mode === 'edit' || mode === 'new'"
name=
"ctrl.form"
>
<h5
class=
"section-heading"
>
Variable
</h5>
<h5
class=
"section-heading"
>
Variable
</h5>
<div
class=
"gf-form-group"
>
<div
class=
"gf-form-group"
>
<div
class=
"gf-form"
ng-show=
"ctrl.form.name.$error.pattern"
>
<div
class=
"gf-form-inline"
>
<span
class=
"gf-form-error"
>
Template names cannot begin with '__' that's reserved for Grafanas global variables
</span>
</div>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form max-width-19"
>
<div
class=
"gf-form max-width-19"
>
<span
class=
"gf-form-label width-6"
>
Name
</span>
<span
class=
"gf-form-label width-6"
>
Name
</span>
<input
type=
"text"
class=
"gf-form-input"
name=
"name"
placeholder=
"name"
ng-model=
'current.name'
required
ng-pattern=
"namePattern"
></input>
<input
type=
"text"
class=
"gf-form-input"
name=
"name"
placeholder=
"name"
ng-model=
'current.name'
required
ng-pattern=
"namePattern"
></input>
...
@@ -113,6 +110,11 @@
...
@@ -113,6 +110,11 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"gf-form"
ng-show=
"ctrl.form.name.$error.pattern"
>
<span
class=
"gf-form-label gf-form-label--error"
>
Template names cannot begin with '__' that's reserved for Grafanas global variables
</span>
</div>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form max-width-19"
>
<div
class=
"gf-form max-width-19"
>
<span
class=
"gf-form-label width-6"
>
Label
</span>
<span
class=
"gf-form-label width-6"
>
Label
</span>
...
...
public/sass/components/_gf-form.scss
View file @
878121bb
...
@@ -64,6 +64,10 @@ $gf-form-margin: 0.25rem;
...
@@ -64,6 +64,10 @@ $gf-form-margin: 0.25rem;
flex-grow
:
1
;
flex-grow
:
1
;
min-height
:
2
.60rem
;
min-height
:
2
.60rem
;
}
}
&
--error
{
color
:
$critical
;
}
}
}
.gf-form-pre
{
.gf-form-pre
{
...
@@ -76,25 +80,6 @@ $gf-form-margin: 0.25rem;
...
@@ -76,25 +80,6 @@ $gf-form-margin: 0.25rem;
@include
border-radius
(
$label-border-radius-sm
);
@include
border-radius
(
$label-border-radius-sm
);
}
}
.gf-form-error
{
padding
:
$input-padding-y
$input-padding-x
;
margin-right
:
$gf-form-margin
;
flex-shrink
:
0
;
background-color
:
$input-label-bg
;
display
:
block
;
font-size
:
$font-size-sm
;
margin-right
:
$gf-form-margin
;
border
:
$input-btn-border-width
solid
$red
;
@include
border-radius
(
$label-border-radius-sm
);
&
--grow
{
flex-grow
:
1
;
min-height
:
2
.60rem
;
}
}
.gf-form-checkbox
{
.gf-form-checkbox
{
flex-shrink
:
0
;
flex-shrink
:
0
;
padding
:
$input-padding-y
$input-padding-x
;
padding
:
$input-padding-y
$input-padding-x
;
...
...
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