fix: center all popups (anchor:cc), remove download URL from status query

- submit_query_status.dspy: add anchor:cc to all Message/Error widgets,
  remove download URL display from status result
- submit_upload.dspy: add anchor:cc to all Error widgets
- Error popups now centered for consistency
This commit is contained in:
yumoqing 2026-05-30 10:46:22 +08:00
parent 29d2ed2609
commit 2440be759d
2 changed files with 8 additions and 11 deletions

View File

@ -4,7 +4,7 @@ asset_id = params_kw.get('asset_id', '')
if not asset_id:
return json.dumps({
"widgettype": "Error",
"options": {"title": "错误", "message": "缺少素材ID"}
"options": {"title": "错误", "message": "缺少素材ID", "anchor": "cc"}
})
org_id = (await get_userorgid()) or '0'
@ -14,10 +14,7 @@ result = await rl_sync_asset_status_user(org_id, asset_id, user_id)
if result.get('success'):
status = result.get('status', '')
url = result.get('url', '')
msg = f"素材状态:{status}"
if url:
msg += f"\n下载地址{url}"
subwidgets = [
{
@ -52,7 +49,7 @@ if result.get('success'):
return json.dumps({
"widgettype": "Message",
"id": "status_result_popup",
"options": {"title": "素材状态", "message": ""},
"options": {"title": "素材状态", "message": "", "anchor": "cc"},
"subwidgets": [
{
"widgettype": "VBox",
@ -64,5 +61,5 @@ if result.get('success'):
else:
return json.dumps({
"widgettype": "Error",
"options": {"title": "查询失败", "message": result.get('message', '未知错误')}
"options": {"title": "查询失败", "message": result.get('message', '未知错误'), "anchor": "cc"}
})

View File

@ -9,7 +9,7 @@ name = params_kw.get('name', '')
if not vendor_group_id or not source_url:
return json.dumps({
"widgettype": "Error",
"options": {"title": "错误", "message": "请选择认证组合并上传素材文件"}
"options": {"title": "错误", "message": "请选择认证组合并上传素材文件", "anchor": "cc"}
})
# Validate media file type from path extension
@ -23,7 +23,7 @@ detected_type = media_map.get(ext, '')
if ext and not detected_type:
return json.dumps({
"widgettype": "Error",
"options": {"title": "错误", "message": f"不支持的文件类型: {ext},请上传图片、音频或视频文件"}
"options": {"title": "错误", "message": f"不支持的文件类型: {ext},请上传图片、音频或视频文件", "anchor": "cc"}
})
if not asset_type and detected_type:
asset_type = detected_type
@ -36,7 +36,7 @@ if source_url.startswith('data:') or (not source_url.startswith('http') and len(
if not source_url:
return json.dumps({
"widgettype": "Error",
"options": {"title": "错误", "message": "素材文件转换失败"}
"options": {"title": "错误", "message": "素材文件转换失败", "anchor": "cc"}
})
org_id = (await get_userorgid()) or '0'
@ -57,7 +57,7 @@ if result.get('success'):
return json.dumps({
"widgettype": "Message",
"id": "upload_result_popup",
"options": {"title": "上传成功", "message": ""},
"options": {"title": "上传成功", "message": "", "anchor": "cc"},
"subwidgets": [
{
"widgettype": "VBox",
@ -92,5 +92,5 @@ if result.get('success'):
else:
return json.dumps({
"widgettype": "Error",
"options": {"title": "上传失败", "message": result.get('message', '未知错误')}
"options": {"title": "上传失败", "message": result.get('message', '未知错误'), "anchor": "cc"}
})