fix(deepseek): USD-only balance display, drop CNY/¥
Launcher and statusline show only USD from balance_infos; ¥ removed. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -706,25 +706,24 @@ try:
|
||||
d = json.load(sys.stdin)
|
||||
available = d.get('is_available', False)
|
||||
infos = d.get('balance_infos', [])
|
||||
# Показываем только USD (CNY не выводим)
|
||||
infos = [i for i in infos if i.get('currency', '').upper() == 'USD']
|
||||
if not infos:
|
||||
print(' \033[0;33m[БАЛАНС]\033[0m Нет данных о балансе')
|
||||
sys.exit(0)
|
||||
symbols = {'USD': '\$', 'CNY': '¥'}
|
||||
cache_parts = []
|
||||
for info in infos:
|
||||
curr = info.get('currency', '???')
|
||||
total = info.get('total_balance', '0')
|
||||
granted = info.get('granted_balance', '0')
|
||||
topped_up = info.get('topped_up_balance', '0')
|
||||
sym = symbols.get(curr, curr)
|
||||
status = '✅ доступен' if available else '❌ не активен'
|
||||
print(f' \033[1;36m💰 Баланс DeepSeek:\033[0m {total} {curr} {status}')
|
||||
print(f' \033[1;36m💰 Баланс DeepSeek:\033[0m \${total} {status}')
|
||||
if float(granted) > 0:
|
||||
print(f' └─ Начислено: {granted} {curr}')
|
||||
print(f' └─ Начислено: \${granted}')
|
||||
if float(topped_up) > 0:
|
||||
print(f' └─ Пополнено: {topped_up} {curr}')
|
||||
cache_parts.append(f'{sym}{total}')
|
||||
# Cache all currencies with symbols for statusline
|
||||
print(f' └─ Пополнено: \${topped_up}')
|
||||
cache_parts.append(f'\${total}')
|
||||
# Cache USD balance for statusline
|
||||
if cache_parts:
|
||||
cache_dir = os.path.expanduser('~/.cache/ai-setup')
|
||||
os.makedirs(cache_dir, exist_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user