1
0
Fork 0
satnogs-network/network/templates/base/station_view.html

327 lines
12 KiB
HTML

{% extends "base.html" %}
{% load tags %}
{% load staticfiles %}
{% block title %} - Ground Station {{ station.name }}{% endblock %}
{% block css %}
<link rel="stylesheet" href="{% static 'lib/bootstrap-slider/dist/css/bootstrap-slider.min.css' %}">
<link rel="stylesheet" href="{% static 'lib/mapbox-gl/dist/mapbox-gl.css' %}">
{% endblock css %}
{% block content %}
<div class="row">
<div class="col-md-6">
<h2 id="station-info"
data-name="{{ station.name }}"
data-id="{{ station.id }}"
data-lng="{{ station.lng }}"
data-lat="{{ station.lat }}"
data-schedule="{{ can_schedule|yesno:"true,false" }}"
data-new-obs="{% url 'base:observation_new' %}">
{{ station.id }} - {{ station.name }}
</h2>
</div>
<div class="col-md-6 text-right">
<h2>
{% if request.user == station.owner %}
<a class="btn btn-primary" href="{% url 'base:station_edit' id=station.id %}">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
Edit
</a>
<a class="btn btn-danger delete-modal-reveal" data-toggle="modal" data-target="#delete-modal">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</a>
{% endif %}
</h2>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="front-line">
<span class="label label-default">Owner</span>
<span class="front-data">
<a href="{% url 'users:view_user' username=station.owner.username %}">
{{ station.owner.displayname }}
</a>
</span>
</div>
{% if station.qthlocator %}
<div class="front-line">
<span class="label label-default">QTH Locator</span>
<span class="front-data">
{{ station.qthlocator }}
</span>
</div>
{% endif %}
{% if station.location %}
<div class="front-line">
<span class="label label-default">Location</span>
<span class="front-data">
{{ station.location }}
</span>
</div>
{% endif %}
<div class="front-line">
<span class="label label-default">Coordinates</span>
<span class="front-data">
{{ station.lat|floatformat:-3 }}°, {{ station.lng|floatformat:-3 }}°
</span>
</div>
<div class="front-line">
<span class="label label-default">Altitude</span>
<span class="front-data">
{{ station.alt }} m
</span>
</div>
<div class="front-line">
<span class="label label-default">Min Horizon</span>
<span class="front-data">
{{ station.horizon }}°
</span>
</div>
{% if station.target_utilization %}
<div class="front-line">
<span class="label label-default">Target Utilization</span>
<span class="front-data">
{{ station.target_utilization }} %
</span>
</div>
{% endif %}
{% if station.antenna %}
<div class="font-line station-antennas">
<span class="label label-default">Antennas</span>
<span class="front-data">
{% for antenna in station.antenna.all %}
<span class="antenna-pill" data-toggle="tooltip" data-placement="bottom"
title="{{ antenna.frequency|frq }} - {{ antenna.frequency_max|frq }}">
{{ antenna.band}} {{ antenna.get_antenna_type_display }}
</span>
{% endfor %}
</span>
</div>
{% endif %}
{% if station.success_rate %}
<div class="front-line">
<span class="label label-default">Success Rate</span>
<span class="front-data">
<div class="progress" title="{{ station.success_rate }}%">
<div class="gs progress-bar progress-bar-success" data-success-rate="{{ station.success_rate }}">
<span class="sr-only">{{ station.success_rate }}% Complete (success)</span>
</div>
<div class="gs progress-bar progress-bar-danger" data-percentagerest="{{ station.success_rate|percentagerest }}">
<span class="sr-only">{{ station.success_rate|percentagerest }}% Complete (danger)</span>
</div>
</div>
</span>
</div>
{% endif %}
{% if station.observations_count %}
<div class="front-line">
<span class="label label-default">Observations</span>
<span class="front-data">{{ station.observations_count }}
<div class="pull-right">
<a href="{% url 'base:observations_list' %}?station={{ station.id }}">
<button type="button" class="btn btn-xs btn-info">
View all
</button>
</a>
</div>
</span>
</div>
{% endif %}
<div class="front-line">
<span class="label label-default">Creation Date</span>
<span class="front-data"
title="{{ station.created|date:"c" }}">
{{ station.created|timesince }} ago
</span>
</div>
{% if station.client_version %}
<div class="front-line">
<span class="label label-default">Client version</span>
<span class="front-data" title="on latest reported observation">
{{ station.client_version }}
</span>
</div>
{% endif %}
<div class="front-line">
<span class="label label-{{ station.get_status_display|lower }}">{{ station.get_status_display }}</span>
<span class="front-data" data-toggle="tooltip"
title="{{ station.last_seen|date:"c" }}">
{% if station.last_seen %}
Last seen {{ station.last_seen|timesince }} ago
{% else %}
Never seen
{% endif %}
</span>
</div>
<div class="front-line">
<span class="label label-default">Uptime</span>
<span class="front-data">
{{ uptime }}
<div class="pull-right">
<a href="{% url 'base:station_log' id=station.id %}">
<button type="button" class="btn btn-xs btn-info">
Log
</button>
</a>
</div>
</span>
</div>
</div>
<div class="col-md-4">
<div id="map-station" data-mapboxid="{{ mapbox_id }}" data-mapboxtoken="{{ mapbox_token }}"></div>
</div>
<div class="col-md-4">
<img src="{{ station.get_image }}" class="station-view-image" alt="{{ station.name }}">
<span class="glyphicon glyphicon-fullscreen img-expand"
aria-hidden="true" data-src="{{ station.get_image }}"></span>
</div>
</div>
{% if station.description %}
<div class="row">
<div class="col-md-12">
<span>{{ station.description }}</span>
</div>
</div>
{% endif %}
<hr>
<div class="row">
<div class="col-md-6">
<h3>
Pass predictions
</h3>
</div>
<div class="col-md-6">
<h3 class="pull-right">
<a class="btn btn-default" role="button" data-toggle="collapse"
href="#collapseFilters" aria-expanded="false" aria-controls="collapseFilters">
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
</a>
</h3>
</div>
</div>
<div id="collapseFilters" class="row collapse">
<div class="col-md-3">
<label for="success-filter">Success Rate</label>
<input id="success-filter" type="text"/>
</div>
<div class="col-md-3">
<label for="elevation-filter">Max Elevation</label>
<input id="elevation-filter" type="text"/>
</div>
<div class="col-md-3">
<label for="overlap-filter">Overlap</label>
<input id="overlap-filter" type="text"/>
</div>
<div class="col-md-3 pull-right">
<form id="antenna-filter" class="form-inline pull-right" method="get" action="{% url 'base:station_view' id=station.id %}#satellites">
<div class="form-group">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default btn-sm {% if unsupported_frequencies == '1' %}active{% endif %}" aria-expanded="true" aria-controls="unsupported_frequencies">
<input type="checkbox" name="unsupported_frequencies" {% if unsupported_frequencies == '1' %}checked{% endif %} autocomplete="off">
Include unsupported satellites
</label>
</div>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table class="table table-hover table-responsive">
<thead>
<th>Name</th>
<th>
<span aria-hidden="true"
data-toggle="tooltip" data-placement="bottom"
title="Satellite raises from horizon">AOS</span>
</th>
<th>
<span aria-hidden="true"
data-toggle="tooltip" data-placement="bottom"
title="Satellite sets to horizon">LOS</span>
</th>
<th>⤉ ⇴ ⤈</th>
<th>Polar plot</th>
{% if can_schedule %}
<th></th>
{% endif %}
</thead>
<tbody id="pass_predictions" can_schedule="{{ can_schedule }}">
<tr id="loading">
<td colspan=7>
<div class="spinner">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
</div>
Loading Pass Predictions
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row" id="prediction_results" hidden>
<div class="col-md-12 notice">
<span id="prediction_results_count"></span> passes found.
<a id="open-all" href="#">Open all for scheduling</a>.
</div>
</div>
<!-- Map Modal -->
<div id="modal-lightbox" class="modal-lightbox">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
<img src="{{ station.get_image }}" class="station-full-image" alt="{{ station.name }}">
</div>
<!-- Delete Modal -->
<div class="modal" id="delete-modal" tabindex="-1" role="dialog" aria-labelledby="delete-modal">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Do you really want to delete the ground station?</h4>
</div>
<div class="modal-body">
<p>WARNING: You are about to delete your ground station.</p>
<p>Please enter the ID of your station below to confirm the action.</p>
<input value="" id="delete-confirm-id" type="text" class="form-control" name="delete-confirm-id" placeholder="Enter your station ID to proceed with deletion">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<a class="btn btn-danger" id="station-delete" href="{% url 'base:station_delete' id=station.id %}">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
Delete
</a>
</div>
</div>
</div>
</div>
{% include 'includes/satellite.html' %}
{% include 'includes/legend.html' %}
{% endblock content %}
{% block javascript %}
<script src="{% static 'lib/mapbox-gl/dist/mapbox-gl.js' %}"></script>
<script src="{% static 'lib/moment/min/moment.min.js' %}"></script>
<script src="{% static 'lib/bootstrap-slider/dist/bootstrap-slider.min.js' %}"></script>
<script src="{% static 'lib/satellite.js/dist/satellite.min.js' %}"></script>
<script src="{% static 'js/polar_svg.js' %}"></script>
<script src="{% static 'js/station_view.js' %}"></script>
<script src="{% static 'js/gridsquare.js' %}"></script>
<script src="{% static 'js/satellite.js' %}"></script>
{% endblock javascript %}