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!
|
||||
|
@ -1,4 +1,2 @@
|
||||
|
||||
<h1>Nginx stream view</h1>
|
||||
|
||||
testing!
|
||||
streams!
|
||||
|
@ -1,5 +1,7 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import './dashboard_loaders';
|
||||
|
||||
import angular from 'angular';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import {BundleLoader} from './bundle_loader';
|
||||
|
@ -5,19 +5,21 @@ import _ from 'lodash';
|
||||
|
||||
export class AppEditCtrl {
|
||||
appModel: any;
|
||||
appId: any;
|
||||
includedPanels: any;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private backendSrv: any, private $routeParams: any) {
|
||||
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.includedPanels = _.where(result.includes, {type: 'panel'});
|
||||
});
|
||||
}
|
||||
|
||||
update(options) {
|
||||
update() {
|
||||
var updateCmd = _.extend({
|
||||
appId: this.appModel.appId,
|
||||
orgId: this.appModel.orgId,
|
||||
@ -25,19 +27,19 @@ export class AppEditCtrl {
|
||||
pinned: this.appModel.pinned,
|
||||
jsonData: this.appModel.jsonData,
|
||||
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;
|
||||
});
|
||||
}
|
||||
|
||||
toggleEnabled() {
|
||||
this.update({enabled: this.appModel.enabled});
|
||||
this.update();
|
||||
}
|
||||
|
||||
togglePinned() {
|
||||
this.update({pinned: this.appModel.pinned});
|
||||
this.update();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,9 +6,8 @@ export class AppListCtrl {
|
||||
apps: any[];
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private backendSrv: any) {}
|
||||
constructor(private backendSrv: any) {
|
||||
|
||||
init() {
|
||||
this.backendSrv.get('api/org/apps').then(apps => {
|
||||
this.apps = apps;
|
||||
});
|
||||
|
@ -5,11 +5,14 @@ import _ from 'lodash';
|
||||
|
||||
export class AppPageCtrl {
|
||||
page: any;
|
||||
appId: any;
|
||||
appModel: any;
|
||||
|
||||
/** @ngInject */
|
||||
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.page = _.findWhere(app.pages, {slug: this.$routeParams.slug});
|
||||
if (!this.page) {
|
||||
|
@ -78,7 +78,7 @@
|
||||
</div>
|
||||
<ul>
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -2,7 +2,7 @@
|
||||
</navbar>
|
||||
|
||||
<div class="page-container">
|
||||
<div class="page-wide" ng-init="ctrl.init()">
|
||||
<div class="page-wide">
|
||||
<h1>Apps</h1>
|
||||
|
||||
<div ng-if="!ctrl.apps">
|
||||
@ -18,7 +18,7 @@
|
||||
<li>
|
||||
<div class="filter-list-card-controls">
|
||||
<div class="filter-list-card-config">
|
||||
<a href="apps/edit/{{app.appId}}">
|
||||
<a href="apps/{{app.appId}}/edit">
|
||||
<i class="fa fa-cog"></i>
|
||||
</a>
|
||||
</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">
|
||||
<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>
|
||||
</navbar>
|
||||
|
||||
<h2>
|
||||
App page
|
||||
</h2>
|
||||
<div class="page-container">
|
||||
<div class="page-wide">
|
||||
<h1>{{ctrl.page.name}}</h1>
|
||||
|
||||
<div ng-if="ctrl.page">
|
||||
<plugin-component type="app-page" page="ctrl.page">
|
||||
</plugin-component>
|
||||
<div ng-if="ctrl.page">
|
||||
<plugin-component type="app-page">
|
||||
</plugin-component>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user