feat: 2026-07-11 全量更新 - 代办集成+会议室预定+知识迭代修复+UI统一+Bug修复
== 已部署上线 (9项) == - 代办事项真实数据源集成 (企微审批API 8bug修复链) - H5/坐席端 Logo样式统一+绿色背景 - 视频引导页修复 (localStorage key v2) - 坐席端 v9 Vue版本修复 (ElMessage._context) - 截图按钮 v10 修复 (getDisplayMedia user gesture) - 扫码样式恢复+H5扫码登录跳转修复 - H5截图快捷键提示 == 代码完成待部署 (3项) == - 知识迭代3Bug修复 (#8 POST端点/#7 MERGE幂等/#6 过期检查) - 会议室预定-小鱼易联终端 (40文件, 40/40测试通过) - IT资产升级审批推送 (asset_service.py) == 需求文档 (2项) == - 坐席端AI辅助消息框-PRD (4项新功能确认) - 坐席端布局优化建议 v2.0 (7天计划) == 新增文档 == - 日报-2026-07-11.md - 知识迭代Bug修复报告-20260711.md - 会议室预定-部署指南.md - CHANGELOG.md 更新 == 测试 == - test_todo_integration.py: 40/40 - test_meetingroom.py: 40/40 - test_bugfix_ki_suggestions.py: 21/21
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
"""Append remaining bytes to partially uploaded file."""
|
||||
import base64
|
||||
import hashlib
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
PYTHON = r"C:\Users\simon\.workbuddy\binaries\python\versions\3.13.12\python.exe"
|
||||
JMS = r"C:\Users\simon\.workbuddy\skills\jumpserver-ops\scripts\jms_ops.py"
|
||||
LOCAL_FILE = r"D:\资料\03-项目开发\wecom_it_smart_desk\deploy_agent_v8.tar.gz"
|
||||
REMOTE_FILE = "/tmp/deploy_agent_v8.tar.gz"
|
||||
CHUNK_SIZE = 12 * 1024 # 12KB
|
||||
|
||||
def run_jms(*args, timeout=30):
|
||||
cmd = [PYTHON, JMS] + list(args)
|
||||
result = subprocess.run(cmd, capture_output=True, timeout=timeout)
|
||||
out = result.stdout.decode('utf-8', errors='replace') if result.stdout else ''
|
||||
err = result.stderr.decode('utf-8', errors='replace') if result.stderr else ''
|
||||
return out + err
|
||||
|
||||
def main():
|
||||
with open(LOCAL_FILE, "rb") as f:
|
||||
data = f.read()
|
||||
|
||||
local_md5 = hashlib.md5(data).hexdigest()
|
||||
local_size = len(data)
|
||||
|
||||
# Check current remote file size
|
||||
result = run_jms("exec", "-c", f"stat -c %s {REMOTE_FILE}", "--cmd-timeout", "15")
|
||||
# Parse the number from output
|
||||
remote_size = 0
|
||||
for line in result.split('\n'):
|
||||
line = line.strip()
|
||||
if line.isdigit():
|
||||
remote_size = int(line)
|
||||
break
|
||||
|
||||
print(f"Local size: {local_size}")
|
||||
print(f"Remote size: {remote_size}")
|
||||
|
||||
if remote_size >= local_size:
|
||||
# File already complete, just verify MD5
|
||||
print("File already complete, verifying MD5...")
|
||||
result = run_jms("exec", "-c", f"md5sum {REMOTE_FILE}", "--cmd-timeout", "15")
|
||||
print(f"Remote MD5: {result.strip()}")
|
||||
print(f"Local MD5: {local_md5}")
|
||||
if local_md5 in result:
|
||||
print("\n✅ MD5 verified!")
|
||||
else:
|
||||
print("\n❌ MD5 mismatch, need to re-upload!")
|
||||
return
|
||||
|
||||
# Upload remaining bytes
|
||||
remaining = data[remote_size:]
|
||||
total_chunks = (len(remaining) + CHUNK_SIZE - 1) // CHUNK_SIZE
|
||||
print(f"Remaining: {len(remaining)} bytes ({total_chunks} chunks)")
|
||||
|
||||
for i in range(total_chunks):
|
||||
chunk = remaining[i * CHUNK_SIZE : (i + 1) * CHUNK_SIZE]
|
||||
b64 = base64.b64encode(chunk).decode("ascii")
|
||||
cmd = f'echo -n "{b64}" | base64 -d >> {REMOTE_FILE}'
|
||||
run_jms("exec", "-c", cmd, "--cmd-timeout", "15")
|
||||
print(f" Appended chunk {i + 1}/{total_chunks}")
|
||||
|
||||
# Verify
|
||||
print("\nVerifying MD5...")
|
||||
result = run_jms("exec", "-c", f"md5sum {REMOTE_FILE}", "--cmd-timeout", "15")
|
||||
print(f"Remote MD5: {result.strip()}")
|
||||
print(f"Local MD5: {local_md5}")
|
||||
|
||||
if local_md5 in result:
|
||||
print("\n✅ MD5 verified - upload complete!")
|
||||
else:
|
||||
print("\n❌ MD5 mismatch!")
|
||||
# Check final size
|
||||
result = run_jms("exec", "-c", f"stat -c %s {REMOTE_FILE}", "--cmd-timeout", "15")
|
||||
for line in result.split('\n'):
|
||||
if line.strip().isdigit():
|
||||
print(f"Final remote size: {line.strip()}")
|
||||
break
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user