Skip to content

Commit

Permalink
feat: better sub info in header
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Jan 21, 2024
1 parent 794f0f4 commit 183b5b6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apps/sspanel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,9 @@ def get_sub_info_header(self):
"""
https://github.com/crossutility/Quantumult/blob/master/extra-subscription-feature.md
"""
expire = int(datetime.datetime.timestamp(self.level_expire_time))
info = f"upload={self.upload_traffic}; download={self.download_traffic}; total={self.total_traffic}; expire={expire}"
# filename = slugify(settings.SITE_TITLE)
return {"Subscription-Userinfo:": info}
expire = self.level_expire_time.date().strftime("%Y-%m-%d")
info = f"u={traffic_format(self.upload_traffic)}; d={traffic_format(self.download_traffic)}; t={traffic_format(self.total_traffic)}; expire={expire}"
return {"Subscription-Userinfo": info}

def reset_sub_uid(self):
self.uid = str(uuid4())
Expand Down

0 comments on commit 183b5b6

Please sign in to comment.