sync
[Pman.Admin] / Pman.Tab.CoreNotifyServers.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Tab');
6
7 Pman.Tab.CoreNotifyServers = new Roo.XComponent({
8
9  _strings : {
10   'ac659513b2353187192e88c5d1988228' :"Servers",
11   'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
12   '2ddb157d4780e8883fbde96f354c57d2' :"Displaying Blacklists {0} - {1} of {2}",
13   'c348b06d2667edd048ded3c1b1878cc1' :"Recurrent Notifications",
14   '774ff60df30a64fad1d29f6c2daa8691' :"No Servers found",
15   '2023301a71db57f37d50da7d045b881a' :"Displaying Servers {0} - {1} of {2}",
16   'c5dd93dd1011986763b5925e0af25e08' :"No Blacklists found",
17   'f29ddbfb905eb2593fdcdfb243f9af85' :"Added",
18   'b26686c0a708faee42861d8b905e882e' :"Last Sent",
19   '1203cd27e4d1ab6f1296728c021d9c1a' :"Is Active",
20   'def36b726efed529b13ba240dd331a12' :"Pool",
21   'be6838286e448ad65c5b55d690e2c38b' :"In Queue",
22   '902b0d55fddef6f8d651fe1035b7d4bd' :"Error",
23   'eae639a70006feff484a39363c977e24' :"Domain",
24   'e3974584afa867d8619253bc669d6197' :"Notify Servers",
25   '825bd435c12978e8492330c2a0d823db' :"Helo",
26   '1063e38cb53d94d386f21227fcd84717' :"Remove",
27   'c8f4b8c435b3d99a66e1b91bec60737c' :"Hostname"
28  },
29
30   part     :  ["Admin", "CoreNotifyServers" ],
31   order    : '900-Pman.Tab.CoreNotifyServers',
32   region   : 'center',
33   parent   : 'Pman.Tab.AdminWatchNotify',
34   name     : "Pman.Tab.CoreNotifyServers",
35   disabled : false, 
36   permname : '', 
37   _tree : function(_data)
38   {
39    var _this = this;
40    var MODULE = this;
41    return {
42    xtype : 'NestedLayoutPanel',
43    background : true,
44    region : 'center',
45    title : _this._strings['e3974584afa867d8619253bc669d6197'] /* Notify Servers */,
46    xns : Roo,
47    '|xns' : 'Roo',
48    layout : {
49     xtype : 'BorderLayout',
50     xns : Roo,
51     '|xns' : 'Roo',
52     center : {
53      xtype : 'LayoutRegion',
54      xns : Roo,
55      '|xns' : 'Roo'
56     },
57     south : {
58      xtype : 'LayoutRegion',
59      height : 200,
60      split : true,
61      xns : Roo,
62      '|xns' : 'Roo'
63     },
64     items  : [
65      {
66       xtype : 'GridPanel',
67       background : true,
68       fitContainer : true,
69       fitToframe : true,
70       region : 'center',
71       tableName : 'core_notify_server',
72       title : _this._strings['ac659513b2353187192e88c5d1988228'] /* Servers */,
73       listeners : {
74        activate : function() {
75             _this.spanel = this;
76             if (_this.sgrid) {
77                 _this.sgrid.footer.onClick('first');
78             }
79         }
80       },
81       xns : Roo,
82       '|xns' : 'Roo',
83       grid : {
84        xtype : 'Grid',
85        autoExpandColumn : 'hostname',
86        loadMask : true,
87        listeners : {
88         render : function() 
89          {
90              _this.sgrid = this; 
91              //_this.dialog = Pman.Dialog.FILL_IN
92              if (_this.spanel.active) {
93                 this.footer.onClick('first');
94              }
95          },
96         rowclick : function (_self, rowIndex, e)
97          {
98              (function() { 
99                  _this.bgrid.footer.onClick('first');
100              }).defer(100);
101          },
102         rowdblclick : function (_self, rowIndex, e)
103          {
104              
105              Pman.Dialog.CoreNotifyServer.show(
106                   this.getDataSource().getAt(rowIndex).data, function() {
107                  _this.sgrid.footer.onClick('first');
108              }); 
109          }
110        },
111        xns : Roo.grid,
112        '|xns' : 'Roo.grid',
113        footer : {
114         xtype : 'PagingToolbar',
115         displayInfo : true,
116         displayMsg : _this._strings['2023301a71db57f37d50da7d045b881a'] /* Displaying Servers {0} - {1} of {2} */,
117         emptyMsg : _this._strings['774ff60df30a64fad1d29f6c2daa8691'] /* No Servers found */,
118         pageSize : 25,
119         xns : Roo,
120         '|xns' : 'Roo'
121        },
122        toolbar : {
123         xtype : 'Toolbar',
124         xns : Roo,
125         '|xns' : 'Roo',
126         items  : [
127          {
128           xtype : 'Button',
129           text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
130           listeners : {
131            click : function() 
132             {
133                 Pman.Dialog.CoreNotifyServer.show(
134                      {}, function() {
135                     _this.sgrid.footer.onClick('first');
136                 }); 
137             }
138           },
139           xns : Roo.Toolbar,
140           '|xns' : 'Roo.Toolbar'
141          },
142          {
143           xtype : 'Fill',
144           xns : Roo.Toolbar,
145           '|xns' : 'Roo.Toolbar'
146          },
147          {
148           xtype : 'Button',
149           text : _this._strings['1063e38cb53d94d386f21227fcd84717'] /* Remove */,
150           listeners : {
151            click : function (_self, e)
152             {
153                    Pman.genericDelete(_this.spanel, 'core_notify_server');
154             }
155           },
156           xns : Roo.Toolbar,
157           '|xns' : 'Roo.Toolbar'
158          }
159         ]
160        },
161        dataSource : {
162         xtype : 'Store',
163         remoteSort : true,
164         sortInfo : { field : 'hostname', direction: 'ASC' },
165         listeners : {
166          beforeload : function (_self, options)
167           {
168              options.params._with_queue_size  =1 ;
169               
170           }
171         },
172         xns : Roo.data,
173         '|xns' : 'Roo.data',
174         proxy : {
175          xtype : 'HttpProxy',
176          method : 'GET',
177          url : baseURL + '/Roo/core_notify_server',
178          xns : Roo.data,
179          '|xns' : 'Roo.data'
180         },
181         reader : {
182          xtype : 'JsonReader',
183          id : 'id',
184          root : 'data',
185          totalProperty : 'total',
186          xns : Roo.data,
187          '|xns' : 'Roo.data'
188         }
189        },
190        colModel : [
191         {
192          xtype : 'ColumnModel',
193          dataIndex : 'is_active',
194          header : _this._strings['1203cd27e4d1ab6f1296728c021d9c1a'] /* Is Active */,
195          renderer : function(v) {
196              var state = v> 0 ?  '-checked' : '';
197          
198              return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
199          },
200          width : 100,
201          xns : Roo.grid,
202          '|xns' : 'Roo.grid'
203         },
204         {
205          xtype : 'ColumnModel',
206          dataIndex : 'hostname',
207          header : _this._strings['c8f4b8c435b3d99a66e1b91bec60737c'] /* Hostname */,
208          width : 150,
209          xns : Roo.grid,
210          '|xns' : 'Roo.grid'
211         },
212         {
213          xtype : 'ColumnModel',
214          dataIndex : 'helo',
215          header : _this._strings['825bd435c12978e8492330c2a0d823db'] /* Helo */,
216          width : 150,
217          xns : Roo.grid,
218          '|xns' : 'Roo.grid'
219         },
220         {
221          xtype : 'ColumnModel',
222          dataIndex : 'poolname',
223          header : _this._strings['def36b726efed529b13ba240dd331a12'] /* Pool */,
224          width : 150,
225          xns : Roo.grid,
226          '|xns' : 'Roo.grid'
227         },
228         {
229          xtype : 'ColumnModel',
230          dataIndex : 'in_queue',
231          header : _this._strings['be6838286e448ad65c5b55d690e2c38b'] /* In Queue */,
232          renderer : function(v,x,r) {
233          
234              return r.data.in_queue || 0;
235          },
236          width : 150,
237          xns : Roo.grid,
238          '|xns' : 'Roo.grid'
239         },
240         {
241          xtype : 'ColumnModel',
242          dataIndex : 'last_send',
243          header : _this._strings['b26686c0a708faee42861d8b905e882e'] /* Last Sent */,
244          renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y  H:i:s') : ''); },
245          width : 120,
246          xns : Roo.grid,
247          '|xns' : 'Roo.grid'
248         }
249        ]
250       }
251      },
252      {
253       xtype : 'GridPanel',
254       background : true,
255       fitContainer : true,
256       fitToframe : true,
257       region : 'south',
258       tableName : 'core_notify_recur',
259       title : _this._strings['c348b06d2667edd048ded3c1b1878cc1'] /* Recurrent Notifications */,
260       listeners : {
261        activate : function() {
262             _this.bpanel = this;
263            
264         }
265       },
266       xns : Roo,
267       '|xns' : 'Roo',
268       grid : {
269        xtype : 'Grid',
270        autoExpandColumn : 'error_msg',
271        loadMask : true,
272        listeners : {
273         render : function() 
274          {
275              _this.bgrid = this; 
276              //_this.dialog = Pman.Dialog.FILL_IN
277              
278          }
279        },
280        xns : Roo.grid,
281        '|xns' : 'Roo.grid',
282        footer : {
283         xtype : 'PagingToolbar',
284         displayInfo : true,
285         displayMsg : _this._strings['2ddb157d4780e8883fbde96f354c57d2'] /* Displaying Blacklists {0} - {1} of {2} */,
286         emptyMsg : _this._strings['c5dd93dd1011986763b5925e0af25e08'] /* No Blacklists found */,
287         pageSize : 25,
288         xns : Roo,
289         '|xns' : 'Roo'
290        },
291        toolbar : {
292         xtype : 'Toolbar',
293         xns : Roo,
294         '|xns' : 'Roo',
295         items  : [
296          {
297           xtype : 'Fill',
298           xns : Roo.Toolbar,
299           '|xns' : 'Roo.Toolbar'
300          },
301          {
302           xtype : 'Button',
303           text : _this._strings['1063e38cb53d94d386f21227fcd84717'] /* Remove */,
304           xns : Roo.Toolbar,
305           '|xns' : 'Roo.Toolbar'
306          }
307         ]
308        },
309        dataSource : {
310         xtype : 'Store',
311         remoteSort : true,
312         sortInfo : { field : 'person_id_name', direction: 'ASC' },
313         listeners : {
314          beforeload : function (_self, opts)
315           {
316               if(!_this.sgrid.getSelectionModel().getSelected()) {
317                   return false;
318               }
319               
320               opts.params.server_id =    _this.sgrid.getSelectionModel().getSelected().data.id;
321           }
322         },
323         xns : Roo.data,
324         '|xns' : 'Roo.data',
325         proxy : {
326          xtype : 'HttpProxy',
327          method : 'GET',
328          url : baseURL + '/Roo/core_notify_blacklist',
329          xns : Roo.data,
330          '|xns' : 'Roo.data'
331         },
332         reader : {
333          xtype : 'JsonReader',
334          id : 'id',
335          root : 'data',
336          totalProperty : 'total',
337          xns : Roo.data,
338          '|xns' : 'Roo.data'
339         }
340        },
341        colModel : [
342         {
343          xtype : 'ColumnModel',
344          dataIndex : 'added_dt',
345          header : _this._strings['f29ddbfb905eb2593fdcdfb243f9af85'] /* Added */,
346          renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); },
347          width : 120,
348          xns : Roo.grid,
349          '|xns' : 'Roo.grid'
350         },
351         {
352          xtype : 'ColumnModel',
353          dataIndex : 'domain_id_domain',
354          header : _this._strings['eae639a70006feff484a39363c977e24'] /* Domain */,
355          width : 150,
356          xns : Roo.grid,
357          '|xns' : 'Roo.grid'
358         },
359         {
360          xtype : 'ColumnModel',
361          dataIndex : 'error_str',
362          header : _this._strings['902b0d55fddef6f8d651fe1035b7d4bd'] /* Error */,
363          width : 150,
364          xns : Roo.grid,
365          '|xns' : 'Roo.grid'
366         }
367        ]
368       }
369      }
370     ]
371    }
372   };  }
373 });