Commit 175c9113 authored by Alain Takoudjou's avatar Alain Takoudjou

erp5_web_mynij_search: Rework index torrent seed and download

Torrent are compressed before seed
torrent blob is saved as attachment and can be reloaded quickly without rebuild everything
There are more details on download and seed progress
parent 8fc8f5c6
......@@ -16,6 +16,7 @@
<script src="jiodev.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script>
<script src="webtorrent.min.js" type="text/javascript"></script>
<script src="jszip.min.js" type="text/javascript"></script>
<script src="gadget_erp5_mynij_webtorrent.js" type="text/javascript"></script>
<script id="torrent-info-template" type="text/x-handlebars-template">
......@@ -41,12 +42,17 @@
{{/if}}
</div>
<div>
<code class="downloaded"></code>
of <code class="total"></code>
<span class="remaining"></span><br/>
{{#if is_seed}}
&#x2197;<code class="uploadSpeed">0 b/s</code>
/ <code class="total">{{total}}</code>
{{else}}
&#x2198;<code class="downloadSpeed">0 b/s</code>
/ &#x2197;<code class="uploadSpeed">0 b/s</code>
/ <code class="downloaded">0 B</code>
of <code class="total">{{total}}</code>
<span class="remaining"></span><br/>
{{/if}}
</div>
<div class="message"></div>
</div>
</div>
</div>
......
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>988.48319.53521.12885</string> </value>
<value> <string>989.27292.54989.38297</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>1608296295.72</float>
<float>1610966584.34</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>989.18558.11562.17885</string> </value>
<value> <string>989.27539.50696.19524</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1610442308.5</float>
<float>1610982586.19</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>989.8720.22549.10018</string> </value>
<value> <string>989.8910.36396.20462</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1609863273.31</float>
<float>1610722711.08</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -128,7 +128,7 @@
zip_file = new JSZip();
zip_file.file(index_id + ".json", JSON.stringify(file_dict));
zip_file.generateAsync({
return zip_file.generateAsync({
type : "blob",
compression: "DEFLATE",
compressionOptions: {level: 9}
......
<!doctype html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="flexsearch.js" type="text/javascript"></script>
<script src="gadget_mynij_html_link_index.js" type="text/javascript"></script>
</head>
<body>
<a href="https://softinst132402.host.vifib.net/erp5/portal_skins/erp5_mynij/gadget_mynij_html_link_index.html">Link to click</a>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_mynij_html_link_index.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>action_mynij_search_build_index.html</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
(function (window, rJS, RSVP) {
"use strict";
rJS(window)
.declareMethod("render", function (options, extra) {
console.log(options);
console.log(extra);
});
}(window, rJS, RSVP));
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_mynij_html_link_index.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>action_mynij_search_build_index.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment