[pve-devel] r6091 - in pve-manager/pve2: . www www/apidoc

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Jun 16 14:01:20 CEST 2011


Author: dietmar
Date: 2011-06-16 14:01:20 +0200 (Thu, 16 Jun 2011)
New Revision: 6091

Removed:
   pve-manager/pve2/www/apidoc/Makefile.am
   pve-manager/pve2/www/apidoc/PVEAPI.js
   pve-manager/pve2/www/apidoc/PVETable.js
   pve-manager/pve2/www/apidoc/apidoc.html
   pve-manager/pve2/www/apidoc/extractapi.pl
Modified:
   pve-manager/pve2/configure.in
   pve-manager/pve2/www/Makefile.am
Log:


Modified: pve-manager/pve2/configure.in
===================================================================
--- pve-manager/pve2/configure.in	2011-06-16 11:22:27 UTC (rev 6090)
+++ pve-manager/pve2/configure.in	2011-06-16 12:01:20 UTC (rev 6091)
@@ -58,7 +58,6 @@
 www/css/Makefile
 www/ext4/Makefile
 www/manager/Makefile
-www/apidoc/Makefile
 www/images/Makefile
 www/templates/pve.conf
 ])

Modified: pve-manager/pve2/www/Makefile.am
===================================================================
--- pve-manager/pve2/www/Makefile.am	2011-06-16 11:22:27 UTC (rev 6090)
+++ pve-manager/pve2/www/Makefile.am	2011-06-16 12:01:20 UTC (rev 6091)
@@ -1,6 +1,6 @@
 include $(top_builddir)/common.mk
 
-SUBDIRS = templates images ext4 css manager apidoc
+SUBDIRS = templates images ext4 css manager
 
 install-data-hook:
 	chown -R www-data:www-data ${DESTDIR}${WWW_BASEDIR}

Deleted: pve-manager/pve2/www/apidoc/Makefile.am
===================================================================
--- pve-manager/pve2/www/apidoc/Makefile.am	2011-06-16 11:22:27 UTC (rev 6090)
+++ pve-manager/pve2/www/apidoc/Makefile.am	2011-06-16 12:01:20 UTC (rev 6091)
@@ -1,22 +0,0 @@
-include $(top_builddir)/common.mk
-
-apidata.js: extractapi.pl
-	./extractapi.pl >$@
-
-JSSRC= 				       	\
-	apidata.js			\
-	PVEAPI.js
-
-apidoc.js: ${JSSRC}
-	cat ${JSSRC} >$@
-
-pvelib_DATA = apidoc.js apidoc.html
-pvelibdir = ${WWW_ROOTDIR}
-
-install-data-hook: 
-	chown -R www-data:www-data ${DESTDIR}/${pvelibdir}
-
-clean-local:
-	-rm -rf *~ apidata.js apidoc.js
-
-

Deleted: pve-manager/pve2/www/apidoc/PVEAPI.js
===================================================================
--- pve-manager/pve2/www/apidoc/PVEAPI.js	2011-06-16 11:22:27 UTC (rev 6090)
+++ pve-manager/pve2/www/apidoc/PVEAPI.js	2011-06-16 12:01:20 UTC (rev 6091)
@@ -1,254 +0,0 @@
-Ext.require([
-    'Ext.tree.*',
-    'Ext.data.*',
-    'Ext.window.MessageBox'
-]);
-
-Ext.onReady(function() {
-
-    Ext.define('pve-param-schema', {
-        extend: 'Ext.data.Model',
-        fields:  [ 
-	    'name', 'type', 'typetext', 'description', 'enum', 
-	    'minimum', 'maximum', 'minLength', 'maxLength',
-	    'pattern', 'title', 'requires', 'format', 'default',
-	    'disallow', 'extends', 'links',
-	    {
-		name: 'optional',
-		type: 'boolean'
-	    }
-	]
-    });
-
-    var store = Ext.create('Ext.data.TreeStore', {
-	model: Ext.define('pve-api-doc', {
-            extend: 'Ext.data.Model',
-            fields:  [ 
-		'path', 'info', 'text',
-	    ]
-	}),
-        proxy: {
-            type: 'memory',
-            data: pveapi
-        },
-        sorters: [{
-            property: 'leaf',
-            direction: 'ASC'
-        }, {
-            property: 'text',
-            direction: 'ASC'
-        }]
-    });
-    
-    var render_text = function(value, metaData, record) {
-	var pdef = record.data;
-
-	metaData.style = 'white-space:pre-wrap;'
-
-	return  value;
-    };
-
-    var render_type = function(value, metaData, record) {
-	var pdef = record.data;
-
-	return pdef['enum'] ? 'enum' : (pdef.type || 'string');
-    };
-
-    var render_format = function(value, metaData, record) {
-	var pdef = record.data;
-
-	metaData.style = 'white-space:normal;'
-
-	if (pdef.typetext)
-	    return pdef.typetext;
-
-	if (pdef['enum'])
-	    return pdef['enum'].join(' | ');
-
-	if (pdef.format) 
-	    return pdef.format;
-
-	if (pdef.pattern) 
-	    return pdef.pattern;
-
-	return '';
-    };
-
-    var render_docu = function(data) {
-	var md = data.info;
-
-	console.log(data);
-
-	var items = [];
-
-	Ext.Array.each(['GET', 'POST', 'PUT', 'DELETE'], function(method) {
-	    var info = md[method];
-	    if (info) {
-
-		var sections = [
-		    {
-			title: 'Description',
-			html: info.description,
-			bodyPadding: 10
-		    }
-		];
-
-		if (info.parameters && info.parameters.properties) {
-
-		    var pstore = Ext.create('Ext.data.Store', {
-			model: 'pve-param-schema',
-			proxy: {
-			    type: 'memory'
-			},
-			groupField: 'optional',
-			sorters: [
-			    {
-				property: 'name',
-				direction: 'ASC'
-			    }
-			]
-		    });
-
-		    Ext.Object.each(info.parameters.properties, function(name, pdef) {
-			pdef.name = name;
-			pstore.add(pdef);
-		    });
-
-		    pstore.sort();
-
-		    var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
-			enableGroupingMenu: false,
-			groupHeaderTpl: '<tpl if="name">Optional</tpl><tpl if="!name">Required</tpl>'
-		    });
-
-		    sections.push({
-			xtype: 'gridpanel',
-			title: 'Parameters',
-			features: [groupingFeature],
-			store: pstore,
-			viewConfig: {
-			    trackOver: false,
-			    stripeRows: true
-			},
-			columns: [
-			    { 
-				header: 'Name',
-				dataIndex: 'name'
-			    },
-			    { 
-				header: 'Type',
-				dataIndex: 'type',
-				renderer: render_type,
-			    },
-			    { 
-				header: 'Format',
-				dataIndex: 'type',
-				renderer: render_format,
-				flex: 1
-			    },
-			    { 
-				header: 'Description',
-				dataIndex: 'description',
-				renderer: render_text,
-				flex: 2
-			    }
-			]
-		    });
-
-		}
-
-		if (info.returns) {
-
-		    var rtype = info.returns.type;
-		    if (!rtype && info.returns.items)
-			rtype = 'array';
-		    if (!rtype)
-			rtype = 'object';
-
-		    sections.push({
-			title: 'Returns: ' + rtype
-		    });
-		}
-
-		var permhtml = '';
-		if (!info.permissions) {
-		    permhtml = "Root only.";
-		} else if (info.permissions.user) {
-		    if (info.permissions.user === 'world') {
-			permhtml += "Accessible without any authententification.";
-		    } else if (info.permissions.user === 'all') {
-			permhtml += "Accessible by all authententicated users.";
-		    } else {
-			permhtml += 'Onyl accessible by user "' + 
-			    info.permissions.user + '"';
-		    }
-		} else if (info.permissions.path && info.permissions.privs) {
-		    permhtml += '<table><tr><td>Path:</td><td>' + 
-			info.permissions.path + '</td></tr>' +
-			'<tr><td style="padding-right:10px;">Permissions:</td><td>' + 
-			info.permissions.privs.join(' ') + 
-			'</td></tr></table>';
-		} else {
-		    permhtml += "Root only.";
-		}
-
-		sections.push({
-		    title: 'Required permissions',
-		    bodyPadding: 10,
-		    html: permhtml
-		});
-    
-  
-		items.push({
-		    title: method,
-		    autoScroll: true,
-		    defaults: {
-			border: false
-		    },
-		    items: sections
-		});
-	    }
-	});
-
-	var ct = Ext.getCmp('docview');
-	ct.setTitle("Path: " + data.path);
-	ct.removeAll(true);
-	ct.add(items);
-    };
-
-    var tree = Ext.create('Ext.tree.Panel', {
-        title: 'Resource Tree',
-        store: store,
-	width: 200,
-        region: 'west',
-        split: true,
-        margins: '5 0 5 5',
-        rootVisible: false,
-	listeners: {
-	    selectionchange: function(v, selections) {
-		if (!selections[0])
-		    return;
-		var rec = selections[0];
-		render_docu(rec.data);
-	    }
-	}
-    });
-
-    Ext.create('Ext.container.Viewport', {
-	layout: 'border',
-	renderTo: Ext.getBody(),
-	items: [
-	    tree,
-	    {
-		xtype: 'tabpanel',
-		title: 'Documentation',
-		id: 'docview',
-		region: 'center',
-		margins: '5 5 5 0',
-		layout: 'fit',
-		items: []
-	    }
-	]
-    });
-
-});

Deleted: pve-manager/pve2/www/apidoc/PVETable.js
===================================================================
--- pve-manager/pve2/www/apidoc/PVETable.js	2011-06-16 11:22:27 UTC (rev 6090)
+++ pve-manager/pve2/www/apidoc/PVETable.js	2011-06-16 12:01:20 UTC (rev 6091)
@@ -1,99 +0,0 @@
-// just a test - not usable now
-
-Ext.define('PVE.Table', {
-    extend: 'Ext.Component',
-
-    alias: 'widget.pvetable',
-
-    onRender: function() {
-        var me = this;
-
-	Ext.applyIf(me.renderData, {
-	    id: me.getId(),
-	    title: me.title,
-	    columns: me.columns
-	});
-
-	var rows = [];
-	me.store.each(function(record) {
-	    rows.push(record.data);
-	});
-
- 
-	me.renderData.rows = rows;
-	me.callParent(arguments);
-    },
-
-    metaRowTpl: '<tr>' +
-	'<tpl for="columns">' +
-	'<td>{{dataIndex}}</td>' +
-	'</tpl>'+ 
-	'</tr>',
-
-     metaRenderTpl: '<h1>{title}</h1>' +
-	'<table border="1" cellspacing="0" cellpadding="0">' +
-	'<tr><tpl for="columns">' +
-	'<th><div id="{parent.id}-th-resize{#}" style="background-color:red;">{header}</div></th>' +
-	'</tpl></tr>'+ 
-        '{[this.openRows()]}' +
-	'{row}'+ 
-        '{[this.closeRows()]}' +
-	'</table>',
-   
-    initComponent : function() {
-        var me = this;
-
-	Ext.Array.each(me.columns, function(col, i) {
-	    if (!col.width)
-		col.width = 100;
-	    if (!col.minWidth || (col.minWidth < 10))
-		col.minWidth = 10;
-	    if (col.width < col.minWidth)
-		col.width = col.minWidth;
-	});
-
-	var metaRowTpl = Ext.create('Ext.XTemplate', me.metaRowTpl);
-        me.row = metaRowTpl.applyTemplate(me);
-
-	var metaTpl = Ext.create('Ext.XTemplate', me.metaRenderTpl, {
-	    openRows: function() {
-		return '<tpl for="rows">';
-	    },
-
-	    closeRows: function() {
-		return '</tpl>';
-	    }
-	});
- 	var tpl = metaTpl.applyTemplate(me);
-
-	//console.log("TEST1 " + tpl);
-
-	Ext.apply(me, {
-	    renderTpl: tpl
-	});
-
- 	me.callParent();
-
-	// only works with FF
-	me.on('afterrender', function() {
-	    Ext.Array.each(me.columns, function(col, i) {
-		var myid = me.getId() + '-th-resize' + (i+1);
-		var rz = Ext.create('Ext.resizer.Resizer', {
-		    el: myid,
-		    handles: 'e',
-		    minWidth: col.minWidth,
-		    transparent: true,
-		    listeners: {
-			resize: function(t, width, height) {
-			    var target = t.getTarget();
-			    var parent = target.parent();
-			    parent.setWidth(width);
-			    t.el.setWidth(parent.getWidth()-1);
-			}
-		    }
-		});
-		rz.resizeTo(col.width);
-	    });
-	});
-    }
-});

Deleted: pve-manager/pve2/www/apidoc/apidoc.html
===================================================================
--- pve-manager/pve2/www/apidoc/apidoc.html	2011-06-16 11:22:27 UTC (rev 6090)
+++ pve-manager/pve2/www/apidoc/apidoc.html	2011-06-16 12:01:20 UTC (rev 6091)
@@ -1,14 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-    <title>Proxmox VE API Documentation</title>
-    <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-4.0.2/resources/css/ext-all.css" />
-
-    <script type="text/javascript" src="http://extjs.cachefly.net/ext-4.0.2/ext-all-debug.js"></script>
-    <script type="text/javascript" src="apidoc.js"></script>
-    
-</head>
-<body>
-</body>
-</html>

Deleted: pve-manager/pve2/www/apidoc/extractapi.pl
===================================================================
--- pve-manager/pve2/www/apidoc/extractapi.pl	2011-06-16 11:22:27 UTC (rev 6090)
+++ pve-manager/pve2/www/apidoc/extractapi.pl	2011-06-16 12:01:20 UTC (rev 6091)
@@ -1,12 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use PVE::RESTHandler;
-use PVE::API2;
-use JSON;
-
-my $tree = PVE::RESTHandler::api_dump('PVE::API2');
-
-print "var pveapi = " . to_json($tree, {pretty => 1}) . ";\n\n";
-
-exit(0);




More information about the pve-devel mailing list