mirror of
https://github.com/GNS3/gns3-registry.git
synced 2025-04-19 08:36:17 +00:00
Build page for each files
This commit is contained in:
parent
21d28e2944
commit
29b82614a0
5
build.py
5
build.py
@ -40,6 +40,7 @@ if os.path.exists('build'):
|
||||
else:
|
||||
os.mkdir('build')
|
||||
os.mkdir(os.path.join('build', 'devices'))
|
||||
os.mkdir(os.path.join('build', 'images'))
|
||||
|
||||
|
||||
def render(template_file, out, **kwargs):
|
||||
@ -64,4 +65,8 @@ for file in os.listdir('devices'):
|
||||
devices.append(device)
|
||||
|
||||
|
||||
for image_type in device['images']:
|
||||
for image in device['images'][image_type]:
|
||||
render('device.html', os.path.join('images', image['md5sum'] + '.html'), device=device)
|
||||
|
||||
render('devices.html', os.path.join('devices', 'index.html'), devices=devices)
|
||||
|
@ -1,7 +1,16 @@
|
||||
{% extends "layout/default.html" %}
|
||||
{% block script %}
|
||||
|
||||
function importDevice() {
|
||||
md5 = gns3.importDevice();
|
||||
window.location = "/images/" + md5 + ".html"
|
||||
}
|
||||
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<div class="jumbotron">
|
||||
<h1>Hello Networker!</h1>
|
||||
<p><a class="btn btn-primary btn-lg" href="/devices" role="button">Show devices</a></p>
|
||||
<p><a class="btn btn-primary btn-lg" href="#" role="button" onclick="importDevice()">Import device</a></p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -12,6 +12,10 @@
|
||||
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
||||
|
||||
<script>
|
||||
{% block script %}{% endblock %}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-default">
|
||||
|
Loading…
x
Reference in New Issue
Block a user