mirror of
https://github.com/Justuser3310/jetwork.git
synced 2025-01-19 01:18:48 +00:00
Новый интерфейс
This commit is contained in:
parent
51b2b69285
commit
ce999e3a71
47
interface.py
47
interface.py
@ -1,11 +1,46 @@
|
||||
import streamlit as st
|
||||
#from streamlit import empty as c
|
||||
|
||||
from os import walk
|
||||
from time import sleep
|
||||
|
||||
# Получаем порт со входа
|
||||
from sys import argv
|
||||
our_port = argv[1]
|
||||
|
||||
|
||||
st.title('jetwork')
|
||||
|
||||
# Получаем все сайты
|
||||
from os import walk
|
||||
sites = next(walk('cached/'), (None, None, []))[1]
|
||||
# st.empty()
|
||||
ph = st.empty()
|
||||
|
||||
for i in sites:
|
||||
addr = f"http://127.0.0.1:8000/{i}"
|
||||
f"[{i}]({addr})"
|
||||
while True:
|
||||
# Боковая панель
|
||||
with ph.container():
|
||||
# Столбцы для элементов
|
||||
sidebar, space, main = st.columns([60, 10, 90])
|
||||
|
||||
|
||||
with sidebar:
|
||||
st.success(f"Ваш порт: {our_port}")
|
||||
|
||||
ports = ['Тут скоро', 'будет что-то']
|
||||
for i in ports:
|
||||
st.warning(f"{i}")
|
||||
|
||||
with main:
|
||||
# Получаем все сайты
|
||||
sites = next(walk('cached/'), (None, None, []))[1]
|
||||
|
||||
for i in sites:
|
||||
addr = f"http://127.0.0.1:8000/{i}"
|
||||
st.info(f"[{i}]({addr})")
|
||||
|
||||
sleep(3)
|
||||
ph.empty()
|
||||
#st.empty()
|
||||
st.rerun()
|
||||
|
||||
#while True:
|
||||
# sleep(3)
|
||||
# st.rerun()
|
||||
|
6
main.py
6
main.py
@ -6,6 +6,7 @@ from network import *
|
||||
|
||||
# Здесь общий запуск всех файлов и команд
|
||||
|
||||
|
||||
# Проверка обновлений
|
||||
from sys import argv
|
||||
if len(argv) == 1:
|
||||
@ -51,8 +52,7 @@ server.start()
|
||||
|
||||
|
||||
# Стартуем интерфейс
|
||||
system("python -m streamlit run --server.address=127.0.0.1 interface.py")
|
||||
|
||||
system(f"python -m streamlit run --server.address=127.0.0.1 interface.py {serv_port}")
|
||||
|
||||
|
||||
#print(client(8000, "ping"))
|
||||
@ -61,3 +61,5 @@ system("python -m streamlit run --server.address=127.0.0.1 interface.py")
|
||||
|
||||
#print(client(4015, "ping"))
|
||||
#print(client(4137, "is_just.jet"))
|
||||
|
||||
#client(4092, "publish_just.jet<>4066")
|
||||
|
Loading…
Reference in New Issue
Block a user