mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +00:00
Add version field for ocr job
This commit is contained in:
parent
a1be95ff68
commit
f506a562cd
@ -29,6 +29,13 @@ class NewOCRJobForm(FlaskForm):
|
|||||||
'Title',
|
'Title',
|
||||||
validators=[DataRequired(), Length(1, 32)]
|
validators=[DataRequired(), Length(1, 32)]
|
||||||
)
|
)
|
||||||
|
version = SelectField(
|
||||||
|
'Version',
|
||||||
|
choices=[('', 'Choose your option'),
|
||||||
|
('latest', 'Latest'),
|
||||||
|
],
|
||||||
|
validators=[DataRequired()]
|
||||||
|
)
|
||||||
|
|
||||||
def validate_files(form, field):
|
def validate_files(form, field):
|
||||||
for file in field.data:
|
for file in field.data:
|
||||||
@ -62,6 +69,13 @@ class NewNLPJobForm(FlaskForm):
|
|||||||
'Title',
|
'Title',
|
||||||
validators=[DataRequired(), Length(1, 32)]
|
validators=[DataRequired(), Length(1, 32)]
|
||||||
)
|
)
|
||||||
|
version = SelectField(
|
||||||
|
'Version',
|
||||||
|
choices=[('', 'Choose your option'),
|
||||||
|
('latest', 'Latest'),
|
||||||
|
],
|
||||||
|
validators=[DataRequired()]
|
||||||
|
)
|
||||||
|
|
||||||
def validate_files(form, field):
|
def validate_files(form, field):
|
||||||
for file in field.data:
|
for file in field.data:
|
||||||
|
@ -28,7 +28,7 @@ def ocr():
|
|||||||
'requested_memory': 2048,
|
'requested_memory': 2048,
|
||||||
'service': 'ocr',
|
'service': 'ocr',
|
||||||
'service_args': {'lang': new_ocr_job_form.language.data,
|
'service_args': {'lang': new_ocr_job_form.language.data,
|
||||||
'version': 'latest'
|
'version': new_ocr_job_form.version.data
|
||||||
},
|
},
|
||||||
'status': 'queued'
|
'status': 'queued'
|
||||||
}
|
}
|
||||||
|
@ -78,8 +78,8 @@
|
|||||||
|
|
||||||
<div class="col s12">
|
<div class="col s12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-content">
|
<form method="POST" enctype="multipart/form-data">
|
||||||
<form method="POST" enctype="multipart/form-data">
|
<div class="card-content">
|
||||||
{{ new_ocr_job_form.hidden_tag() }}
|
{{ new_ocr_job_form.hidden_tag() }}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col s12 m4">
|
<div class="col s12 m4">
|
||||||
@ -92,30 +92,6 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col s12 m8">
|
|
||||||
<div class="input-field">
|
|
||||||
<i class="material-icons prefix">description</i>
|
|
||||||
{{ new_ocr_job_form.description() }}
|
|
||||||
{{ new_ocr_job_form.description.label }}
|
|
||||||
{% for error in new_ocr_job_form.description.errors %}
|
|
||||||
<span class="helper-text red-text">{{ error }}</span>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col s12 m8">
|
|
||||||
<div class="file-field input-field">
|
|
||||||
<div class="btn">
|
|
||||||
<span>{{ new_ocr_job_form.files.label.text }}</span>
|
|
||||||
{{ new_ocr_job_form.files(accept='application/pdf, image/tiff') }}
|
|
||||||
</div>
|
|
||||||
<div class="file-path-wrapper">
|
|
||||||
<input class="file-path validate" type="text">
|
|
||||||
</div>
|
|
||||||
{% for error in new_ocr_job_form.files.errors %}
|
|
||||||
<span class="helper-text red-text">{{ error }}</span>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col s12 m4">
|
<div class="col s12 m4">
|
||||||
<div class="input-field">
|
<div class="input-field">
|
||||||
<i class="material-icons prefix">language</i>
|
<i class="material-icons prefix">language</i>
|
||||||
@ -126,10 +102,48 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col s12 m4">
|
||||||
|
<div class="input-field">
|
||||||
|
<i class="material-icons prefix">language</i>
|
||||||
|
{{ new_ocr_job_form.version() }}
|
||||||
|
{{ new_ocr_job_form.version.label }}
|
||||||
|
{% for error in new_ocr_job_form.version.errors %}
|
||||||
|
<span class="helper-text red-text">{{ error }}</span>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col s12 m6">
|
||||||
|
<div class="file-field input-field">
|
||||||
|
<div class="btn">
|
||||||
|
<span>{{ new_ocr_job_form.files.label.text }}</span>
|
||||||
|
{{ new_ocr_job_form.files(accept='application/pdf, image/tiff') }}
|
||||||
|
</div>
|
||||||
|
<div class="file-path-wrapper">
|
||||||
|
<input class="file-path validate" type="text">
|
||||||
|
</div>
|
||||||
|
{% for error in new_ocr_job_form.files.errors %}
|
||||||
|
<span class="helper-text red-text">{{ error }}</span>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col s12 m6">
|
||||||
|
<div class="input-field">
|
||||||
|
<i class="material-icons prefix">description</i>
|
||||||
|
{{ new_ocr_job_form.description() }}
|
||||||
|
{{ new_ocr_job_form.description.label }}
|
||||||
|
{% for error in new_ocr_job_form.description.errors %}
|
||||||
|
<span class="helper-text red-text">{{ error }}</span>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-action right-align">
|
||||||
{{ new_ocr_job_form.submit(class='btn') }}
|
{{ new_ocr_job_form.submit(class='btn') }}
|
||||||
</form>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user