sync
[Pman.Admin] / Pman.Dialog.CoreNotifyServer.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.CoreNotifyServer = {
8
9  _strings : {
10   '7082f08d3a32017e44122c3c708ce06a' :"Add / Edit Server",
11   '7e240928383acb93e5066a6149430337' :"Pool Name",
12   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
13   '2059e6f007c7ec60d08be149f4196c0c' :"Helo Name",
14   'e253f01e45700c07327115a5e6d677bf' :"Is Active?",
15   'c8f4b8c435b3d99a66e1b91bec60737c' :"Hostname",
16   'c9cc8cce247e49bae79f15173ce97354' :"Save"
17  },
18  _named_strings : {
19   'hostname_fieldLabel' : 'c8f4b8c435b3d99a66e1b91bec60737c' /* Hostname */ ,
20   'is_active_fieldLabel' : 'e253f01e45700c07327115a5e6d677bf' /* Is Active? */ ,
21   'poolname_fieldLabel' : '7e240928383acb93e5066a6149430337' /* Pool Name */ ,
22   'helo_fieldLabel' : '2059e6f007c7ec60d08be149f4196c0c' /* Helo Name */ 
23  },
24
25  dialog : false,
26  callback:  false,
27
28  show : function(data, cb)
29  {
30   if (!this.dialog) {
31    this.create();
32   }
33
34   this.callback = cb;
35   this.data = data;
36   this.dialog.show.apply(this.dialog,  Array.prototype.slice.call(arguments).slice(2));
37   if (this.form) {
38    this.form.reset();
39    this.form.setValues(data);
40    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
41   }
42
43  },
44
45  create : function()
46  {
47    var _this = this;
48    this.dialog = Roo.factory({
49     xtype : 'LayoutDialog',
50     closable : true,
51     collapsible : false,
52     height : 200,
53     modal : true,
54     resizable : false,
55     title : _this._strings['7082f08d3a32017e44122c3c708ce06a'] /* Add / Edit Server */,
56     width : 500,
57     xns : Roo,
58     '|xns' : 'Roo',
59     center : {
60      xtype : 'LayoutRegion',
61      xns : Roo,
62      '|xns' : 'Roo'
63     },
64     buttons : [
65      {
66       xtype : 'Button',
67       text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
68       listeners : {
69        click : function (_self, e)
70         {
71            _this.dialog.hide();
72         
73         }
74       },
75       xns : Roo,
76       '|xns' : 'Roo'
77      },
78      {
79       xtype : 'Button',
80       text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
81       listeners : {
82        click : function (_self, e)
83         {
84          
85             _this.form.doAction("submit");
86         
87         }
88       },
89       xns : Roo,
90       '|xns' : 'Roo'
91      }
92     ],
93     items  : [
94      {
95       xtype : 'ContentPanel',
96       region : 'center',
97       xns : Roo,
98       '|xns' : 'Roo',
99       items  : [
100        {
101         xtype : 'Form',
102         labelWidth : 150,
103         method : 'POST',
104         style : 'margin:10px;',
105         url : baseURL + '/Roo/core_notify_server',
106         listeners : {
107          actioncomplete : function(_self,action)
108           {
109               if (action.type == 'setdata') {
110                  
111                  if (_this.data.clone_of) {
112                      _this.dialog.el.mask("Loading");
113                       this.load({ method: 'GET', params: { '_id' : _this.data.clone_of }});
114                  }
115                  return;
116               }
117               if (action.type == 'load') {
118                   _this.dialog.el.unmask();
119                   // unset the id..
120                   
121                   return;
122               }
123               if (action.type =='submit') {
124               
125                   _this.dialog.el.unmask();
126                   _this.dialog.hide();
127                   
128                    
129                   _this.form.reset();
130                    
131                    _this.callback.call(_this, action.result.data);
132             
133                   
134                    return;
135               }
136           },
137          actionfailed : function (_self, action)
138           {
139               _this.dialog.el.unmask();
140               
141               Pman.standardActionFailed(_self, action);
142           },
143          rendered : function (form)
144           {
145               _this.form= form;
146           }
147         },
148         xns : Roo.form,
149         '|xns' : 'Roo.form',
150         items  : [
151          {
152           xtype : 'TextField',
153           allowBlank : false,
154           fieldLabel : _this._strings['c8f4b8c435b3d99a66e1b91bec60737c'] /* Hostname */,
155           name : 'hostname',
156           width : 200,
157           xns : Roo.form,
158           '|xns' : 'Roo.form'
159          },
160          {
161           xtype : 'TextField',
162           allowBlank : false,
163           fieldLabel : _this._strings['2059e6f007c7ec60d08be149f4196c0c'] /* Helo Name */,
164           name : 'helo',
165           width : 200,
166           xns : Roo.form,
167           '|xns' : 'Roo.form'
168          },
169          {
170           xtype : 'TextField',
171           allowBlank : false,
172           fieldLabel : _this._strings['7e240928383acb93e5066a6149430337'] /* Pool Name */,
173           name : 'poolname',
174           width : 200,
175           xns : Roo.form,
176           '|xns' : 'Roo.form'
177          },
178          {
179           xtype : 'Checkbox',
180           fieldLabel : _this._strings['e253f01e45700c07327115a5e6d677bf'] /* Is Active? */,
181           name : 'is_active',
182           xns : Roo.form,
183           '|xns' : 'Roo.form'
184          },
185          {
186           xtype : 'Hidden',
187           name : 'id',
188           xns : Roo.form,
189           '|xns' : 'Roo.form'
190          }
191         ]
192        }
193       ]
194      }
195     ]
196    });
197  }
198 };