Better persistence, better dashboard
This commit is contained in:
parent
1c15bf4a4e
commit
fbba5010a3
@ -64,6 +64,10 @@ class BotFramework():
|
|||||||
|
|
||||||
def react_chats(self):
|
def react_chats(self):
|
||||||
"""Checks unanswered messages and answers them"""
|
"""Checks unanswered messages and answers them"""
|
||||||
|
|
||||||
|
# HACKY: TODO remove
|
||||||
|
self.persistence.sync()
|
||||||
|
# writes persistent variables to file so that they ACTUALLY persist
|
||||||
num = self.telegram.fetch_updates()
|
num = self.telegram.fetch_updates()
|
||||||
for i in range(num):
|
for i in range(num):
|
||||||
self.react_command()
|
self.react_command()
|
||||||
|
@ -54,7 +54,7 @@ class DashBoard():
|
|||||||
|
|
||||||
|
|
||||||
def launch_dashboard(self):
|
def launch_dashboard(self):
|
||||||
self.app.run_server(host=self.host_ip)#, debug=True)
|
self.app.run_server(host=self.host_ip, port=8080)#, debug=True)
|
||||||
|
|
||||||
|
|
||||||
def card_header(self):
|
def card_header(self):
|
||||||
@ -75,7 +75,7 @@ class DashBoard():
|
|||||||
ret = []
|
ret = []
|
||||||
for l in self.persistence["global"]["lists"].keys():
|
for l in self.persistence["global"]["lists"].keys():
|
||||||
l_content = self.persistence["global"]["lists"][l]
|
l_content = self.persistence["global"]["lists"][l]
|
||||||
html_content = [dbc.ListGroupItem(t) for t in l_content]
|
html_content = [html.A(t, href="#", className="list-group-item bg-dark list-group-item-action text-light") for t in l_content]
|
||||||
card = dbc.Card(
|
card = dbc.Card(
|
||||||
[
|
[
|
||||||
dbc.CardBody([
|
dbc.CardBody([
|
||||||
@ -99,12 +99,18 @@ class DashBoard():
|
|||||||
ye = self.persistence["bot"]["execute_activity"]["count"]
|
ye = self.persistence["bot"]["execute_activity"]["count"]
|
||||||
|
|
||||||
fig = go.Figure()
|
fig = go.Figure()
|
||||||
fig.add_trace(go.Scatter(x=xr, y=yr, fill="tozeroy", mode="lines", text="Gelesen"))
|
fig.add_trace(go.Scatter(x=xr, y=yr, mode="lines", text="Gelesen", line=dict(width=4)))
|
||||||
fig.add_trace(go.Scatter(x=xs, y=ys, fill="tozeroy", mode="lines", text="Gesendet"))
|
fig.add_trace(go.Scatter(x=xs, y=ys, mode="lines", text="Gesendet", line=dict(width=4)))
|
||||||
fig.add_trace(go.Scatter(x=xe, y=ye, fill="tozeroy", mode="lines", text="Ausgeführt"))
|
fig.add_trace(go.Scatter(x=xe, y=ye, mode="lines", text="Ausgeführt", line=dict(width=4)))
|
||||||
|
|
||||||
|
fig.update_xaxes(showgrid=False)
|
||||||
fig.layout.update(showlegend=False,margin=dict(l=0, r=0, t=0, b=0),)
|
fig.update_yaxes(showgrid=False)
|
||||||
|
fig.layout.update(
|
||||||
|
showlegend=False,
|
||||||
|
margin=dict(l=0, r=0, t=0, b=0),
|
||||||
|
paper_bgcolor='rgba(0,0,0,0)',
|
||||||
|
plot_bgcolor='rgba(0,0,0,0)',
|
||||||
|
)
|
||||||
|
|
||||||
card = dbc.Card(
|
card = dbc.Card(
|
||||||
[
|
[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user