PHP8
[Pman.BAdmin] / Pman.Dialog.BAdminIPAccess.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.Dialog');
6
7 Pman.Dialog.BAdminIPAccess= function() {}
8 Roo.apply(Pman.Dialog.BAdminIPAccess.prototype, {
9
10  _strings : {
11   'e2c9d024b79dfb48b42a7807206c6aed' :"Verify New IP Access",
12   'a12a3079e14ced46e69ba52b8a90b21a' :"IP",
13   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
14   'f6039d44b29456b20f8f373155ae4973' :"Username",
15   '004bf6c9a40003140292e97330236c53' :"Action",
16   '5a787141d53b573ec9b86e900bfe0d79' :"Expire Date",
17   'dfb790522fdea3859af206d32916fe77' :"User Agent",
18   '70d9be9b139893aa6c69b5e77e614311' :"Confirm"
19  },
20
21  dialog : false,
22  callback:  false,
23
24  show : function(data, cb)
25  {
26   if (!this.dialog) {
27    this.create();
28   }
29
30   this.callback = cb;
31   this.data = data;
32   this.dialog.show(this.data._el);
33   if (this.form) {
34    this.form.reset();
35    this.form.setValues(data);
36    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
37   }
38
39  },
40
41  create : function()
42  {
43   var _this = this;
44   this.dialog = Roo.factory({
45     xtype : 'Modal',
46     allow_close : true,
47     cls : 'enable-overflow',
48     title : _this._strings['e2c9d024b79dfb48b42a7807206c6aed'] /* Verify New IP Access */,
49     xns : Roo.bootstrap,
50     '|xns' : 'Roo.bootstrap',
51     buttons : [
52      {
53       xtype : 'Button',
54       html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
55       weight : 'default',
56       listeners : {
57        click : function (_self, e)
58         {
59             _this.dialog.hide();
60         }
61       },
62       xns : Roo.bootstrap,
63       '|xns' : 'Roo.bootstrap'
64      },
65      {
66       xtype : 'Button',
67       html : _this._strings['70d9be9b139893aa6c69b5e77e614311'] /* Confirm */,
68       weight : 'primary',
69       listeners : {
70        click : function (_self, e)
71         {
72             _this.form.doAction('submit');
73             
74         }
75       },
76       xns : Roo.bootstrap,
77       '|xns' : 'Roo.bootstrap'
78      }
79     ],
80     items  : [
81      {
82       xtype : 'Form',
83       errorMask : true,
84       labelAlign : 'top',
85       loadMask : true,
86       url : baseURL + '/Roo/core_ip_access',
87       listeners : {
88        actioncomplete : function (_self, action)
89         {
90             if (action.type == 'setdata') {
91                 
92                 if(_this.data.id) {
93                     this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});
94                 } 
95                 
96                 return;
97             }
98             if (action.type == 'load') {
99                 
100                 return;
101             }
102             if (action.type =='submit') {
103                 
104                 _this.dialog.hide();
105                 
106                 if (_this.callback) {
107                     _this.callback.call(this, action.result.data);
108                 }
109                 
110                 return;
111             }
112             
113         },
114        actionfailed : function (_self, action)
115         {
116             _this.dialog.el.unmask();
117             Roo.log("action failed");
118             Roo.log(action);
119           
120             if(!action.result.errorMsg){
121                 Roo.bootstrap.MessageBox.alert("Error", "Please contact system adminisrator");
122             }
123            
124             var msg = action.result.errorMsg;
125            
126             if(msg.length >= 200){
127                 msg = msg.substring(0,199) + '...'
128             }
129             
130             Roo.bootstrap.MessageBox.alert("Error", msg);
131         },
132        render : function (_self,e)
133         {
134             _this.form = _self;
135             
136         }
137       },
138       xns : Roo.bootstrap,
139       '|xns' : 'Roo.bootstrap',
140       items  : [
141        {
142         xtype : 'Row',
143         xns : Roo.bootstrap,
144         '|xns' : 'Roo.bootstrap',
145         items  : [
146          {
147           xtype : 'Column',
148           xs : 12,
149           xns : Roo.bootstrap,
150           '|xns' : 'Roo.bootstrap',
151           items  : [
152            {
153             xtype : 'Input',
154             fieldLabel : _this._strings['f6039d44b29456b20f8f373155ae4973'] /* Username */,
155             name : 'email',
156             readOnly : true,
157             xns : Roo.bootstrap,
158             '|xns' : 'Roo.bootstrap'
159            }
160           ]
161          },
162          {
163           xtype : 'Column',
164           xs : 12,
165           xns : Roo.bootstrap,
166           '|xns' : 'Roo.bootstrap',
167           items  : [
168            {
169             xtype : 'Input',
170             fieldLabel : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
171             name : 'ip',
172             readOnly : true,
173             xns : Roo.bootstrap,
174             '|xns' : 'Roo.bootstrap'
175            }
176           ]
177          },
178          {
179           xtype : 'Column',
180           xs : 12,
181           xns : Roo.bootstrap,
182           '|xns' : 'Roo.bootstrap',
183           items  : [
184            {
185             xtype : 'TextArea',
186             fieldLabel : _this._strings['dfb790522fdea3859af206d32916fe77'] /* User Agent */,
187             name : 'user_agent',
188             readOnly : true,
189             rows : 3,
190             style : 'margin-bottom: 15px;',
191             xns : Roo.bootstrap,
192             '|xns' : 'Roo.bootstrap'
193            }
194           ]
195          },
196          {
197           xtype : 'Column',
198           xs : 12,
199           xns : Roo.bootstrap,
200           '|xns' : 'Roo.bootstrap',
201           items  : [
202            {
203             xtype : 'ComboBox',
204             allowBlank : false,
205             alwaysQuery : true,
206             displayField : 'value',
207             editable : false,
208             fieldLabel : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
209             forceSelection : true,
210             hiddenName : 'status',
211             indicatorpos : 'right',
212             mode : 'local',
213             name : 'status_name',
214             selectOnFocus : true,
215             tpl : '<div class=\"roo-select2-result\"><b>{value}</b></div>',
216             triggerAction : 'all',
217             valueField : 'code',
218             listeners : {
219              select : function (combo, record, index)
220               {
221                   _this.expire_dt.allowBlank = true;
222                   _this.expire_dt.el.hide();
223                   
224                   if(record.data.code == '-2'){
225                       _this.expire_dt.allowBlank = false;
226                       _this.expire_dt.el.show();
227                   }
228               }
229             },
230             xns : Roo.bootstrap,
231             '|xns' : 'Roo.bootstrap',
232             store : {
233              xtype : 'SimpleStore',
234              data : [
235                  ['1', 'Approve'],
236                  ['-2', 'Temporary'],
237                  ['-1', 'Reject']
238              ],
239              fields : [ 'code', 'value' ],
240              xns : Roo.data,
241              '|xns' : 'Roo.data'
242             }
243            }
244           ]
245          },
246          {
247           xtype : 'Column',
248           xs : 12,
249           xns : Roo.bootstrap,
250           '|xns' : 'Roo.bootstrap',
251           items  : [
252            {
253             xtype : 'DateField',
254             allowBlank : false,
255             fieldLabel : _this._strings['5a787141d53b573ec9b86e900bfe0d79'] /* Expire Date */,
256             format : 'Y-m-d',
257             indicatorpos : 'right',
258             name : 'expire_dt',
259             listeners : {
260              render : function (_self)
261               {
262                   _this.expire_dt = this;
263                   
264                   var d = new Date();
265                   
266                   d.setDate(d.getDate() - 1);
267               
268                   this.setStartDate(d);
269                   
270                   this.el.setVisibilityMode(Roo.Element.DISPLAY);
271                   
272                   this.el.hide();
273               }
274             },
275             xns : Roo.bootstrap,
276             '|xns' : 'Roo.bootstrap'
277            }
278           ]
279          }
280         ]
281        },
282        {
283         xtype : 'Row',
284         xns : Roo.bootstrap,
285         '|xns' : 'Roo.bootstrap',
286         items  : [
287          {
288           xtype : 'Column',
289           xs : 12,
290           xns : Roo.bootstrap,
291           '|xns' : 'Roo.bootstrap',
292           items  : [
293            {
294             xtype : 'Input',
295             inputType : 'hidden',
296             name : 'id',
297             xns : Roo.bootstrap,
298             '|xns' : 'Roo.bootstrap'
299            },
300            {
301             xtype : 'Input',
302             inputType : 'hidden',
303             name : 'authorized_key',
304             xns : Roo.bootstrap,
305             '|xns' : 'Roo.bootstrap'
306            }
307           ]
308          }
309         ]
310        }
311       ]
312      }
313     ]
314    }  );
315  }
316 });
317 Roo.apply(Pman.Dialog.BAdminIPAccess, Pman.Dialog.BAdminIPAccess.prototype);