Pman.Tab.BAdminIPAccess.bjs
[Pman.BAdmin] / Pman.Tab.BAdminIPAccess.bjs
1 {
2  "name" : "Pman.Tab.BAdminIPAccess",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Tab.BAdminIPAccess.bjs",
6  "permname" : "",
7  "modOrder" : "006",
8  "strings" : {
9   "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
10   "0eceeb45861f9585dd7a97a3e36f85c6" : "Created",
11   "7dce122004969d56ae2e0245cb754d35" : "Edit",
12   "01abfc750a0c942167651c40d088531d" : "#",
13   "a12a3079e14ced46e69ba52b8a90b21a" : "IP",
14   "dae8ace18bdcbcc6ae5aece263e14fe8" : "Options",
15   "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
16   "4d3d769b812b6faa6b76e1a8abaece2d" : "Active",
17   "e3030abfa75de4573fb37032affa11e7" : "IP Access"
18  },
19  "items" : [
20   {
21    "xtype" : "Nest",
22    "$ xns" : "Roo.bootstrap.panel",
23    "String title" : "IP Access",
24    "Boolean background" : true,
25    "items" : [
26     {
27      "xtype" : "Border",
28      "$ xns" : "Roo.bootstrap.layout",
29      "* prop" : "layout",
30      "items" : [
31       {
32        "String tabPosition" : "top",
33        "xtype" : "Region",
34        "Boolean hideTabs" : true,
35        "$ xns" : "Roo.bootstrap.layout",
36        "* prop" : "center"
37       },
38       {
39        "listeners" : {
40         "activate" : "function (_self)\n{\n    _this.edit_btn.hide();\n    _this.delete_btn.hide();\n    \n    if (_this.option_grid) {\n        _this.option_grid.store.load({});\n    }\n}",
41         "render" : "function (_self)\n{\n    _this.option_panel = _self;\n}"
42        },
43        "Boolean fitContainer" : true,
44        "xtype" : "Grid",
45        "Boolean fitToFrame" : true,
46        "String region" : "center",
47        "$ xns" : "Roo.bootstrap.panel",
48        "String title" : "Options",
49        "Boolean background" : false,
50        "items" : [
51         {
52          "xtype" : "NavSimplebar",
53          "$ xns" : "Roo.bootstrap",
54          "* prop" : "toolbar",
55          "items" : [
56           {
57            "xtype" : "NavGroup",
58            "$ xns" : "Roo.bootstrap",
59            "items" : [
60             {
61              "xtype" : "NavItem",
62              "$ xns" : "Roo.bootstrap",
63              "items" : [
64               {
65                "xtype" : "Element",
66                "$ xns" : "Roo.bootstrap",
67                "items" : [
68                 {
69                  "String cls" : "roo-toolbar",
70                  "xtype" : "Row",
71                  "$ xns" : "Roo.bootstrap",
72                  "items" : [
73                   {
74                    "Number md" : 12,
75                    "xtype" : "Column",
76                    "$ xns" : "Roo.bootstrap",
77                    "items" : [
78                     {
79                      "listeners" : {
80                       "click" : "function (_self, e)\n{\n    var sel = _this.type_grid.getSelectionModel().getSelected();\n    \n    if(!sel || sel.data.id * 1 < 1 || !sel.data.name.length ){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please select a type');\n        return;\n    }\n\n    Pman.Dialog.BAdminCoreEnum.show({ \n        id : 0,\n        etype : sel.data.name\n    }, function(res) {\n        _this.option_grid.store.load({});\n    });\n\n}"
81                      },
82                      "String cls" : "roo-toolbar-button",
83                      "String weight" : "default",
84                      "xtype" : "Button",
85                      "$ xns" : "Roo.bootstrap",
86                      "String html" : "Add",
87                      "String glyphicon" : "plus"
88                     },
89                     {
90                      "listeners" : {
91                       "render" : "function (_self)\n{\n    _this.edit_btn = this;\n    \n    this.hide();\n}",
92                       "click" : "function (_self, e)\n{\n    var sel = _this.option_grid.getSelectionModel().getSelected();\n    \n    if(!sel || sel.data.id * 1 < 1){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');\n        return;\n    }\n\n    Pman.Dialog.BAdminCoreEnum.show({ \n        id : sel.data.id\n    }, function(res) {\n        _this.option_grid.store.load({});\n    });\n\n}"
93                      },
94                      "String cls" : "roo-toolbar-button",
95                      "String weight" : "default",
96                      "xtype" : "Button",
97                      "$ xns" : "Roo.bootstrap",
98                      "String html" : "Edit",
99                      "String glyphicon" : "edit"
100                     },
101                     {
102                      "listeners" : {
103                       "render" : "function (_self)\n{\n    _this.delete_btn = this;\n    \n    this.hide();\n}",
104                       "click" : "function (_self, e)\n{\n    var sel = _this.option_grid.getSelectionModel().getSelected();\n    \n    if(!sel || sel.data.id * 1 < 1){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please select a option');\n        return;\n    }\n\n    new Pman.Request({\n        url: baseURL + '/Roo/Core_enum.php',\n        method : 'POST',\n        params : {\n            _delete : sel.data.id\n        }, \n        success : function(res) {\n            _this.option_grid.store.load({});\n        }\n    });\n\n}"
105                      },
106                      "String cls" : "roo-toolbar-button",
107                      "String weight" : "primary",
108                      "xtype" : "Button",
109                      "$ xns" : "Roo.bootstrap",
110                      "String html" : "Delete",
111                      "String glyphicon" : "trash"
112                     }
113                    ]
114                   }
115                  ]
116                 }
117                ]
118               }
119              ]
120             }
121            ]
122           }
123          ]
124         },
125         {
126          "listeners" : {
127           "rowdblclick" : "function (_self, el, rowIndex, e)\n{\n    var sel = _this.option_grid.store.getAt(rowIndex);\n    \n    if(!sel || sel.data.id * 1 < 1){\n        return;\n    }\n    \n    Pman.Dialog.BAdminCoreEnum.show({ \n        id : sel.data.id\n    }, function(res) {\n        _this.option_grid.store.load({});\n    });\n    \n}",
128           "cellclick" : "function (_self, el, rowIndex, columnIndex, e)\n{\n    var di = _this.option_grid.colModel.getDataIndex(columnIndex);\n    \n    if (di != 'active') {\n        return;\n    }\n     \n    var rec = _this.option_grid.store.getAt(rowIndex);\n    \n    rec.set('active', rec.data.active ? 0 : 1);\n    \n    rec.commit();\n}",
129           "render" : "function (_self)\n{\n    _this.option_grid = _self; \n\n}"
130          },
131          "Boolean cellSelection" : true,
132          "String cls" : "table-fixed",
133          "Boolean footerShow" : false,
134          "boolean hover" : true,
135          "boolean striped" : true,
136          "xtype" : "Table",
137          "boolean responsive" : true,
138          "Boolean rowSelection" : true,
139          "$ xns" : "Roo.bootstrap",
140          "Boolean loadMask" : true,
141          "* prop" : "grid",
142          "items" : [
143           {
144            "listeners" : {
145             "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}"
146            },
147            "Boolean singleSelect" : true,
148            "xtype" : "RowSelectionModel",
149            "$ xns" : "Roo.bootstrap.Table",
150            "* prop" : "sm"
151           },
152           {
153            "listeners" : {
154             "update" : "function (_self, record, operation)\n{\n    if (operation != 'commit') {\n        return;\n    }\n\n    new Pman.Request({\n        url : baseURL + '/Roo/Core_enum',\n        method :'POST',\n        params : {\n            id : record.data.id,\n            active: record.data.active\n        },\n        success : function() {\n\n        },\n        failure : function() \n        {\n            Roo.bootstrap.MessageBox.alert(\"Error\", \"saving failed\", function() {\n                _this.grid.footer.onClick('first');\n            });\n        }\n    });\n}",
155             "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    \n}",
156             "load" : "function (_self, records, options)\n{\n    _this.edit_btn.hide();\n    _this.delete_btn.hide();\n}"
157            },
158            "xtype" : "Store",
159            "boolean remoteSort" : true,
160            "$ xns" : "Roo.data",
161            "$ sortinfo" : "{ field : 'display_name', direction: 'ASC' }",
162            "* prop" : "store",
163            "items" : [
164             {
165              "$ 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]",
166              "xtype" : "JsonReader",
167              "String root" : "data",
168              "$ xns" : "Roo.data",
169              "String id" : "id",
170              "* prop" : "reader",
171              "String totalProperty" : "total"
172             },
173             {
174              "$ url" : "baseURL + '/Roo/Core_ip_access.php'",
175              "xtype" : "HttpProxy",
176              "$ xns" : "Roo.data",
177              "String method" : "GET",
178              "* prop" : "proxy"
179             }
180            ]
181           },
182           {
183            "String header" : "#",
184            "String cursor" : "pointer",
185            "String dataIndex" : "id",
186            "xtype" : "ColumnModel",
187            "$ xns" : "Roo.grid",
188            "$ renderer" : "function(v,x,r) \n{\n    return String.format('{0}', v ? v : '');\n}",
189            "Boolean sortable" : true,
190            "* prop" : "cm[]"
191           },
192           {
193            "String header" : "Created",
194            "String cursor" : "pointer",
195            "String dataIndex" : "created_dt",
196            "xtype" : "ColumnModel",
197            "$ xns" : "Roo.grid",
198            "$ renderer" : "function(v,x,r) { \n    return String.format('{0}', v ? v : '');\n}",
199            "Boolean sortable" : true,
200            "* prop" : "cm[]"
201           },
202           {
203            "String header" : "IP",
204            "String cursor" : "pointer",
205            "String dataIndex" : "ip",
206            "xtype" : "ColumnModel",
207            "$ xns" : "Roo.grid",
208            "$ renderer" : "function(v,x,r) { \n    return String.format('{0}', v ? v : '');\n}",
209            "Boolean sortable" : true,
210            "* prop" : "cm[]"
211           },
212           {
213            "String header" : "Active",
214            "String cursor" : "pointer",
215            "Number md" : 2,
216            "String dataIndex" : "active",
217            "xtype" : "ColumnModel",
218            "Number xs" : 2,
219            "$ xns" : "Roo.grid",
220            "$ renderer" : "function(v,x,r) { \n    var state = v > 0 ?  '-checked' : '';\n\n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n}",
221            "Boolean sortable" : false,
222            "* prop" : "cm[]",
223            "Number sm" : 2
224           }
225          ]
226         }
227        ]
228       }
229      ]
230     }
231    ]
232   }
233  ]
234 }