Pman.Tab.BAdminIPAccess.bjs
[Pman.BAdmin] / Pman.Tab.BAdminIPAccess.bjs
1 {
2  "name" : "Pman.Tab.BAdminIPAccess",
3  "parent" : "Pman.Tab.BAdmin",
4  "title" : "",
5  "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Tab.BAdminIPAccess.bjs",
6  "permname" : "",
7  "modOrder" : "006",
8  "strings" : {
9   "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email",
10   "86f16ddf147752b95ffe69e2dfa769a1" : "Authorized By",
11   "ec53a8c4f07baed5d8825072c89799be" : "Status",
12   "7dce122004969d56ae2e0245cb754d35" : "Edit",
13   "fc6f97505d89fe9277965c126744647a" : "No Companies found",
14   "11e8622b4aa4b1924aee81a9ec54c555" : "Create Date",
15   "a12a3079e14ced46e69ba52b8a90b21a" : "IP",
16   "155ca6a755e25c15ad7ce45e2f638f10" : "Displaying Companies{0} - {1} of {2}",
17   "5a787141d53b573ec9b86e900bfe0d79" : "Expire Date",
18   "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
19   "e3030abfa75de4573fb37032affa11e7" : "IP Access"
20  },
21  "items" : [
22   {
23    "xtype" : "Nest",
24    "$ xns" : "Roo.bootstrap.panel",
25    "String title" : "IP Access",
26    "Boolean background" : true,
27    "items" : [
28     {
29      "xtype" : "Border",
30      "$ xns" : "Roo.bootstrap.layout",
31      "* prop" : "layout",
32      "items" : [
33       {
34        "String tabPosition" : "top",
35        "xtype" : "Region",
36        "Boolean hideTabs" : true,
37        "$ xns" : "Roo.bootstrap.layout",
38        "* prop" : "center"
39       },
40       {
41        "listeners" : {
42         "activate" : "function (_self)\n{\n    _this.edit_btn.hide();\n    _this.delete_btn.hide();\n    \n    if (_this.table) {\n        _this.table.footer.onClick('first');\n    }\n}",
43         "render" : "function (_self)\n{\n    _this.grid = _self;\n}"
44        },
45        "xtype" : "Grid",
46        "Boolean fitToFrame" : true,
47        "$ xns" : "Roo.bootstrap.panel",
48        "String region" : "center",
49        "String title" : "IP Access",
50        "Boolean closable" : false,
51        "items" : [
52         {
53          "xtype" : "NavSimplebar",
54          "$ xns" : "Roo.bootstrap",
55          "* prop" : "toolbar",
56          "items" : [
57           {
58            "xtype" : "NavGroup",
59            "$ xns" : "Roo.bootstrap",
60            "items" : [
61             {
62              "xtype" : "NavItem",
63              "$ xns" : "Roo.bootstrap",
64              "items" : [
65               {
66                "xtype" : "Element",
67                "$ xns" : "Roo.bootstrap",
68                "items" : [
69                 {
70                  "String cls" : "roo-toolbar",
71                  "xtype" : "Row",
72                  "$ xns" : "Roo.bootstrap",
73                  "items" : [
74                   {
75                    "Number md" : 3,
76                    "xtype" : "Column",
77                    "$ xns" : "Roo.bootstrap",
78                    "items" : [
79                     {
80                      "listeners" : {
81                       "render" : "function (_self)\n{\n    _this.status = this;\n}",
82                       "select" : "function (combo, record, index)\n{\n    _this.table.footer.onClick('first'); \n}"
83                      },
84                      "String name" : "status_name",
85                      "String mode" : "local",
86                      "String valueField" : "code",
87                      "Boolean editable" : false,
88                      "xtype" : "ComboBox",
89                      "String triggerAction" : "all",
90                      "$ xns" : "Roo.bootstrap",
91                      "String/Roo.Template tpl" : "<div class=\"roo-select2-result\"><b>{value}</b></div>",
92                      "String hiddenName" : "status",
93                      "String displayField" : "value",
94                      "items" : [
95                       {
96                        "$ string data" : "[\n    ['1', 'Approve'],\n    ['-2', 'Temporary'],\n    ['-1', 'Reject']\n] ",
97                        "xtype" : "SimpleStore",
98                        "$ xns" : "Roo.data",
99                        "$ fields" : "[ 'code', 'value' ]",
100                        "* prop" : "store"
101                       }
102                      ]
103                     }
104                    ]
105                   },
106                   {
107                    "Number md" : 12,
108                    "xtype" : "Column",
109                    "$ xns" : "Roo.bootstrap",
110                    "items" : [
111                     {
112                      "listeners" : {
113                       "render" : "function (_self)\n{\n    _this.edit_btn = this;\n    \n    this.hide();\n}",
114                       "click" : "function (_self, e)\n{\n    var sel = _this.table.getSelectionModel().getSelected();\n    \n    if(!sel || sel.data.id * 1 < 1){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please select a row');\n        return;\n    }\n\n    Pman.Dialog.BAdminIPAccess.show({ \n        id : sel.data.id\n    }, function(res) {\n        _this.table.store.load({});\n    });\n\n}"
115                      },
116                      "String cls" : "roo-toolbar-button",
117                      "String weight" : "default",
118                      "xtype" : "Button",
119                      "$ xns" : "Roo.bootstrap",
120                      "String html" : "Edit",
121                      "String glyphicon" : "edit"
122                     },
123                     {
124                      "listeners" : {
125                       "render" : "function (_self)\n{\n    _this.delete_btn = this;\n    \n    this.hide();\n}",
126                       "click" : "function (_self, e)\n{\n    Pman.genericDelete(_this.grid, 'core_ip_access'); \n\n}"
127                      },
128                      "String cls" : "roo-toolbar-button",
129                      "String weight" : "primary",
130                      "xtype" : "Button",
131                      "$ xns" : "Roo.bootstrap",
132                      "String html" : "Delete",
133                      "String glyphicon" : "trash"
134                     }
135                    ]
136                   }
137                  ]
138                 }
139                ]
140               }
141              ]
142             }
143            ]
144           }
145          ]
146         },
147         {
148          "listeners" : {
149           "rowdblclick" : "function (_self, el, rowIndex, e)\n{\n    var s = _this.table.store.getAt(rowIndex);\n    \n    if(!s || s.data.id * 1 < 1){\n        return;\n    }\n    \n    Pman.Dialog.BAdminIPAccess.show({ \n        id : s.data.id\n    }, function(res) {\n        _this.table.footer.onClick('first');\n    });\n}",
150           "render" : "function (_self)\n{\n    _this.table = this;\n}"
151          },
152          "String cls" : "table-fixed",
153          "boolean hover" : true,
154          "boolean striped" : false,
155          "xtype" : "Table",
156          "boolean responsive" : true,
157          "Boolean rowSelection" : true,
158          "$ xns" : "Roo.bootstrap",
159          "Boolean loadMask" : true,
160          "* prop" : "grid",
161          "items" : [
162           {
163            "listeners" : {
164             "selectionchange" : "function (_self)\n{\n    _this.edit_btn.hide();\n    _this.delete_btn.hide();\n    \n    if (!this.getSelected()) {\n        return;\n    }\n    \n    _this.edit_btn.show();\n    _this.delete_btn.show();\n    \n}"
165            },
166            "Boolean singleSelect" : true,
167            "xtype" : "RowSelectionModel",
168            "$ xns" : "Roo.bootstrap.Table",
169            "* prop" : "sm"
170           },
171           {
172            "listeners" : {
173             "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    var status = _this.status.getValue() * 1;\n    \n    o.params.status = status;\n    \n}",
174             "load" : "function (_self, records, options)\n{\n    _this.edit_btn.hide();\n    _this.delete_btn.hide();\n}"
175            },
176            "xtype" : "Store",
177            "boolean remoteSort" : true,
178            "$ xns" : "Roo.data",
179            "$ sortinfo" : "{ field : 'display_name', direction: 'ASC' }",
180            "* prop" : "store",
181            "items" : [
182             {
183              "$ Array fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'created_dt',\n        'type': 'date',\n        'formatDate' : 'Y-m-d'\n    },\n    {\n        'name': 'status',\n        'type': 'int'\n    },\n    {\n        'name': 'authorized_by',\n        'type': 'int'\n    },\n    {\n        'name': 'authorized_by_name',\n        'type': 'string'\n    },\n    {\n        'name': 'authorized_by_email',\n        'type': 'string'\n    },\n    {\n        'name': 'authorized_key',\n        'type': 'string'\n    },\n    {\n        'name': 'email',\n        'type': 'string'\n    },\n    {\n        'name': 'expire_dt',\n        'type': 'date',\n        'formatDate' : 'Y-m-d'\n    },\n    {\n        'name': 'user_agent',\n        'type': 'string'\n    },\n    {\n        'name': 'updated_by',\n        'type': 'int'\n    },\n    {\n        'name': 'updated_by_name',\n        'type': 'string'\n    },\n    {\n        'name': 'updated_by_email',\n        'type': 'string'\n    }\n    \n]",
184              "xtype" : "JsonReader",
185              "String root" : "data",
186              "$ xns" : "Roo.data",
187              "String id" : "id",
188              "* prop" : "reader",
189              "String totalProperty" : "total"
190             },
191             {
192              "$ url" : "baseURL + '/Roo/Core_ip_access.php'",
193              "xtype" : "HttpProxy",
194              "$ xns" : "Roo.data",
195              "String method" : "GET",
196              "* prop" : "proxy"
197             }
198            ]
199           },
200           {
201            "String header" : "Create Date",
202            "String cursor" : "pointer",
203            "String dataIndex" : "created_dt",
204            "xtype" : "ColumnModel",
205            "Number xs" : 2,
206            "$ xns" : "Roo.grid",
207            "$ renderer" : "function(v,x,r) { \n    return String.format('{0}', v ? v.format('Y-m-d') : '');\n}",
208            "Boolean sortable" : true,
209            "* prop" : "cm[]"
210           },
211           {
212            "String header" : "IP",
213            "String cursor" : "pointer",
214            "String dataIndex" : "ip",
215            "xtype" : "ColumnModel",
216            "Number xs" : 2,
217            "$ xns" : "Roo.grid",
218            "$ renderer" : "function(v,x,r) { \n    return String.format('{0}', v ? v : '');\n}",
219            "Boolean sortable" : true,
220            "* prop" : "cm[]"
221           },
222           {
223            "String header" : "Email",
224            "String cursor" : "pointer",
225            "String dataIndex" : "email",
226            "xtype" : "ColumnModel",
227            "Number xs" : 2,
228            "$ xns" : "Roo.grid",
229            "$ renderer" : "function(v,x,r) \n{ \n    return String.format('<a href=\"mailto:{0}\">{0}</a>', v ? v : '')\n}",
230            "Boolean sortable" : true,
231            "* prop" : "cm[]"
232           },
233           {
234            "String header" : "Authorized By",
235            "String cursor" : "pointer",
236            "String dataIndex" : "authorized_by",
237            "xtype" : "ColumnModel",
238            "Number xs" : 2,
239            "$ xns" : "Roo.grid",
240            "$ renderer" : "function(v,x,r) \n{ \n    if(v * 1 == 0){\n        return '';\n    }\n    \n    return String.format('{0}', r.data.authorized_by_name);\n}",
241            "Boolean sortable" : true,
242            "* prop" : "cm[]"
243           },
244           {
245            "String header" : "Status",
246            "String cursor" : "pointer",
247            "String dataIndex" : "status",
248            "xtype" : "ColumnModel",
249            "Number xs" : 2,
250            "$ xns" : "Roo.grid",
251            "$ renderer" : "function(v,x,r) \n{\n    v = v * 1;\n    \n    var status = 'Pending';\n    \n    switch (v) {\n        case 1 :\n            status = 'Approve';\n            break;\n        case -1 :\n            status = 'Reject';\n            break;\n        case -2 :\n            status = 'Temporary';\n            break;\n        default : \n            break;\n    }\n    \n    return String.format('{0}', status);\n    \n}",
252            "Boolean sortable" : true,
253            "* prop" : "cm[]"
254           },
255           {
256            "String header" : "Expire Date",
257            "String cursor" : "pointer",
258            "String dataIndex" : "expire_dt",
259            "xtype" : "ColumnModel",
260            "Number xs" : 2,
261            "$ xns" : "Roo.grid",
262            "$ renderer" : "function(v,x,r) { \n    \n    if(r.data.status * 1 != -2){\n        return '';\n    }\n    \n    return String.format('{0}', v ? v.format('Y-m-d') : '');\n}",
263            "Boolean sortable" : true,
264            "* prop" : "cm[]"
265           },
266           {
267            "Number pageSize" : 25,
268            "String displayMsg" : "Displaying Companies{0} - {1} of {2}",
269            "Boolean displayInfo" : false,
270            "xtype" : "PagingToolbar",
271            "String emptyMsg" : "No Companies found",
272            "$ xns" : "Roo.bootstrap",
273            "* prop" : "footer",
274            "string name" : "footer"
275           }
276          ]
277         }
278        ]
279       }
280      ]
281     }
282    ]
283   }
284  ]
285 }