58 lines
1.6 KiB
Python
58 lines
1.6 KiB
Python
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_settings():
|
|
|
|
if len(ss.TOKEN_LIST) > 1:
|
|
st.caption("Account")
|
|
with st.container(border=True):
|
|
|
|
def save_token():
|
|
set_cookie("token", ss.new_token)
|
|
page_redirect()
|
|
|
|
token = st.text_input(
|
|
"Token",
|
|
value=get_cookie("token"),
|
|
help="Provide a valid token here",
|
|
on_change=save_token,
|
|
key="new_token")
|
|
|
|
if ss.TOKEN is None:
|
|
return
|
|
|
|
st.caption("Behavior")
|
|
with st.container(border=True):
|
|
ss.SETTINGS.widget(st, st.toggle, "Fetch reply automatically", "auto_fetch")
|
|
ss.SETTINGS.widget(st, st.toggle, "Save as copy by default", "save_as")
|
|
|
|
st.caption("Display")
|
|
with st.container(border=True):
|
|
st.caption("Toolbar")
|
|
ss.SETTINGS.widget(st, st.toggle, "Show clear button", "show_clear")
|
|
ss.SETTINGS.widget(st, st.toggle, "Show undo button", "show_undo")
|
|
ss.SETTINGS.widget(st, st.toggle, "Show redo button", "show_redo")
|
|
ss.SETTINGS.widget(st, st.toggle, "Show more button", "show_more")
|
|
ss.SETTINGS.widget(st, st.toggle, "Show fetch button", "show_fetch_button")
|
|
ss.SETTINGS.widget(st, st.toggle, "Show fetch toggle", "show_fetch_toggle")
|