Files
live-call-asr-monitor/frontend-redesign/patch_buttons.py
2026-07-16 11:24:02 +08:00

33 lines
1.5 KiB
Python

import re
with open('src/components/RuleManagement.tsx', 'r') as f:
content = f.read()
buttons_html = """ <button
className="inline-flex items-center justify-center space-x-1 rounded-md border border-slate-200 bg-white px-3 py-2 text-xs font-bold text-slate-700 uppercase tracking-wider transition hover:bg-slate-50 focus:outline-none"
>
<FileDown className="h-3.5 w-3.5 text-slate-500" />
<span>模版下载</span>
</button>
<button
className="inline-flex items-center justify-center space-x-1 rounded-md border border-slate-200 bg-white px-3 py-2 text-xs font-bold text-slate-700 uppercase tracking-wider transition hover:bg-slate-50 focus:outline-none"
>
<Upload className="h-3.5 w-3.5 text-slate-500" />
<span>导入</span>
</button>
<button
className="inline-flex items-center justify-center space-x-1 rounded-md border border-slate-200 bg-white px-3 py-2 text-xs font-bold text-slate-700 uppercase tracking-wider transition hover:bg-slate-50 focus:outline-none"
>
<Download className="h-3.5 w-3.5 text-slate-500" />
<span>导出</span>
</button>
<button"""
content = content.replace(" <button\n onClick={handleAddRuleClick}", buttons_html + "\n onClick={handleAddRuleClick}")
with open('src/components/RuleManagement.tsx', 'w') as f:
f.write(content)