From ebfaead46838e2613f0759d305f3723f8a71fee4 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 17 Nov 2020 13:44:17 -0800 Subject: [PATCH] French translation update and debugging improvements. --- public/scripts/agent-desktop-0.0.2-min.js | 2 +- public/scripts/agent-desktop-0.0.2.js | 12 ++++++++++-- translate/translate.js | 6 ++++++ translate/translate.json | 17 ++++++++++++++++- webserver.js | 11 ++++++++--- 5 files changed, 41 insertions(+), 7 deletions(-) diff --git a/public/scripts/agent-desktop-0.0.2-min.js b/public/scripts/agent-desktop-0.0.2-min.js index b1378523..ef9ebe17 100644 --- a/public/scripts/agent-desktop-0.0.2-min.js +++ b/public/scripts/agent-desktop-0.0.2-min.js @@ -1 +1 @@ -Uint8Array.prototype.slice||Object.defineProperty(Uint8Array.prototype,"slice",{value:function(e,t){return new Uint8Array(Array.prototype.slice.call(this,e,t))}});var CreateAgentRemoteDesktop=function(e,t){var h={};"string"==typeof(h.CanvasId=e)&&(h.CanvasId=Q(e)),h.Canvas=h.CanvasId.getContext("2d"),h.scrolldiv=t,h.State=0,h.PendingOperations=[],h.tilesReceived=0,h.TilesDrawn=0,h.KillDraw=0,h.ipad=!1,h.tabletKeyboardVisible=!1,h.LastX=0,h.LastY=0,h.touchenabled=0,h.submenuoffset=0,h.touchtimer=null,h.TouchArray={},h.connectmode=0,h.connectioncount=0,h.rotation=0,h.protocol=2,h.debugmode=0,h.firstUpKeys=[],h.stopInput=!1,h.localKeyMap=!0,h.pressedKeys=[],h.sessionid=0,h.username,h.oldie=!1,h.CompressionLevel=50,h.ScalingLevel=1024,h.FrameRateTimer=100,h.SwapMouse=!1,h.FirstDraw=!1,h.ScreenWidth=960,h.ScreenHeight=701,h.width=960,h.height=960,h.displays=null,h.selectedDisplay=null,h.onScreenSizeChange=null,h.onMessage=null,h.onConnectCountChanged=null,h.onDebugMessage=null,h.onTouchEnabledChanged=null,h.onDisplayinfo=null;var g=!(h.accumulator=null),p="default";h.mouseCursorActive=function(e){g!=e&&(g=e,h.CanvasId.style.cursor=1==e?p:"default")};var v=["default","progress","crosshair","pointer","help","text","no-drop","move","nesw-resize","ns-resize","nwse-resize","w-resize","alias","wait","none","not-allowed","col-resize","row-resize","copy","zoom-in","zoom-out"];h.Start=function(){h.State=0,h.accumulator=null},h.Stop=function(){h.setRotation(0),h.UnGrabKeyInput(),h.UnGrabMouseInput(),h.touchenabled=0,null!=h.onScreenSizeChange&&h.onScreenSizeChange(h,h.ScreenWidth,h.ScreenHeight,h.CanvasId),h.Canvas.clearRect(0,0,h.CanvasId.width,h.CanvasId.height)},h.xxStateChange=function(e){if(h.State!=e)switch(h.State=e,h.CanvasId.style.cursor="default",e){case 0:h.Stop()}},h.send=function(e){2>32)+h.intToStr(32&o)):(h.recordedSize+=n.length,h.shortToStr(e)+h.shortToStr(t)+h.intToStr(n.length)+h.intToStr(o>>32)+h.intToStr(32&o)+n)}return h.SendKeyMsg=function(e,t){var n;null!=e&&((t=t||window.event).code&&0==h.localKeyMap?null!=(n=function(e){return e.code.startsWith("Key")&&4==e.code.length?e.code.charCodeAt(3):e.code.startsWith("Digit")&&6==e.code.length?e.code.charCodeAt(5):e.code.startsWith("Numpad")&&7==e.code.length?e.code.charCodeAt(6)+48:o[e.code]}(t))&&h.SendKeyMsgKC(e,n):(59==(n=t.keyCode)?n=186:173==n?n=189:61==n&&(n=187),h.SendKeyMsgKC(e,n)))},h.SendMessage=function(e){3==h.State&&h.send(String.fromCharCode(0,17)+h.shortToStr(4+e.length)+e)},h.SendKeyMsgKC=function(e,t){if(3==h.State)if("object"==typeof e)for(var n in e)h.SendKeyMsgKC(e[n][0],e[n][1]);else{if(1==e)-1==h.pressedKeys.indexOf(t)&&h.pressedKeys.unshift(t);else if(2==e){-1!=(n=h.pressedKeys.indexOf(t))&&h.pressedKeys.splice(n,1)}h.send(String.fromCharCode(0,h.InputType.KEY,0,6,e-1,t))}},h.sendcad=function(){h.SendCtrlAltDelMsg()},h.SendCtrlAltDelMsg=function(){3==h.State&&h.send(String.fromCharCode(0,h.InputType.CTRLALTDEL,0,4))},h.SendEscKey=function(){3==h.State&&h.send(String.fromCharCode(0,h.InputType.KEY,0,6,0,27,0,h.InputType.KEY,0,6,1,27))},h.SendStartMsg=function(){h.SendKeyMsgKC(h.KeyAction.EXDOWN,91),h.SendKeyMsgKC(h.KeyAction.EXUP,91)},h.SendCharmsMsg=function(){h.SendKeyMsgKC(h.KeyAction.EXDOWN,91),h.SendKeyMsgKC(h.KeyAction.DOWN,67),h.SendKeyMsgKC(h.KeyAction.UP,67),h.SendKeyMsgKC(h.KeyAction.EXUP,91)},h.SendTouchMsg1=function(e,t,n,o){3==h.State&&h.send(String.fromCharCode(0,h.InputType.TOUCH)+h.shortToStr(14)+String.fromCharCode(1,e)+h.intToStr(t)+h.shortToStr(n)+h.shortToStr(o))},h.SendTouchMsg2=function(e,t){var n,o="";for(var a in h.TouchArray)a==e?n=t:1==h.TouchArray[a].f?(n=65542,h.TouchArray[a].f=3,"START"+a):2==h.TouchArray[a].f?(n=262144,"STOP"+a):n=131078,o+=String.fromCharCode(a)+h.intToStr(n)+h.shortToStr(h.TouchArray[a].x)+h.shortToStr(h.TouchArray[a].y),2==h.TouchArray[a].f&&delete h.TouchArray[a];3==h.State&&h.send(String.fromCharCode(0,h.InputType.TOUCH)+h.shortToStr(5+o.length)+String.fromCharCode(2)+o),0==Object.keys(h.TouchArray).length&&null!=h.touchtimer&&(clearInterval(h.touchtimer),h.touchtimer=null)},h.SendMouseMsg=function(e,t){if(3==h.State&&null!=e&&null!=h.Canvas){if(!t)t=window.event;var n=h.Canvas.canvas.height/h.CanvasId.clientHeight,o=h.Canvas.canvas.width/h.CanvasId.clientWidth,a=h.GetPositionOfControl(h.Canvas.canvas),r=(t.pageX-a[0])*o,s=(t.pageY-a[1])*n;if(t.addx&&(r+=t.addx),t.addy&&(s+=t.addy),0<=r&&r<=h.Canvas.canvas.width&&0<=s&&s<=h.Canvas.canvas.height){var i=0,c=0;e==h.KeyAction.UP||e==h.KeyAction.DOWN?t.which?i=1==t.which?h.MouseButton.LEFT:2==t.which?h.MouseButton.MIDDLE:h.MouseButton.RIGHT:t.button&&(i=0==t.button?h.MouseButton.LEFT:1==t.button?h.MouseButton.MIDDLE:h.MouseButton.RIGHT):e==h.KeyAction.SCROLL&&(t.detail?c=120*t.detail*-1:t.wheelDelta&&(c=3*t.wheelDelta)),!0===h.SwapMouse&&(i==h.MouseButton.LEFT?i=h.MouseButton.RIGHT:i==h.MouseButton.RIGHT&&(i=h.MouseButton.LEFT));var u="";if(e==h.KeyAction.DBLCLICK)u=String.fromCharCode(0,h.InputType.MOUSE,0,10,0,136,r/256&255,255&r,s/256&255,255&s);else if(e==h.KeyAction.SCROLL){var l=0,d=0;d=c<0?(l=255-(Math.abs(c)>>8),255-(255&Math.abs(c))):(l=c>>8,255&c),u=String.fromCharCode(0,h.InputType.MOUSE,0,12,0,0,r/256&255,255&r,s/256&255,255&s,l,d)}else u=String.fromCharCode(0,h.InputType.MOUSE,0,10,0,e==h.KeyAction.DOWN?i:2*i&255,r/256&255,255&r,s/256&255,255&s);h.Action==h.KeyAction.NONE?0==h.Alternate||h.ipad?(h.send(u),h.Alternate=1):h.Alternate=0:h.send(u)}}},h.GetDisplayNumbers=function(){h.send(String.fromCharCode(0,11,0,4))},h.SetDisplay=function(e){h.send(String.fromCharCode(0,12,0,6,e>>8,255&e))},h.intToStr=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},h.shortToStr=function(e){return String.fromCharCode(e>>8&255,255&e)},h.onResize=function(){0!=h.ScreenWidth&&0!=h.ScreenHeight&&(h.Canvas.canvas.width==h.ScreenWidth&&h.Canvas.canvas.height==h.ScreenHeight||(h.FirstDraw&&(h.Canvas.canvas.width=h.ScreenWidth,h.Canvas.canvas.height=h.ScreenHeight,h.Canvas.fillRect(0,0,h.ScreenWidth,h.ScreenHeight),null!=h.onScreenSizeChange&&h.onScreenSizeChange(h,h.ScreenWidth,h.ScreenHeight,h.CanvasId)),h.FirstDraw=!1,1>32)+h.intToStr(32&o)):(h.recordedSize+=n.length,h.shortToStr(e)+h.shortToStr(t)+h.intToStr(n.length)+h.intToStr(o>>32)+h.intToStr(32&o)+n)}return h.SendKeyMsg=function(e,t){var n;null!=e&&((t=t||window.event).code&&0==h.localKeyMap?null!=(n=function(e){return e.code.startsWith("Key")&&4==e.code.length?e.code.charCodeAt(3):e.code.startsWith("Digit")&&6==e.code.length?e.code.charCodeAt(5):e.code.startsWith("Numpad")&&7==e.code.length?e.code.charCodeAt(6)+48:o[e.code]}(t))&&h.SendKeyMsgKC(e,n):(59==(n=t.keyCode)?n=186:173==n?n=189:61==n&&(n=187),h.SendKeyMsgKC(e,n)))},h.SendMessage=function(e){3==h.State&&h.send(String.fromCharCode(0,17)+h.shortToStr(4+e.length)+e)},h.SendKeyMsgKC=function(e,t){if(3==h.State)if("object"==typeof e)for(var n in e)h.SendKeyMsgKC(e[n][0],e[n][1]);else{if(1==e)-1==h.pressedKeys.indexOf(t)&&h.pressedKeys.unshift(t);else if(2==e){-1!=(n=h.pressedKeys.indexOf(t))&&h.pressedKeys.splice(n,1)}null==h.remoteKeyMap||""==h.remoteKeyMap?h.send(String.fromCharCode(0,h.InputType.KEY,0,6,e-1,t)):h.send(String.fromCharCode(0,h.InputType.KEYWITHLAYOUT,0,22,e-1,t)+h.remoteKeyMap+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0".substring(0,16-h.remoteKeyMap.length))}},h.sendcad=function(){h.SendCtrlAltDelMsg()},h.SendCtrlAltDelMsg=function(){3==h.State&&h.send(String.fromCharCode(0,h.InputType.CTRLALTDEL,0,4))},h.SendEscKey=function(){3==h.State&&h.send(String.fromCharCode(0,h.InputType.KEY,0,6,0,27,0,h.InputType.KEY,0,6,1,27))},h.SendStartMsg=function(){h.SendKeyMsgKC(h.KeyAction.EXDOWN,91),h.SendKeyMsgKC(h.KeyAction.EXUP,91)},h.SendCharmsMsg=function(){h.SendKeyMsgKC(h.KeyAction.EXDOWN,91),h.SendKeyMsgKC(h.KeyAction.DOWN,67),h.SendKeyMsgKC(h.KeyAction.UP,67),h.SendKeyMsgKC(h.KeyAction.EXUP,91)},h.SendTouchMsg1=function(e,t,n,o){3==h.State&&h.send(String.fromCharCode(0,h.InputType.TOUCH)+h.shortToStr(14)+String.fromCharCode(1,e)+h.intToStr(t)+h.shortToStr(n)+h.shortToStr(o))},h.SendTouchMsg2=function(e,t){var n,o="";for(var a in h.TouchArray)a==e?n=t:1==h.TouchArray[a].f?(n=65542,h.TouchArray[a].f=3,"START"+a):2==h.TouchArray[a].f?(n=262144,"STOP"+a):n=131078,o+=String.fromCharCode(a)+h.intToStr(n)+h.shortToStr(h.TouchArray[a].x)+h.shortToStr(h.TouchArray[a].y),2==h.TouchArray[a].f&&delete h.TouchArray[a];3==h.State&&h.send(String.fromCharCode(0,h.InputType.TOUCH)+h.shortToStr(5+o.length)+String.fromCharCode(2)+o),0==Object.keys(h.TouchArray).length&&null!=h.touchtimer&&(clearInterval(h.touchtimer),h.touchtimer=null)},h.SendMouseMsg=function(e,t){if(3==h.State&&null!=e&&null!=h.Canvas){if(!t)t=window.event;var n=h.Canvas.canvas.height/h.CanvasId.clientHeight,o=h.Canvas.canvas.width/h.CanvasId.clientWidth,a=h.GetPositionOfControl(h.Canvas.canvas),r=(t.pageX-a[0])*o,s=(t.pageY-a[1])*n;if(t.addx&&(r+=t.addx),t.addy&&(s+=t.addy),0<=r&&r<=h.Canvas.canvas.width&&0<=s&&s<=h.Canvas.canvas.height){var i=0,c=0;e==h.KeyAction.UP||e==h.KeyAction.DOWN?t.which?i=1==t.which?h.MouseButton.LEFT:2==t.which?h.MouseButton.MIDDLE:h.MouseButton.RIGHT:t.button&&(i=0==t.button?h.MouseButton.LEFT:1==t.button?h.MouseButton.MIDDLE:h.MouseButton.RIGHT):e==h.KeyAction.SCROLL&&(t.detail?c=120*t.detail*-1:t.wheelDelta&&(c=3*t.wheelDelta)),!0===h.SwapMouse&&(i==h.MouseButton.LEFT?i=h.MouseButton.RIGHT:i==h.MouseButton.RIGHT&&(i=h.MouseButton.LEFT));var u="";if(e==h.KeyAction.DBLCLICK)u=String.fromCharCode(0,h.InputType.MOUSE,0,10,0,136,r/256&255,255&r,s/256&255,255&s);else if(e==h.KeyAction.SCROLL){var l=0,d=0;d=c<0?(l=255-(Math.abs(c)>>8),255-(255&Math.abs(c))):(l=c>>8,255&c),u=String.fromCharCode(0,h.InputType.MOUSE,0,12,0,0,r/256&255,255&r,s/256&255,255&s,l,d)}else u=String.fromCharCode(0,h.InputType.MOUSE,0,10,0,e==h.KeyAction.DOWN?i:2*i&255,r/256&255,255&r,s/256&255,255&s);h.Action==h.KeyAction.NONE?0==h.Alternate||h.ipad?(h.send(u),h.Alternate=1):h.Alternate=0:h.send(u)}}},h.GetDisplayNumbers=function(){h.send(String.fromCharCode(0,11,0,4))},h.SetDisplay=function(e){h.send(String.fromCharCode(0,12,0,6,e>>8,255&e))},h.intToStr=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},h.shortToStr=function(e){return String.fromCharCode(e>>8&255,255&e)},h.onResize=function(){0!=h.ScreenWidth&&0!=h.ScreenHeight&&(h.Canvas.canvas.width==h.ScreenWidth&&h.Canvas.canvas.height==h.ScreenHeight||(h.FirstDraw&&(h.Canvas.canvas.width=h.ScreenWidth,h.Canvas.canvas.height=h.ScreenHeight,h.Canvas.fillRect(0,0,h.ScreenWidth,h.ScreenHeight),null!=h.onScreenSizeChange&&h.onScreenSizeChange(h,h.ScreenWidth,h.ScreenHeight,h.CanvasId)),h.FirstDraw=!1,1'; } var { JSDOM } = jsdom; const dom = new JSDOM(data, { includeNodeLocations: true }); log("Translating HTML (" + lang + "): " + path.basename(file)); @@ -778,6 +779,11 @@ function translateFromHtml(lang, file, createSubDir) { } else if (outname.endsWith('.htm')) { outnamemin = (outname.substring(0, outname.length - 4) + '-min_' + lang + '.htm'); outname = (outname.substring(0, outname.length - 4) + '_' + lang + '.htm'); + } else if (outname.endsWith('.js')) { + if (out.startsWith('')) { out = out.substring(0, out.length - 23); } + outnamemin = (outname.substring(0, outname.length - 3) + '-min_' + lang + '.js'); + outname = (outname.substring(0, outname.length - 3) + '_' + lang + '.js'); } else { outnamemin = (outname + '_' + lang + '.min'); outname = (outname + '_' + lang); diff --git a/translate/translate.json b/translate/translate.json index f46f2041..3cede187 100644 --- a/translate/translate.json +++ b/translate/translate.json @@ -5989,6 +5989,7 @@ { "en": "Batch File Upload", "nl": "Batch bestand uploaden", + "fr": "Chargement de fichiers", "xloc": [ "default.handlebars->29->480" ] @@ -6016,6 +6017,7 @@ { "en": "Batch upload of {0} file(s) to folder {1}", "nl": "Batch-upload van {0} bestand (en) naar map {1}", + "fr": "Chargement de {0} fichier(s) dans le dossier {1}", "xloc": [ "default.handlebars->29->1690" ] @@ -9606,6 +9608,7 @@ { "en": "Create folder if it does not exists?", "nl": "Map aanmaken als deze niet bestaat?", + "fr": "Créer le répertoire si il n'existe pas ?", "xloc": [ "default.handlebars->29->478" ] @@ -15222,7 +15225,8 @@ ] }, { - "en": "File Files" + "en": "File Files", + "fr": "Rechercher des fichiers" }, { "cs": "Provoz souboru", @@ -15404,12 +15408,14 @@ { "en": "Find", "nl": "Zoeken", + "fr": "Rechercher", "xloc": [ "default.handlebars->container->column_l->p13->p13toolbar->1->2->1->3" ] }, { "en": "Find Files", + "fr": "Recherche des fichiers", "xloc": [ "default.handlebars->29->896" ] @@ -18163,6 +18169,7 @@ { "en": "Intel® AMT ACM", "nl": "Intel® AMT ACM", + "fr": "Intel® AMT ACM", "xloc": [ "default.handlebars->29->307" ] @@ -20929,6 +20936,7 @@ { "en": "Linux Path", "nl": "Linux Pad", + "fr": "Chemin Linux", "xloc": [ "default.handlebars->29->477" ] @@ -21116,6 +21124,7 @@ }, { "en": "Live Graph", + "fr": "Utilisation du processeur et de la mémoire", "xloc": [ "default.handlebars->container->column_l->p17->p17info->p17graph->1->1->0->3->1->0" ] @@ -25012,6 +25021,7 @@ }, { "en": "No files found", + "fr": "Aucun fichier trouvé", "xloc": [ "default.handlebars->29->887" ] @@ -26367,6 +26377,7 @@ { "en": "Overwrite if file exists?", "nl": "Overschrijven als bestand bestaat?", + "fr": "Ecraser les fichiers existants ?", "xloc": [ "default.handlebars->29->479" ] @@ -32959,6 +32970,7 @@ }, { "en": "Show device CPU and memory usage.", + "fr": "Afficher l'utilisation du CPU et de la mémoire", "xloc": [ "default.handlebars->container->column_l->p17->p17title->devListToolbarViewIcons3" ] @@ -37733,6 +37745,7 @@ { "en": "Upload files", "nl": "Upload bestanden", + "fr": "Charger les fichiers", "xloc": [ "default.handlebars->29->445" ] @@ -37780,6 +37793,7 @@ { "en": "Upload selected files to all selected devices", "nl": "Upload de geselecteerde bestanden naar alle geselecteerde apparaten", + "fr": "Charger ces fichiers sur les appareils sélectionnés", "xloc": [ "default.handlebars->29->475" ] @@ -40086,6 +40100,7 @@ { "en": "Windows Path", "nl": "Windows Pad", + "fr": "Chemin Windows", "xloc": [ "default.handlebars->29->476" ] diff --git a/webserver.js b/webserver.js index 6a24984f..0be7920d 100644 --- a/webserver.js +++ b/webserver.js @@ -3236,13 +3236,18 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { // Send the agent commands to perform the batch upload operation for (var f in cmd.files) { try { - if ((agentPath != null) && (cmd.files[f].name != null)) { + //if ((agentPath != null) && (cmd.files[f].name != null)) { const acmd = { action: 'wget', overwrite: cmd.overwrite, createFolder: cmd.createFolder, urlpath: '/agentdownload.ashx?c=' + obj.parent.encodeCookie({ a: 'tmpdl', d: cmd.domain.id, nid: node._id, f: cmd.files[f].target }, obj.parent.loginCookieEncryptionKey), path: obj.path.join(agentPath, cmd.files[f].name), folder: agentPath, servertlshash: tlsCertHash }; var agent = obj.wsagents[node._id]; if (agent != null) { try { agent.send(JSON.stringify(acmd)); } catch (ex) { } } // TODO: Add support for peer servers. - } - } catch (ex) { } + //} + } catch (ex) { + parent.debug('web', 'Exception: ' + ex); + parent.debug('web', 'AgentPath: ' + agentPath); + parent.debug('web', 'Command: ' + JSON.stringify(cmd)); + parent.debug('web', 'AgentId: ' + node.agent.id); + } } }); }