mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
WIP: refactor folder-picker for dashlist
This commit is contained in:
@@ -12,6 +12,7 @@ class DashListCtrl extends PanelCtrl {
|
||||
modes: any[];
|
||||
|
||||
panelDefaults = {
|
||||
folder: '',
|
||||
query: '',
|
||||
limit: 10,
|
||||
tags: [],
|
||||
@@ -19,6 +20,7 @@ class DashListCtrl extends PanelCtrl {
|
||||
search: false,
|
||||
starred: true,
|
||||
headings: true,
|
||||
folderId: 0
|
||||
};
|
||||
|
||||
/** @ngInject */
|
||||
@@ -87,6 +89,7 @@ class DashListCtrl extends PanelCtrl {
|
||||
limit: this.panel.limit,
|
||||
query: this.panel.query,
|
||||
tag: this.panel.tags,
|
||||
folderId: this.panel.folderId
|
||||
};
|
||||
|
||||
return this.backendSrv.search(params).then(result => {
|
||||
@@ -123,6 +126,11 @@ class DashListCtrl extends PanelCtrl {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onFolderChange(parentId) {
|
||||
this.$scope.$parent.ctrl.panel.folderId = parentId;
|
||||
this.$scope.$parent.ctrl.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
export {DashListCtrl, DashListCtrl as PanelCtrl};
|
||||
|
||||
Reference in New Issue
Block a user