Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion web/submission/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ def index(request, task_id=None, resubmit_hash=None):
enabledconf["pre_script"] = web_conf.pre_script.enabled
enabledconf["during_script"] = web_conf.during_script.enabled
enabledconf["downloading_service"] = bool(downloader_services.downloaders)
enabledconf["interactive_desktop"] = web_conf.guacamole.enabled

all_vms_tags = load_vms_tags()

Expand Down Expand Up @@ -775,7 +776,7 @@ def status(request, task_id):
"session_data": "",
"target": task.sample.sha256 if getattr(task, "sample") else task.target,
}
if settings.REMOTE_SESSION:
if web_conf.guacamole.enabled and get_options(task.options).get("interactive") == "1":
machine = db.view_machine_by_label(task.machine)
if machine:
guest_ip = machine.ip
Expand Down
24 changes: 22 additions & 2 deletions web/templates/submission/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -674,16 +674,18 @@
<input type="checkbox" name="nohuman" /> Disable automated interaction
</label>
</div>
{% if config.interactive_desktop %}
<div class="form-check">
<label>
<input type="checkbox" name="interactive" /> Interactive desktop
<input type="checkbox" id="interactive" name="interactive" /> Interactive desktop
</label>
</div>
<div class="form-check">
<label>
<input type="checkbox" name="manual" /> Manual detonation. Must be used with Interactive desktop
<input type="checkbox" id="manual" name="manual" disabled /> Manual detonation <span class="text-muted"><small>(Must be used with Interactive desktop!)</small></span>
</label>
</div>
{% endif %}
{% if config.kernel %}
<div class="form-check">
<label>
Expand Down Expand Up @@ -711,4 +713,22 @@
</form>
</div>
</div>
<script>
document.addEventListener("DOMContentLoaded", function() {
const interactive = document.getElementById("interactive");
const manual = document.getElementById("manual");

if (interactive && manual) {
const syncManualCheckbox = () => {
manual.disabled = !interactive.checked;
if (!interactive.checked) {
manual.checked = false;
}
};

syncManualCheckbox();
interactive.addEventListener("change", syncManualCheckbox);
}
});
</script>
{% endblock %}
6 changes: 3 additions & 3 deletions web/templates/submission/status.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ <h4>Status for task {{task_id}} - {{ target }}</h4>
<p>The analysis is not finished yet, it's still <b>{{status}}</b>. This page will refresh every 30 seconds.</p>
{% if session_data %}
<p>To view the Remote Session - click <a href='javascript:window.open(window.location.origin + "/guac/{{task_id}}/{{session_data}}", "_blank");'>here.</a></p>
<div class="progress progress-striped active" style="margin-top: 10px;">
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width:100%"></div>
</div>
{% endif %}
<div class="progress progress-striped active" style="margin-top: 10px;">
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width:100%"></div>
</div>
Comment on lines +19 to +21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The indentation for the inner div of the progress bar is excessive, which harms code readability. It's a good practice to maintain consistent indentation.

        <div class="progress progress-striped active" style="margin-top: 10px;">
            <div class="progress-bar progress-bar-striped progress-bar-animated" style="width:100%"></div>
        </div>

</div>
{% endif %}
{% endblock %}
Loading