Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,8 @@
|
|
| 2 |
# requires-python = ">=3.10"
|
| 3 |
# dependencies = [
|
| 4 |
# "marimo",
|
|
|
|
|
|
|
| 5 |
# ]
|
| 6 |
# ///
|
| 7 |
|
|
@@ -20,24 +22,47 @@ def _():
|
|
| 20 |
@app.cell
|
| 21 |
def _(mo):
|
| 22 |
mo.md("# π¦ VerdantClaw-Secure")
|
| 23 |
-
mo.md("**Status:** Online")
|
| 24 |
mo.md("---")
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
|
| 30 |
@app.cell
|
| 31 |
-
def _(mo,
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
return
|
| 34 |
|
| 35 |
|
| 36 |
@app.cell
|
| 37 |
def _(mo):
|
| 38 |
mo.md("---")
|
| 39 |
-
mo.md("##
|
| 40 |
-
mo.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
return
|
| 42 |
|
| 43 |
|
|
|
|
| 2 |
# requires-python = ">=3.10"
|
| 3 |
# dependencies = [
|
| 4 |
# "marimo",
|
| 5 |
+
# "gqlalchemy",
|
| 6 |
+
# "plotly",
|
| 7 |
# ]
|
| 8 |
# ///
|
| 9 |
|
|
|
|
| 22 |
@app.cell
|
| 23 |
def _(mo):
|
| 24 |
mo.md("# π¦ VerdantClaw-Secure")
|
| 25 |
+
mo.md("**Status:** β
Online")
|
| 26 |
mo.md("---")
|
| 27 |
+
return
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
@app.cell
|
| 31 |
+
def _(mo):
|
| 32 |
+
mo.md("### π Memgraph Query")
|
| 33 |
+
query = mo.ui.text_area(
|
| 34 |
+
label="Cypher Query:",
|
| 35 |
+
value="MATCH (n) RETURN n LIMIT 10",
|
| 36 |
+
full_width=True
|
| 37 |
+
)
|
| 38 |
+
return query,
|
| 39 |
|
| 40 |
|
| 41 |
@app.cell
|
| 42 |
+
def _(mo, query):
|
| 43 |
+
from gqlalchemy import Memgraph
|
| 44 |
+
try:
|
| 45 |
+
memgraph = Memgraph(host='localhost', port=7687)
|
| 46 |
+
results = list(memgraph.execute(query.value))
|
| 47 |
+
mo.md(f"**Results:** {len(results)} rows")
|
| 48 |
+
mo.ui.table(results)
|
| 49 |
+
except Exception as e:
|
| 50 |
+
mo.md(f"β Memgraph error: {e}")
|
| 51 |
return
|
| 52 |
|
| 53 |
|
| 54 |
@app.cell
|
| 55 |
def _(mo):
|
| 56 |
mo.md("---")
|
| 57 |
+
mo.md("### π¬ Chat")
|
| 58 |
+
chat = mo.ui.text_area(label="Message:", full_width=True)
|
| 59 |
+
return chat,
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
@app.cell
|
| 63 |
+
def _(chat, mo):
|
| 64 |
+
if chat.value:
|
| 65 |
+
mo.md(f"**You:** {chat.value}")
|
| 66 |
return
|
| 67 |
|
| 68 |
|