+++ /dev/null
-{
- "id": "roo-file-224",
- "name": "Pman.Tab.CoreOAuthClient",
- "parent": "Pman.Tab.Admin",
- "title": "",
- "path": "/home/edward/gitlive/Pman.Core/Pman.Tab.CoreOAuthClient.bjs",
- "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": "900"
-}
\ No newline at end of file
+++ /dev/null
-//<script type="text/javascript">
-
-// Auto generated file - created by app.Builder.js- do not edit directly (at present!)
-
-Pman.Tab.CoreOAuthClient = new Roo.XComponent({
- part : ["Core","OAuthClient"],
- order : '900-Pman.Tab.CoreOAuthClient',
- region : 'center',
- parent : 'Pman.Tab.Admin',
- name : "unnamed module",
- disabled : false,
- permname : '',
- _tree : function()
- {
- var _this = this;
- var MODULE = this;
- return {
- xtype: 'NestedLayoutPanel',
- xns: Roo,
- region : 'center',
- title : "Oauth2 Clients",
- layout : {
- xtype: 'BorderLayout',
- xns: Roo,
- items : [
- {
- xtype: 'GridPanel',
- xns: Roo,
- listeners : {
- activate : function() {
- _this.panel = this;
-
- if (_this.grid) {
- _this.grid.footer.onClick('first');
- }
- }
- },
- background : true,
- fitContainer : true,
- fitToframe : true,
- region : 'center',
- tableName : 'core_oauth_clients',
- title : "Oauth2 Clients",
- grid : {
- xtype: 'EditorGrid',
- xns: Roo.grid,
- listeners : {
- render : function()
- {
- _this.grid = this;
- if (_this.panel.active) {
- this.footer.onClick('first');
- }
- },
- afteredit : function (e)
- {
- if(e.originalValue == e.value || !e.value.length){
- return false;
- }
-
- Roo.log('commit it');
- e.record.commit();
- }
- },
- autoExpandColumn : 'redirect_uri',
- clicksToEdit : 1,
- loadMask : true,
- dataSource : {
- xtype: 'Store',
- xns: Roo.data,
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
-
- },
- update : function (_self, record, operation)
- {
- if (operation != Roo.data.Record.COMMIT) {
- return;
- }
-
- if (!record.data.client_id.length || !record.data.client_secret.length) {
- return;
- }
-
- new Pman.Request({
- url : baseURL + '/Roo/Core_oauth_clients',
- method : 'POST',
- params : {
- id : record.data.id,
- client_id : record.data.client_id,
- client_secret : record.data.client_secret,
- redirect_uri : record.data.redirect_uri
- },
- success : function(res) {
- _this.grid.footer.onClick('refresh');
- }
- });
-
- }
- },
- remoteSort : true,
- sortInfo : { field : 'client_id', direction: 'ASC' },
- proxy : {
- xtype: 'HttpProxy',
- xns: Roo.data,
- method : 'GET',
- url : baseURL + '/Roo/Core_oauth_clients'
- },
- reader : {
- xtype: 'JsonReader',
- xns: Roo.data,
- id : 'id',
- root : 'data',
- totalProperty : 'total',
- fields : [
- {
- 'name': 'id',
- 'type': 'int'
- },
- {
- 'name': 'client_id',
- 'type': 'string'
- },
- {
- 'name': 'client_secret',
- 'type': 'string'
- },
- {
- 'name': 'redirect_uri',
- 'type': 'string'
- }
- ]
- }
- },
- toolbar : {
- xtype: 'Toolbar',
- xns: Roo,
- items : [
- {
- xtype: 'Button',
- xns: Roo.Toolbar,
- listeners : {
- click : function()
- {
-
- var nr = _this.grid.ds.reader.newRow({
- id : 0,
- client_id : '',
- client_secret : '',
- redirect_uri : ''
- });
-
- _this.grid.stopEditing();
- _this.grid.ds.insert(_this.grid.ds.getCount(), nr);
- _this.grid.startEditing(_this.grid.ds.getCount()-1, 0);
- }
- },
- cls : 'x-btn-text-icon',
- text : "Add",
- icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
- },
- {
- xtype: 'Button',
- xns: Roo.Toolbar,
- listeners : {
- click : function ()
- {
- var cs = _this.grid.getSelectionModel().getSelectedCell();
- if (!cs) {
- Roo.MessageBox.alert("Error", "Select a cell");
- return;
- }
- _this.grid.stopEditing();
-
- var r = _this.grid.ds.getAt(cs[0]);
-
- Roo.MessageBox.confirm("Confirm", "Are you sure you want to delete this client?", function (v){
- if (v != 'yes') {
- return;
- }
-
- new Pman.Request({
- url : baseURL + '/Roo/Core_oauth_clients',
- method : 'POST',
- params : {
- _delete : r.data.id
- },
- success : function(res) {
- _this.grid.footer.onClick('refresh');
- }
- });
- });
- }
- },
- cls : 'x-btn-text-icon',
- text : "Remove",
- icon : rootURL + '/Pman/templates/images/trash.gif'
- }
- ]
- },
- footer : {
- xtype: 'PagingToolbar',
- xns: Roo,
- displayInfo : true,
- emptyMsg : "No Clients found",
- pageSize : 25
- },
- colModel : [
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- dataIndex : 'client_id',
- header : 'Client ID',
- width : 150,
- renderer : function(v) {
- return String.format('{0}', v ? v : '');
- },
- editor : {
- xtype: 'GridEditor',
- xns: Roo.grid,
- field : {
- xtype: 'TextField',
- xns: Roo.form,
- allowBlank : false
- }
- }
- },
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- dataIndex : 'client_secret',
- header : 'Client Secret',
- width : 150,
- renderer : function(v) {
- return String.format('{0}', v ? v : '');
- },
- editor : {
- xtype: 'GridEditor',
- xns: Roo.grid,
- field : {
- xtype: 'TextField',
- xns: Roo.form,
- allowBlank : false
- }
- }
- },
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- dataIndex : 'redirect_uri',
- header : 'Redirect URI',
- width : 150,
- renderer : function(v) {
- return String.format('{0}', v ? v : '');
- },
- editor : {
- xtype: 'GridEditor',
- xns: Roo.grid,
- field : {
- xtype: 'TextField',
- xns: Roo.form
- }
- }
- }
- ]
- }
- }
- ],
- center : {
- xtype: 'LayoutRegion',
- xns: Roo,
- autoScroll : false,
- split : true
- }
- }
- };
- }
-});