Commit c4fa90fb authored by Alexandre Derumier's avatar Alexandre Derumier Committed by Dietmar Maurer

add snapshot selector

Signed-off-by: 's avatarAlexandre Derumier <aderumier@odiso.com>
parent 49e72b9b
......@@ -45,6 +45,7 @@ JSSRC= \
form/LanguageSelector.js \
form/DisplaySelector.js \
form/CacheTypeSelector.js \
form/SnapshotSelector.js \
form/ContentTypeSelector.js \
form/DayOfWeekSelector.js \
form/BackupModeSelector.js \
......
Ext.define('PVE.form.SnapshotSelector', {
extend: 'PVE.form.ComboGrid',
alias: ['widget.PVE.form.SnapshotSelector'],
loadStore: function(nodename, vmid) {
var me = this;
if (!nodename) {
return;
}
me.nodename = nodename;
if (!vmid) {
return
}
me.vmid = vmid;
me.store.setProxy({
type: 'pve',
url: '/api2/json/nodes/' + me.nodename + '/qemu/' + me.vmid +'/snapshot'
});
me.store.load();
},
initComponent: function() {
var me = this;
if (!me.nodename) {
throw "no node name specified";
}
if (!me.vmid) {
throw "no VM ID specified";
}
var store = Ext.create('Ext.data.Store', {
fields: [ 'name'],
filterOnLoad: true,
});
Ext.apply(me, {
store: store,
valueField: 'name',
displayField: 'name',
listConfig: {
columns: [
{
header: 'Snapshot',
dataIndex: 'name',
hideable: false,
flex: 1
},
]
}
});
me.callParent();
me.loadStore(me.nodename, me.vmid);
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment