Commit 0bd9939a authored by Thomas Lamprecht's avatar Thomas Lamprecht Committed by Dietmar Maurer

replace OpenVZ API calls in mobile UI with LXC

Signed-off-by: 's avatarThomas Lamprecht <t.lamprecht@proxmox.com>
parent be34116f
Ext.define('PVE.OpenVzSummary', {
Ext.define('PVE.LXCSummary', {
extend: 'PVE.Page',
alias: 'widget.pveOpenVzSummary',
alias: 'widget.pveLXCSummary',
statics: {
pathMatch: function(loc) {
return loc.match(/^nodes\/([^\s\/]+)\/openvz\/(\d+)$/);
return loc.match(/^nodes\/([^\s\/]+)\/lxc\/(\d+)$/);
}
},
......@@ -16,7 +16,7 @@ Ext.define('PVE.OpenVzSummary', {
PVE.Utils.API2Request({
params: params,
url: '/nodes/' + me.nodename + '/openvz/' + me.vmid + '/status/' + cmd,
url: '/nodes/' + me.nodename + '/lxc/' + me.vmid + '/status/' + cmd,
method: 'POST',
success: function(response, opts) {
var upid = response.result.data;
......@@ -46,7 +46,7 @@ Ext.define('PVE.OpenVzSummary', {
{
xtype: 'pveMenuButton',
align: 'right',
pveStdMenu: true,
pveStdMenu: true
}
]
},
......@@ -57,10 +57,13 @@ Ext.define('PVE.OpenVzSummary', {
style: 'background-color:white;',
tpl: [
'<table style="margin-bottom:0px;">',
'<tr><td>Status:</td><td>{status}</td></tr>',
'<tr><td>Memory:</td><td>{[this.meminfo(values)]}</td></tr>',
'<tr><td>CPU:</td><td>{[this.cpuinfo(values)]}</td></tr>',
'<tr><td>Uptime:</td><td>{[PVE.Utils.format_duration_long(values.uptime)]}</td></tr>',
'<tr><td>Uptime:</td><td>{[PVE.Utils.format_duration_long'+
'(values.uptime)]}</td></tr>',
'</table>',
{
meminfo: function(values) {
......@@ -113,7 +116,7 @@ Ext.define('PVE.OpenVzSummary', {
};
PVE.Utils.API2Request({
url: '/nodes/' + me.nodename + '/openvz/' + me.vmid + '/status/current',
url: '/nodes/' + me.nodename + '/lxc/' + me.vmid + '/status/current',
method: 'GET',
success: function(response) {
var d = response.result.data;
......@@ -125,12 +128,13 @@ Ext.define('PVE.OpenVzSummary', {
var ctc = me.down('#ctconfig');
PVE.Utils.API2Request({
url: '/nodes/' + me.nodename + '/openvz/' + me.vmid + '/config',
url: '/nodes/' + me.nodename + '/lxc/' + me.vmid + '/config',
method: 'GET',
success: function(response) {
var d = response.result.data;
var names = ['hostname', 'memory', 'swap', 'cpus', 'ostemplate',
'ip_address', 'nameserver', 'searchdomain', 'netif'];
'ip_address', 'nameserver', 'searchdomain',
'netif'];
var kv = PVE.Workspace.obj_to_kv(d, names);
ctc.setData(kv);
},
......@@ -185,19 +189,22 @@ Ext.define('PVE.OpenVzSummary', {
{
text: gettext('Migrate'),
handler: function() {
PVE.Workspace.gotoPage('nodes/' + me.nodename + '/openvz/' + me.vmid + '/migrate');
PVE.Workspace.gotoPage('nodes/' + me.nodename + '/lxc/'
+ me.vmid + '/migrate');
}
},
{
text: gettext('Console'),
handler: function() {
PVE.Utils.openConsoleWindow('html5', 'openvz', me.vmid, me.nodename);
PVE.Utils.openConsoleWindow('html5', 'lxc', me.vmid,
me.nodename);
}
},
{
text: gettext('Spice'),
handler: function() {
PVE.Utils.openConsoleWindow('vv', 'openvz', me.vmid, me.nodename);
PVE.Utils.openConsoleWindow('vv', 'lxc', me.vmid,
me.nodename);
}
}
]);
......
......@@ -18,7 +18,7 @@ JSSRC= \
NodeSummary.js \
Migrate.js \
QemuSummary.js \
OpenVzSummary.js \
LXCSummary.js \
app.js
all: pvemanager-mobile.js
......
......@@ -3,7 +3,7 @@ Ext.define('PVE.MigrateBase', {
nodename: undefined,
vmid: undefined,
vmtype: undefined, // qemu or openvz
vmtype: undefined, // qemu or lxc
config: {
items: [
......@@ -110,14 +110,14 @@ Ext.define('PVE.QemuMigrate', {
}
});
Ext.define('PVE.OpenVzMigrate', {
Ext.define('PVE.LXCMigrate', {
extend: 'PVE.MigrateBase',
vmtype: 'openvz',
vmtype: 'lxc',
statics: {
pathMatch: function(loc) {
return loc.match(/^nodes\/([^\s\/]+)\/openvz\/(\d+)\/migrate$/);
return loc.match(/^nodes\/([^\s\/]+)\/lxc\/(\d+)\/migrate$/);
}
},
......
......@@ -141,14 +141,14 @@ Ext.define('PVE.NodeSummary', {
};
PVE.Utils.API2Request({
url: '/nodes/' + me.nodename + '/openvz',
url: '/nodes/' + me.nodename + '/lxc',
method: 'GET',
success: function(response) {
var d = response.result.data;
d.nodename = me.nodename;
d.forEach(function(el) { el.type = 'openvz'; el.nodename = me.nodename });
d.forEach(function(el) { el.type = 'lxc'; el.nodename = me.nodename });
me.store.each(function(rec) {
if (rec.get('type') === 'openvz') {
if (rec.get('type') === 'lxc') {
rec.destroy();
}
});
......
......@@ -52,8 +52,8 @@ Ext.define('PVE.Workspace', { statics: {
history: null,
pages: [
'PVE.OpenVzMigrate',
'PVE.OpenVzSummary',
'PVE.LXCMigrate',
'PVE.LXCSummary',
'PVE.QemuMigrate',
'PVE.QemuSummary',
'PVE.NodeSummary',
......
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