mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ux: dashboard settings progress
This commit is contained in:
@@ -66,3 +66,15 @@
|
||||
<div class="dashboard-settings__content" ng-if="ctrl.viewId === 'links'" >
|
||||
<dash-links-editor></dash-links-editor>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-settings__content" ng-if="ctrl.viewId === 'versions'" >
|
||||
<gf-dashboard-history dashboard="dashboard"></gf-dashboard-history>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-settings__content" ng-if="ctrl.viewId === 'view_json'" >
|
||||
<h3 class="dashboard-settings__header">View JSON</h3>
|
||||
|
||||
<div class="gf-form">
|
||||
<textarea class="gf-form-input" ng-model="ctrl.json" rows="30" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,7 @@ export class SettingsCtrl {
|
||||
dashboard: DashboardModel;
|
||||
isOpen: boolean;
|
||||
viewId: string;
|
||||
json: string;
|
||||
|
||||
sections: any[] = [
|
||||
{title: 'General', id: 'settings', icon: "fa fa-fw fa-sliders"},
|
||||
@@ -31,21 +32,23 @@ export class SettingsCtrl {
|
||||
for (let section of this.sections) {
|
||||
const sectionParams = _.defaults({editview: section.id}, params);
|
||||
section.url = url + '?' + $.param(sectionParams);
|
||||
console.log(section.url);
|
||||
}
|
||||
|
||||
this.viewId = params.editview;
|
||||
$rootScope.onAppEvent("$routeUpdate", this.onRouteUpdated.bind(this), $scope);
|
||||
|
||||
this.$scope.$on('$destroy', () => {
|
||||
this.dashboard.updateSubmenuVisibility();
|
||||
this.$rootScope.$broadcast("refresh");
|
||||
});
|
||||
|
||||
this.onRouteUpdated();
|
||||
$rootScope.onAppEvent("$routeUpdate", this.onRouteUpdated.bind(this), $scope);
|
||||
}
|
||||
|
||||
onRouteUpdated() {
|
||||
console.log('settings route updated');
|
||||
this.viewId = this.$location.search().editview;
|
||||
|
||||
if (this.viewId) {
|
||||
this.json = JSON.stringify(this.dashboard.getSaveModelClone(), null, 2);
|
||||
}
|
||||
}
|
||||
|
||||
hideSettings() {
|
||||
|
||||
Reference in New Issue
Block a user