add download iso
This commit is contained in:
parent
6e3c032d97
commit
7cb5c76562
|
@ -95,7 +95,7 @@
|
||||||
<li>
|
<li>
|
||||||
<a class="dropdown-item d-flex align-items-center" href="{{ url_for('workbench.settings') }}">
|
<a class="dropdown-item d-flex align-items-center" href="{{ url_for('workbench.settings') }}">
|
||||||
<i class="bi bi-tools"></i>
|
<i class="bi bi-tools"></i>
|
||||||
<span>Workbench Settings</span>
|
<span>Workbench</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import flask
|
import flask
|
||||||
|
@ -22,6 +23,7 @@ class SettingsView(GenericMixin):
|
||||||
|
|
||||||
def dispatch_request(self):
|
def dispatch_request(self):
|
||||||
self.get_context()
|
self.get_context()
|
||||||
|
self.get_iso()
|
||||||
self.context.update(
|
self.context.update(
|
||||||
{
|
{
|
||||||
'page_title': self.page_title,
|
'page_title': self.page_title,
|
||||||
|
@ -34,6 +36,20 @@ class SettingsView(GenericMixin):
|
||||||
|
|
||||||
return flask.render_template(self.template_name, **self.context)
|
return flask.render_template(self.template_name, **self.context)
|
||||||
|
|
||||||
|
def get_iso(self):
|
||||||
|
files = [
|
||||||
|
f
|
||||||
|
for f in os.listdir('ereuse_devicehub/static/iso/')
|
||||||
|
if f[-3:].lower() == 'iso'
|
||||||
|
]
|
||||||
|
|
||||||
|
self.context['iso'] = ''
|
||||||
|
self.context['iso_sha'] = ''
|
||||||
|
|
||||||
|
if files:
|
||||||
|
self.context['iso'] = files[0]
|
||||||
|
self.context['iso_sha'] = 'aaa'
|
||||||
|
|
||||||
def download(self):
|
def download(self):
|
||||||
url = "https://{}/api/inventory/".format(app.config['HOST'])
|
url = "https://{}/api/inventory/".format(app.config['HOST'])
|
||||||
self.wbContext = {
|
self.wbContext = {
|
||||||
|
|
Reference in New Issue