Pman.Dialog.VerifyAccess.bjs
[Pman.Core] / Pman.Dialog.VerifyAccess.bjs
1 {
2  "name" : "Pman.Dialog.VerifyAccess",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/edward/gitlive/Pman.Core/Pman.Dialog.VerifyAccess.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "e2c9d024b79dfb48b42a7807206c6aed" : "Verify New IP Access",
10   "d41d8cd98f00b204e9800998ecf8427e" : "",
11   "f6039d44b29456b20f8f373155ae4973" : "Username",
12   "004bf6c9a40003140292e97330236c53" : "Action",
13   "dfb790522fdea3859af206d32916fe77" : "User Agent",
14   "70d9be9b139893aa6c69b5e77e614311" : "Confirm"
15  },
16  "items" : [
17   {
18    "listeners" : {
19     "show" : "function (_self)\n{\n    var path = window.location.pathname.split('/');\n    \n    var authorized_key = path.pop();\n    \n    var id = path.pop();\n    \n    new Pman.Request({\n        url: baseURL + '/Core/VerifyAccess',\n        method : 'POST',\n        mask : 'Loading...',\n        params : {\n            id : id,\n            authorized_key : authorized_key,\n            _to_data : 1\n        }, \n        success : function(res) {\n        \n            _this.data = res.data;\n            \n            _this.form.setValues(_this.data);\n            \n            if(_this.data.status * 1 == 0){\n                _this.form.findField('status').reset();\n            }\n            \n            _this.form.clearInvalid();\n            \n            return;\n        },\n        failure: function(res) {\n            \n            _this.dialog.hide();\n            \n            Roo.bootstrap.MessageBox.alert('Error', res.errorMsg);\n            \n            return;\n       }\n    });\n}"
20    },
21    "String cls" : "enable-overflow",
22    "Boolean allow_close" : false,
23    "xtype" : "Modal",
24    "$ xns" : "Roo.bootstrap",
25    "String title" : "Verify New IP Access",
26    "items" : [
27     {
28      "listeners" : {
29       "actionfailed" : "function (_self, action)\n{\n    _this.dialog.el.unmask();\n    Roo.log(\"action failed\");\n    Roo.log(action);\n  \n    if(!action.result.errorMsg){\n        Roo.bootstrap.MessageBox.alert(\"Error\", \"Please contact system adminisrator\");\n    }\n   \n    var msg = action.result.errorMsg;\n   \n    if(msg.length >= 200){\n        msg = msg.substring(0,199) + '...'\n    }\n    \n    Roo.bootstrap.MessageBox.alert(\"Error\", msg);\n}",
30       "actioncomplete" : "function (_self, action)\n{\n    if (action.type == 'setdata') {\n        \n        return;\n    }\n    if (action.type == 'load') {\n        \n        return;\n    }\n    if (action.type =='submit') {\n        \n        _this.dialog.hide();\n        \n        return;\n    }\n    \n}",
31       "render" : "function (_self,e)\n{\n    _this.form = _self;\n    \n}"
32      },
33      "$ string url" : "baseURL + '/Core/VerifyAccess'",
34      "Boolean errorMask" : true,
35      "xtype" : "Form",
36      "String labelAlign" : "top",
37      "$ xns" : "Roo.bootstrap",
38      "Boolean loadMask" : false,
39      "items" : [
40       {
41        "xtype" : "Row",
42        "$ xns" : "Roo.bootstrap",
43        "items" : [
44         {
45          "xtype" : "Column",
46          "Number xs" : 12,
47          "$ xns" : "Roo.bootstrap",
48          "items" : [
49           {
50            "String name" : "email",
51            "Boolean readOnly" : true,
52            "xtype" : "Input",
53            "string fieldLabel" : "Username",
54            "$ xns" : "Roo.bootstrap"
55           }
56          ]
57         },
58         {
59          "xtype" : "Column",
60          "Number xs" : 12,
61          "$ xns" : "Roo.bootstrap",
62          "items" : [
63           {
64            "String name" : "user_agent",
65            "Boolean readOnly" : true,
66            "xtype" : "TextArea",
67            "string fieldLabel" : "User Agent",
68            "Number rows" : 3,
69            "$ xns" : "Roo.bootstrap",
70            "String style" : "margin-bottom: 15px;"
71           }
72          ]
73         },
74         {
75          "xtype" : "Column",
76          "Number xs" : 12,
77          "$ xns" : "Roo.bootstrap",
78          "items" : [
79           {
80            "listeners" : {
81             "select" : "function (combo, record, index)\n{\n    \n}"
82            },
83            "Boolean allowBlank" : false,
84            "Boolean selectOnFocus" : true,
85            "String name" : "status_name",
86            "String mode" : "local",
87            "String valueField" : "code",
88            "Boolean editable" : false,
89            "xtype" : "ComboBox",
90            "String triggerAction" : "all",
91            "string fieldLabel" : "Action",
92            "Boolean alwaysQuery" : true,
93            "$ xns" : "Roo.bootstrap",
94            "String/Roo.Template tpl" : "<div class=\"roo-select2-result\"><b>{value}</b></div>",
95            "String hiddenName" : "status",
96            "String displayField" : "value",
97            "String indicatorpos" : "right",
98            "Boolean forceSelection" : true,
99            "items" : [
100             {
101              "$ string data" : "[\n    ['1', 'Approve'],\n    ['-2', 'Temporary'],\n    ['-1', 'Reject']\n] ",
102              "xtype" : "SimpleStore",
103              "$ xns" : "Roo.data",
104              "$ fields" : "[ 'code', 'value' ]",
105              "* prop" : "store"
106             }
107            ]
108           }
109          ]
110         },
111         {
112          "xtype" : "Column",
113          "Number xs" : 12,
114          "$ xns" : "Roo.bootstrap",
115          "items" : [
116           {
117            "listeners" : {
118             "select" : "function (combo, record, index)\n{\n    \n}"
119            },
120            "Boolean allowBlank" : false,
121            "Boolean selectOnFocus" : true,
122            "String name" : "status_name",
123            "String mode" : "local",
124            "String valueField" : "code",
125            "Boolean editable" : false,
126            "xtype" : "ComboBox",
127            "String triggerAction" : "all",
128            "string fieldLabel" : "Action",
129            "Boolean alwaysQuery" : true,
130            "$ xns" : "Roo.bootstrap",
131            "String/Roo.Template tpl" : "<div class=\"roo-select2-result\"><b>{value}</b></div>",
132            "String hiddenName" : "status",
133            "String displayField" : "value",
134            "String indicatorpos" : "right",
135            "Boolean forceSelection" : true,
136            "items" : [
137             {
138              "$ string data" : "[\n    ['1', 'Approve'],\n    ['-2', 'Temporary'],\n    ['-1', 'Reject']\n] ",
139              "xtype" : "SimpleStore",
140              "$ xns" : "Roo.data",
141              "$ fields" : "[ 'code', 'value' ]",
142              "* prop" : "store"
143             }
144            ]
145           }
146          ]
147         }
148        ]
149       },
150       {
151        "xtype" : "Row",
152        "$ xns" : "Roo.bootstrap",
153        "items" : [
154         {
155          "xtype" : "Column",
156          "Number xs" : 12,
157          "$ xns" : "Roo.bootstrap",
158          "items" : [
159           {
160            "String name" : "id",
161            "xtype" : "Input",
162            "String inputType" : "hidden",
163            "$ xns" : "Roo.bootstrap"
164           },
165           {
166            "String name" : "authorized_key",
167            "xtype" : "Input",
168            "String inputType" : "hidden",
169            "$ xns" : "Roo.bootstrap"
170           }
171          ]
172         }
173        ]
174       }
175      ]
176     },
177     {
178      "listeners" : {
179       "render" : "function (_self)\n{\n    _this.error_row = this;\n    \n    this.el.setVisibilityMode(Roo.Element.DISPLAY);\n    \n    this.el.hide();\n}"
180      },
181      "xtype" : "Row",
182      "$ xns" : "Roo.bootstrap",
183      "items" : [
184       {
185        "xtype" : "Column",
186        "Number xs" : 12,
187        "$ xns" : "Roo.bootstrap",
188        "items" : [
189         {
190          "listeners" : {
191           "render" : "function (_self)\n{\n    _this.text_el = _self;\n}"
192          },
193          "xtype" : "Element",
194          "$ xns" : "Roo.bootstrap",
195          "String html" : ""
196         }
197        ]
198       }
199      ]
200     },
201     {
202      "listeners" : {
203       "click" : "function (_self, e)\n{\n    if(!_this.form.isValid()){\n        return;\n    }\n    \n    _this.dialog.el.mask('Sending...');\n    _this.form.doAction('submit');\n    \n}"
204      },
205      "String weight" : "primary",
206      "xtype" : "Button",
207      "$ xns" : "Roo.bootstrap",
208      "String html" : "Confirm",
209      "* prop" : "buttons[]"
210     }
211    ]
212   }
213  ]
214 }