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
7afb6fa3
Commit
7afb6fa3
authored
Apr 12, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux(ds edit): combine save and test connection buttons, closes #4658
parent
29dff7ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
10 deletions
+13
-10
public/app/features/plugins/ds_edit_ctrl.ts
+10
-3
public/app/features/plugins/partials/ds_edit.html
+2
-6
public/sass/_variables.dark.scss
+1
-1
No files found.
public/app/features/plugins/ds_edit_ctrl.ts
View file @
7afb6fa3
...
...
@@ -16,6 +16,8 @@ var defaults = {
jsonData
:
{}
};
var
datasourceCreated
=
false
;
export
class
DataSourceEditCtrl
{
isNew
:
boolean
;
datasources
:
any
[];
...
...
@@ -66,6 +68,11 @@ export class DataSourceEditCtrl {
this
.
backendSrv
.
get
(
'/api/datasources/'
+
id
).
then
(
ds
=>
{
this
.
isNew
=
false
;
this
.
current
=
ds
;
if
(
datasourceCreated
)
{
datasourceCreated
=
false
;
this
.
testDatasource
();
}
return
this
.
typeChanged
();
});
}
...
...
@@ -123,14 +130,14 @@ export class DataSourceEditCtrl {
if
(
this
.
current
.
id
)
{
return
this
.
backendSrv
.
put
(
'/api/datasources/'
+
this
.
current
.
id
,
this
.
current
).
then
(()
=>
{
this
.
updateFrontendSettings
().
then
(()
=>
{
if
(
test
)
{
this
.
testDatasource
();
}
this
.
testDatasource
();
});
});
}
else
{
return
this
.
backendSrv
.
post
(
'/api/datasources'
,
this
.
current
).
then
(
result
=>
{
this
.
updateFrontendSettings
();
datasourceCreated
=
true
;
this
.
$location
.
path
(
'datasources/edit/'
+
result
.
id
);
});
}
...
...
public/app/features/plugins/partials/ds_edit.html
View file @
7afb6fa3
...
...
@@ -25,7 +25,7 @@
<div
ng-if=
"ctrl.tabIndex === 0"
class=
"tab-content"
>
<form
name=
"ctrl.editForm"
>
<form
name=
"ctrl.editForm"
ng-if=
"ctrl.current"
>
<div
class=
"gf-form-group"
>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form"
>
...
...
@@ -55,7 +55,6 @@
<div
ng-if=
"ctrl.testing"
style=
"margin-top: 25px"
>
<h5
ng-show=
"!ctrl.testing.done"
>
Testing....
<i
class=
"fa fa-spiner fa-spin"
></i></h5>
<h5
ng-show=
"ctrl.testing.done"
>
Test results
</h5>
<div
class=
"alert-{{ctrl.testing.status}} alert"
>
<div
class=
"alert-title"
>
{{ctrl.testing.title}}
</div>
<div
ng-bind=
'ctrl.testing.message'
></div>
...
...
@@ -64,10 +63,7 @@
<div
class=
"gf-form-button-row"
>
<button
type=
"submit"
class=
"btn btn-success"
ng-show=
"ctrl.isNew"
ng-click=
"ctrl.saveChanges()"
>
Add
</button>
<button
type=
"submit"
class=
"btn btn-success"
ng-show=
"!ctrl.isNew"
ng-click=
"ctrl.saveChanges()"
>
Save
</button>
<button
type=
"submit"
class=
"btn btn-secondary"
ng-show=
"!ctrl.isNew"
ng-click=
"ctrl.saveChanges(true)"
>
Test Connection
</button>
<button
type=
"submit"
class=
"btn btn-success"
ng-show=
"!ctrl.isNew"
ng-click=
"ctrl.saveChanges()"
>
Save
&
Test
</button>
<button
type=
"submit"
class=
"btn btn-danger"
ng-show=
"!ctrl.isNew"
ng-click=
"ctrl.delete()"
>
Delete
</button>
...
...
public/sass/_variables.dark.scss
View file @
7afb6fa3
...
...
@@ -27,7 +27,7 @@ $white: #fff;
// -------------------------
$blue
:
#33B5E5
;
$blue-dark
:
#005f81
;
$green
:
#6
699
00
;
$green
:
#6
090
00
;
$red
:
#CC3900
;
$yellow
:
#ECBB13
;
$pink
:
#FF4444
;
...
...
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