fix build and add style

- fix build with requirements.txt
- card styling
This commit is contained in:
Brian Martin 2020-01-02 08:46:11 -05:00
parent 01d13e0264
commit d08d3b2d3c
2 changed files with 93 additions and 81 deletions

View file

@ -11,103 +11,112 @@
{% endfor %} {% endfor %}
</ul> </ul>
<div class="container-fluid col-8">
<h1>Bumper</h1> <h1>Bumper</h1>
<!-- Section Stats --> <!-- Section Stats -->
<div class="card col-8"> <div class="card bg-light border-dark">
<div> <div class="card-header">
<h2>Bumper Server Status</h2> <h2 class="card-title">Bumper Server Status</h2>
<h3>MQTT Server</h3> </div>
Status: {% if mqtt_server[0].state == "started" %} <span class="badge badge-success">{{ mqtt_server[0].state }}</span> {% else %} <span class="badge badge-danger">{{ mqtt_server[0].state }}</span> {% endif %} <div class="card-body">
Sessions: {{ mqtt_server[1].sessions[0].count }}
<table class="table table-striped table-bordered"> <h3>MQTT Server</h3>
<thead class="thead-dark"> Status: {% if mqtt_server[0].state == "started" %} <span class="badge badge-success">{{ mqtt_server[0].state }}</span> {% else %} <span class="badge badge-danger">{{ mqtt_server[0].state }}</span> {% endif %}
<TH>username</TH><TH>clientid</TH><TH>state</TH> Sessions: {{ mqtt_server[1].sessions[0].count }}
</thead>
{% for sess in mqtt_server[1].sessions[1].clients %}
<TR>
<TD>{{ sess[0].username }}</TD>
<TD>{{ sess[0].client_id }}</TD>
<TD {% if sess[0].state == "connected" %} class="table-success" {% endif %}> {{ sess[0].state }} </TD>
</TR>
{% endfor %}
</table>
<h3>XMPP Server</h3> <table class="table table-striped table-bordered">
Status: {% if xmpp_server.server._serving == True %} <span class="badge badge-success">running</span> {% else %} <span class="badge badge-danger">not running</span> {% endif %} <thead class="thead-dark">
Clients: {{ xmpp_server.clients | length }} <TH>username</TH><TH>clientid</TH><TH>state</TH>
</thead>
{% for sess in mqtt_server[1].sessions[1].clients %}
<TR>
<TD>{{ sess[0].username }}</TD>
<TD>{{ sess[0].client_id }}</TD>
<TD {% if sess[0].state == "connected" %} class="table-success" {% endif %}> {{ sess[0].state }} </TD>
</TR>
{% endfor %}
</table>
<table class="table table-striped table-bordered"> <h3>XMPP Server</h3>
<thead class="thead-dark"> Status: {% if xmpp_server.server._serving == True %} <span class="badge badge-success">running</span> {% else %} <span class="badge badge-danger">not running</span> {% endif %}
<TH>uid</TH><TH>jid</TH><TH>state</TH> Clients: {{ xmpp_server.clients | length }}
</thead>
{% for client in xmpp_server.clients %} <table class="table table-striped table-bordered">
<TR> <thead class="thead-dark">
<TD>{{ client.uid }}</TD> <TH>uid</TH><TH>jid</TH><TH>state</TH>
<TD>{{ client.bumper_jid }}</TD> </thead>
<TD {% if client.state == 4 %} class="table-success" {% endif %}>{% if client.state == 4 %} connected {% else %} not connected {% endif %}</TD> {% for client in xmpp_server.clients %}
</TR> <TR>
{% endfor %} <TD>{{ client.uid }}</TD>
</table> <TD>{{ client.bumper_jid }}</TD>
<TD {% if client.state == 4 %} class="table-success" {% endif %}>{% if client.state == 4 %} connected {% else %} not connected {% endif %}</TD>
</TR>
{% endfor %}
</table>
<h3>Helperbot</h3> <h3>Helperbot</h3>
Status: {% if helperbot[0].state == "connected" %} <span class="badge badge-success">{{ helperbot[0].state }}</span> {% else %} <span class="badge badge-danger">{{ helperbot[0].state }}</span> {% endif %} Status: {% if helperbot[0].state == "connected" %} <span class="badge badge-success">{{ helperbot[0].state }}</span> {% else %} <span class="badge badge-danger">{{ helperbot[0].state }}</span> {% endif %}
</div>
</div>
</div> </div>
</br> </br>
<!-- Section Bots --> <!-- Section Bots -->
<div class="card col-8"> <div class="card bg-light border-dark">
<div> <div class="card-header">
<h2>Bots</h2> <h2 class="card-title">Bots</h2>
<table class="table table-striped table-bordered"> </div>
<thead class="thead-dark"> <div class="card-body">
<TH>SN</TH><TH>Nickname</TH><TH>Class</TH><TH>DID</TH><TH>Resource</TH><TH>Company</TH><TH>MQTT Connected</TH><TH>XMPP Connected</TH> <table class="table table-striped table-bordered">
</thead> <thead class="thead-dark">
{% for bot in bots %} <TH>SN</TH><TH>Nickname</TH><TH>Class</TH><TH>DID</TH><TH>Resource</TH><TH>Company</TH><TH>MQTT Connected</TH><TH>XMPP Connected</TH>
<TR> </thead>
<TD>{{ bot.name }}</TD> {% for bot in bots %}
<TD>{{ bot.nick }}</TD> <TR>
<TD>{{ bot.class }}</TD> <TD>{{ bot.name }}</TD>
<TD>{{ bot.did }}</TD> <TD>{{ bot.nick }}</TD>
<TD>{{ bot.resource }} </TD> <TD>{{ bot.class }}</TD>
<TD>{{ bot.company}} </TD> <TD>{{ bot.did }}</TD>
<TD>{{ bot.resource }} </TD>
<TD>{{ bot.company}} </TD>
<TD {% if bot.mqtt_connection == True %} class="table-success" {% endif %}> {{ bot.mqtt_connection }} </TD> <TD {% if bot.mqtt_connection == True %} class="table-success" {% endif %}> {{ bot.mqtt_connection }} </TD>
<TD {% if bot.xmpp_connection == True %} class="table-success" {% endif %}> {{ bot.xmpp_connection }}</TD> <TD {% if bot.xmpp_connection == True %} class="table-success" {% endif %}> {{ bot.xmpp_connection }}</TD>
</TR> </TR>
{% endfor %} {% endfor %}
</table> </table>
</div> </div>
</div> </div>
</br> </br>
<!-- Section Clients --> <!-- Section Clients -->
<div class="card col-8"> <div class="card bg-light border-dark">
<div> <div class="card-header">
<h2>Clients</h2> <h2 class="card-title">Clients</h2>
<table class="table table-striped table-bordered"> </div>
<thead class="thead-dark"> <div class="card-body">
<TH>User ID</TH><TH>Realm</TH><TH>Resource</TH><TH>MQTT Connected</TH><TH>XMPP Connected</TH> <table class="table table-striped table-bordered">
</thead> <thead class="thead-dark">
{% for client in clients %} <TH>User ID</TH><TH>Realm</TH><TH>Resource</TH><TH>MQTT Connected</TH><TH>XMPP Connected</TH>
<TR> </thead>
<TD>{{ client.userid }}</TD> {% for client in clients %}
<TD>{{ client.realm }}</TD> <TR>
<TD>{{ client.resource }}</TD> <TD>{{ client.userid }}</TD>
<TD {% if client.mqtt_connection == True %} class="table-success" {% endif %}> {{ client.mqtt_connection }} </TD> <TD>{{ client.realm }}</TD>
<TD {% if client.xmpp_connection == True %} class="table-success" {% endif %}> {{ client.xmpp_connection }}</TD> <TD>{{ client.resource }}</TD>
</TR> <TD {% if client.mqtt_connection == True %} class="table-success" {% endif %}> {{ client.mqtt_connection }} </TD>
{% endfor %} <TD {% if client.xmpp_connection == True %} class="table-success" {% endif %}> {{ client.xmpp_connection }}</TD>
</table> </TR>
</div> {% endfor %}
</table>
</div>
</div> </div>
</div>
</body> </body>
</html> </html>

View file

@ -1,4 +1,5 @@
aiohttp==3.6.2 aiohttp==3.6.2
aiohttp-jinja2==1.2.0
async-timeout==3.0.1 async-timeout==3.0.1
atomicwrites==1.3.0 atomicwrites==1.3.0
attrs==19.3.0 attrs==19.3.0
@ -6,9 +7,11 @@ chardet==3.0.4
docopt==0.6.2 docopt==0.6.2
hbmqtt==0.9.5 hbmqtt==0.9.5
idna==2.8 idna==2.8
Jinja2==2.10.3
MarkupSafe==1.1.1
multidict==4.5.2 multidict==4.5.2
passlib==1.7.2 passlib==1.7.2
PyYAML==5.2 PyYAML==5.3b1
six==1.13.0 six==1.13.0
tinydb==3.15.2 tinydb==3.15.2
transitions==0.7.1 transitions==0.7.1