mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fixed the subUrl bugs from https://community.grafana.com/t/suburl-not-work-at-some-links-and-buttons/4701 with folder/settings/teams etc.
This commit is contained in:
10
public/app/features/dashboard/folder_page_loader.ts
Normal file → Executable file
10
public/app/features/dashboard/folder_page_loader.ts
Normal file → Executable file
@@ -11,28 +11,28 @@ export class FolderPageLoader {
|
|||||||
subTitle: 'Manage folder dashboards & permissions',
|
subTitle: 'Manage folder dashboards & permissions',
|
||||||
url: '',
|
url: '',
|
||||||
text: '',
|
text: '',
|
||||||
breadcrumbs: [{ title: 'Dashboards', url: '/dashboards' }, { title: ' ' }],
|
breadcrumbs: [{ title: 'Dashboards', url: 'dashboards' }, { title: ' ' }],
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
active: activeChildId === 'manage-folder-dashboards',
|
active: activeChildId === 'manage-folder-dashboards',
|
||||||
icon: 'fa fa-fw fa-th-large',
|
icon: 'fa fa-fw fa-th-large',
|
||||||
id: 'manage-folder-dashboards',
|
id: 'manage-folder-dashboards',
|
||||||
text: 'Dashboards',
|
text: 'Dashboards',
|
||||||
url: '/dashboards',
|
url: 'dashboards',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
active: activeChildId === 'manage-folder-permissions',
|
active: activeChildId === 'manage-folder-permissions',
|
||||||
icon: 'fa fa-fw fa-lock',
|
icon: 'fa fa-fw fa-lock',
|
||||||
id: 'manage-folder-permissions',
|
id: 'manage-folder-permissions',
|
||||||
text: 'Permissions',
|
text: 'Permissions',
|
||||||
url: '/dashboards/permissions',
|
url: 'dashboards/permissions',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
active: activeChildId === 'manage-folder-settings',
|
active: activeChildId === 'manage-folder-settings',
|
||||||
icon: 'fa fa-fw fa-cog',
|
icon: 'fa fa-fw fa-cog',
|
||||||
id: 'manage-folder-settings',
|
id: 'manage-folder-settings',
|
||||||
text: 'Settings',
|
text: 'Settings',
|
||||||
url: '/dashboards/settings',
|
url: 'dashboards/settings',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -41,7 +41,7 @@ export class FolderPageLoader {
|
|||||||
return this.backendSrv.getDashboard('db', this.$routeParams.slug).then(result => {
|
return this.backendSrv.getDashboard('db', this.$routeParams.slug).then(result => {
|
||||||
const folderTitle = result.dashboard.title;
|
const folderTitle = result.dashboard.title;
|
||||||
ctrl.navModel.main.text = '';
|
ctrl.navModel.main.text = '';
|
||||||
ctrl.navModel.main.breadcrumbs = [{ title: 'Dashboards', url: '/dashboards' }, { title: folderTitle }];
|
ctrl.navModel.main.breadcrumbs = [{ title: 'Dashboards', url: 'dashboards' }, { title: folderTitle }];
|
||||||
|
|
||||||
const folderUrl = this.createFolderUrl(folderId, result.meta.type, result.meta.slug);
|
const folderUrl = this.createFolderUrl(folderId, result.meta.type, result.meta.slug);
|
||||||
|
|
||||||
|
|||||||
3
public/app/features/dashboard/settings/settings.ts
Normal file → Executable file
3
public/app/features/dashboard/settings/settings.ts
Normal file → Executable file
@@ -2,6 +2,7 @@ import { coreModule, appEvents, contextSrv } from 'app/core/core';
|
|||||||
import { DashboardModel } from '../dashboard_model';
|
import { DashboardModel } from '../dashboard_model';
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
import config from 'app/core/config';
|
||||||
|
|
||||||
export class SettingsCtrl {
|
export class SettingsCtrl {
|
||||||
dashboard: DashboardModel;
|
dashboard: DashboardModel;
|
||||||
@@ -86,7 +87,7 @@ export class SettingsCtrl {
|
|||||||
|
|
||||||
for (let section of this.sections) {
|
for (let section of this.sections) {
|
||||||
const sectionParams = _.defaults({ editview: section.id }, params);
|
const sectionParams = _.defaults({ editview: section.id }, params);
|
||||||
section.url = url + '?' + $.param(sectionParams);
|
section.url = config.appSubUrl + url + '?' + $.param(sectionParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
public/app/features/org/partials/teams.html
Normal file → Executable file
2
public/app/features/org/partials/teams.html
Normal file → Executable file
@@ -8,7 +8,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="page-action-bar__spacer"></div>
|
<div class="page-action-bar__spacer"></div>
|
||||||
|
|
||||||
<a class="btn btn-success" href="/org/teams/new">
|
<a class="btn btn-success" href="org/teams/new">
|
||||||
<i class="fa fa-plus"></i>
|
<i class="fa fa-plus"></i>
|
||||||
Add Team
|
Add Team
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user