File size: 2,417 Bytes
cd12af9
 
 
 
0e4030e
cd12af9
 
 
 
 
0e4030e
cd12af9
 
 
 
0e4030e
cd12af9
 
 
 
0e4030e
cd12af9
 
 
 
9f128fc
1ac58cb
 
 
 
0e4030e
cd12af9
 
 
 
 
ebc6d2f
cd12af9
ebc6d2f
 
cd12af9
6946dd2
b8b0c1e
 
 
fcc2ac3
b8b0c1e
ebc6d2f
 
 
 
 
cd12af9
 
 
 
 
 
 
 
 
 
 
 
fcc2ac3
cd12af9
 
 
 
 
 
fcc2ac3
 
6946dd2
fcc2ac3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import streamlit as st
from streamlit_option_menu import option_menu

menu = {
    "对话-GPU版ChatGLM-6B by@sdshq":
        {
            "link": "https://sdshq-chatglm2-6b-demo.hf.space/",
            "desc": "",
            "author": "sdshq"
        },
    "对话-GPU版ChatGPT-web by@lijiacai":
        {
            "link": "https://lijiacai-chatgpt-next-web.hf.space/",
            "desc": "模型ChatGLM-6B,接口兼容openai API,可实现流式在线对话"
        },
    "绘图-图像反推关键词 by@lijiacai":
        {
            "link": "https://lijiacai-wd14-tagging-online.hf.space/",
            "desc": ""
        },
    "绘图-Stable Diffusion 2.1 by@lijiacai":
        {
            "link": "https://lijiacai-stable-diffusion-2-1-demo.hf.space/",
            "desc": ""
        },
    "绘图-Stable Diffusion WebUI CPU by@lijiacai":
        {
            "link": "https://lijiacai-stable-diffusion-webui-cpu.hf.space",
            "desc": ""
        },
    "绘图-Stable Diffusion 2.1 by@stabilityai":
        {
            "link": "https://stabilityai-stable-diffusion.hf.space",
            "desc": "",
            "author": "stabilityai"
        },
    "工具-翻译 by@lijiacai":
        {
            "link": "https://lijiacai-translate.hf.space",
            "desc": "",
        },
    "工具-视频下载工具 by@未知":
        {
            "link": "https://zh.savefrom.net/226/",
            "desc": "",
            "shadow-iframe": True
        },
    # "Openai代理接口文档 by@lijiacai":
    #     {
    #         "link": "https://lijiacai-openai-agent.hf.space/docs",
    #         "desc": ""
    #     },
}

# 1. as sidebar menu

with st.sidebar:
    selected = option_menu("工具栏", options=list(menu.keys()),
                           icons=None, menu_icon="cast", default_index=1)

nav_link = menu.get(selected).get("link")
author = menu.get(selected).get("author", "lijiacai")

st.markdown(
    f'[点我前往大屏操作]({nav_link}) 作者by@{author}',
)

st.markdown(
    '<style>.full-height-iframe {height: 100vh;width: 100vh;min-width: 100vh} </style>',
    unsafe_allow_html=True
)
if not menu.get(selected).get("shadow-iframe"):
    # 在一个具有自定义样式的div中嵌入IFrame
    st.markdown(f'<div class="full-height-iframe"><iframe src="{nav_link}" class="full-height-iframe"></iframe></div>',
                unsafe_allow_html=True)