Merge pull request #332 from eReuse/feature/3683-wb-page2
add external mirror for download the workbench isos
This commit is contained in:
commit
45323cd932
|
@ -44,19 +44,17 @@
|
||||||
|
|
||||||
<div class="pt-6 pb-2">
|
<div class="pt-6 pb-2">
|
||||||
<h5 class="card-title text-center pb-0 fs-4">Workbench 2022</h5>
|
<h5 class="card-title text-center pb-0 fs-4">Workbench 2022</h5>
|
||||||
{% if iso %}
|
|
||||||
<div class="row pt-3">
|
<div class="row pt-3">
|
||||||
<div class="col-5">
|
<div class="col-5">
|
||||||
<a href="/static/iso/demo/{{ iso }}" class="btn btn-primary">{{ iso }}</a>
|
<a href="{{ iso.demo.url }}/{{ iso.demo.iso }}" class="btn btn-primary">{{ iso.demo.iso }}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="small">
|
<p class="small">
|
||||||
Download Checksum: <a class="help" href="/static/iso/demo/SHA512SUMS">SHA512SUMS</a> |
|
Download Checksum: <a class="help" href="{{ iso.demo.url }}/SHA512SUMS">SHA512SUMS</a> |
|
||||||
<a href="https://help.usody.com/es/setup/setup-pendrive/" target="_blank" class="help">Help</a></p>
|
<a href="https://help.usody.com/es/setup/setup-pendrive/" target="_blank" class="help">Help</a></p>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -115,14 +113,14 @@
|
||||||
<br />
|
<br />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-5">
|
<div class="col-5">
|
||||||
<a href="/static/iso/{{ d }}/{{ v }}" class="btn btn-primary" style="width: 200px;">Get ISO file</a>
|
<a href="{{ v.url }}/{{ v.iso }}" class="btn btn-primary" style="width: 200px;">Get ISO file</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="small">
|
<p class="small">
|
||||||
{{ v }}
|
{{ v.iso }}
|
||||||
</p>
|
</p>
|
||||||
<p class="small">
|
<p class="small">
|
||||||
Download Checksum: <a class="help" href="/static/iso/{{ d }}/SHA512SUMS">SHA512SUMS</a> |
|
Download Checksum: <a class="help" href="{{ v.url }}/SHA512SUMS">SHA512SUMS</a> |
|
||||||
<a href="https://help.usody.com/es/setup/setup-pendrive/" target="_blank" class="help">Help</a></p>
|
<a href="https://help.usody.com/es/setup/setup-pendrive/" target="_blank" class="help">Help</a></p>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
isos = {
|
||||||
|
"demo": {
|
||||||
|
'iso': "USODY_2022.5.2-beta.iso",
|
||||||
|
'url': 'http://releases.usody.com/demo/',
|
||||||
|
},
|
||||||
|
"2022": {
|
||||||
|
'iso': "USODY_2022.5.2-beta.iso",
|
||||||
|
'url': 'http://releases.usody.com//2022/',
|
||||||
|
},
|
||||||
|
"v14": {'iso': "USODY_14.0.0.iso", 'url': 'http://releases.usody.com/v14/'},
|
||||||
|
}
|
|
@ -1,6 +1,4 @@
|
||||||
import os
|
|
||||||
import time
|
import time
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import flask
|
import flask
|
||||||
from flask import Blueprint
|
from flask import Blueprint
|
||||||
|
@ -13,6 +11,7 @@ from ereuse_devicehub.db import db
|
||||||
from ereuse_devicehub.resources.enums import SessionType
|
from ereuse_devicehub.resources.enums import SessionType
|
||||||
from ereuse_devicehub.resources.user.models import Session
|
from ereuse_devicehub.resources.user.models import Session
|
||||||
from ereuse_devicehub.views import GenericMixin
|
from ereuse_devicehub.views import GenericMixin
|
||||||
|
from ereuse_devicehub.workbench import isos
|
||||||
|
|
||||||
workbench = Blueprint('workbench', __name__, url_prefix='/workbench')
|
workbench = Blueprint('workbench', __name__, url_prefix='/workbench')
|
||||||
|
|
||||||
|
@ -28,9 +27,9 @@ class SettingsView(GenericMixin):
|
||||||
{
|
{
|
||||||
'page_title': self.page_title,
|
'page_title': self.page_title,
|
||||||
'demo': g.user.email == app.config['EMAIL_DEMO'],
|
'demo': g.user.email == app.config['EMAIL_DEMO'],
|
||||||
|
'iso': isos,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
self.get_iso()
|
|
||||||
|
|
||||||
self.opt = request.values.get('opt')
|
self.opt = request.values.get('opt')
|
||||||
if self.opt in ['register', 'erease_basic', 'erease_sectors']:
|
if self.opt in ['register', 'erease_basic', 'erease_sectors']:
|
||||||
|
@ -38,30 +37,6 @@ 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):
|
|
||||||
path = Path(__file__).parent.parent
|
|
||||||
uri = f'{path}/static/iso/'
|
|
||||||
if self.context.get('demo'):
|
|
||||||
uri = f'{path}/static/iso/demo/'
|
|
||||||
|
|
||||||
self.context['iso'] = {}
|
|
||||||
|
|
||||||
if not os.path.exists(uri):
|
|
||||||
return
|
|
||||||
|
|
||||||
versions = os.listdir(f'{path}/static/iso/')
|
|
||||||
versions.sort()
|
|
||||||
|
|
||||||
for d in versions:
|
|
||||||
dir_iso = f'{uri}/{d}'
|
|
||||||
if not os.path.isdir(dir_iso):
|
|
||||||
continue
|
|
||||||
|
|
||||||
files = [f for f in os.listdir(dir_iso) if f[-3:].lower() == 'iso']
|
|
||||||
|
|
||||||
if files:
|
|
||||||
self.context['iso'][f'{d}'] = files[0]
|
|
||||||
|
|
||||||
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 = {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import csv
|
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
Reference in New Issue