diff --git a/views/more_settings.py b/views/more_settings.py index e9ecfc2..b1098f3 100644 --- a/views/more_settings.py +++ b/views/more_settings.py @@ -25,7 +25,7 @@ def more_settings_account_tab(): cols = st.columns([1, 1]) with cols[0]: 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, "E-mail", "account_email") st.write("") @@ -34,12 +34,12 @@ def more_settings_general_tab(): cols = st.columns([1, 1]) with cols[0]: st.caption("Behavior") - with st.container(border=False): + with st.container(border=True): ss.SETTINGS.widget(st, st.toggle, "Fetch reply", "fetch_reply") st.write("") 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 undo", "show_undo") ss.SETTINGS.widget(st, st.toggle, "Show redo", "show_redo") @@ -52,7 +52,7 @@ def more_settings_advanced_tab(): cols = st.columns([1, 1]) with cols[0]: 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") st.write("") diff --git a/views/more_tokens.py b/views/more_tokens.py new file mode 100644 index 0000000..d29b10b --- /dev/null +++ b/views/more_tokens.py @@ -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)