feat: 楼宇查询连接信息直接展示并开启保存即重载
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
[server]
|
[server]
|
||||||
address = "127.0.0.1"
|
address = "127.0.0.1"
|
||||||
maxUploadSize = 4096
|
maxUploadSize = 4096
|
||||||
|
runOnSave = true
|
||||||
|
|
||||||
[browser]
|
[browser]
|
||||||
gatherUsageStats = false
|
gatherUsageStats = false
|
||||||
|
|||||||
+8
-7
@@ -13,21 +13,22 @@ def render():
|
|||||||
limit = c2.number_input("查询数量(0 表示全部)", 0, value=1000)
|
limit = c2.number_input("查询数量(0 表示全部)", 0, value=1000)
|
||||||
concurrency = c3.number_input("并发数", 1, 32, 8)
|
concurrency = c3.number_input("并发数", 1, 32, 8)
|
||||||
encoding = st.selectbox("文件编码", ["gb18030", "utf-8-sig"])
|
encoding = st.selectbox("文件编码", ["gb18030", "utf-8-sig"])
|
||||||
with st.expander("连接设置"):
|
st.markdown("**连接信息**(留空则使用脚本内默认配置)")
|
||||||
|
url = st.text_input("服务地址", type="password", placeholder="https://...wfs?...ak=...&sig=...")
|
||||||
|
cookies = st.text_input("登录信息", type="password", placeholder="CASTGC=...")
|
||||||
|
referer = st.text_input("来源页(可留空)")
|
||||||
|
with st.expander("高级参数"):
|
||||||
timeout = st.number_input("超时(秒)", 1, 300, 30)
|
timeout = st.number_input("超时(秒)", 1, 300, 30)
|
||||||
retries = st.number_input("失败重试", 0, 10, 2)
|
retries = st.number_input("失败重试", 0, 10, 2)
|
||||||
interval = st.number_input("请求间隔(秒)", 0.0, 60.0, 0.2, 0.1)
|
interval = st.number_input("请求间隔(秒)", 0.0, 60.0, 0.2, 0.1)
|
||||||
override = st.checkbox("使用临时连接信息", value=False)
|
|
||||||
url = st.text_input("服务地址", type="password")
|
|
||||||
cookies = st.text_input("登录信息", type="password")
|
|
||||||
referer = st.text_input("来源页(可留空)")
|
|
||||||
submitted = st.form_submit_button("开始查询", type="primary")
|
submitted = st.form_submit_button("开始查询", type="primary")
|
||||||
if submitted:
|
if submitted:
|
||||||
try:
|
try:
|
||||||
if not source:
|
if not source:
|
||||||
raise ValueError("请先导入坐标文件。")
|
raise ValueError("请先导入坐标文件。")
|
||||||
if override and (not url.startswith(("http://", "https://")) or not cookies.strip()):
|
override = bool(url.strip() or cookies.strip())
|
||||||
raise ValueError("请填写完整服务地址和登录信息。")
|
if override and (not url.strip().startswith(("http://", "https://")) or not cookies.strip()):
|
||||||
|
raise ValueError("服务地址和登录信息需同时填写,且地址以 http(s):// 开头。")
|
||||||
params = {"INPUT_CSV": source, "INPUT_ENCODING": encoding, "START_ROW": start,
|
params = {"INPUT_CSV": source, "INPUT_ENCODING": encoding, "START_ROW": start,
|
||||||
"LIMIT": limit or None, "CONCURRENCY": concurrency, "TIMEOUT": timeout,
|
"LIMIT": limit or None, "CONCURRENCY": concurrency, "TIMEOUT": timeout,
|
||||||
"MAX_RETRIES": retries, "REQUEST_INTERVAL": interval}
|
"MAX_RETRIES": retries, "REQUEST_INTERVAL": interval}
|
||||||
|
|||||||
Reference in New Issue
Block a user