Expose seeded Heimdall dashboard
Homelab Main / deploy (push) Successful in 1m28s
Details
Homelab Main / deploy (push) Successful in 1m28s
Details
This commit is contained in:
parent
e16d99ffaf
commit
122407899d
|
|
@ -116,6 +116,17 @@ data:
|
||||||
def quote_identifier(name):
|
def quote_identifier(name):
|
||||||
return '"' + name.replace('"', '""') + '"'
|
return '"' + name.replace('"', '""') + '"'
|
||||||
|
|
||||||
|
def ensure_public_dashboard(conn, user_id):
|
||||||
|
if not table_exists(conn, "users"):
|
||||||
|
return
|
||||||
|
user_columns = columns(conn, "users")
|
||||||
|
if "public_front" not in user_columns:
|
||||||
|
return
|
||||||
|
conn.execute(
|
||||||
|
'update "users" set "public_front" = 1 where "id" = ?',
|
||||||
|
(user_id,),
|
||||||
|
)
|
||||||
|
|
||||||
def wait_for_items_table(db_path):
|
def wait_for_items_table(db_path):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
|
@ -129,8 +140,11 @@ data:
|
||||||
|
|
||||||
def upsert_links(conn, links):
|
def upsert_links(conn, links):
|
||||||
item_columns = columns(conn, "items")
|
item_columns = columns(conn, "items")
|
||||||
|
seed_user_id = 1
|
||||||
now = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S")
|
now = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S")
|
||||||
|
|
||||||
|
ensure_public_dashboard(conn, seed_user_id)
|
||||||
|
|
||||||
for order, link in enumerate(links):
|
for order, link in enumerate(links):
|
||||||
existing = conn.execute(
|
existing = conn.execute(
|
||||||
'select "id" from "items" where "title" = ?',
|
'select "id" from "items" where "title" = ?',
|
||||||
|
|
@ -144,7 +158,7 @@ data:
|
||||||
"pinned": 1,
|
"pinned": 1,
|
||||||
"order": order,
|
"order": order,
|
||||||
"type": 0,
|
"type": 0,
|
||||||
"user_id": 1,
|
"user_id": seed_user_id,
|
||||||
"class": link.get("class"),
|
"class": link.get("class"),
|
||||||
"appid": None,
|
"appid": None,
|
||||||
"appdescription": link.get("description"),
|
"appdescription": link.get("description"),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue