Skip to content

Commit

Permalink
Merge pull request #488 from mmdchnar/hosts
Browse files Browse the repository at this point in the history
add {STATUS} variable in hosts to show user status by emojies
  • Loading branch information
SaintShit committed Aug 23, 2023
2 parents d4bc011 + d47f010 commit 111422f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/utils/share.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,24 @@ def generate_v2ray_links(proxies: dict, inbounds: dict, extra_data: dict) -> lis
else:
data_limit = '∞'
data_left = '∞'

statuses = {
'active': '✅',
'expired': '⌛️',
'limited': '🪫',
'disabled': '❌'
}

status = statuses[extra_data['status']]

format_variables = FormatVariables({
"SERVER_IP": SERVER_IP,
"USERNAME": extra_data.get('username', '{USERNAME}'),
"DATA_USAGE": readable_size(extra_data.get('used_traffic')),
"DATA_LIMIT": data_limit,
"DATA_LEFT": data_left,
"DAYS_LEFT": days_left
"DAYS_LEFT": days_left,
"STATUS": status
})

for protocol, tags in inbounds.items():
Expand Down

0 comments on commit 111422f

Please sign in to comment.