#GetScreenshots

dev-linux
Ivan Maslov 5 years ago
parent 7bf872d78f
commit 83c4b75d82

@ -33,6 +33,26 @@
on: 'hover' on: 'hover'
}); });
mGlobal.Monitor={};
mGlobal.Monitor.ScreenshotModal={};
mGlobal.Monitor.GenerateUniqueID=function(inPrefix="tempUID=") {
return inPrefix+Math.round(Math.random()*1000)+"-"+Math.round(Math.random()*10000)+"-"+Math.round(Math.random()*1000)
}
mGlobal.Monitor.ScreenshotModal.Show=function() {
$('.ui.modal.daemon-screenshot').modal('show');
//Функция обновления картинки
lScreenshotUpdate=function() {
lScreenshotSrc="/GetScreenshot?"+mGlobal.Monitor.GenerateUniqueID()
$(".daemon-screenshot img").attr('src', lScreenshotSrc);
}
mGlobal.Monitor.ScreenshotModal.timerId=setInterval(lScreenshotUpdate,1500)
}
mGlobal.Monitor.ScreenshotModal.Close=function() {
clearInterval(mGlobal.Monitor.ScreenshotModal.timerId);
}
}) })
; ;
</script> </script>
@ -129,8 +149,7 @@
</div> </div>
<div class="row"> <div class="row">
<img src="GetScreenshot" width="60%" height="60%"> <a onclick="mGlobal.Monitor.ScreenshotModal.Show();" class="item" target="_blank">GetScreenshot</a>
<a href="GetScreenshot" class="item" target="_blank">GetScreenshot</a>
</div> </div>
<div class="row black"> <div class="row black">
@ -199,7 +218,20 @@
</div> </div>
</div> </div>
</div> </div>
<div class="ui daemon-screenshot modal">
<div class="ui icon header">
</div>
<div class="content">
<img src="GetScreenshot" class="ui fluid image">
</div>
<div class="actions">
<div class="ui green ok inverted button" onclick="mGlobal.Monitor.ScreenshotModal.Close()">
<i class="checkmark icon"></i>
Close
</div>
</div>
</div>
<div class="ui modal openrpa-code-list-gui-import-modal"> <div class="ui modal openrpa-code-list-gui-import-modal">
<i class="close icon"></i> <i class="close icon"></i>

@ -67,7 +67,8 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
if self.path == '/favicon.ico': if self.path == '/favicon.ico':
self.SendResponseContentTypeFile('image/x-icon',"..\\..\\favicon.ico") self.SendResponseContentTypeFile('image/x-icon',"..\\..\\favicon.ico")
#Получить скриншот #Получить скриншот
if self.path == '/GetScreenshot':
if self.path.split("?")[0] == '/GetScreenshot':
#Сохранить файл на диск #Сохранить файл на диск
SaveScreenshot("Screenshot.png") SaveScreenshot("Screenshot.png")
self.SendResponseContentTypeFile('image/png',"Screenshot.png") self.SendResponseContentTypeFile('image/png',"Screenshot.png")

Loading…
Cancel
Save