forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'grafana/master' into useQueryRunner-in-…
…MetricPanelCtrl * grafana/master: (24 commits) CSV: escape quotes in toCSV (grafana#16874) Dashboard: Lazy load out of view panels (grafana#15554) LDAP: Added reload endpoint for LDAP config (grafana#15470) PluginsList: Removed icons and updated snapshots (grafana#16872) Panels: Fixed issue with panel type change and data updates (grafana#16871) Chore: fix modes for non-executable files (grafana#16864) DataSourceSettings: Minor fix for uncontrolled input (grafana#16863) Chore: Lowered implicit anys limit to 5623 TestData: Add dashboards to testdata (grafana#16855) Input Datasource: convert from angular config to react ConfigEditor (grafana#16856) DataSources: minor typescript cleanups and comments (grafana#16860) TestDataDatasource: Add config editor (grafana#16861) App Plugins: support react pages and tabs (grafana#16586) Add Windows MSI generation to build process (grafana#16502) Datasources: add support for POST HTTP verb for InfluxDB (grafana#16690) Add pattern validation in configs (grafana#16837) Search: Enable filtering dashboards in search by current folder (grafana#16790) FormLabel: allow any rather than just a string for tooltip (grafana#16841) prometheus: fix regression after adding support for tracing headers (grafana#16829) area/circleci: Speed up circleci build process for branches and pr (grafana#16778) ...
- Loading branch information
Showing
141 changed files
with
4,022 additions
and
1,010 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { ComponentClass } from 'react'; | ||
import { NavModel } from './navModel'; | ||
import { PluginMeta, PluginIncludeType, GrafanaPlugin } from './plugin'; | ||
|
||
export interface AppRootProps { | ||
meta: AppPluginMeta; | ||
|
||
path: string; // The URL path to this page | ||
query: { [s: string]: any }; // The URL query parameters | ||
|
||
/** | ||
* Pass the nav model to the container... is there a better way? | ||
*/ | ||
onNavChanged: (nav: NavModel) => void; | ||
} | ||
|
||
export interface AppPluginMeta extends PluginMeta { | ||
// TODO anything specific to apps? | ||
} | ||
|
||
export class AppPlugin extends GrafanaPlugin<AppPluginMeta> { | ||
// Content under: /a/${plugin-id}/* | ||
root?: ComponentClass<AppRootProps>; | ||
rootNav?: NavModel; // Initial navigation model | ||
|
||
// Old style pages | ||
angularPages?: { [component: string]: any }; | ||
|
||
/** | ||
* Set the component displayed under: | ||
* /a/${plugin-id}/* | ||
*/ | ||
setRootPage(root: ComponentClass<AppRootProps>, rootNav?: NavModel) { | ||
this.root = root; | ||
this.rootNav = rootNav; | ||
return this; | ||
} | ||
|
||
setComponentsFromLegacyExports(pluginExports: any) { | ||
if (pluginExports.ConfigCtrl) { | ||
this.angularConfigCtrl = pluginExports.ConfigCtrl; | ||
} | ||
|
||
const { meta } = this; | ||
if (meta && meta.includes) { | ||
for (const include of meta.includes) { | ||
const { type, component } = include; | ||
if (type === PluginIncludeType.page && component) { | ||
const exp = pluginExports[component]; | ||
if (!exp) { | ||
console.warn('App Page uses unknown component: ', component, meta); | ||
continue; | ||
} | ||
if (!this.angularPages) { | ||
this.angularPages = {}; | ||
} | ||
this.angularPages[component] = exp; | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.