Far better dashboard. Fixed bot-bugs
This commit is contained in:
parent
5fe02d4bcd
commit
db6c13655e
@ -2,6 +2,7 @@ import datetime
|
||||
from bot.api import telegram, google, weather, reddit
|
||||
|
||||
import requests
|
||||
import socket
|
||||
import numpy as np
|
||||
import time
|
||||
import json
|
||||
@ -65,12 +66,13 @@ class ChatBot(FW.BotFramework):
|
||||
ip = requests.get('https://api.ipify.org').text
|
||||
except:
|
||||
ip = "not fetchable"
|
||||
local_ips = [i[4][0] for i in socket.getaddrinfo(socket.gethostname(), None)]
|
||||
|
||||
message += "<pre>Status: Running :green_circle:\n"
|
||||
message += "Uptime: " + delta[:delta.rfind(".")] + "\n"
|
||||
message += "Reboots: " + str(self.persistence["global"]["reboots"]) + "\n"
|
||||
message += "IP-Adress: " + ip + "\n"
|
||||
|
||||
message += "IP-Adress (public): " + ip + "\n"
|
||||
message += "IP-Adress (private): " + str(local_ips) + "\n"
|
||||
tot_r = np.array(self.persistence["bot"]["receive_activity"]["count"]).sum()
|
||||
message += "Total messages read: " + str(tot_r) + "\n"
|
||||
|
||||
|
@ -99,9 +99,11 @@ class DashBoard():
|
||||
ye = self.persistence["bot"]["execute_activity"]["count"]
|
||||
|
||||
fig = go.Figure()
|
||||
fig.add_trace(go.Scatter(x=xs, y=ys, fill="tozeroy", mode="lines", text="Gesendet"))
|
||||
fig.add_trace(go.Scatter(x=xr, y=yr, fill="tozeroy", mode="lines", text="Gelesen"))
|
||||
fig.add_trace(go.Scatter(x=xs, y=ys, fill="tozeroy", mode="lines", text="Gesendet"))
|
||||
fig.add_trace(go.Scatter(x=xe, y=ye, fill="tozeroy", mode="lines", text="Ausgeführt"))
|
||||
|
||||
|
||||
fig.layout.update(showlegend=False,margin=dict(l=0, r=0, t=0, b=0),)
|
||||
|
||||
card = dbc.Card(
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 809 KiB After Width: | Height: | Size: 310 KiB |
@ -20,7 +20,7 @@ class Launcher():
|
||||
self.persistence["global"]["reboots"] += 1
|
||||
|
||||
self.clock_module = clock.main.ClockFace(prst=self.persistence)
|
||||
self.bot_module = bot.main.ChatBot(name="ChatterBot", version="2.1", prst=self.persistence, hw_commands=self.clock_module.commands)
|
||||
self.bot_module = bot.main.ChatBot(name="ChatterBot", version="2.2", prst=self.persistence, hw_commands=self.clock_module.commands)
|
||||
self.dashboard_module = dashboard.main.DashBoard(host_ip="0.0.0.0", prst=self.persistence)
|
||||
|
||||
self.threads = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user