-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseen2scene.html
More file actions
45 lines (43 loc) · 1.63 KB
/
seen2scene.html
File metadata and controls
45 lines (43 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html>
<head>
<title>Remote Image Generator</title>
</head>
<body>
<h1>Generate Remote Image</h1>
<button id="generateButton">Generate Image</button>
<div id="result"></div>
<img id="generatedImage" style="display:none;" />
<script>
document.getElementById('generateButton').addEventListener('click', function() {
// Show loading message
const resultDiv = document.getElementById('result');
resultDiv.textContent = 'Processing...';
// Make request to your server-side script
fetch('/generate-image', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
server: 'bigcornea.cs.stonybrook.edu',
port: 130,
username: 'rraina',
password: 'YOUR_PASSWORD_HERE' // Note: Sending passwords client-side is a security risk
})
})
.then(response => response.blob())
.then(imageBlob => {
// Create image URL and display it
const imageUrl = URL.createObjectURL(imageBlob);
document.getElementById('generatedImage').src = imageUrl;
document.getElementById('generatedImage').style.display = 'block';
resultDiv.textContent = 'Image generated successfully!';
})
.catch(error => {
resultDiv.textContent = 'Error: ' + error.message;
});
});
</script>
</body>
</html>