Readded borders to settings groups and added tokens view for admins

This commit is contained in:
Conner Harkness 2025-06-03 21:23:04 -06:00
parent 1107eba42b
commit bfac851624
2 changed files with 56 additions and 4 deletions

View File

@ -25,7 +25,7 @@ def more_settings_account_tab():
cols = st.columns([1, 1]) cols = st.columns([1, 1])
with cols[0]: with cols[0]:
st.caption("Account") st.caption("Account")
with st.container(border=False): with st.container(border=True):
ss.SETTINGS.widget(st, st.text_input, "Name", "account_name") ss.SETTINGS.widget(st, st.text_input, "Name", "account_name")
ss.SETTINGS.widget(st, st.text_input, "E-mail", "account_email") ss.SETTINGS.widget(st, st.text_input, "E-mail", "account_email")
st.write("") st.write("")
@ -34,12 +34,12 @@ def more_settings_general_tab():
cols = st.columns([1, 1]) cols = st.columns([1, 1])
with cols[0]: with cols[0]:
st.caption("Behavior") st.caption("Behavior")
with st.container(border=False): with st.container(border=True):
ss.SETTINGS.widget(st, st.toggle, "Fetch reply", "fetch_reply") ss.SETTINGS.widget(st, st.toggle, "Fetch reply", "fetch_reply")
st.write("") st.write("")
st.caption("Interface") st.caption("Interface")
with st.container(border=False): with st.container(border=True):
ss.SETTINGS.widget(st, st.toggle, "Show clear", "show_clear") ss.SETTINGS.widget(st, st.toggle, "Show clear", "show_clear")
ss.SETTINGS.widget(st, st.toggle, "Show undo", "show_undo") ss.SETTINGS.widget(st, st.toggle, "Show undo", "show_undo")
ss.SETTINGS.widget(st, st.toggle, "Show redo", "show_redo") ss.SETTINGS.widget(st, st.toggle, "Show redo", "show_redo")
@ -52,7 +52,7 @@ def more_settings_advanced_tab():
cols = st.columns([1, 1]) cols = st.columns([1, 1])
with cols[0]: with cols[0]:
st.caption("Advanced") st.caption("Advanced")
with st.container(border=False): with st.container(border=True):
ss.APP_SETTINGS.widget(st, st.text_input, "Inference Server URL", "inference_server_url", help="The URL to POST to for text-based inference") ss.APP_SETTINGS.widget(st, st.text_input, "Inference Server URL", "inference_server_url", help="The URL to POST to for text-based inference")
st.write("") st.write("")

52
views/more_tokens.py Normal file
View File

@ -0,0 +1,52 @@
import sys
import argparse
import os
import subprocess
import re
import hashlib
import random
import requests
import json
import asyncio
import threading
import time
import string
import shutil
import datetime
from lib.helpers import *
from lib.extension import *
import streamlit as st
ss = st.session_state
def more_tokens():
tokens = []
c = 1
for t in ss.TOKEN_LIST:
token = t["token"]
new_t = {
"id": c
}
new_t.update(t)
new_t["name"] = ""
try:
with open(f"user/{token}/settings.json") as f:
user_json = json.loads(f.read())
if "account_name" in user_json.keys():
new_t["name"] = user_json["account_name"]
except:
pass
tokens.append(new_t)
c = c + 1
st.dataframe(tokens)