Skip to content

Commit

Permalink
+doc/ui/others
Browse files Browse the repository at this point in the history
  • Loading branch information
xinetzone committed Apr 8, 2024
1 parent 10dd1fa commit 4254dcc
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc/linux/bash/faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ wait 等待直到子进程运行完毕
shell 脚本各种执行方式(`source ./*.sh`, `. ./*.sh`, `./*.sh`)的区别
- 结论一: `./*.sh` 的执行方式等价于 `sh ./*.sh` 或者 `bash ./*.sh`,此三种执行脚本的方式都是重新启动一个子 shell,在子 shell 中执行此脚本,脚本中设置的变量在脚本执行完毕后不会保存。但是若 `script.sh` 脚本不是以 `#!/bin/bash` 开头,那么也不会在子进程中执行。
- 结论二: source ./*.sh和 . ./*.sh的执行方式是等价的,即两种执行方式都是在当前shell进程中执行此脚本,而不是重新启动一个shell 在子shell进程中执行此脚本,并且脚本中设置的变量在脚本执行完毕后会保存下来。
- 结论二: `source ./*.sh` 和 `. ./*.sh` 的执行方式是等价的,即两种执行方式都是在当前 shell 进程中执行此脚本,而不是重新启动一个 shell 在子 shell 进程中执行此脚本,并且脚本中设置的变量在脚本执行完毕后会保存下来。
```

验证依据:没有被 `export` 导出的变量(即非环境变量)是不能被子 shell 继承的
2 changes: 2 additions & 0 deletions doc/ui/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

```{toctree}
fastapi/index
nicegui <https://xinetzone.github.io/vision/ext/nicegui/>
others/index
```
3 changes: 3 additions & 0 deletions doc/ui/others/flet/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `flet`

参考:[flet](https://flet.dev/docs/)
5 changes: 5 additions & 0 deletions doc/ui/others/gradio/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Gradio

```{toctree}
intro
```
99 changes: 99 additions & 0 deletions doc/ui/others/gradio/intro.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Gradio 简介"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Running on local URL: http://0.0.0.0:4099\n",
"\n",
"To create a public link, set `share=True` in `launch()`.\n"
]
},
{
"data": {
"text/html": [
"<div><iframe src=\"http://localhost:4099/\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": []
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import gradio as gr\n",
"import plotly.express as px\n",
"import pandas as pd\n",
"def plotly_plot():\n",
" # prepare some data\n",
" x = [\"Math\", \"Business\", \"Statistics\", \"IT\", \"Commerce\"]\n",
" y = [68, 73, 82, 74, 85]\n",
" data = pd.DataFrame()\n",
" data['Subject'] = x\n",
" data['Score'] = y\n",
" # create a new plot\n",
" p = px.bar(data, x='Subject', y='Score')\n",
"\n",
" return p\n",
"\n",
"# show the results\n",
"outputs = gr.Plot()\n",
"\n",
"demo = gr.Interface(fn=plotly_plot, inputs=None, outputs=outputs)\n",
"\n",
"# demo.launch()\n",
"demo.launch(server_name=\"0.0.0.0\", server_port=4099, share=False, inbrowser=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "py311",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
8 changes: 8 additions & 0 deletions doc/ui/others/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 其他

```{toctree}
pywebio/index
flet/index
gradio/index
streamlit/index
```
3 changes: 3 additions & 0 deletions doc/ui/others/pywebio/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# PyWebIO

参考:[PyWebIO](https://pywebio.readthedocs.io/zh-cn/latest/index.html)
5 changes: 5 additions & 0 deletions doc/ui/others/streamlit/deploy/authentication-without-sso.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 无 SSO 认证

参考:- [无 SSO 认证](https://docs.streamlit.io/knowledge-base/deploy/authentication-without-sso)

本指南展示了两种简单的技术,使用密钥管理将基本身份验证添加到 Streamlit 应用程序中。
16 changes: 16 additions & 0 deletions doc/ui/others/streamlit/deploy/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Streamlit 部署

已经部署 [streamlit-demo](https://github.com/xinetzone/streamlit-demo)[https://xinetzone.streamlit.app](https://xinetzone.streamlit.app)

如果想要嵌入到 iframe,只需要在网站后添加 `/?embed=true`

[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://xinetzone.streamlit.app)

[streamlit-jupyter](https://github.com/ddobrinskiy/streamlit-jupyter) 使 streamlit 可以在 Jupyter Notebook 中运行。


```{toctree}
:glob:
*
```
10 changes: 10 additions & 0 deletions doc/ui/others/streamlit/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# streamlit

- 集成 plotly:[plotly_chart](https://docs.streamlit.io/library/api-reference/charts/st.plotly_chart)
- [plotly.streamlit.app](https://plotly.streamlit.app/)


```{toctree}
deploy/index
ai-stream<https://xinetzone.streamlit.app>
```

0 comments on commit 4254dcc

Please sign in to comment.