Last active
December 10, 2017 08:20
-
-
Save GordonSmith/027841e31e7186069d796eba4c31b691 to your computer and use it in GitHub Desktop.
hpcc-js + WU hosted Image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>HPCC WU Hosted Image</title> | |
<meta charset="utf-8" /> | |
<style> | |
body { | |
padding: 0px; | |
margin: 0px; | |
overflow: hidden; | |
} | |
</style> | |
<script src="https://unpkg.com/@hpcc-js/[email protected]"></script> | |
<script src="https://unpkg.com/@hpcc-js/[email protected]/build/index.js"></script> | |
<script> | |
var hpccComms = window["@hpcc-js/comms"]; | |
</script> | |
</head> | |
<body> | |
<img id="placeholder"></img> | |
<script> | |
var wu = hpccComms.Workunit.attach({ baseUrl: "http://52.51.90.23:8010" }, "W20171210-075100"); | |
wu.fetchResults().then(function (results) { | |
return results[0].fetchRows(0, 1); | |
}).then(function (rows) { | |
document.getElementById("placeholder").setAttribute("src", "data:image/png;base64," + rows[0].base64image); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment