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
bce5c447
Commit
bce5c447
authored
Apr 26, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(apps): app dashboards can now be updated, fixes #4817
parent
34cb1754
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
12 deletions
+15
-12
pkg/api/dtos/plugins.go
+1
-1
pkg/api/plugins.go
+1
-0
pkg/plugins/dashboard_importer.go
+7
-5
public/app/features/plugins/import_list/import_list.html
+4
-4
public/app/features/plugins/import_list/import_list.ts
+2
-2
No files found.
pkg/api/dtos/plugins.go
View file @
bce5c447
...
@@ -48,6 +48,6 @@ func (slice PluginList) Swap(i, j int) {
...
@@ -48,6 +48,6 @@ func (slice PluginList) Swap(i, j int) {
type
ImportDashboardCommand
struct
{
type
ImportDashboardCommand
struct
{
PluginId
string
`json:"pluginId"`
PluginId
string
`json:"pluginId"`
Path
string
`json:"path"`
Path
string
`json:"path"`
Reinstall
bool
`json:"reinstall
"`
Overwrite
bool
`json:"overwrite
"`
Inputs
[]
plugins
.
ImportDashboardInput
`json:"inputs"`
Inputs
[]
plugins
.
ImportDashboardInput
`json:"inputs"`
}
}
pkg/api/plugins.go
View file @
bce5c447
...
@@ -161,6 +161,7 @@ func ImportDashboard(c *middleware.Context, apiCmd dtos.ImportDashboardCommand)
...
@@ -161,6 +161,7 @@ func ImportDashboard(c *middleware.Context, apiCmd dtos.ImportDashboardCommand)
PluginId
:
apiCmd
.
PluginId
,
PluginId
:
apiCmd
.
PluginId
,
Path
:
apiCmd
.
Path
,
Path
:
apiCmd
.
Path
,
Inputs
:
apiCmd
.
Inputs
,
Inputs
:
apiCmd
.
Inputs
,
Overwrite
:
apiCmd
.
Overwrite
,
}
}
if
err
:=
bus
.
Dispatch
(
&
cmd
);
err
!=
nil
{
if
err
:=
bus
.
Dispatch
(
&
cmd
);
err
!=
nil
{
...
...
pkg/plugins/dashboard_importer.go
View file @
bce5c447
...
@@ -11,12 +11,13 @@ import (
...
@@ -11,12 +11,13 @@ import (
)
)
type
ImportDashboardCommand
struct
{
type
ImportDashboardCommand
struct
{
Path
string
`json:"string"`
Path
string
Inputs
[]
ImportDashboardInput
`json:"inputs"`
Inputs
[]
ImportDashboardInput
Overwrite
bool
OrgId
int64
`json:"-"`
OrgId
int64
UserId
int64
`json:"-"`
UserId
int64
PluginId
string
`json:"-"`
PluginId
string
Result
*
PluginDashboardInfoDTO
Result
*
PluginDashboardInfoDTO
}
}
...
@@ -67,6 +68,7 @@ func ImportDashboard(cmd *ImportDashboardCommand) error {
...
@@ -67,6 +68,7 @@ func ImportDashboard(cmd *ImportDashboardCommand) error {
Dashboard
:
generatedDash
,
Dashboard
:
generatedDash
,
OrgId
:
cmd
.
OrgId
,
OrgId
:
cmd
.
OrgId
,
UserId
:
cmd
.
UserId
,
UserId
:
cmd
.
UserId
,
Overwrite
:
cmd
.
Overwrite
,
}
}
if
err
:=
bus
.
Dispatch
(
&
saveCmd
);
err
!=
nil
{
if
err
:=
bus
.
Dispatch
(
&
saveCmd
);
err
!=
nil
{
...
...
public/app/features/plugins/import_list/import_list.html
View file @
bce5c447
...
@@ -15,16 +15,16 @@
...
@@ -15,16 +15,16 @@
</td>
</td>
<td>
<td>
v{{dash.revision}}
v{{dash.revision}}
</td
>
<span
ng-if=
"dash.installed"
>
<td
ng-if=
"dash.installed"
>
(Imported v{{dash.installedRevision}})
Imported v{{dash.installedRevision}}
<span>
</td>
</td>
<td
style=
"text-align: right"
>
<td
style=
"text-align: right"
>
<button
class=
"btn btn-secondary"
ng-click=
"ctrl.import(dash, false)"
ng-show=
"!dash.installed"
>
<button
class=
"btn btn-secondary"
ng-click=
"ctrl.import(dash, false)"
ng-show=
"!dash.installed"
>
Import
Import
</button>
</button>
<button
class=
"btn btn-secondary"
ng-click=
"ctrl.import(dash, true)"
ng-show=
"dash.installed"
>
<button
class=
"btn btn-secondary"
ng-click=
"ctrl.import(dash, true)"
ng-show=
"dash.installed"
>
Re-Import
Update
</button>
</button>
<button
class=
"btn btn-danger"
ng-click=
"ctrl.remove(dash)"
ng-show=
"dash.installed"
>
<button
class=
"btn btn-danger"
ng-click=
"ctrl.remove(dash)"
ng-show=
"dash.installed"
>
Delete
Delete
...
...
public/app/features/plugins/import_list/import_list.ts
View file @
bce5c447
...
@@ -43,11 +43,11 @@ export class DashImportListCtrl {
...
@@ -43,11 +43,11 @@ export class DashImportListCtrl {
});
});
}
}
import
(
dash
,
reinstall
)
{
import
(
dash
,
overwrite
)
{
var
installCmd
=
{
var
installCmd
=
{
pluginId
:
this
.
plugin
.
id
,
pluginId
:
this
.
plugin
.
id
,
path
:
dash
.
path
,
path
:
dash
.
path
,
reinstall
:
reinstall
,
overwrite
:
overwrite
,
inputs
:
[]
inputs
:
[]
};
};
...
...
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