瀏覽代碼

11.0.4 release

David Benson [draw.io] 6 年之前
父節點
當前提交
92562fc3e9

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+23-JUL-2019: 11.0.4
+
+- Adds timeout handler for Google Drive thumb generation
+
 23-JUL-2019: 11.0.3
 
 - Fixes handling of repository paths in GitLab

+ 1 - 1
VERSION

@@ -1 +1 @@
-11.0.3
+11.0.4

+ 13 - 2
src/main/java/com/mxgraph/online/ConverterServlet.java

@@ -7,6 +7,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.net.HttpURLConnection;
+import java.net.URI;
 import java.net.URL;
 import java.util.List;
 import java.util.logging.Level;
@@ -74,8 +75,6 @@ public class ConverterServlet  extends HttpServlet
 	protected void doPost(HttpServletRequest request,
 			HttpServletResponse response) throws ServletException, IOException
 	{
-		log.log(Level.CONFIG, "EMF-CONVERT: Request from " + request.getHeader("referer"));
-		
 		readApiKey();
 		
 		String inputformat = null, outputformat = null, fileName = null;
@@ -209,6 +208,18 @@ public class ConverterServlet  extends HttpServlet
 
 				bytesRead = in.read(data);
 				
+				try
+				{
+					URI uri = new URI(request.getHeader("referer"));
+				    String domain = uri.getHost();
+					log.log(Level.CONFIG, "EMF-CONVERT, domain: " + domain + " ,Filename: " + 
+							fileName != null ? fileName : "" + ", size: " + bytesRead);
+				}
+				catch (Exception e)
+				{
+					e.printStackTrace();
+				}
+				
 				while(bytesRead != -1) 
 				{
 					out.write(data, 0, bytesRead);

+ 1 - 1
src/main/webapp/cache.manifest

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 07/23/2019 03:26 PM
+# 07/23/2019 04:44 PM
 
 app.html
 index.html?offline=1

File diff suppressed because it is too large
+ 427 - 426
src/main/webapp/js/app.min.js


+ 21 - 1
src/main/webapp/js/diagramly/App.js

@@ -1943,12 +1943,30 @@ App.prototype.createCrcTable = function()
 /**
  * Returns a thumbnail of the current file.
  */
-App.prototype.getThumbnail = function(width, success)
+App.prototype.getThumbnail = function(width, fn)
 {
 	var result = false;
 	
 	try
 	{
+		var acceptResponse = true;
+		
+		var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
+		{
+			acceptResponse = false;
+			fn(null);
+		}), this.timeout);
+		
+		var success = mxUtils.bind(this, function(canvas)
+		{
+			window.clearTimeout(timeoutThread);
+			
+			if (acceptResponse)
+			{
+				fn(canvas);
+			}
+		});
+		
 		if (this.thumbImageCache == null)
 		{
 			this.thumbImageCache = new Object();
@@ -2111,6 +2129,8 @@ App.prototype.getThumbnail = function(width, success)
 	}
 	catch (e)
 	{
+		result = false;
+		
 		// Removes temporary graph from DOM
   	    if (graph != null && graph != this.editor.graph && graph.container.parentNode != null)
 		{

+ 24 - 10
src/main/webapp/js/diagramly/EditorUi.js

@@ -6805,15 +6805,29 @@
 			
 			if (this.doImportVisio)
 			{
-				if (this.isRemoteVisioFormat(filename) && VSD_CONVERT_URL != null) 
+				var remote = this.isRemoteVisioFormat(filename);
+				
+				try
 				{
-					if (filename.substring(filename.length - 3, filename.length) === 'vss')
+					var ext = 'UNKNOWN-VISIO';
+					var dot = filename.lastIndexOf('.');
+					
+					if (dot >= 0 && dot < filename.length)
 					{
-						EditorUi.logEvent({category: 'EMF',
-							action: 'vss upload',
-							label: filename});
+						ext = filename.substring(dot + 1).toUpperCase();
 					}
 					
+					EditorUi.logEvent({category: ext + '-IMPORT',
+						action: 'size_' + file.size,
+						label: (remote) ? 'remote' : 'local'});
+				}
+				catch (e)
+				{
+					onerror(e);
+				}
+				
+				if (remote && VSD_CONVERT_URL != null) 
+				{
 					var formData = new FormData();
 					formData.append('file1', file, filename);
 
@@ -12827,7 +12841,7 @@ var CommentsWindow = function(editorUi, x, y, w, h, saveCallback)
 	{
 		var busyImg = document.createElement('img');
 		busyImg.className = 'geCommentBusyImg';
-		busyImg.src= '/images/spin.gif';
+		busyImg.src= IMAGE_PATH + '/spin.gif';
 		commentDiv.appendChild(busyImg);
 		commentDiv.busyImg = busyImg;
 	};
@@ -13195,7 +13209,7 @@ var CommentsWindow = function(editorUi, x, y, w, h, saveCallback)
 	}
 
 	var resolvedLink = link.cloneNode();
-	resolvedLink.innerHTML = '<img src="/images/check.png" style="width: 16px; padding: 2px;">';
+	resolvedLink.innerHTML = '<img src="' + IMAGE_PATH + '/check.png" style="width: 16px; padding: 2px;">';
 	resolvedLink.setAttribute('title', mxResources.get('showResolved'));
 	var resolvedChecked = false;
 	
@@ -13220,7 +13234,7 @@ var CommentsWindow = function(editorUi, x, y, w, h, saveCallback)
 	if (editorUi.commentsRefreshNeeded())
 	{
 		var refreshLink = link.cloneNode();
-		refreshLink.innerHTML = '<img src="/images/update16.png" style="width: 16px; padding: 2px;">';
+		refreshLink.innerHTML = '<img src="' + IMAGE_PATH + '/update16.png" style="width: 16px; padding: 2px;">';
 		refreshLink.setAttribute('title', mxResources.get('refresh'));
 	
 		if (uiTheme == 'dark')
@@ -13242,7 +13256,7 @@ var CommentsWindow = function(editorUi, x, y, w, h, saveCallback)
 	if (editorUi.commentsSaveNeeded())
 	{
 		var saveLink = link.cloneNode();
-		saveLink.innerHTML = '<img src="/images/save.png" style="width: 20px; padding: 2px;">';
+		saveLink.innerHTML = '<img src="' + IMAGE_PATH + '/save.png" style="width: 20px; padding: 2px;">';
 		saveLink.setAttribute('title', mxResources.get('save'));
 	
 		if (uiTheme == 'dark')
@@ -13278,7 +13292,7 @@ var CommentsWindow = function(editorUi, x, y, w, h, saveCallback)
 			commentEditBtns.parentNode.removeChild(commentEditBtns);
 		}
 		
-		listDiv.innerHTML = '<div style="padding-top:10px;text-align:center;"><img src="/images/spin.gif" valign="middle"> ' +
+		listDiv.innerHTML = '<div style="padding-top:10px;text-align:center;"><img src="' + IMAGE_PATH + '/spin.gif" valign="middle"> ' +
 			mxUtils.htmlEntities(mxResources.get('loading')) + '...</div>';
 		
 		canReplyToReplies = editorUi.canReplyToReplies();

File diff suppressed because it is too large
+ 379 - 379
src/main/webapp/js/viewer.min.js