2018-11-26 07:23:33 +00:00
{% extends "base.html" %}
2019-01-24 13:18:07 +00:00
{% load notifications %}
2019-02-01 08:56:02 +00:00
{% load manager %}
2018-11-26 07:23:33 +00:00
{% block content %}
2019-02-21 09:46:25 +00:00
< p > < b > Organization:< / b > {% userOrgas as orgas %}< select { % if orgas | length = = 1 % } style = "display: none;" { % endif % } id = "orgaselect" > {% for orga in orgas %}< option { % if user . userstatus . orga = = orga % } selected { % endif % } value = "{{ orga.id }}" > {{ orga }}< / option > {% endfor %}< / select > {% if orgas|length == 1 %}{% orgaString %}{% endif %}< / p >
2019-02-02 12:31:05 +00:00
< p > < b > User:< / b > {{ user.first_name }} {{ user.last_name }} ({{ user.username }}) < a href = "/users/{{ user.id }}/edit" > < i class = "fas fa-edit" title = "Edit User" > < / i > < / a > < / p >
2018-11-26 07:23:33 +00:00
2019-02-03 09:51:02 +00:00
< div align = "center" > < b > Manage:< / b >
< a id = "linkdevices" href = "#" onclick = "showdevices();" > Devices< / a >
‐ < a id = "linkwifi" href = "#" onclick = "showwifi();" > WiFi< / a >
2019-02-21 09:46:25 +00:00
‐ < a id = "linkusers" href = "#" onclick = "showusers();" > Users< / a >
2019-02-03 09:51:02 +00:00
{% if user.is_superuser %}
‐ < a id = "linknets" href = "#" onclick = "shownets();" > Networks< / a >
‐ < a id = "linkorgas" href = "#" onclick = "showorgas();" > Organizations< / a >
{% endif %}
< / div >
2019-04-18 13:59:06 +00:00
< p > < / p >
{% autoescape off %}
2019-01-24 13:18:07 +00:00
{% getNotifications %}
2019-04-18 13:59:06 +00:00
{% endautoescape %}
2019-01-24 12:04:04 +00:00
2019-01-13 10:48:05 +00:00
< div name = "devicespart" id = "devicespart" >
< h2 > Devices< / h2 >
< div class = "table-responsive" >
< table id = "table" name = "table" class = "table" >
< thead >
< tr >
< th > Device ID< / th >
< th > Common Name< / th >
< th > Network< / th >
< th > Latest IP< / th >
< th > Options {% if user.is_superuser %}< a href = "/makedevice/" style = "font-weight:bold;color:green;" > < i class = "fas fa-plus" title = "Add Device" > < / i > < / a > {% endif %}< / th >
< / tr >
< / thead >
2019-02-19 13:19:43 +00:00
< tbody >
2019-02-01 14:28:56 +00:00
{% userDevices as devices %}
2019-01-13 10:48:05 +00:00
{% for device in devices %}
2019-02-19 13:19:43 +00:00
< tr data-orga = "[{{ device.organization.id }}]" >
2019-04-16 09:02:39 +00:00
< td > < i class = "fas fa-circle" style = "color: grey;" title = "No information available" id = "{{ device.id }}-indicator" > < / i > {% if device.model.deprecated %} < i style = "color: red;" title = "Device outdated{% if not user.is_superuser %} – please contact us to replace it with a new one{% endif %}" class = "fas fa-exclamation-triangle" > < / i > {% elif user.is_superuser and device.upgrade_available %} < i style = "color: green;" title = "Firmware upgrade available" class = "fas fa-upload" > < / i > {% endif %} < div style = "display: inline;" { % if user . is_superuser % } title = "{{ device.organization.name }}" { % endif % } id = "{{ device.id }}-id" > {{ device.serial }}{% if device.ssid %}< br > < small > SSID: {{ device.ssid }}< / small > {% endif %}< / div > < / td >
2019-01-13 10:48:05 +00:00
< td id = "{{ device.id }}-name" > {% if device.name %}{{ device.name }}{% endif %}< / td >
< td id = "{{ device.id }}-network" > {{ device.network }}< / td >
2019-01-15 11:08:19 +00:00
< td > < div style = "display:inline;" id = "{{ device.id }}-ip" > {% if device.curip %}{{ device.curip }} (at {{ device.lasttime }}){% endif %}< / div > < / td >
2019-03-10 13:09:45 +00:00
< td > < a href = "/devices/{{ device.id }}/edit" > < i class = "fas fa-edit" title = "Edit Device" > < / i > < / a > < a href = "#" > < i style = "color: green;" onclick = "askreboot({{ device.id }});" class = "fas fa-sync" title = "Reboot Device" > < / i > < / a > {% if user.is_staff %} < a href = "#" > < i onclick = "downloadnotice({{ device.id }});" class = "fas fa-download" title = "Download Configuration" > < / i > < / a > {% endif %}{% if user.is_superuser %} < a href = "#" > < i style = "color: darkred;" onclick = "askdelete({{ device.id }});" class = "fas fa-trash-alt" title = "Delete Device" > < / i > < / a > {% endif %}< / td >
2019-01-13 10:48:05 +00:00
< / tr >
{% endfor %}
2019-02-19 13:19:43 +00:00
< / tbody >
2019-01-13 10:48:05 +00:00
< / table >
< / div >
2018-11-26 07:23:33 +00:00
< / div >
2019-01-13 10:48:05 +00:00
< div name = "wifipart" id = "wifipart" >
< h2 > WiFi< / h2 >
2018-12-28 09:43:57 +00:00
2019-01-13 10:48:05 +00:00
< div class = "table-responsive" >
< table id = "wifi" name = "wifi" class = "table" >
< thead >
< tr >
< th > Common Name< / th >
< th > SSID< / th >
2019-02-21 09:46:25 +00:00
< th > Options < a href = "/makewifi/" style = "font-weight:bold;color:green;" > < i class = "fas fa-plus" title = "Add WiFi" > < / i > < / a > < / th >
2019-01-13 10:48:05 +00:00
< / tr >
< / thead >
2019-02-19 13:19:43 +00:00
< tbody >
2019-02-01 14:28:56 +00:00
{% userWifis as wifis %}
2019-01-13 10:48:05 +00:00
{% for wifi in wifis %}
2019-02-19 13:19:43 +00:00
< tr data-orga = "[{{ wifi.organization.id }}]" >
2019-01-15 11:08:19 +00:00
< td > < div style = "display:inline;" { % if user . is_superuser % } title = "{{ wifi.organization.name }}" { % endif % } > {{ wifi.serial }}< / div > < / td >
2019-01-13 10:48:05 +00:00
< td > {{ wifi.ssid }}< / td >
< td > < a href = "/wifi/{{ wifi.id }}/edit" > < i class = "fas fa-edit" title = "Edit WiFi" > < / i > < / a > {% if user.is_staff %} < a href = "#" > < i style = "color: darkred;" onclick = "askdeletewifi({{ wifi.id }});" class = "fas fa-trash-alt" title = "Delete WiFi" > < / i > < / a > {% endif %}< / td >
< / tr >
{% endfor %}
2019-02-19 13:19:43 +00:00
< / tbody >
2019-01-13 10:48:05 +00:00
< / table >
< / div >
2018-12-28 09:43:57 +00:00
< / div >
2019-01-13 12:55:53 +00:00
< div name = "userpart" id = "userpart" >
< h2 > Users< / h2 >
< div class = "table-responsive" >
< table id = "users" name = "users" class = "table" >
< thead >
< tr >
2019-04-18 14:26:28 +00:00
< th > < / th >
2019-01-13 12:55:53 +00:00
< th > Username< / th >
< th > Real name< / th >
2019-02-01 08:19:18 +00:00
< th > Last Activity< / th >
2019-02-02 12:01:06 +00:00
< th > Options {% if user.is_superuser %}< a href = "/makeuser/" style = "font-weight:bold;color:green;" > < i class = "fas fa-plus" title = "Add User" > < / i > < / a > {% endif %}< / th >
2019-01-13 12:55:53 +00:00
< / tr >
< / thead >
2019-02-19 13:19:43 +00:00
< tbody >
2019-02-01 14:28:56 +00:00
{% userUsers as users %}
2019-01-13 12:55:53 +00:00
{% for auser in users %}
2019-02-19 13:19:43 +00:00
< tr data-orga = "{% directOrgaAjax auser %}" >
2019-04-18 14:26:28 +00:00
< td > {% if auser.is_superuser %}< i class = "fas fa-concierge-bell" style = "color:gold;" title = "Technical Support" > < / i > {% endif %}< / td >
< td > < div style = "display:inline;" { % if user . is_superuser % } title = "{% directOrgaString auser %}" { % endif % } > {% if auser.is_staff %}< b > {% endif %}{{ auser.username }}{% if auser.is_staff %}< / b > {% endif %}< / div > < / td >
2019-01-13 12:55:53 +00:00
< td > {% if auser.is_staff %}< b > {% endif %}{{ auser.first_name }} {{ auser.last_name }}{% if auser.is_staff %}< / b > {% endif %}< / td >
2019-02-01 08:19:18 +00:00
< td > {{ auser.userstatus.last_action }}< / td >
2019-02-21 09:46:25 +00:00
< td > {% if user.is_staff %}< a href = "/users/{{ auser.id }}/edit" > < i class = "fas fa-edit" title = "Edit User" > < / i > < / a > {% endif %}{% if auser.email %}< a href = "mailto:{{ auser.email }}" > < i class = "fas fa-envelope" title = "Send Email" > < / i > < / a > {% endif %}{% if user.is_superuser %} < a href = "#" > < i style = "color: darkred;" onclick = "askdeleteuser({{ auser.id }});" class = "fas fa-trash-alt" title = "Delete User" > < / i > < / a > {% endif %}< / td >
2019-01-13 12:55:53 +00:00
< / tr >
{% endfor %}
2019-02-19 13:19:43 +00:00
< / tbody >
2019-01-13 12:55:53 +00:00
< / table >
< / div >
< / div >
2019-02-21 09:46:25 +00:00
{% if user.is_superuser %}
2019-02-02 13:20:40 +00:00
< div name = "netpart" id = "netpart" >
< h2 > Networks< / h2 >
< div class = "table-responsive" >
< table id = "networks" name = "networks" class = "table" >
< thead >
< tr >
< th > Common Name< / th >
< th > Internal IP< / th >
< th > External IP< / th >
2019-02-02 14:34:32 +00:00
< th > Options < a href = "/makenet/" style = "font-weight:bold;color:green;" > < i class = "fas fa-plus" title = "Add User" > < / i > < / a > < / th >
2019-02-02 13:20:40 +00:00
< / tr >
< / thead >
2019-02-19 13:19:43 +00:00
< tbody >
2019-02-02 13:20:40 +00:00
{% userNets as networks %}
{% for network in networks %}
2019-02-19 13:19:43 +00:00
< tr data-orga = "{% netOrgaAjax network %}" >
2019-03-08 15:51:58 +00:00
< td > < div style = "display:inline;" title = "{% netOrgaString network %}" > {% if network.name %}{{ network.name }}{% endif %}< / div > < / td >
2019-02-02 13:20:40 +00:00
< td > {{ network.intip }}< / td >
< td > {{ network.extip }}< / td >
2019-03-16 13:25:37 +00:00
< td > {% if not network.intip == "No VPN" %}< a href = "/networks/{{ network.id }}/edit" > < i class = "fas fa-edit" title = "Edit Network" > < / i > < / a > < a href = "#" > < i style = "color: darkred;" onclick = "askdeletenet({{ network.id }});" class = "fas fa-trash-alt" title = "Delete Network" > < / i > < / a > {% endif %}< / td >
2019-02-02 13:20:40 +00:00
< / tr >
{% endfor %}
2019-02-19 13:19:43 +00:00
< / tbody >
2019-02-02 13:20:40 +00:00
< / table >
< / div >
2019-01-13 12:55:53 +00:00
2019-02-03 09:51:02 +00:00
< / div >
< div name = "orgapart" id = "orgapart" >
< h2 > Organizations< / h2 >
< div class = "table-responsive" >
< table id = "organizations" name = "organizations" class = "table" >
< thead >
< tr >
< th > Name< / th >
< th > Users< / th >
< th > Options < a href = "/makeorga/" style = "font-weight:bold;color:green;" > < i class = "fas fa-plus" title = "Add Organization" > < / i > < / a > < / th >
< / tr >
< / thead >
2019-02-19 14:42:13 +00:00
{% for orga in orgas %}
2019-02-19 14:01:18 +00:00
< tr class = "orgarow" >
2019-02-03 09:51:02 +00:00
< td > < div style = "display:inline;" > {{ orga.name }}< / div > < / td >
2019-03-16 13:25:37 +00:00
< td > {{ orga.orgausers.all|length }}{% if orga.userlimit %}/{{ orga.userlimit }}{% endif %}< / td >
2019-02-03 10:35:52 +00:00
< td > < a href = "/organizations/{{ orga.id }}/edit" > < i class = "fas fa-edit" title = "Edit Organization" > < / i > < / a > < a href = "#" > < i style = "color: darkred;" onclick = "askdeleteorga({{ orga.id }});" class = "fas fa-trash-alt" title = "Delete Organization" > < / i > < / a > < / td >
2019-02-03 09:51:02 +00:00
< / tr >
{% endfor %}
< / table >
< / div >
2019-02-02 13:20:40 +00:00
< / div >
{% endif %}
2019-02-09 16:24:41 +00:00
< iframe id = "download" width = "1" height = "1" style = "display:none" > < / iframe >
2018-11-28 15:38:35 +00:00
< script src = "/js/devices.js" > < / script >
2018-11-26 07:23:33 +00:00
{% endblock %}