Skip to content

Commit

Permalink
influxdb2: clean up web interface code and tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
onkelandy committed Nov 2, 2023
1 parent e23c3b9 commit ec7419f
Showing 1 changed file with 4 additions and 83 deletions.
87 changes: 4 additions & 83 deletions influxdb2/webif/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,13 @@
}
}
</script>
<!--
This part is used to implement datatable JS for the tables. It allows resorting tables by column, etc.
For each table you have to implement the code part $('#<table_id>').DataTable(..); where the <table_id> matches the id of a table tag
-->

<script>
$(document).ready( function () {
/*
loading defaults from /modules/http/webif/gstatic/datatables/datatables.defaults.js
You can copy that file, put it in your plugin directory, rename the "bind" function and
trigger that function here instead of datatables_defaults if you want to change the behaviour.
Of course you can also overwrite defaults by putting the option declarations in {} below.
*/
$(window).trigger('datatables_defaults');
try
{
$('#maintable').DataTable( {} ); // put options into {} if needed
$('#<table_id>').DataTable( {} ); // delete or change name
$('#maintable').DataTable( {} );
}
catch (e)
{
Expand Down Expand Up @@ -91,41 +81,12 @@
</table>
{% endblock headtable %}

{% set tabcount = 1 %}

<!--
Additional buttons for the web interface (if any are needed) - displayed below the headtable-section
-->
{% block buttons %}
{% if 1==2 %}
<div>
<button id="btn1" class="btn btn-shng btn-sm" name="scan" onclick="shngPost('', {learn: 'on'})"><i class="fas fa-question"></i>&nbsp;&nbsp;&nbsp;{{ _('nach Devices suchen') }}&nbsp;</button>
</div>
{% endif %}
{% endblock %}

<!--
Define the number of tabs for the body of the web interface (1 - 6)
-->
{% set tabcount = 4 %}


<!--
Set the tab that will be visible on start, if another tab that 1 is wanted (1 - 3)
-->
{% if item_count==0 %}
{% set start_tab = 2 %}
{% endif %}


<!--
Content block for the first tab of the Webinterface
-->
{% set tab1title = "<strong>" ~ p.get_shortname() ~ " Items</strong> (" ~ item_count ~ ")" %}
{% block bodytab1 %}
<div class="container-fluid m-2">

<!-- set id accordingly -->
<table id="maintable" class="table table-striped table-hover pluginList display">
<table id="maintable" class="datatableAdditional">
<thead>
<tr>
<th>{{ _('Item') }}</th>
Expand All @@ -148,44 +109,4 @@
</tbody>
</table>

</div>
{% endblock bodytab1 %}


<!--
Content block for the second tab of the Webinterface
-->
{% set tab2title = "<strong>" ~ p.get_shortname() ~ " Geräte</strong> (" ~ device_count ~ ")" %}
{% block bodytab2 %}
<div class="container-fluid m-2">
{{ _('Hier kommt der Inhalt des Webinterfaces hin.') }}
</div>
{% endblock bodytab2 %}


<!--
Content block for the third tab of the Webinterface
If wanted, a title for the tab can be defined as:
{% set tab3title = "<strong>" ~ p.get_shortname() ~ " Geräte</strong>" %}
It has to be defined before (and outside) the block bodytab3
-->
{% block bodytab3 %}
<div class="container-fluid m-2">
{{ _('Hier kommt der Inhalt des Webinterfaces hin.') }}
</div>
{% endblock bodytab3 %}


<!--
Content block for the fourth tab of the Webinterface
If wanted, a title for the tab can be defined as:
{% set tab4title = "<strong>" ~ p.get_shortname() ~ " Geräte</strong>" %}
It has to be defined before (and outside) the block bodytab4
-->
{% block bodytab4 %}
<div class="container-fluid m-2">
{{ _('Hier kommt der Inhalt des Webinterfaces hin.') }}
</div>
{% endblock bodytab4 %}

0 comments on commit ec7419f

Please sign in to comment.