DataObjects/Core_person_signup.php
[Pman.Core] / Pman.Tab.CoreOAuthClient.bjs
index 08dbbfe..d39efd6 100644 (file)
 {
-    "id": "roo-file-363",
+    "id": "roo-file-224",
     "name": "Pman.Tab.CoreOAuthClient",
-    "parent": "",
+    "parent": "Pman.Tab.Admin",
     "title": "",
     "path": "/home/edward/gitlive/Pman.Core/Pman.Tab.CoreOAuthClient.bjs",
-    "items": [],
+    "items": [
+        {
+            "region": "center",
+            "title": "Oauth2 Clients",
+            "xtype": "NestedLayoutPanel",
+            "|xns": "Roo",
+            "items": [
+                {
+                    "|xns": "Roo",
+                    "xtype": "BorderLayout",
+                    "*prop": "layout",
+                    "items": [
+                        {
+                            "*prop": "center",
+                            "autoScroll": false,
+                            "split": true,
+                            "xtype": "LayoutRegion",
+                            "|xns": "Roo"
+                        },
+                        {
+                            "listeners": {
+                                "|activate": "function() {\n    _this.panel = this;\n    \n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
+                            },
+                            "background": true,
+                            "fitContainer": true,
+                            "fitToframe": true,
+                            "region": "center",
+                            "tableName": "core_oauth_clients",
+                            "title": "Oauth2 Clients",
+                            "xtype": "GridPanel",
+                            "|xns": "Roo",
+                            "items": [
+                                {
+                                    "listeners": {
+                                        "|render": "function() \n{\n    _this.grid = this; \n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
+                                        "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}"
+                                    },
+                                    "*prop": "grid",
+                                    "autoExpandColumn": "redirect_uri",
+                                    "clicksToEdit": 1,
+                                    "loadMask": true,
+                                    "xtype": "EditorGrid",
+                                    "|xns": "Roo.grid",
+                                    "items": [
+                                        {
+                                            "listeners": {
+                                                "beforeload": "function (_self, o){\n    o.params = o.params || {};\n\n}\n",
+                                                "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}"
+                                            },
+                                            "*prop": "dataSource",
+                                            "remoteSort": true,
+                                            "xtype": "Store",
+                                            "|sortInfo": "{ field : 'client_id', direction: 'ASC' }",
+                                            "|xns": "Roo.data",
+                                            "items": [
+                                                {
+                                                    "*prop": "proxy",
+                                                    "method": "GET",
+                                                    "xtype": "HttpProxy",
+                                                    "|url": "baseURL + '/Roo/Core_oauth_clients'",
+                                                    "|xns": "Roo.data"
+                                                },
+                                                {
+                                                    "*prop": "reader",
+                                                    "id": "id",
+                                                    "root": "data",
+                                                    "totalProperty": "total",
+                                                    "xtype": "JsonReader",
+                                                    "|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]",
+                                                    "|xns": "Roo.data"
+                                                }
+                                            ]
+                                        },
+                                        {
+                                            "|xns": "Roo",
+                                            "xtype": "Toolbar",
+                                            "*prop": "toolbar",
+                                            "items": [
+                                                {
+                                                    "listeners": {
+                                                        "|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"
+                                                    },
+                                                    "cls": "x-btn-text-icon",
+                                                    "text": "Add",
+                                                    "xtype": "Button",
+                                                    "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
+                                                    "|xns": "Roo.Toolbar"
+                                                },
+                                                {
+                                                    "listeners": {
+                                                        "|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}"
+                                                    },
+                                                    "cls": "x-btn-text-icon",
+                                                    "text": "Remove",
+                                                    "xtype": "Button",
+                                                    "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
+                                                    "|xns": "Roo.Toolbar"
+                                                }
+                                            ]
+                                        },
+                                        {
+                                            "*prop": "footer",
+                                            "displayInfo": true,
+                                            "emptyMsg": "No Clients found",
+                                            "pageSize": 25,
+                                            "xtype": "PagingToolbar",
+                                            "|xns": "Roo"
+                                        },
+                                        {
+                                            "*prop": "colModel[]",
+                                            "dataIndex": "client_id",
+                                            "header": "Client ID",
+                                            "width": 150,
+                                            "xtype": "ColumnModel",
+                                            "|renderer": "function(v) { \n    return String.format('{0}', v ? v : '');\n}",
+                                            "|xns": "Roo.grid",
+                                            "items": [
+                                                {
+                                                    "|xns": "Roo.grid",
+                                                    "xtype": "GridEditor",
+                                                    "*prop": "editor",
+                                                    "items": [
+                                                        {
+                                                            "*prop": "field",
+                                                            "allowBlank": false,
+                                                            "xtype": "TextField",
+                                                            "|xns": "Roo.form"
+                                                        }
+                                                    ]
+                                                }
+                                            ]
+                                        },
+                                        {
+                                            "*prop": "colModel[]",
+                                            "dataIndex": "client_secret",
+                                            "header": "Client Secret",
+                                            "width": 150,
+                                            "xtype": "ColumnModel",
+                                            "|renderer": "function(v) { \n    return String.format('{0}', v ? v : '');\n}",
+                                            "|xns": "Roo.grid",
+                                            "items": [
+                                                {
+                                                    "|xns": "Roo.grid",
+                                                    "xtype": "GridEditor",
+                                                    "*prop": "editor",
+                                                    "items": [
+                                                        {
+                                                            "*prop": "field",
+                                                            "allowBlank": false,
+                                                            "xtype": "TextField",
+                                                            "|xns": "Roo.form"
+                                                        }
+                                                    ]
+                                                }
+                                            ]
+                                        },
+                                        {
+                                            "*prop": "colModel[]",
+                                            "dataIndex": "redirect_uri",
+                                            "header": "Redirect URI",
+                                            "width": 150,
+                                            "xtype": "ColumnModel",
+                                            "|renderer": "function(v) { \n    return String.format('{0}', v ? v : '');\n}",
+                                            "|xns": "Roo.grid",
+                                            "items": [
+                                                {
+                                                    "|xns": "Roo.grid",
+                                                    "xtype": "GridEditor",
+                                                    "*prop": "editor",
+                                                    "items": [
+                                                        {
+                                                            "*prop": "field",
+                                                            "xtype": "TextField",
+                                                            "|xns": "Roo.form"
+                                                        }
+                                                    ]
+                                                }
+                                            ]
+                                        }
+                                    ]
+                                }
+                            ]
+                        }
+                    ]
+                }
+            ]
+        }
+    ],
     "permname": "",
-    "modOrder": "001"
+    "modOrder": "900"
 }
\ No newline at end of file