提交表单后,我正在使用MailChimp API在列表上创建新记录。但是,根据New Relic的要求,目前这些请求最多可能需要700毫秒。如果这是一个查找,我将限制// Setting HTML Label to true
mxGraph.prototype.isHtmlLabel = function(cell)
{
return true;
}
graph.convertValueToString = function(cell)
{
if (mxUtils.isNode(cell.value))
{
var labelVal = cell.getAttribute('label', '');
if (labelVal != null)
{
return labelVal;
}
return '';
}
return '';
};
var tmpElem = doc.createElement("testnode");
// Setting label text as HTML formatted content
tmpElem.setAttribute('label', '<div class="roottitle">Label Text</div>');
graphItm = graph.insertVertex(parent, null, tmpElem, 0, 0, 100, 30);
var ExportGraphToImage = function()
{
exportFile("png");
}
function exportFile(format) {
var bg = '#ffffff';
var scale = 1;
var b = 1;
var imgExport = new mxImageExport();
var bounds = graph.getGraphBounds();
var vs = graph.view.scale;
// New image export
var xmlDoc = mxUtils.createXmlDocument();
var root = xmlDoc.createElement('output');
xmlDoc.appendChild(root);
// Renders graph. Offset will be multiplied with state's scale when painting state.
var xmlCanvas = new mxXmlCanvas2D(root);
xmlCanvas.translate(Math.floor((b / scale - bounds.x) / vs), Math.floor((b / scale - bounds.y) / vs));
xmlCanvas.scale(scale / vs);
imgExport.drawState(graph.getView().getState(graph.model.root), xmlCanvas);
// Puts request data together
var w = Math.ceil(bounds.width * scale / vs + 2 * b);
var h = Math.ceil(bounds.height * scale / vs + 2 * b);
var xml = mxUtils.getXml(root);
if (bg != null) {
bg = '&bg=' + bg;
}
new mxXmlRequest('../mxGraph/Export.ashx', 'filename=export.' + format + '&format=' + format +
bg + '&w=' + w + '&h=' + h + '&xml=' + encodeURIComponent(xml)).
simulate(document, '_blank');
}
参数来更改返回的内容-除了成功/失败响应之外,我实际上不需要任何其他内容-但似乎没有任何类似的内容在PUT列表端点上。有办法吗?