Skip to content

Commit

Permalink
UI changes to log display, service control, and DICOM query
Browse files Browse the repository at this point in the history
  • Loading branch information
tblock79 committed Oct 17, 2024
1 parent 6701742 commit 27906f6
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
16 changes: 8 additions & 8 deletions configuration/default_services.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
"systemd_service": "mercure_bookkeeper.service",
"docker_service": "mercure_bookkeeper_1"
},
"workers": {
"name": "Workers",
"systemd_service": ["mercure_worker_fast@1.service", "[email protected]", "[email protected]", "[email protected]"],
"docker_service": ["mercure_worker_fast_1", "mercure_worker_fast_2", "mercure_worker_slow_1", "mercure_worker_slow_2"]
"ui": {
"name": "WebUI",
"systemd_service": "mercure_ui.service",
"docker_service": "mercure_ui_1"
},
"redis": {
"name": "Redis",
"systemd_service": "redis.service",
"docker_service": "mercure_redis_1"
},
"ui": {
"name": "UI",
"systemd_service": "mercure_ui.service",
"docker_service": "mercure_ui_1"
"workers": {
"name": "Workers",
"systemd_service": ["mercure_worker_fast@1.service", "[email protected]", "[email protected]", "[email protected]"],
"docker_service": ["mercure_worker_fast_1", "mercure_worker_fast_2", "mercure_worker_slow_1", "mercure_worker_slow_2"]
}
}
10 changes: 8 additions & 2 deletions webgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ async def show_log(request) -> Response:

service_name_or_list = services.services_list[requested_service]["systemd_service"]
if isinstance(service_name_or_list, list):
service_name = request.query_params.get("subservice", service_name_or_list[0])
service_name = request.query_params.get("subservice", "missing")
# Redirect to the first sub-service if none has been specified in the URL
if service_name == "missing":
return RedirectResponse(url="/logs/" + requested_service + "?subservice="+service_name_or_list[0], status_code=303)
sub_services = service_name_or_list
else:
service_name = service_name_or_list
Expand All @@ -317,7 +320,10 @@ async def show_log(request) -> Response:
try:
service_name_or_list = services.services_list[requested_service]["docker_service"]
if isinstance(service_name_or_list, list):
service_name = request.query_params.get("subservice", service_name_or_list[0])
service_name = request.query_params.get("subservice", "missing")
# Redirect to the first sub-service if none has been specified in the URL
if service_name == "missing":
return RedirectResponse(url="/logs/" + requested_service + "?subservice="+service_name_or_list[0], status_code=303)
sub_services = service_name_or_list
else:
service_name = service_name_or_list
Expand Down
1 change: 0 additions & 1 deletion webinterface/statics/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,6 @@ body {
height: 14px;
}


#target option:checked {
background-color: rgb(50, 115, 220);
color: #FFF;
Expand Down
15 changes: 8 additions & 7 deletions webinterface/templates/dashboards/query.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h1 class="title is-4">DICOM Query</h1>

<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">Dicom Node</label>
<label class="label">DICOM Node</label>
</div>
<div class="field-body">
<div class="field">
Expand Down Expand Up @@ -125,22 +125,22 @@ <h1 class="title is-4">DICOM Query</h1>
</div>
<div class="field-body" style="margin-top: 10px;">
<div class="field">
<div class="control">
<div class="buttons">
<button type="submit" id="get-accessions-button" class="button is-success">
<i class="fas fa-check"></i>&nbsp;Submit Query
</button>
<button type="button" id="check-accessions-button" class="button is-dark">
<i class="fas fa-question"></i>&nbsp;Check Accessions
<button type="button" id="check-accessions-button" class="button">
<i class="fas fa-search"></i>&nbsp;Search Cases
</button>
</div>
</div>
</div>
</div>
</form>
<div class="tabs logtabs" id="query_result_tabs" style="margin-bottom: 30px;">
<div class="tabs is-toggle is-toggle-rounded is-centered" id="query_result_tabs" style="margin-bottom: 30px; margin-top: 40px;">
<ul>
<li class="is-active"><a data-tab="get-accessions">Query Status</a></li>
<li><a data-tab="check-accessions">Check Accessions</a></li>
<li class="is-active"><a data-tab="get-accessions"><i class="far fa-clock"></i>&nbsp;&nbsp;Query Status</a></li>
<li><a data-tab="check-accessions"><i class="fas fa-list"></i>&nbsp;&nbsp;Search Result</a></li>
</ul>
</div>
<div id="get-accessions" class="tab-content">
Expand Down Expand Up @@ -352,6 +352,7 @@ <h1 class="title is-4">DICOM Query</h1>
var jobId;
var errMessage;
var accessionTableConfig = {
dom: "<'columns row browsertoolbar align-items-end'<'column col-sm-12 col-md-7 browserbuttons'B><'column col-sm-12 col-md-2'><'column col-sm-12 col-md-3'f>>" + "<'columns row'<'column col-sm-12'tr>>" + "<'columns row browserfooterbar'<'column col-sm-12 col-md-5'l><'column col-sm-12 col-md-7'p>>",
columns: [{ data: 'AccessionNumber' }, {data: 'StudyDescription'}, { data: 'SeriesDescription' }, {data: 'NumberOfSeriesRelatedInstances'}],
order: [[0, 'asc']],
pageLength: 25,
Expand Down
2 changes: 1 addition & 1 deletion webinterface/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h5 class="title is-5 configtitle" style="margin-top: 40px; margin-bottom: 0px !
<div class="field">
<label class="label">Selected Services</label>
<div class="control select is-multiple is-fullwidth">
<select name='services[]' multiple size="6" id="controlserviceselector">
<select name='services[]' multiple size="9" id="controlserviceselector" style="overflow-y: auto;">
{% for service in service_status %}
<option {% if loop.index> 1 %}selected{% endif %} value="{{service["id"]}}">{{service['name']}}
</option>
Expand Down
2 changes: 1 addition & 1 deletion webinterface/templates/logs.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h1 class="title">Service Logs</h1>
</ul>
</div>
{% if sub_services %}
<div class="logtabs tabs">
<div class="tabs">
<ul>
{% for service in sub_services %}
<li title="service" {% if subservice==service %}class="is-active"{% endif %}>
Expand Down

0 comments on commit 27906f6

Please sign in to comment.