ui: ds content: add reload button, use view controller
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
d9c38ddc1b
commit
f1baa7f4fc
@ -29,7 +29,8 @@ pam = "0.7"
|
||||
pam-sys = "0.5"
|
||||
percent-encoding = "2.1"
|
||||
pin-utils = "0.1.0-alpha"
|
||||
proxmox = { git = "ssh://gitolite3@proxdev.maurer-it.com/rust/proxmox", version = "0.1", features = [ "sortable-macro", "api-macro" ] }
|
||||
#proxmox = { git = "ssh://gitolite3@proxdev.maurer-it.com/rust/proxmox", version = "0.1", features = [ "sortable-macro", "api-macro" ] }
|
||||
proxmox = { path = "/root/sources/pbs/proxmox/proxmox", version = "0.1", features = [ "sortable-macro", "api-macro" ] }
|
||||
regex = "1.2"
|
||||
rustyline = "5.0.5"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
|
@ -13,6 +13,32 @@ Ext.define('PBS.DataStoreContent', {
|
||||
extend: 'Ext.grid.GridPanel',
|
||||
alias: 'widget.pbsDataStoreContent',
|
||||
|
||||
controller: {
|
||||
xclass: 'Ext.app.ViewController',
|
||||
|
||||
init: function(view) {
|
||||
if (!view.datastore) {
|
||||
throw "no datastore specified";
|
||||
}
|
||||
|
||||
view.title = gettext('Data Store Content: ') + view.datastore;
|
||||
|
||||
Proxmox.Utils.monStoreErrors(view, view.store, true);
|
||||
this.reload(); // initial load
|
||||
},
|
||||
|
||||
reload: function() {
|
||||
var view = this.getView();
|
||||
|
||||
let url = `/api2/json/admin/datastore/${view.datastore}/snapshots`;
|
||||
view.store.setProxy({
|
||||
type: 'proxmox',
|
||||
url: url
|
||||
});
|
||||
view.store.load();
|
||||
},
|
||||
},
|
||||
|
||||
columns: [
|
||||
{
|
||||
header: gettext('Type'),
|
||||
@ -42,32 +68,16 @@ Ext.define('PBS.DataStoreContent', {
|
||||
},
|
||||
],
|
||||
|
||||
tbar: [
|
||||
{
|
||||
text: gettext('Reload'),
|
||||
iconCls: 'fa fa-refresh',
|
||||
handler: 'reload',
|
||||
},
|
||||
],
|
||||
|
||||
store: {
|
||||
model: 'pbs-data-store-content',
|
||||
sorters: 'name',
|
||||
},
|
||||
|
||||
reload: function() {
|
||||
let url = `/api2/json/admin/datastore/${this.datastore}/snapshots`;
|
||||
this.store.setProxy({
|
||||
type: 'proxmox',
|
||||
url: url
|
||||
});
|
||||
this.store.load();
|
||||
},
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
||||
if (!me.datastore) {
|
||||
throw "no datastore specified";
|
||||
}
|
||||
|
||||
me.title = gettext('Data Store Content: ') + me.datastore;
|
||||
|
||||
me.callParent();
|
||||
|
||||
Proxmox.Utils.monStoreErrors(me, me.store, true);
|
||||
me.reload(); // initial load
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user