mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 11:12:58 +08:00
28 lines
716 B
TypeScript
28 lines
716 B
TypeScript
///<reference path="../../headers/common.d.ts" />
|
|
|
|
import angular from 'angular';
|
|
import _ from 'lodash';
|
|
|
|
export class AppPageCtrl {
|
|
page: any;
|
|
pluginId: any;
|
|
appModel: any;
|
|
|
|
/** @ngInject */
|
|
constructor(private backendSrv, private $routeParams: any, private $rootScope) {
|
|
this.pluginId = $routeParams.pluginId;
|
|
|
|
this.backendSrv.get(`/api/plugins/${this.pluginId}/settings`).then(app => {
|
|
this.appModel = app;
|
|
this.page = _.findWhere(app.includes, {slug: this.$routeParams.slug});
|
|
|
|
if (!this.page) {
|
|
this.$rootScope.appEvent('alert-error', ['App Page Not Found', '']);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
angular.module('grafana.controllers').controller('AppPageCtrl', AppPageCtrl);
|
|
|