The system settings support setting the tag_bar_display variable.

This commit is contained in:
Liujian committed 2025-12-29 15:43:10 +08:00
1 parent 88325a0ba9
commit 77ca12045d
4 files changed
+16

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
INSERT INTO `sys_config` (`id`,`key`, `value`,`description`,`created_at`,`updated_at`)
VALUES ('xpack-tag-bar-display','tag_bar_display', 'true', 'Display tag bar on the top of the page', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
ON DUPLICATE KEY UPDATE `value` = VALUES(`value`), `description` = VALUES(`description`), `updated_at` = CURRENT_TIMESTAMP;
INSERT INTO `sys_config` (`id`,`key`, `value`,`description`,`created_at`,`updated_at`)
VALUES ('xpack-version','version', '1.3.0', 'The user interface supports viewing the transaction list.', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
ON DUPLICATE KEY UPDATE `value` = VALUES(`value`), `description` = VALUES(`description`), `updated_at` = CURRENT_TIMESTAMP;
@@ -7,6 +7,7 @@ KEY_SUBHEADLINE = "subheadline"
KEY_LANGUAGE = "language"
KEY_THEME = "theme"
KEY_ABOUT_PAGE = "about_page"
KEY_TAG_BAR_DISPLAY = "tag_bar_display"
KEY_ADMIN_USERNAME = "admin_username"
KEY_ADMIN_PASSWORD = "admin_password"
KEY_LOGIN_GOOGLE_CLIENT = "login_google_client_id"
@@ -67,6 +67,7 @@ def get_config(
"facebook_image_url": values.get(KEY_FACEBOOK_IMAGE_URL, ""),
"social_account_facebook_url": values.get(KEY_SOCIAL_ACCOUNT_FACEBOOK_URL, ""),
"social_account_x_url": values.get(KEY_SOCIAL_ACCOUNT_X_URL, ""),
"tag_bar_display": values.get(KEY_TAG_BAR_DISPLAY, "false").lower() in ("true", "t", "yes", "y", "1"),
},
"faq": faq,
"embeded_html": embeded_html,
@@ -144,6 +144,7 @@ def get_sysconfig(
"social_account_facebook_url": small_values.get(sys_config_key.KEY_SOCIAL_ACCOUNT_FACEBOOK_URL, ""),
"social_account_x_url": small_values.get(sys_config_key.KEY_SOCIAL_ACCOUNT_X_URL, ""),
"cname_a_ip": cname_a_ip,
"tag_bar_display": small_values.get(sys_config_key.KEY_TAG_BAR_DISPLAY, "").lower() in ("true", "t", "yes", "y", "1"),
},
"account": {
"username": admin_username,
@@ -219,6 +220,9 @@ def set_sysconfig(
facebook_image_url = platform.get("facebook_image_url")
social_account_facebook_url = platform.get("social_account_facebook_url")
social_account_x_url = platform.get("social_account_x_url")
tag_bar_display = platform.get("tag_bar_display")
account = body.get("account", {})
admin_username = account.get("username")
@@ -270,6 +274,7 @@ def set_sysconfig(
(sys_config_key.KEY_FACEBOOK_IMAGE_URL, facebook_image_url, "Facebook image URL"),
(sys_config_key.KEY_SOCIAL_ACCOUNT_FACEBOOK_URL, social_account_facebook_url, "Facebook URL"),
(sys_config_key.KEY_SOCIAL_ACCOUNT_X_URL, social_account_x_url, "X URL"),
(sys_config_key.KEY_TAG_BAR_DISPLAY, tag_bar_display, "Tag bar display"),
(sys_config_key.KEY_LOGIN_GOOGLE_CLIENT, login_google_client, "Google login client ID"),
(sys_config_key.KEY_LOGIN_GOOGLE_SECRET, login_google_secret, "Google login client secret"),
(sys_config_key.KEY_LOGIN_GOOGLE_ENABLE, login_google_enable, "Google login enabled"),
@@ -318,6 +323,7 @@ def set_sysconfig(
"facebook_image_url": facebook_image_url,
"social_account_facebook_url": social_account_facebook_url,
"social_account_x_url": social_account_x_url,
"tag_bar_display": tag_bar_display,
}
# Use background reporting to avoid blocking the main configuration update