Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/handlers/servers/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ async def servers_info(callback_query: CallbackQuery, callback_data: BotCB, hetz
included_gb = round(((getattr(server, "included_traffic", 0) or 0) / 1024**3), 3)
used_percent = round((outgoing_gb / included_gb * 100), 1) if included_gb else None

prices = server.server_type.prices
price_hourly = "➖"
price_monthly = "➖"
if prices:
price_hourly = prices[0]["price_hourly"]["gross"]
price_monthly = prices[0]["price_monthly"]["gross"]

update = await callback_query.message.edit(
text=Dialogs.SERVERS_INFO.format(
name=server.name,
Expand Down Expand Up @@ -51,6 +58,8 @@ async def servers_info(callback_query: CallbackQuery, callback_data: BotCB, hetz
traffic_included=included_gb,
traffic_used_percent=(used_percent if used_percent is not None else "➖"),
traffic_billable=round(max(total_gb - included_gb, 0), 3) if included_gb else 0,
price_hourly=price_hourly,
price_monthly=price_monthly,
),
reply_markup=BotKB.servers_update(server=server),
)
Expand Down
3 changes: 3 additions & 0 deletions src/lang/_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ class Dialogs(StrEnum):
• Included: <code>{traffic_included} GB</code>
• Used: <code>{traffic_used_percent}% [Out/Included traffic]</code>
• Billable: <code>{traffic_billable} GB</code>
<b>💰 Price:</b>
• Hourly: <code>{price_hourly} €</code>
• Monthly: <code>{price_monthly} €</code>
<b>📅 Created:</b> <code>{created}</code> [<code>{created_day} days ago</code>]
"""
SERVERS_REBUILD_CONFIRM = "<b>⚠️ Are you sure you want to rebuild the server?</b>\n🧹 This action will erase all data on the server.\n🖼️ Please select an image to proceed."
Expand Down