mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(apps): more progress on app pages
This commit is contained in:
parent
18eb9d6076
commit
0def04ad34
@ -1,4 +1,2 @@
|
|||||||
|
|
||||||
<h1>Nginx logs view</h1>
|
|
||||||
|
|
||||||
Logs!
|
Logs!
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
|
|
||||||
<h1>Nginx stream view</h1>
|
streams!
|
||||||
|
|
||||||
testing!
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
///<reference path="../../headers/common.d.ts" />
|
///<reference path="../../headers/common.d.ts" />
|
||||||
|
|
||||||
|
import './dashboard_loaders';
|
||||||
|
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import coreModule from 'app/core/core_module';
|
import coreModule from 'app/core/core_module';
|
||||||
import {BundleLoader} from './bundle_loader';
|
import {BundleLoader} from './bundle_loader';
|
||||||
|
@ -5,19 +5,21 @@ import _ from 'lodash';
|
|||||||
|
|
||||||
export class AppEditCtrl {
|
export class AppEditCtrl {
|
||||||
appModel: any;
|
appModel: any;
|
||||||
|
appId: any;
|
||||||
includedPanels: any;
|
includedPanels: any;
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
constructor(private backendSrv: any, private $routeParams: any) {
|
constructor(private backendSrv: any, private $routeParams: any) {
|
||||||
this.appModel = {};
|
this.appModel = {};
|
||||||
|
this.appId = $routeParams.appId;
|
||||||
|
|
||||||
this.backendSrv.get(`/api/org/apps/${this.$routeParams.appId}/settings`).then(result => {
|
this.backendSrv.get(`/api/org/apps/${this.appId}/settings`).then(result => {
|
||||||
this.appModel = result;
|
this.appModel = result;
|
||||||
this.includedPanels = _.where(result.includes, {type: 'panel'});
|
this.includedPanels = _.where(result.includes, {type: 'panel'});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
update(options) {
|
update() {
|
||||||
var updateCmd = _.extend({
|
var updateCmd = _.extend({
|
||||||
appId: this.appModel.appId,
|
appId: this.appModel.appId,
|
||||||
orgId: this.appModel.orgId,
|
orgId: this.appModel.orgId,
|
||||||
@ -25,19 +27,19 @@ export class AppEditCtrl {
|
|||||||
pinned: this.appModel.pinned,
|
pinned: this.appModel.pinned,
|
||||||
jsonData: this.appModel.jsonData,
|
jsonData: this.appModel.jsonData,
|
||||||
secureJsonData: this.appModel.secureJsonData,
|
secureJsonData: this.appModel.secureJsonData,
|
||||||
}, options);
|
}, {});
|
||||||
|
|
||||||
this.backendSrv.post(`/api/org/apps/${this.$routeParams.appId}/settings`, updateCmd).then(function() {
|
this.backendSrv.post(`/api/org/apps/${this.appId}/settings`, updateCmd).then(function() {
|
||||||
window.location.href = window.location.href;
|
window.location.href = window.location.href;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleEnabled() {
|
toggleEnabled() {
|
||||||
this.update({enabled: this.appModel.enabled});
|
this.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
togglePinned() {
|
togglePinned() {
|
||||||
this.update({pinned: this.appModel.pinned});
|
this.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,9 +6,8 @@ export class AppListCtrl {
|
|||||||
apps: any[];
|
apps: any[];
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
constructor(private backendSrv: any) {}
|
constructor(private backendSrv: any) {
|
||||||
|
|
||||||
init() {
|
|
||||||
this.backendSrv.get('api/org/apps').then(apps => {
|
this.backendSrv.get('api/org/apps').then(apps => {
|
||||||
this.apps = apps;
|
this.apps = apps;
|
||||||
});
|
});
|
||||||
|
@ -5,11 +5,14 @@ import _ from 'lodash';
|
|||||||
|
|
||||||
export class AppPageCtrl {
|
export class AppPageCtrl {
|
||||||
page: any;
|
page: any;
|
||||||
|
appId: any;
|
||||||
appModel: any;
|
appModel: any;
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
constructor(private backendSrv, private $routeParams: any, private $rootScope) {
|
constructor(private backendSrv, private $routeParams: any, private $rootScope) {
|
||||||
this.backendSrv.get(`/api/org/apps/${this.$routeParams.appId}/settings`).then(app => {
|
this.appId = $routeParams.appId;
|
||||||
|
|
||||||
|
this.backendSrv.get(`/api/org/apps/${this.appId}/settings`).then(app => {
|
||||||
this.appModel = app;
|
this.appModel = app;
|
||||||
this.page = _.findWhere(app.pages, {slug: this.$routeParams.slug});
|
this.page = _.findWhere(app.pages, {slug: this.$routeParams.slug});
|
||||||
if (!this.page) {
|
if (!this.page) {
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li ng-repeat="page in ctrl.appModel.pages">
|
<li ng-repeat="page in ctrl.appModel.pages">
|
||||||
<a href="{{page.url}}" class="external-link">{{page.name}}</a>
|
<a href="apps/{{ctrl.appId}}/page/{{page.slug}}" class="external-link">{{page.name}}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
</navbar>
|
</navbar>
|
||||||
|
|
||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
<div class="page-wide" ng-init="ctrl.init()">
|
<div class="page-wide">
|
||||||
<h1>Apps</h1>
|
<h1>Apps</h1>
|
||||||
|
|
||||||
<div ng-if="!ctrl.apps">
|
<div ng-if="!ctrl.apps">
|
||||||
@ -18,7 +18,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<div class="filter-list-card-controls">
|
<div class="filter-list-card-controls">
|
||||||
<div class="filter-list-card-config">
|
<div class="filter-list-card-config">
|
||||||
<a href="apps/edit/{{app.appId}}">
|
<a href="apps/{{app.appId}}/edit">
|
||||||
<i class="fa fa-cog"></i>
|
<i class="fa fa-cog"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
<navbar icon="fa fa-fw fa-cubes" title="{{ctrl.appModel.name}}" subnav="true">
|
<navbar icon="fa fa-fw fa-cubes" title="{{ctrl.appModel.name}}" title-url="apps/{{ctrl.appId}}/edit" subnav="true">
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
<li class="active"><a href="apps/nginx">{{ctrl.page.name}}</a></li>
|
<li class="active"><a href="apps/{{ctrl.appId}}/ctrl.page.slug">{{ctrl.page.name}}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</navbar>
|
</navbar>
|
||||||
|
|
||||||
<h2>
|
<div class="page-container">
|
||||||
App page
|
<div class="page-wide">
|
||||||
</h2>
|
<h1>{{ctrl.page.name}}</h1>
|
||||||
|
|
||||||
<div ng-if="ctrl.page">
|
<div ng-if="ctrl.page">
|
||||||
<plugin-component type="app-page" page="ctrl.page">
|
<plugin-component type="app-page">
|
||||||
</plugin-component>
|
</plugin-component>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user