mirror of
https://github.com/GNS3/gns3-registry.git
synced 2025-01-18 10:46:31 +00:00
Export device to JS to allow pyqt to retrieve the information
This commit is contained in:
parent
3ef5cf875c
commit
21d28e2944
1
build.py
1
build.py
@ -46,6 +46,7 @@ def render(template_file, out, **kwargs):
|
||||
log.info('Build %s', out)
|
||||
env = Environment(loader=FileSystemLoader('templates'))
|
||||
env.filters['jsonify'] = json.dumps
|
||||
env.filters['escape_quote'] = lambda x: x.replace('"','\\"')
|
||||
template = env.get_template(template_file)
|
||||
template.stream(**kwargs).dump(os.path.join('build', out))
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
<h3>{{image["filename"]}}</h3>
|
||||
Version: {{image["version"]}}<br />
|
||||
Checksum: {{image["md5sum"]}}<br />
|
||||
<button class="btn btn-primary btn-lg" type="button" onclick='gns3.install({{device|jsonify}}, "{{image["md5sum"]}}")'>Install</button>
|
||||
<button class="btn btn-primary btn-lg" type="button" onclick='gns3.install("{{device|jsonify|escape_quote}}", "{{image["md5sum"]}}")'>Install</button>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
|
Loading…
Reference in New Issue
Block a user