{# Extends the base layout template #} {% extends "base.html" %} {# --- Page Title Block --- #} {% block title %}{{ super() }} - Configure Service: {{ server_name }}{% endblock %} {# --- Head Scripts Block --- #} {# Include JavaScript files needed for this page #} {% block head_scripts %} {# Core utilities #} {# Contains saveServiceSettings function and toggle switch JS logic #} {# server_actions.js might be needed if saveServiceSettings calls start_server #} {% endblock %} {# --- Main Content Block --- #} {% block content %} {# Main heading for the page #}

Configure Service Options

{# Display server context and installation step if applicable #}

Server: {{ server_name }} {% if new_install %} {# Indicator for multi-step installation workflow #} {# Assuming this is the final step? Adjust number if needed. #}
(Step 4 of 4 for New Installation) {% endif %}

{# --- Status Message Area --- #} {# Targeted by JavaScript (showStatusMessage) #}
{# Area for JavaScript-driven validation errors #} {# Server-side flash messages (handled by base.html) #} {# --- Service Configuration Section --- #}
{# --- Conditionally render options based on OS --- #} {% if os == 'Linux' or os == 'Windows' %}

Configure automatic behavior for this server.

{# --- Auto-Update Toggle (Common to Linux/Windows) --- #} {# This setting controls whether the server checks for updates when started #}
{# Label linked to the actual checkbox input #} {% if os == 'Linux' %}Checks for updates when the systemd service starts.{% endif %} {% if os == 'Windows' %}Checks for updates when starting via the manager (not Task Scheduler).{% endif %}
{# Checkbox input stores the state #} {# Visual switch linked to the checkbox #}
{# Hidden input ensures 'false' is submitted if checkbox is unchecked #} {# Placeholder for validation error related to this toggle #} {#
#}
{# --- Auto-Start Toggle (Linux Only - Systemd) --- #} {% if os == 'Linux' %}
Starts the server automatically via systemd when the user logs in.
{% endif %} {# --- Start Server after Save Toggle (New Install Only) --- #} {% if new_install %}
Automatically start the server once these settings are saved.
{# This checkbox value is read directly by JS, no hidden false needed #} {# Default off #}
{% endif %} {# End of new_install section #} {# --- Form Actions --- #}
{# Save button calls JS function, passing necessary data #} {# Use |tojson filter for boolean new_install flag #} {# Navigation button/link #} {% if new_install %} Finish Setup & Go To Dashboard {% else %} « Back to Dashboard {% endif %}
{% else %} {# --- Unsupported OS --- #}
{# Use warning style #} Service configuration is not currently supported on this operating system ({{ os }}).
Back to Dashboard {# Simple back button #}
{% endif %} {# End of OS check #}
{# --- End of .service-config-section --- #} {% endblock %} {# --- Body Scripts Block --- #} {% block body_scripts %} {# JavaScript for initializing toggle switches (if not globally handled) #} {# Assuming the JS logic from install_config.js (or similar) is loaded via head_scripts #} {# If that script doesn't exist or doesn't handle toggles, add the JS here: #} {# #} {% endblock %}