DataObjects/I18n.php
[Pman.Core] / Pman.Tab.CoreOAuthClient.bjs
1 {
2     "id": "roo-file-224",
3     "name": "Pman.Tab.CoreOAuthClient",
4     "parent": "Pman.Tab.Admin",
5     "title": "",
6     "path": "/home/edward/gitlive/Pman.Core/Pman.Tab.CoreOAuthClient.bjs",
7     "items": [
8         {
9             "region": "center",
10             "title": "Oauth2 Clients",
11             "xtype": "NestedLayoutPanel",
12             "|xns": "Roo",
13             "items": [
14                 {
15                     "|xns": "Roo",
16                     "xtype": "BorderLayout",
17                     "*prop": "layout",
18                     "items": [
19                         {
20                             "*prop": "center",
21                             "autoScroll": false,
22                             "split": true,
23                             "xtype": "LayoutRegion",
24                             "|xns": "Roo"
25                         },
26                         {
27                             "listeners": {
28                                 "|activate": "function() {\n    _this.panel = this;\n    \n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
29                             },
30                             "background": true,
31                             "fitContainer": true,
32                             "fitToframe": true,
33                             "region": "center",
34                             "tableName": "core_oauth_clients",
35                             "title": "Oauth2 Clients",
36                             "xtype": "GridPanel",
37                             "|xns": "Roo",
38                             "items": [
39                                 {
40                                     "listeners": {
41                                         "|render": "function() \n{\n    _this.grid = this; \n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
42                                         "afteredit": "function (e)\n{\n    if(e.originalValue == e.value || !e.value.length){\n        return false;\n    }\n    \n    Roo.log('commit it');\n    e.record.commit();\n}"
43                                     },
44                                     "*prop": "grid",
45                                     "autoExpandColumn": "redirect_uri",
46                                     "clicksToEdit": 1,
47                                     "loadMask": true,
48                                     "xtype": "EditorGrid",
49                                     "|xns": "Roo.grid",
50                                     "items": [
51                                         {
52                                             "listeners": {
53                                                 "beforeload": "function (_self, o){\n    o.params = o.params || {};\n\n}\n",
54                                                 "update": "function (_self, record, operation)\n{\n    if (operation != Roo.data.Record.COMMIT) {\n        return;\n    }\n\n    if (!record.data.client_id.length || !record.data.client_secret.length) {\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Core_oauth_clients',\n        method : 'POST',\n        params : {\n            id : record.data.id,\n            client_id : record.data.client_id,\n            client_secret : record.data.client_secret,\n            redirect_uri : record.data.redirect_uri\n        },\n        success : function(res) {\n            _this.grid.footer.onClick('refresh');\n        }\n    });\n    \n}"
55                                             },
56                                             "*prop": "dataSource",
57                                             "remoteSort": true,
58                                             "xtype": "Store",
59                                             "|sortInfo": "{ field : 'client_id', direction: 'ASC' }",
60                                             "|xns": "Roo.data",
61                                             "items": [
62                                                 {
63                                                     "*prop": "proxy",
64                                                     "method": "GET",
65                                                     "xtype": "HttpProxy",
66                                                     "|url": "baseURL + '/Roo/Core_oauth_clients'",
67                                                     "|xns": "Roo.data"
68                                                 },
69                                                 {
70                                                     "*prop": "reader",
71                                                     "id": "id",
72                                                     "root": "data",
73                                                     "totalProperty": "total",
74                                                     "xtype": "JsonReader",
75                                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'client_id',\n        'type': 'string'\n    },\n    {\n        'name': 'client_secret',\n        'type': 'string'\n    },\n    {\n        'name': 'redirect_uri',\n        'type': 'string'\n    }\n]",
76                                                     "|xns": "Roo.data"
77                                                 }
78                                             ]
79                                         },
80                                         {
81                                             "|xns": "Roo",
82                                             "xtype": "Toolbar",
83                                             "*prop": "toolbar",
84                                             "items": [
85                                                 {
86                                                     "listeners": {
87                                                         "|click": "function()\n{\n    \n    var nr = _this.grid.ds.reader.newRow({\n        id : 0,\n        client_id : '',\n        client_secret : '',\n        redirect_uri : ''\n    });\n    \n    _this.grid.stopEditing();\n    _this.grid.ds.insert(_this.grid.ds.getCount(), nr); \n    _this.grid.startEditing(_this.grid.ds.getCount()-1, 0);\n}\n"
88                                                     },
89                                                     "cls": "x-btn-text-icon",
90                                                     "text": "Add",
91                                                     "xtype": "Button",
92                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
93                                                     "|xns": "Roo.Toolbar"
94                                                 },
95                                                 {
96                                                     "listeners": {
97                                                         "|click": "function ()\n{   \n    var cs = _this.grid.getSelectionModel().getSelectedCell();\n    if (!cs) {\n        Roo.MessageBox.alert(\"Error\", \"Select a cell\");\n        return;\n    }\n    _this.grid.stopEditing();\n \n    var r = _this.grid.ds.getAt(cs[0]);\n    \n    Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete this client?\", function (v){\n        if (v != 'yes') {\n            return;\n        }\n        \n        new Pman.Request({\n            url : baseURL + '/Roo/Core_oauth_clients',\n            method : 'POST',\n            params : {\n                _delete : r.data.id\n            },\n            success : function(res) {\n                _this.grid.footer.onClick('refresh');\n            }\n        });\n    });\n}"
98                                                     },
99                                                     "cls": "x-btn-text-icon",
100                                                     "text": "Remove",
101                                                     "xtype": "Button",
102                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
103                                                     "|xns": "Roo.Toolbar"
104                                                 }
105                                             ]
106                                         },
107                                         {
108                                             "*prop": "footer",
109                                             "displayInfo": true,
110                                             "emptyMsg": "No Clients found",
111                                             "pageSize": 25,
112                                             "xtype": "PagingToolbar",
113                                             "|xns": "Roo"
114                                         },
115                                         {
116                                             "*prop": "colModel[]",
117                                             "dataIndex": "client_id",
118                                             "header": "Client ID",
119                                             "width": 150,
120                                             "xtype": "ColumnModel",
121                                             "|renderer": "function(v) { \n    return String.format('{0}', v ? v : '');\n}",
122                                             "|xns": "Roo.grid",
123                                             "items": [
124                                                 {
125                                                     "|xns": "Roo.grid",
126                                                     "xtype": "GridEditor",
127                                                     "*prop": "editor",
128                                                     "items": [
129                                                         {
130                                                             "*prop": "field",
131                                                             "allowBlank": false,
132                                                             "xtype": "TextField",
133                                                             "|xns": "Roo.form"
134                                                         }
135                                                     ]
136                                                 }
137                                             ]
138                                         },
139                                         {
140                                             "*prop": "colModel[]",
141                                             "dataIndex": "client_secret",
142                                             "header": "Client Secret",
143                                             "width": 150,
144                                             "xtype": "ColumnModel",
145                                             "|renderer": "function(v) { \n    return String.format('{0}', v ? v : '');\n}",
146                                             "|xns": "Roo.grid",
147                                             "items": [
148                                                 {
149                                                     "|xns": "Roo.grid",
150                                                     "xtype": "GridEditor",
151                                                     "*prop": "editor",
152                                                     "items": [
153                                                         {
154                                                             "*prop": "field",
155                                                             "allowBlank": false,
156                                                             "xtype": "TextField",
157                                                             "|xns": "Roo.form"
158                                                         }
159                                                     ]
160                                                 }
161                                             ]
162                                         },
163                                         {
164                                             "*prop": "colModel[]",
165                                             "dataIndex": "redirect_uri",
166                                             "header": "Redirect URI",
167                                             "width": 150,
168                                             "xtype": "ColumnModel",
169                                             "|renderer": "function(v) { \n    return String.format('{0}', v ? v : '');\n}",
170                                             "|xns": "Roo.grid",
171                                             "items": [
172                                                 {
173                                                     "|xns": "Roo.grid",
174                                                     "xtype": "GridEditor",
175                                                     "*prop": "editor",
176                                                     "items": [
177                                                         {
178                                                             "*prop": "field",
179                                                             "xtype": "TextField",
180                                                             "|xns": "Roo.form"
181                                                         }
182                                                     ]
183                                                 }
184                                             ]
185                                         }
186                                     ]
187                                 }
188                             ]
189                         }
190                     ]
191                 }
192             ]
193         }
194     ],
195     "permname": "",
196     "modOrder": "900"
197 }