{% extends "allianceauth/base-bs5.html" %} {% load i18n %} {% load static %} {% load humanize %} {% block content %} {% if structures %}

Structure and Fuel Stats


Filtered Stats

Structures Matching Filter

Block Usage (Month)

Required Blocks for Days

Filtered System Count

Filtered Constelation Count

Filtered Region Count


{% for structure in structures %} {% empty %} {% endfor %}
Structure Fuel Use 30d Fuel Expires Blocks for 90d Refuel Services System Constellation Region Corp Type
{{ structure.structure.name }}
{{ structure.structure.type_name.name }}
{{ structure.structure.corporation.corporation.corporation_name }}
{% widthratio structure.fuel_req 1 720 %} {% if structure.extra_fuel_info %} {% if structure.structure.fuel_expires < structure.extra_fuel_info.expires %} {{ structure.structure.fuel_expires|date:"Y-m-d" }}
Blocks: {{ structure.structure.fuel_expires|timeuntil }}
{{ structure.extra_fuel_info.name }}: {{ ft.extra_fuel_info.expires|timeuntil }} {% else %} {{ structure.extra_fuel_info.expires|date:"Y-m-d" }}
{{ structure.extra_fuel_info.name }}: {{ structure.extra_fuel_info.expires|timeuntil }}
Blocks: {{ structure.structure.fuel_expires|timeuntil }} {% endif %} {% else %} {{ structure.structure.fuel_expires|date:"Y-m-d" }}
Blocks: {{ structure.structure.fuel_expires|timeuntil }} {% endif %}
{{ structure.90day }} {% for service in structure.structure.structureservice_set.all %} {% if service.state == 'online' %} {{ service.name }} {% else %} {{ service.name }} {% endif %} {% endfor %} {{ structure.structure.system_name.name }} {{ structure.structure.system_name.constellation.name }} {{ structure.structure.system_name.constellation.region.name }} {{ structure.structure.corporation.corporation.corporation_name }} {{ structure.structure.type_name.name }}
{% else %}
{% translate "No Structures Available" %}
{% endif %} {% endblock content %} {% block extra_javascript %} {% include "bundles/datatables-js-bs5.html" %} {% include "bundles/filterdropdown-js.html" %} {% endblock extra_javascript %} {% block extra_script %} function numberWithCommas(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } $(document).ready(function() { $('#table-structs').DataTable({ filterDropDown: { columns: [{ idx: 10 }, { idx: 7 }, { idx: 8 }, { idx:9 } ], }, columnDefs: [ { "searchable": false, "targets": [0] }, { "sortable": false, "targets": [0] }, { "visible": false, "targets": [10, 6, 7, 8, 9] } ], order: [ [1, "desc"] ], paging: false, responsive: true, pageLength: -1, footerCallback: function ( row, data, start, end, display ) { var api = this.api(), data; var pageTotal = api .column(2, { page: 'current'}) .data() .reduce( function (a, b) { return Number(a) + Number(b); }, 0 ); pageTotal_req = api .column(4, { page: 'current'}) .data() .reduce( function (a, b) { return Number(a) + Number(b); }, 0 ); var total_count = api.column(9, { page: 'current'}).data().count(); var systems = api.column(6, { page: 'current'}).data().unique().count(); var constel = api.column(7, { page: 'current'}).data().unique().count(); var region = api.column(8, { page: 'current'}).data().unique().count(); var types = []; api.column(9, { page: 'current'}).data().unique().each(function(value, index) { types.push(value); }); var type_count = []; var t; for ( t of types) { console.log(t) filteredData = api.column(9, {search: 'applied'}) .data() .filter( function ( value, index ) { return value == t ? true : false; } ).count(); type_count.push(filteredData); } console.log(types); console.log(type_count); $('#total_fuel').html(numberWithCommas(pageTotal)) $('#total_fuel_90d').html(numberWithCommas(pageTotal_req)) $('#total_str').html(numberWithCommas(total_count)) $('#total_system').html(numberWithCommas(systems)) $('#total_const').html(numberWithCommas(constel)) $('#total_region').html(numberWithCommas(region)) } }); const duration_title = document.getElementById('daytitle'); const duration_title2 = document.getElementById('totalDaysTitle'); const duration_90d_span = document.getElementById('total_fuel_90d'); const fuelInput = document.getElementById('fuelDuration'); const inputHandler = function(e) { const fuelItems = document.getElementsByClassName("blocks-till"); var days = Number(e.target.value) if (days <= 30 ){ days = 30; } const hours = days*24 duration_title.innerText = days; duration_title2.innerText = days; var total_reqs = 0 for (const elem of fuelItems) { console.log(elem); const start_blocks = elem.getAttribute("start_blocks"); const hourly = elem.getAttribute("hourly"); var blocks = hourly*hours - start_blocks; if (blocks >=0){ elem.innerText = blocks; total_reqs += blocks; } else { elem.innerText = 0; } } duration_90d_span.innerText = numberWithCommas(total_reqs); } fuelInput.addEventListener('input', inputHandler); }); {% endblock extra_script %} {% block extra_css %} {% include "bundles/datatables-css-bs5.html" %} {% endblock extra_css %}