forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
105 additions
and
801 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import _ from 'lodash'; | ||
import { DataSource, PluginMeta, NavModel } from 'app/types'; | ||
|
||
export function buildNavModel(ds: DataSource, plugin: PluginMeta, currentPage: string): NavModel { | ||
let title = 'New'; | ||
const subTitle = `Type: ${plugin.name}`; | ||
|
||
if (ds.id) { | ||
title = ds.name; | ||
} | ||
|
||
const main = { | ||
img: plugin.info.logos.large, | ||
id: 'ds-edit-' + plugin.id, | ||
subTitle: subTitle, | ||
url: '', | ||
text: title, | ||
breadcrumbs: [{ title: 'Data Sources', url: 'datasources' }], | ||
children: [ | ||
{ | ||
active: currentPage === 'datasource-settings', | ||
icon: 'fa fa-fw fa-sliders', | ||
id: 'datasource-settings', | ||
text: 'Settings', | ||
url: `datasources/edit/${ds.id}`, | ||
}, | ||
], | ||
}; | ||
|
||
const hasDashboards = _.find(plugin.includes, { type: 'dashboard' }) !== undefined; | ||
if (hasDashboards && ds.id) { | ||
main.children.push({ | ||
active: currentPage === 'datasource-dashboards', | ||
icon: 'fa fa-fw fa-th-large', | ||
id: 'datasource-dashboards', | ||
text: 'Dashboards', | ||
url: `datasources/edit/${ds.id}/dashboards`, | ||
}); | ||
} | ||
|
||
return { | ||
main: main, | ||
node: _.find(main.children, { active: true }), | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.