energy/example/browser-download/resources/download.html
2023-02-28 09:55:20 +08:00

30 lines
1.3 KiB
Go

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>下载文件示例</title>
<script>
console.log("下载文件示例")
//使用ipc.on监听事件
ipc.on("downloadUpdateDemo", function (id, suggestedFileName, receivedBytes, totalBytes) {
console.log(id, suggestedFileName, receivedBytes, totalBytes)
var downloadMessage = document.getElementById("downloadMessage")
downloadMessage.innerHTML = downloadMessage.innerHTML + ("id: " + id + " suggestedFileName: " + suggestedFileName + " receivedBytes: " + receivedBytes + " / totalBytes: " + totalBytes) + "<br>"
});
</script>
</head>
<body style="overflow: hidden;margin: 10px;padding: 10px;">
<h3>download demo:</h3><br>
<a href="https://gitee.com/energye/energy/releases/download/v1.109.1182/Windows%2032%20bits.zip">Windows 32 bits</a>
<br>
<a href="https://gitee.com/energye/energy/releases/download/v1.109.1182/Windows%2064%20bits.zip">Windows 64 bits</a>
<br>
<a href="https://gitee.com/energye/energy/releases/download/v1.109.1182/Linux%20x86%2064%20bits.zip">Linux x86 64
bits</a> <br>
<a href="https://gitee.com/energye/energy/releases/download/v1.109.1182/Linux%20x86%2064%20bits.zip">MacOSX x86 64
bits</a> <br>
<div id="downloadMessage">
</div>
</body>
</html>