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