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
7c3d1012
Commit
7c3d1012
authored
Oct 15, 2018
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rendering settings
parent
e642fce4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
2 deletions
+59
-2
public/app/core/components/FormSwitch/FormSwitch.tsx
+49
-0
public/app/features/datasources/DataSourceHttpSettings.tsx
+0
-0
public/app/features/datasources/DataSourceSettings.tsx
+1
-2
public/app/features/datasources/__mocks__/dataSourcesMocks.ts
+3
-0
public/app/features/datasources/state/navModel.ts
+3
-0
public/app/types/datasources.ts
+3
-0
No files found.
public/app/core/components/FormSwitch/FormSwitch.tsx
0 → 100644
View file @
7c3d1012
import
React
,
{
PureComponent
}
from
'react'
;
import
_
from
'lodash'
;
export
interface
Props
{
label
:
string
;
checked
:
boolean
;
labelClass
?:
string
;
switchClass
?:
string
;
onChange
:
(
event
)
=>
any
;
}
export
interface
State
{
id
:
any
;
}
export
class
FormSwitch
extends
PureComponent
<
Props
,
State
>
{
state
=
{
id
:
_
.
uniqueId
(),
};
internalOnChange
=
event
=>
{
event
.
stopPropagation
();
this
.
props
.
onChange
(
event
);
};
render
()
{
const
{
labelClass
,
switchClass
,
label
,
checked
}
=
this
.
props
;
const
labelId
=
`check-
${
this
.
state
.
id
}
`
;
const
labelClassName
=
`gf-form-label
${
labelClass
}
pointer`
;
const
switchClassName
=
`gf-form-switch
${
switchClass
}
`
;
return
(
<
div
className=
"gf-form"
>
{
label
&&
(
<
label
htmlFor=
{
labelId
}
className=
{
labelClassName
}
>
{
label
}
</
label
>
)
}
<
div
className=
{
switchClassName
}
>
<
input
id=
{
labelId
}
type=
"checkbox"
checked=
{
checked
}
onChange=
{
this
.
internalOnChange
}
/>
<
label
htmlFor=
{
labelId
}
/>
</
div
>
</
div
>
);
}
}
export
default
FormSwitch
;
public/app/features/datasources/DataSourceHttpSettings.tsx
View file @
7c3d1012
This diff is collapsed.
Click to expand it.
public/app/features/datasources/DataSourceSettings.tsx
View file @
7c3d1012
...
@@ -86,7 +86,6 @@ export class DataSourceSettings extends PureComponent<Props, State> {
...
@@ -86,7 +86,6 @@ export class DataSourceSettings extends PureComponent<Props, State> {
tlsCACert
:
{},
tlsCACert
:
{},
tlsClientCert
:
{},
tlsClientCert
:
{},
tlsClientKey
:
{},
tlsClientKey
:
{},
url
:
{},
};
};
return
(
return
(
...
@@ -135,6 +134,7 @@ export class DataSourceSettings extends PureComponent<Props, State> {
...
@@ -135,6 +134,7 @@ export class DataSourceSettings extends PureComponent<Props, State> {
to update this datasource.
to update this datasource.
</
div
>
</
div
>
)
}
)
}
<
DataSourceHttpSettings
{
...
props
}
/>
<
div
className=
"gf-form-button-row"
>
<
div
className=
"gf-form-button-row"
>
<
button
type=
"submit"
className=
"btn btn-success"
disabled=
{
this
.
isReadyOnly
()
}
onClick=
{
this
.
onSubmit
}
>
<
button
type=
"submit"
className=
"btn btn-success"
disabled=
{
this
.
isReadyOnly
()
}
onClick=
{
this
.
onSubmit
}
>
Save
&
Test
Save
&
Test
...
@@ -147,7 +147,6 @@ export class DataSourceSettings extends PureComponent<Props, State> {
...
@@ -147,7 +147,6 @@ export class DataSourceSettings extends PureComponent<Props, State> {
</
a
>
</
a
>
</
div
>
</
div
>
</
form
>
</
form
>
<
DataSourceHttpSettings
{
...
props
}
/>
</
div
>
</
div
>
);
);
}
}
...
...
public/app/features/datasources/__mocks__/dataSourcesMocks.ts
View file @
7c3d1012
...
@@ -29,6 +29,9 @@ export const getMockDataSource = (): DataSource => {
...
@@ -29,6 +29,9 @@ export const getMockDataSource = (): DataSource => {
return
{
return
{
access
:
''
,
access
:
''
,
basicAuth
:
false
,
basicAuth
:
false
,
basicAuthUser
:
''
,
basicAuthPassword
:
''
,
withCredentials
:
false
,
database
:
''
,
database
:
''
,
id
:
13
,
id
:
13
,
isDefault
:
false
,
isDefault
:
false
,
...
...
public/app/features/datasources/state/navModel.ts
View file @
7c3d1012
...
@@ -48,6 +48,9 @@ export function getDataSourceLoadingNav(pageName: string): NavModel {
...
@@ -48,6 +48,9 @@ export function getDataSourceLoadingNav(pageName: string): NavModel {
{
{
access
:
''
,
access
:
''
,
basicAuth
:
false
,
basicAuth
:
false
,
basicAuthUser
:
''
,
basicAuthPassword
:
''
,
withCredentials
:
false
,
database
:
''
,
database
:
''
,
id
:
1
,
id
:
1
,
isDefault
:
false
,
isDefault
:
false
,
...
...
public/app/types/datasources.ts
View file @
7c3d1012
...
@@ -35,9 +35,12 @@ export interface DataSource {
...
@@ -35,9 +35,12 @@ export interface DataSource {
user
:
string
;
user
:
string
;
database
:
string
;
database
:
string
;
basicAuth
:
boolean
;
basicAuth
:
boolean
;
basicAuthPassword
:
string
;
basicAuthUser
:
string
;
isDefault
:
boolean
;
isDefault
:
boolean
;
jsonData
:
{
authType
:
string
;
defaultRegion
:
string
};
jsonData
:
{
authType
:
string
;
defaultRegion
:
string
};
readOnly
:
boolean
;
readOnly
:
boolean
;
withCredentials
:
boolean
;
}
}
export
interface
DataSourcesState
{
export
interface
DataSourcesState
{
...
...
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