hiddifypanel 9.0.0.dev42__py3-none-any.whl → 9.0.0.dev44__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hiddifypanel/VERSION +1 -1
- hiddifypanel/VERSION.py +2 -2
- hiddifypanel/panel/auth.py +9 -3
- hiddifypanel/panel/commercial/restapi/v2/user/info_api.py +8 -5
- hiddifypanel/panel/common.py +2 -2
- hiddifypanel/panel/user/templates/new.html +3 -2
- hiddifypanel/static/new/assets/{index-c4c80da4.js → index-a180e42e.js} +2 -2
- hiddifypanel/translations/en/LC_MESSAGES/messages.mo +0 -0
- hiddifypanel/translations/en/LC_MESSAGES/messages.po +15 -3
- hiddifypanel/translations/fa/LC_MESSAGES/messages.mo +0 -0
- hiddifypanel/translations/fa/LC_MESSAGES/messages.po +14 -3
- hiddifypanel/translations/pt/LC_MESSAGES/messages.mo +0 -0
- hiddifypanel/translations/pt/LC_MESSAGES/messages.po +20 -3
- hiddifypanel/translations/ru/LC_MESSAGES/messages.mo +0 -0
- hiddifypanel/translations/ru/LC_MESSAGES/messages.po +20 -3
- hiddifypanel/translations/zh/LC_MESSAGES/messages.mo +0 -0
- hiddifypanel/translations/zh/LC_MESSAGES/messages.po +16 -3
- {hiddifypanel-9.0.0.dev42.dist-info → hiddifypanel-9.0.0.dev44.dist-info}/METADATA +1 -1
- {hiddifypanel-9.0.0.dev42.dist-info → hiddifypanel-9.0.0.dev44.dist-info}/RECORD +23 -23
- {hiddifypanel-9.0.0.dev42.dist-info → hiddifypanel-9.0.0.dev44.dist-info}/LICENSE.md +0 -0
- {hiddifypanel-9.0.0.dev42.dist-info → hiddifypanel-9.0.0.dev44.dist-info}/WHEEL +0 -0
- {hiddifypanel-9.0.0.dev42.dist-info → hiddifypanel-9.0.0.dev44.dist-info}/entry_points.txt +0 -0
- {hiddifypanel-9.0.0.dev42.dist-info → hiddifypanel-9.0.0.dev44.dist-info}/top_level.txt +0 -0
hiddifypanel/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
9.0.0.
|
1
|
+
9.0.0.dev44
|
hiddifypanel/VERSION.py
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
__version__='9.0.0.
|
1
|
+
__version__='9.0.0.dev44'
|
2
2
|
from datetime import datetime
|
3
|
-
__release_date__= datetime.strptime('2024-01-
|
3
|
+
__release_date__= datetime.strptime('2024-01-10','%Y-%m-%d')
|
hiddifypanel/panel/auth.py
CHANGED
@@ -19,6 +19,10 @@ def _get_user():
|
|
19
19
|
return g.account
|
20
20
|
|
21
21
|
|
22
|
+
def admin_session_is_exist():
|
23
|
+
return '_admin_id' in session
|
24
|
+
|
25
|
+
|
22
26
|
def logout_user():
|
23
27
|
g.account = None
|
24
28
|
if '_user_id' in session:
|
@@ -28,9 +32,10 @@ def logout_user():
|
|
28
32
|
|
29
33
|
|
30
34
|
def login_user(user: AdminUser | User, remember=False, duration=None, force=False, fresh=True):
|
35
|
+
# abort(400, f'logining user: {user} {user.is_active}')
|
31
36
|
g.account = user
|
32
|
-
if not user.is_active:
|
33
|
-
|
37
|
+
# if not user.is_active:
|
38
|
+
# return False
|
34
39
|
|
35
40
|
account_id = user.get_id() # type: ignore
|
36
41
|
# print('account_id', account_id)
|
@@ -107,8 +112,9 @@ def init_app(app):
|
|
107
112
|
next_url = None
|
108
113
|
|
109
114
|
if g.uuid:
|
110
|
-
|
115
|
+
print("uuid", g.uuid, is_admin_path)
|
111
116
|
account = get_account_by_uuid(g.uuid, is_admin_path)
|
117
|
+
print(account)
|
112
118
|
if not account:
|
113
119
|
return logout_redirect()
|
114
120
|
|
@@ -5,7 +5,8 @@ from apiflask.fields import Integer, String, Float, URL, Enum
|
|
5
5
|
from flask import g, request
|
6
6
|
from flask import current_app as app
|
7
7
|
from hiddifypanel.panel.auth import login_required
|
8
|
-
|
8
|
+
import hiddifypanel.panel.auth as auth
|
9
|
+
from flask_babelex import gettext as _
|
9
10
|
from hiddifypanel.models import Lang
|
10
11
|
from hiddifypanel.models.role import Role
|
11
12
|
from hiddifypanel.models.user import User
|
@@ -54,10 +55,12 @@ class InfoAPI(MethodView):
|
|
54
55
|
dto.profile_reset_days = g.account.days_to_reset()
|
55
56
|
dto.telegram_bot_url = f"https://t.me/{c['bot'].username}?start={g.account.uuid}" if c['bot'] else ""
|
56
57
|
dto.telegram_id = c['user'].telegram_id or 0
|
57
|
-
dto.admin_message_html = hconfig(ConfigEnum.branding_freetext)
|
58
|
-
|
59
|
-
|
60
|
-
dto.
|
58
|
+
dto.admin_message_html = hconfig(ConfigEnum.branding_freetext) or _("Join our Hiddify Telegram channel to get the latest updates on Hiddify.")
|
59
|
+
if not hconfig(ConfigEnum.branding_freetext) and auth.admin_session_is_exist():
|
60
|
+
dto.admin_message_html += "<p style='font-style: italic;font-size:8px'>"+_("[Admin only visible message:] You can change this message from settings")+"</p>"
|
61
|
+
dto.admin_message_url = hconfig(ConfigEnum.branding_site) or "https://t.me/hiddify"
|
62
|
+
dto.brand_title = hconfig(ConfigEnum.branding_title) or _("Hiddify")
|
63
|
+
dto.brand_icon_url = "" if hconfig(ConfigEnum.branding_title) else static_url_for(filename="images/hiddify.png")
|
61
64
|
dto.doh = f"https://{request.host}/{g.proxy_path}/dns/dns-query"
|
62
65
|
dto.lang = c['user'].lang
|
63
66
|
return dto
|
hiddifypanel/panel/common.py
CHANGED
@@ -28,7 +28,7 @@ def init_app(app: APIFlask):
|
|
28
28
|
'message': 'Not Found',
|
29
29
|
}), 404
|
30
30
|
# print(request.headers)
|
31
|
-
last_version = hiddify.get_latest_release_version('
|
31
|
+
last_version = hiddify.get_latest_release_version('hiddify-panel') # TODO: add dev update check
|
32
32
|
if "T" in hiddifypanel.__version__:
|
33
33
|
has_update = False
|
34
34
|
else:
|
@@ -63,7 +63,7 @@ def init_app(app: APIFlask):
|
|
63
63
|
# Create github issue link
|
64
64
|
issue_link = generate_github_issue_link_for_500_error(e, trace)
|
65
65
|
|
66
|
-
last_version = hiddify.get_latest_release_version('
|
66
|
+
last_version = hiddify.get_latest_release_version('hiddify-panel') # TODO: add dev update check
|
67
67
|
if "T" in hiddifypanel.__version__:
|
68
68
|
has_update = False
|
69
69
|
else:
|
@@ -2,6 +2,7 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<meta charset="UTF-8" />
|
5
|
+
|
5
6
|
<meta name="apple-itunes-app" content="app-id=6450534064, app-argument=streisand://import/{{profile_url}}">
|
6
7
|
|
7
8
|
<link rel="icon" type="image/png" href="../static/new/assets/hiddify-logo-7617d937.png" />
|
@@ -10,13 +11,13 @@
|
|
10
11
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
11
12
|
|
12
13
|
<title>Hiddify | Panel</title>
|
13
|
-
<script type="module" crossorigin src="../static/new/assets/index-
|
14
|
+
<script type="module" crossorigin src="../static/new/assets/index-a180e42e.js"></script>
|
14
15
|
<link rel="stylesheet" href="../static/new/assets/index-d9bbf489.css">
|
15
16
|
</head>
|
16
17
|
<body>
|
17
18
|
<div id="root"></div>
|
18
19
|
|
19
|
-
|
20
|
+
<!--<script src="node_modules/smartbanner.js/dist/smartbanner.min.js"></script>-->
|
20
21
|
<script>
|
21
22
|
window.appVersion = '{{version}}';
|
22
23
|
window.deepLink = "hiddify://import/{{profile_url}}"
|