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