Skip to content

Commit

Permalink
fix: hide raw result overflow to fix scrollbar issue
Browse files Browse the repository at this point in the history
fixes the issue that the raw result is hidden by default but is considered for page height and scroll bar length nontheless
  • Loading branch information
jstucke committed Nov 18, 2024
1 parent ef6c71c commit 4c178af
Showing 1 changed file with 63 additions and 63 deletions.
126 changes: 63 additions & 63 deletions src/web_interface/templates/analysis_plugins/general_information.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,82 +4,82 @@

<table class="table table-bordered" style="table-layout: fixed">
<colgroup>
<col style="width: 12.5%">
<col style="width: 87.5%">
<col style="width: 12.5%">
<col style="width: 87.5%">
</colgroup>
<thead class="thead-light">
<tr>
<th colspan="2">
<div class="d-flex justify-content-between align-items-center">
<tr>
<th colspan="2">
<div class="d-flex justify-content-between align-items-center">
<span>
Showing Analysis: {{ selected_analysis | replace_underscore }}
</span>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="rawResultSwitch">
<label class="custom-control-label" for="rawResultSwitch" style="font-weight: normal;">
Show Raw Result (JSON)
</label>
<button class="btn btn-outline-secondary btn-sm" type="submit" style="padding: 2px 5px;"
onclick="copyRawAnalysis()" data-toggle="tooltip" title="copy raw result">
<i class="far fa-copy"></i>
</button>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="rawResultSwitch">
<label class="custom-control-label" for="rawResultSwitch" style="font-weight: normal;">
Show Raw Result (JSON)
</label>
<button class="btn btn-outline-secondary btn-sm" type="submit" style="padding: 2px 5px;"
onclick="copyRawAnalysis()" data-toggle="tooltip" title="copy raw result">
<i class="far fa-copy"></i>
</button>
</div>
</th>
</tr>
</div>
</th>
</tr>
</thead>
<tbody class="table-analysis" id="analysis-table-body">
{% if analysis_result['skipped'] %}
<tr class="analysis-meta">
<td class="table-warning">Analysis was skipped</td>
<td>{{ analysis_metadata['skipped'] }}</td>
</tr>
{% endif %}
{% if analysis_metadata['analysis_date'] %}
<tr class="analysis-meta">
<td class="table-head-light">Time of Analysis</td>
<td>{{ analysis_metadata['analysis_date'] | nice_unix_time }}</td>
</tr>
{% endif %}
{% if analysis_metadata['plugin_version'] %}
<tr class="analysis-meta">
<td class="table-head-light">Plugin Version</td>
<td>{{ analysis_metadata['plugin_version']}}</td>
</tr>
{% endif %}
{% if analysis_metadata['system_version'] %}
<tr class="analysis-meta">
<td class="table-head-light">System Version</td>
<td>{{ analysis_metadata['system_version']}}</td>
</tr>
{% endif %}
<tr id="raw-result" class="analysis-meta" style="visibility: collapse">
<td>Raw Analysis Result</td>
<td>
<pre class="m-0"><code id="raw-analysis" class="language-json">{{ analysis_result | dict_to_json(indent=4) }}</code></pre>
</td>
{% if analysis_result['skipped'] %}
<tr class="analysis-meta">
<td class="table-warning">Analysis was skipped</td>
<td>{{ analysis_metadata['skipped'] }}</td>
</tr>
{% endif %}
{% if analysis_metadata['analysis_date'] %}
<tr class="analysis-meta">
<td class="table-head-light">Time of Analysis</td>
<td>{{ analysis_metadata['analysis_date'] | nice_unix_time }}</td>
</tr>
{% endif %}
{% if analysis_metadata['plugin_version'] %}
<tr class="analysis-meta">
<td class="table-head-light">Plugin Version</td>
<td>{{ analysis_metadata['plugin_version'] }}</td>
</tr>
{% endif %}
{% if analysis_metadata['system_version'] %}
<tr class="analysis-meta">
<td class="table-head-light">System Version</td>
<td>{{ analysis_metadata['system_version'] }}</td>
</tr>
{% endif %}
<tr id="raw-result" class="analysis-meta" style="visibility: collapse">
<td>Raw Analysis Result</td>
<td>
<pre class="m-0" style="max-height: 50vh; overflow: scroll;"><code id="raw-analysis" class="language-json">{{ analysis_result | dict_to_json(indent=4) }}</code></pre>
</td>
</tr>

{% set version_backend = analysis_plugin_dict[selected_analysis][3] %}
{% set version_database = analysis_metadata['plugin_version'] %}

{% if selected_analysis == 'unpacker' or version_database | version_is_compatible(version_backend, True) %}
{% if analysis_result is not none and 'skipped' not in analysis_result %}
{% block analysis_result_details %}
{% set version_backend = analysis_plugin_dict[selected_analysis][3] %}
{% set version_database = analysis_metadata['plugin_version'] %}

{% endblock %}
{% endif %}
{% else %}
<tr>
<td class="table-warning">Analysis outdated</td>
<td>
The backend plugin version ({{ version_backend | string }}) is incompatible with
the version ({{ version_database | string }}) of the analysis result.
{% if selected_analysis == 'unpacker' or version_database | version_is_compatible(version_backend, True) %}
{% if analysis_result is not none and 'skipped' not in analysis_result %}
{% block analysis_result_details %}

Please update the analysis.
</td>
</tr>
{% endblock %}
{% endif %}
{% else %}
<tr>
<td class="table-warning">Analysis outdated</td>
<td>
The backend plugin version ({{ version_backend | string }}) is incompatible with
the version ({{ version_database | string }}) of the analysis result.

Please update the analysis.
</td>
</tr>
{% endif %}
</tbody>
</table>

Expand Down

0 comments on commit 4c178af

Please sign in to comment.