vpnmanager/templates/manager/edit.html

68 lines
2.9 KiB
HTML

{% extends "base.html" %}
{% block content %}
<form action="#" method="post">
{% csrf_token %}
<div class="form-group">
<label for="serial">Serial Number</label>
<input type="text" class="form-control" id="serial" disabled="disabled" value="{{ device.serial }}"></input>
</div>
{% if user.is_staff %}
<div class="form-group">
<label for="model">Device Model</label>
<input type="text" class="form-control" id="model" disabled="disabled" value="{{ device.model }}"></input>
</div>
{% endif %}
{% if user.is_superuser %}
<div class="form-group">
<label for="secret">Device Secret</label>
<input type="text" class="form-control" id="secret" disabled="disabled" value="{{ device.secret }}"></input>
</div>
{% endif %}
{% if user.is_staff %}
<div class="form-group">
<label for="password">Root Password</label>
<input type="text" class="form-control" id="password" disabled="disabled" value="{{ device.password }}"></input>
</div>
{% endif %}
<div class="form-group">
<label for="name">Device Name</label>
<input type="text" class="form-control" name="name" id="name" placeholder="Enter Device Name (Optional)" {% if device.name %} value="{{ device.name }}" {% endif %}></input>
</div>
<div class="form-group">
<label for="subnet">Assigned Network</label>
<select class="custom-select mr-sm-2" id="subnet" name="subnet">
{% for choice in subnets %}
<option {% if choice.intip == device.network.intip %} selected {% endif %} value="{{ choice.intip }}">{{ choice.intip}}{% if choice.name %} ({{ choice.name }}){% endif %}</option>
{% endfor %}
</select>
<small id="subnetHelp" class="form-text text-muted">A network change will require a reboot of the device to be applied.</small>
</div>
{% if device.model.wwan %}
<div class="form-group">
<label for="wifi">Assigned WiFis</label>
<select multiple class="custom-select mr-sm-2" id="wifi" name="wifi">
{% for choice in wifis %}
<option {% if choice in curfis %} selected {% endif %} value="{{ choice.id }}">{{ choice }}</option>
{% endfor %}
</select>
<small id="subnetHelp" class="form-text text-muted">This feature is not yet available on all devices.</small>
</div>
{% endif %}
<div class="form-group form-check">
<input class="form-check-input" type="checkbox" value="True" {% if device.reboot %} checked {% endif %} id="reboot" name="reboot">
<label class="form-check-label" for="reboot">Reboot device immediately </label>
</div>
{% if user.is_staff %}
<div class="form-group form-check">
<input class="form-check-input" type="checkbox" value="True" {% if device.update %} checked {% endif %} id="update" name="update">
<label class="form-check-label" for="update">Install Firmware Update</label>
</div>
{% endif %}
<button type="submit" class="btn btn-success">Apply Changes</button>
<a class="btn btn-danger" href="/devices/" role="button">Cancel</a>
</form>
{% endblock %}