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
40c83e3e
Commit
40c83e3e
authored
Jan 31, 2018
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboards: update dashboard/folder url if browser url is not the same as from backend
parent
c0c3f17d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
8 deletions
+24
-8
public/app/features/dashboard/folder_dashboards_ctrl.ts
+6
-2
public/app/features/dashboard/folder_permissions_ctrl.ts
+6
-2
public/app/features/dashboard/folder_settings_ctrl.ts
+8
-4
public/app/routes/dashboard_loaders.ts
+4
-0
No files found.
public/app/features/dashboard/folder_dashboards_ctrl.ts
View file @
40c83e3e
...
@@ -6,13 +6,17 @@ export class FolderDashboardsCtrl {
...
@@ -6,13 +6,17 @@ export class FolderDashboardsCtrl {
uid
:
string
;
uid
:
string
;
/** @ngInject */
/** @ngInject */
constructor
(
private
backendSrv
,
navModelSrv
,
private
$routeParams
)
{
constructor
(
private
backendSrv
,
navModelSrv
,
private
$routeParams
,
$location
)
{
if
(
this
.
$routeParams
.
uid
)
{
if
(
this
.
$routeParams
.
uid
)
{
this
.
uid
=
$routeParams
.
uid
;
this
.
uid
=
$routeParams
.
uid
;
const
loader
=
new
FolderPageLoader
(
this
.
backendSrv
);
const
loader
=
new
FolderPageLoader
(
this
.
backendSrv
);
loader
.
load
(
this
,
this
.
uid
,
'manage-folder-dashboards'
);
loader
.
load
(
this
,
this
.
uid
,
'manage-folder-dashboards'
).
then
(
folder
=>
{
if
(
$location
.
path
()
!==
folder
.
meta
.
url
)
{
$location
.
path
(
folder
.
meta
.
url
).
replace
();
}
});
}
}
}
}
}
}
public/app/features/dashboard/folder_permissions_ctrl.ts
View file @
40c83e3e
...
@@ -6,11 +6,15 @@ export class FolderPermissionsCtrl {
...
@@ -6,11 +6,15 @@ export class FolderPermissionsCtrl {
uid
:
string
;
uid
:
string
;
/** @ngInject */
/** @ngInject */
constructor
(
private
backendSrv
,
navModelSrv
,
private
$routeParams
)
{
constructor
(
private
backendSrv
,
navModelSrv
,
private
$routeParams
,
$location
)
{
if
(
this
.
$routeParams
.
uid
)
{
if
(
this
.
$routeParams
.
uid
)
{
this
.
uid
=
$routeParams
.
uid
;
this
.
uid
=
$routeParams
.
uid
;
new
FolderPageLoader
(
this
.
backendSrv
).
load
(
this
,
this
.
uid
,
'manage-folder-permissions'
);
new
FolderPageLoader
(
this
.
backendSrv
).
load
(
this
,
this
.
uid
,
'manage-folder-permissions'
).
then
(
folder
=>
{
if
(
$location
.
path
()
!==
folder
.
meta
.
url
)
{
$location
.
path
(
`
${
folder
.
meta
.
url
}
/permissions`
).
replace
();
}
});
}
}
}
}
}
}
public/app/features/dashboard/folder_settings_ctrl.ts
View file @
40c83e3e
...
@@ -18,10 +18,14 @@ export class FolderSettingsCtrl {
...
@@ -18,10 +18,14 @@ export class FolderSettingsCtrl {
this
.
uid
=
$routeParams
.
uid
;
this
.
uid
=
$routeParams
.
uid
;
this
.
folderPageLoader
=
new
FolderPageLoader
(
this
.
backendSrv
);
this
.
folderPageLoader
=
new
FolderPageLoader
(
this
.
backendSrv
);
this
.
folderPageLoader
.
load
(
this
,
this
.
uid
,
'manage-folder-settings'
).
then
(
result
=>
{
this
.
folderPageLoader
.
load
(
this
,
this
.
uid
,
'manage-folder-settings'
).
then
(
folder
=>
{
this
.
dashboard
=
result
.
dashboard
;
if
(
$location
.
path
()
!==
folder
.
meta
.
url
)
{
this
.
meta
=
result
.
meta
;
$location
.
path
(
`
${
folder
.
meta
.
url
}
/settings`
).
replace
();
this
.
canSave
=
result
.
meta
.
canSave
;
}
this
.
dashboard
=
folder
.
dashboard
;
this
.
meta
=
folder
.
meta
;
this
.
canSave
=
folder
.
meta
.
canSave
;
this
.
title
=
this
.
dashboard
.
title
;
this
.
title
=
this
.
dashboard
.
title
;
});
});
}
}
...
...
public/app/routes/dashboard_loaders.ts
View file @
40c83e3e
...
@@ -29,6 +29,10 @@ export class LoadDashboardCtrl {
...
@@ -29,6 +29,10 @@ export class LoadDashboardCtrl {
}
}
dashboardLoaderSrv
.
loadDashboard
(
$routeParams
.
type
,
$routeParams
.
slug
,
$routeParams
.
uid
).
then
(
function
(
result
)
{
dashboardLoaderSrv
.
loadDashboard
(
$routeParams
.
type
,
$routeParams
.
slug
,
$routeParams
.
uid
).
then
(
function
(
result
)
{
if
(
$location
.
path
()
!==
result
.
meta
.
url
)
{
$location
.
path
(
result
.
meta
.
url
).
replace
();
}
if
(
$routeParams
.
keepRows
)
{
if
(
$routeParams
.
keepRows
)
{
result
.
meta
.
keepRows
=
true
;
result
.
meta
.
keepRows
=
true
;
}
}
...
...
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