feat: website settings menu gated by has_landing

Add تنظیمات وبسایت before پیکربندی with landing_* subsections, and show unit addon on numeric setting fields.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-05 17:01:51 +03:30
co-authored by Cursor
parent dec36cc31e
commit e0b89223ac
11 changed files with 325 additions and 21 deletions
+17 -1
View File
@@ -86,6 +86,9 @@ export const supportChatMenuEnabledSetting = ref(false)
/** reactive — سوییچ دیپلوی show_to_users_chat (برای مخفی کردن has_chat در تنظیمات عادی) */
export const showToUsersChatSetting = ref(false)
/** reactive — منوی تنظیمات وبسایت وقتی has_landing روشن است */
export const hasLandingSetting = ref(false)
/** reactive — سوییچ دیپلوی price_channel_access (گروه کانال در تنظیمات عادی) */
export const priceChannelAccessSetting = ref(false)
@@ -215,6 +218,10 @@ export function setShowToUsersChatFromSettings(value: boolean): void {
showToUsersChatSetting.value = value
}
export function setHasLandingFromSettings(value: boolean): void {
hasLandingSetting.value = value
}
export function setPriceChannelAccessFromSettings(value: boolean): void {
priceChannelAccessSetting.value = value
}
@@ -313,7 +320,7 @@ export function invalidateSettingsBootstrap(): void {
}
/**
* اعمال مستقیم ۱۵ دسترسی سوپرادمین روی فلگ‌های منو/UI
* اعمال مستقیم ۱۶ دسترسی سوپرادمین روی فلگ‌های منو/UI
* (پاسخ refresh-superadmin.items یا ردیف‌های get_settings).
*/
export function applySuperAdminAccessFlagsFromItems(
@@ -333,6 +340,7 @@ export function applySuperAdminAccessFlagsFromItems(
applyPriceTriggerEnabledFromRows(rows)
applyAppNotificationEnabledFromRows(rows)
applySupportChatMenuEnabledFromRows(rows)
applyHasLandingFromRows(rows)
}
export function applyConditionalOrderEnabledFromRows(
@@ -377,6 +385,13 @@ export function applyAppNotificationEnabledFromRows(
if (row) setAppNotificationEnabledFromSettings(isSwitchOn(row.value))
}
export function applyHasLandingFromRows(
rows: Array<{ key?: string; value?: string | null }>
) {
const row = rows.find((item) => item.key === 'has_landing')
if (row) setHasLandingFromSettings(isSwitchOn(row.value))
}
export function applyPriceProviderFromRows(
rows: Array<{ key?: string; value?: string | null }>
) {
@@ -419,6 +434,7 @@ async function bootstrapSettingsFromApi(): Promise<void> {
applyPriceTriggerEnabledFromRows(list)
applyAppNotificationEnabledFromRows(list)
applySupportChatMenuEnabledFromRows(list)
applyHasLandingFromRows(list)
applyPriceProviderFromRows(list)
applyPriceChannelAccessFromRows(list)
setCachedMainMetal(mainMetalRow?.value)