Pman.Tab.AdminOffice.bjs
[Pman.Admin] / Pman.Tab.AdminOAuthClient.bjs
1 {
2  "name" : "Pman.Tab.AdminOAuthClient",
3  "parent" : "Pman.Tab.Admin",
4  "title" : "",
5  "path" : "/home/edward/gitlive/Pman.Admin/Pman.Tab.AdminOAuthClient.bjs",
6  "permname" : "",
7  "modOrder" : "900",
8  "strings" : {
9   "16f63df432feae9fab6840eabc9d3704" : "No Clients found",
10   "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
11   "76525f0f34b48475e5ca33f71d296f3b" : "Client ID",
12   "27499763cc523271e74f32ff4f740a7f" : "Redirect URI",
13   "1063e38cb53d94d386f21227fcd84717" : "Remove",
14   "0c95cb44ad29b66991e47d3e27fecadc" : "Oauth2 Clients",
15   "734082edf44417dd19cc65943aa65c36" : "Client Secret"
16  },
17  "items" : [
18   {
19    "region" : "center",
20    "xtype" : "NestedLayoutPanel",
21    "title" : "Oauth2 Clients",
22    "$ xns" : "Roo",
23    "items" : [
24     {
25      "xtype" : "BorderLayout",
26      "$ xns" : "Roo",
27      "* prop" : "layout",
28      "items" : [
29       {
30        "autoScroll" : false,
31        "xtype" : "LayoutRegion",
32        "$ xns" : "Roo",
33        "split" : true,
34        "* prop" : "center"
35       },
36       {
37        "listeners" : {
38         "|activate" : "function() {\n    _this.panel = this;\n    \n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
39        },
40        "fitToframe" : true,
41        "background" : true,
42        "region" : "center",
43        "title" : "Oauth2 Clients",
44        "xtype" : "GridPanel",
45        "fitContainer" : true,
46        "$ xns" : "Roo",
47        "tableName" : "core_oauth_clients",
48        "items" : [
49         {
50          "listeners" : {
51           "|render" : "function() \n{\n    _this.grid = this; \n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
52           "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}"
53          },
54          "autoExpandColumn" : "redirect_uri",
55          "xtype" : "EditorGrid",
56          "loadMask" : true,
57          "clicksToEdit" : 1,
58          "$ xns" : "Roo.grid",
59          "* prop" : "grid",
60          "items" : [
61           {
62            "listeners" : {
63             "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}",
64             "beforeload" : "function (_self, o){\n    o.params = o.params || {};\n\n}\n"
65            },
66            "xtype" : "Store",
67            "remoteSort" : true,
68            "$ sortInfo" : "{ field : 'client_id', direction: 'ASC' }",
69            "$ xns" : "Roo.data",
70            "* prop" : "dataSource",
71            "items" : [
72             {
73              "$ url" : "baseURL + '/Roo/Core_oauth_clients'",
74              "xtype" : "HttpProxy",
75              "method" : "GET",
76              "$ xns" : "Roo.data",
77              "* prop" : "proxy"
78             },
79             {
80              "id" : "id",
81              "root" : "data",
82              "xtype" : "JsonReader",
83              "$ 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]",
84              "$ xns" : "Roo.data",
85              "* prop" : "reader",
86              "totalProperty" : "total"
87             }
88            ]
89           },
90           {
91            "xtype" : "Toolbar",
92            "$ xns" : "Roo",
93            "* prop" : "toolbar",
94            "items" : [
95             {
96              "listeners" : {
97               "|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"
98              },
99              "text" : "Add",
100              "xtype" : "Button",
101              "cls" : "x-btn-text-icon",
102              "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
103              "$ xns" : "Roo.Toolbar"
104             },
105             {
106              "listeners" : {
107               "|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}"
108              },
109              "text" : "Remove",
110              "xtype" : "Button",
111              "cls" : "x-btn-text-icon",
112              "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
113              "$ xns" : "Roo.Toolbar"
114             }
115            ]
116           },
117           {
118            "pageSize" : 25,
119            "xtype" : "PagingToolbar",
120            "emptyMsg" : "No Clients found",
121            "$ xns" : "Roo",
122            "displayInfo" : true,
123            "* prop" : "footer"
124           },
125           {
126            "xtype" : "ColumnModel",
127            "header" : "Client ID",
128            "width" : 150,
129            "$ renderer" : "function(v) { \n    return String.format('{0}', v ? v : '');\n}",
130            "$ xns" : "Roo.grid",
131            "* prop" : "colModel[]",
132            "dataIndex" : "client_id",
133            "items" : [
134             {
135              "xtype" : "GridEditor",
136              "$ xns" : "Roo.grid",
137              "* prop" : "editor",
138              "items" : [
139               {
140                "xtype" : "TextField",
141                "allowBlank" : false,
142                "$ xns" : "Roo.form",
143                "* prop" : "field"
144               }
145              ]
146             }
147            ]
148           },
149           {
150            "xtype" : "ColumnModel",
151            "header" : "Client Secret",
152            "width" : 150,
153            "$ renderer" : "function(v) { \n    return String.format('{0}', v ? v : '');\n}",
154            "$ xns" : "Roo.grid",
155            "* prop" : "colModel[]",
156            "dataIndex" : "client_secret",
157            "items" : [
158             {
159              "xtype" : "GridEditor",
160              "$ xns" : "Roo.grid",
161              "* prop" : "editor",
162              "items" : [
163               {
164                "xtype" : "TextField",
165                "allowBlank" : false,
166                "$ xns" : "Roo.form",
167                "* prop" : "field"
168               }
169              ]
170             }
171            ]
172           },
173           {
174            "xtype" : "ColumnModel",
175            "header" : "Redirect URI",
176            "width" : 150,
177            "$ renderer" : "function(v) { \n    return String.format('{0}', v ? v : '');\n}",
178            "$ xns" : "Roo.grid",
179            "* prop" : "colModel[]",
180            "dataIndex" : "redirect_uri",
181            "items" : [
182             {
183              "xtype" : "GridEditor",
184              "$ xns" : "Roo.grid",
185              "* prop" : "editor",
186              "items" : [
187               {
188                "xtype" : "TextField",
189                "$ xns" : "Roo.form",
190                "* prop" : "field"
191               }
192              ]
193             }
194            ]
195           }
196          ]
197         }
198        ]
199       }
200      ]
201     }
202    ]
203   }
204  ]
205 }