]>
Commit | Line | Data |
---|---|---|
cd81cc2a DC |
1 | Ext.define('PVE.dc.NodeView', { |
2 | extend: 'Ext.grid.GridPanel', | |
cf8b372a | 3 | alias: 'widget.pveDcNodeView', |
cd81cc2a | 4 | |
cf8b372a DC |
5 | title: gettext('Nodes'), |
6 | disableSelection: true, | |
7 | scrollable: true, | |
cd81cc2a | 8 | |
cf8b372a DC |
9 | columns: [ |
10 | { | |
11 | header: gettext('Name'), | |
12 | flex: 1, | |
13 | sortable: true, | |
14 | dataIndex: 'name' | |
15 | }, | |
16 | { | |
17 | header: 'ID', | |
18 | width: 40, | |
19 | sortable: true, | |
20 | dataIndex: 'nodeid' | |
21 | }, | |
22 | { | |
23 | header: gettext('Online'), | |
24 | width: 60, | |
25 | sortable: true, | |
26 | dataIndex: 'online', | |
27 | renderer: function(value) { | |
28 | var icon = '<i class="fa good fa-check"></i>'; | |
29 | if (!value) { | |
30 | icon = '<i class="fa critical fa-times"></i>'; | |
cd81cc2a | 31 | } |
cd81cc2a | 32 | |
cf8b372a | 33 | return icon; |
cd81cc2a | 34 | } |
cf8b372a DC |
35 | }, |
36 | { | |
37 | header: gettext('Support'), | |
38 | width: 100, | |
39 | sortable: true, | |
40 | dataIndex: 'level', | |
41 | renderer: PVE.Utils.render_support_level | |
42 | }, | |
43 | { | |
44 | header: gettext('Server Address'), | |
45 | width: 115, | |
46 | sortable: true, | |
47 | dataIndex: 'ip' | |
48 | }, | |
49 | ], | |
cd81cc2a | 50 | |
cf8b372a DC |
51 | stateful: true, |
52 | stateId: 'grid-cluster-nodes', | |
53 | tools: [ | |
54 | { | |
55 | type: 'up', | |
56 | handler: function(){ | |
57 | var me = this.up('grid'); | |
58 | var height = Math.max(me.getHeight()-50, 250); | |
59 | me.setHeight(height); | |
cd81cc2a | 60 | } |
cf8b372a DC |
61 | }, |
62 | { | |
63 | type: 'down', | |
64 | handler: function(){ | |
65 | var me = this.up('grid'); | |
66 | var height = me.getHeight()+50; | |
67 | me.setHeight(height); | |
cd81cc2a | 68 | } |
cf8b372a DC |
69 | } |
70 | ] | |
cd81cc2a DC |
71 | }, function() { |
72 | ||
73 | Ext.define('pve-dc-nodes', { | |
74 | extend: 'Ext.data.Model', | |
75 | fields: [ 'id', 'type', 'name', 'nodeid', 'ip', 'level', 'local', 'online'], | |
76 | idProperty: 'id' | |
77 | }); | |
78 | ||
79 | }); | |
80 |