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
150b9769
Commit
150b9769
authored
Mar 19, 2019
by
Andrej Ocenas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use SecretFormField in MSSql and Postgres datasources
parent
d8167ffb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
17 deletions
+52
-17
public/app/core/angular_wrappers.ts
+8
-1
public/app/plugins/datasource/mssql/config_ctrl.ts
+14
-0
public/app/plugins/datasource/mssql/partials/config.html
+8
-8
public/app/plugins/datasource/postgres/config_ctrl.ts
+13
-0
public/app/plugins/datasource/postgres/partials/config.html
+9
-8
No files found.
public/app/core/angular_wrappers.ts
View file @
150b9769
...
@@ -9,7 +9,7 @@ import { TagFilter } from './components/TagFilter/TagFilter';
...
@@ -9,7 +9,7 @@ import { TagFilter } from './components/TagFilter/TagFilter';
import
{
SideMenu
}
from
'./components/sidemenu/SideMenu'
;
import
{
SideMenu
}
from
'./components/sidemenu/SideMenu'
;
import
{
MetricSelect
}
from
'./components/Select/MetricSelect'
;
import
{
MetricSelect
}
from
'./components/Select/MetricSelect'
;
import
AppNotificationList
from
'./components/AppNotifications/AppNotificationList'
;
import
AppNotificationList
from
'./components/AppNotifications/AppNotificationList'
;
import
{
ColorPicker
,
SeriesColorPickerPopoverWithTheme
}
from
'@grafana/ui'
;
import
{
ColorPicker
,
SeriesColorPickerPopoverWithTheme
,
SecretFormField
}
from
'@grafana/ui'
;
import
{
FunctionEditor
}
from
'app/plugins/datasource/graphite/FunctionEditor'
;
import
{
FunctionEditor
}
from
'app/plugins/datasource/graphite/FunctionEditor'
;
export
function
registerAngularDirectives
()
{
export
function
registerAngularDirectives
()
{
...
@@ -59,4 +59,11 @@ export function registerAngularDirectives() {
...
@@ -59,4 +59,11 @@ export function registerAngularDirectives() {
[
'datasource'
,
{
watchDepth
:
'reference'
}],
[
'datasource'
,
{
watchDepth
:
'reference'
}],
[
'templateSrv'
,
{
watchDepth
:
'reference'
}],
[
'templateSrv'
,
{
watchDepth
:
'reference'
}],
]);
]);
react2AngularDirective
(
'secretFormField'
,
SecretFormField
,
[
'value'
,
'isConfigured'
,
'inputWidth'
,
[
'onReset'
,
{
watchDepth
:
'reference'
,
wrapApply
:
true
}],
[
'onChange'
,
{
watchDepth
:
'reference'
,
wrapApply
:
true
}],
]);
}
}
public/app/plugins/datasource/mssql/config_ctrl.ts
View file @
150b9769
import
{
SyntheticEvent
}
from
'react'
;
export
class
MssqlConfigCtrl
{
export
class
MssqlConfigCtrl
{
static
templateUrl
=
'partials/config.html'
;
static
templateUrl
=
'partials/config.html'
;
...
@@ -7,4 +9,16 @@ export class MssqlConfigCtrl {
...
@@ -7,4 +9,16 @@ export class MssqlConfigCtrl {
constructor
(
$scope
)
{
constructor
(
$scope
)
{
this
.
current
.
jsonData
.
encrypt
=
this
.
current
.
jsonData
.
encrypt
||
'false'
;
this
.
current
.
jsonData
.
encrypt
=
this
.
current
.
jsonData
.
encrypt
||
'false'
;
}
}
onPasswordReset
=
(
event
:
SyntheticEvent
<
HTMLInputElement
>
)
=>
{
event
.
preventDefault
();
this
.
current
.
secureJsonFields
.
password
=
false
;
this
.
current
.
secureJsonData
=
this
.
current
.
secureJsonData
||
{};
this
.
current
.
secureJsonData
.
password
=
''
;
};
onPasswordChange
=
(
event
:
SyntheticEvent
<
HTMLInputElement
>
)
=>
{
this
.
current
.
secureJsonData
=
this
.
current
.
secureJsonData
||
{};
this
.
current
.
secureJsonData
.
password
=
event
.
currentTarget
.
value
;
};
}
}
public/app/plugins/datasource/mssql/partials/config.html
View file @
150b9769
...
@@ -17,14 +17,14 @@
...
@@ -17,14 +17,14 @@
<span
class=
"gf-form-label width-7"
>
User
</span>
<span
class=
"gf-form-label width-7"
>
User
</span>
<input
type=
"text"
class=
"gf-form-input"
ng-model=
'ctrl.current.user'
placeholder=
"user"
></input>
<input
type=
"text"
class=
"gf-form-input"
ng-model=
'ctrl.current.user'
placeholder=
"user"
></input>
</div>
</div>
<div
class=
"gf-form max-width-15"
ng-if=
"!ctrl.current.secureJsonFields.password
"
>
<div
class=
"gf-form
"
>
<span
class=
"gf-form-label width-7"
>
Password
</span>
<secret-form-field
<input
type=
"password"
class=
"gf-form-input"
ng-model=
'ctrl.current.secureJsonData.password'
placeholder=
"password"
></input>
isConfigured=
"ctrl.current.secureJsonFields.password"
</div>
value=
"ctrl.current.secureJsonData.password"
<div
class=
"gf-form max-width-19"
ng-if=
"ctrl.current.secureJsonFields.password"
>
on-reset=
"ctrl.onPasswordReset"
<span
class=
"gf-form-label width-7"
>
Password
</span>
on-change=
"ctrl.onPasswordChange"
<input
type=
"text"
class=
"gf-form-input"
disabled=
"disabled"
value=
"configured"
>
inputWidth=
"9"
<a
class=
"btn btn-secondary gf-form-btn"
href=
"#"
ng-click=
"ctrl.current.secureJsonFields.password = false"
>
reset
</a
>
/
>
</div>
</div>
</div>
</div>
...
...
public/app/plugins/datasource/postgres/config_ctrl.ts
View file @
150b9769
import
_
from
'lodash'
;
import
_
from
'lodash'
;
import
{
SyntheticEvent
}
from
'react'
;
export
class
PostgresConfigCtrl
{
export
class
PostgresConfigCtrl
{
static
templateUrl
=
'partials/config.html'
;
static
templateUrl
=
'partials/config.html'
;
...
@@ -52,6 +53,18 @@ export class PostgresConfigCtrl {
...
@@ -52,6 +53,18 @@ export class PostgresConfigCtrl {
this
.
showTimescaleDBHelp
=
!
this
.
showTimescaleDBHelp
;
this
.
showTimescaleDBHelp
=
!
this
.
showTimescaleDBHelp
;
}
}
onPasswordReset
=
(
event
:
SyntheticEvent
<
HTMLInputElement
>
)
=>
{
event
.
preventDefault
();
this
.
current
.
secureJsonFields
.
password
=
false
;
this
.
current
.
secureJsonData
=
this
.
current
.
secureJsonData
||
{};
this
.
current
.
secureJsonData
.
password
=
''
;
};
onPasswordChange
=
(
event
:
SyntheticEvent
<
HTMLInputElement
>
)
=>
{
this
.
current
.
secureJsonData
=
this
.
current
.
secureJsonData
||
{};
this
.
current
.
secureJsonData
.
password
=
event
.
currentTarget
.
value
;
};
// the value portion is derived from postgres server_version_num/100
// the value portion is derived from postgres server_version_num/100
postgresVersions
=
[
postgresVersions
=
[
{
name
:
'9.3'
,
value
:
903
},
{
name
:
'9.3'
,
value
:
903
},
...
...
public/app/plugins/datasource/postgres/partials/config.html
View file @
150b9769
...
@@ -17,16 +17,17 @@
...
@@ -17,16 +17,17 @@
<span
class=
"gf-form-label width-7"
>
User
</span>
<span
class=
"gf-form-label width-7"
>
User
</span>
<input
type=
"text"
class=
"gf-form-input"
ng-model=
'ctrl.current.user'
placeholder=
"user"
></input>
<input
type=
"text"
class=
"gf-form-input"
ng-model=
'ctrl.current.user'
placeholder=
"user"
></input>
</div>
</div>
<div
class=
"gf-form max-width-15"
ng-if=
"!ctrl.current.secureJsonFields.password
"
>
<div
class=
"gf-form
"
>
<span
class=
"gf-form-label width-7"
>
Password
</span>
<secret-form-field
<input
type=
"password"
class=
"gf-form-input"
ng-model=
'ctrl.current.secureJsonData.password'
placeholder=
"password"
></input>
isConfigured=
"ctrl.current.secureJsonFields.password"
</div>
value=
"ctrl.current.secureJsonData.password"
<div
class=
"gf-form max-width-19"
ng-if=
"ctrl.current.secureJsonFields.password"
>
on-reset=
"ctrl.onPasswordReset"
<span
class=
"gf-form-label width-7"
>
Password
</span>
on-change=
"ctrl.onPasswordChange"
<input
type=
"text"
class=
"gf-form-input"
disabled=
"disabled"
value=
"configured"
>
inputWidth=
"9"
<a
class=
"btn btn-secondary gf-form-btn"
href=
"#"
ng-click=
"ctrl.current.secureJsonFields.password = false"
>
reset
</a
>
/
>
</div>
</div>
</div>
</div>
<div
class=
"gf-form"
>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label width-7"
>
SSL Mode
</label>
<label
class=
"gf-form-label width-7"
>
SSL Mode
</label>
<div
class=
"gf-form-select-wrapper max-width-15 gf-form-select-wrapper--has-help-icon"
>
<div
class=
"gf-form-select-wrapper max-width-15 gf-form-select-wrapper--has-help-icon"
>
...
...
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