]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/lxc/Summary.js
jslint: remove trailing commas
[pve-manager.git] / www / manager6 / lxc / Summary.js
1 Ext.define('PVE.lxc.Summary', {
2 extend: 'Ext.panel.Panel',
3 alias: 'widget.pveLxcSummary',
4
5 tbar: [ '->' , { xtype: 'pveRRDTypeSelector' } ],
6 scrollable: true,
7 bodyStyle: 'padding:10px',
8 defaults: {
9 style: {'padding-top':'10px'},
10 width: 800
11 },
12
13 initComponent: function() {
14 var me = this;
15
16 var nodename = me.pveSelNode.data.node;
17 if (!nodename) {
18 throw "no node name specified";
19 }
20
21 var vmid = me.pveSelNode.data.vmid;
22 if (!vmid) {
23 throw "no VM ID specified";
24 }
25
26 if (!me.workspace) {
27 throw "no workspace specified";
28 }
29
30 if (!me.statusStore) {
31 throw "no status storage specified";
32 }
33
34 var rstore = me.statusStore;
35
36 var statusview = Ext.create('PVE.lxc.StatusView', {
37 title: gettext('Status'),
38 pveSelNode: me.pveSelNode,
39 width: 400,
40 rstore: rstore
41 });
42
43 var notesview = Ext.create('PVE.panel.NotesView', {
44 pveSelNode: me.pveSelNode,
45 flex: 1
46 });
47
48 var rrdstore = Ext.create('PVE.data.RRDStore', {
49 rrdurl: "/api2/json/nodes/" + nodename + "/lxc/" + vmid + "/rrddata"
50 });
51
52 Ext.apply(me, {
53 plugins: {
54 ptype: 'lazyitems',
55 items: [
56 {
57 style: {'padding-top': '0px' },
58 layout: {
59 type: 'hbox',
60 align: 'stretchmax'
61 },
62 border: false,
63 items: [ statusview, notesview ]
64 },
65 {
66 xtype: 'pveRRDChart',
67 title: gettext('CPU usage'),
68 pveSelNode: me.pveSelNode,
69 fields: ['cpu'],
70 fieldTitles: [gettext('CPU usage')],
71 store: rrdstore
72 },
73 {
74 xtype: 'pveRRDChart',
75 title: gettext('Memory usage'),
76 pveSelNode: me.pveSelNode,
77 fields: ['maxmem', 'mem'],
78 fieldTitles: [gettext('Total'), gettext('RAM usage')],
79 store: rrdstore
80 },
81 {
82 xtype: 'pveRRDChart',
83 title: gettext('Network traffic'),
84 pveSelNode: me.pveSelNode,
85 fields: ['netin','netout'],
86 store: rrdstore
87 },
88 {
89 xtype: 'pveRRDChart',
90 title: gettext('Disk IO'),
91 pveSelNode: me.pveSelNode,
92 fields: ['diskread','diskwrite'],
93 store: rrdstore
94 }
95 ]
96 },
97 listeners: {
98 activate: function() { notesview.load(); rrdstore.startUpdate(); },
99 hide: rrdstore.stopUpdate,
100 destroy: rrdstore.stopUpdate
101 }
102 });
103
104 me.callParent();
105 }
106 });