fix chart
This commit is contained in:
@@ -0,0 +1,158 @@
|
||||
export type SettingGroupDef = {
|
||||
id: string
|
||||
title: string
|
||||
icon: string
|
||||
match: (key: string) => boolean
|
||||
}
|
||||
|
||||
/** گروههای صفحه تنظیمات عادی (فقط can_edit=1) */
|
||||
export const EDITABLE_SETTING_GROUPS: SettingGroupDef[] = [
|
||||
{
|
||||
id: 'general',
|
||||
title: 'عمومی و برند',
|
||||
icon: 'vuesax-linear:home-2',
|
||||
match: (k) =>
|
||||
/^(name_fa|name_en|bace_url|server_url|logo_|title_pwa|title_fav|open_register|auto_active_customer|store_status|key$)/.test(
|
||||
k
|
||||
)
|
||||
},
|
||||
{
|
||||
id: 'pricing',
|
||||
title: 'کارمزد و محدودیتها',
|
||||
icon: 'vuesax-linear:dollar-circle',
|
||||
match: (k) =>
|
||||
/^(fee_|buy_fee|sell_fee|min_|minimum_|show_last_price|close_price|startDay|endDay|up_price|down_price|price_extreme_date|balance_report_exclude)/.test(
|
||||
k
|
||||
) || k.includes('charge_percentage')
|
||||
},
|
||||
{
|
||||
id: 'content',
|
||||
title: 'متنهای اپ',
|
||||
icon: 'vuesax-linear:document-text',
|
||||
match: (k) => /^text_/.test(k)
|
||||
},
|
||||
{
|
||||
id: 'referral',
|
||||
title: 'معرف و پاداش',
|
||||
icon: 'vuesax-linear:people',
|
||||
match: (k) =>
|
||||
/^(referral_|gift_for|register_referral|register_jibit|jibit_verification|referral_bonus|invite_link_text)/.test(
|
||||
k
|
||||
)
|
||||
},
|
||||
{
|
||||
id: 'montzar',
|
||||
title: 'همکار Montzar',
|
||||
icon: 'vuesax-linear:link-2',
|
||||
match: (k) =>
|
||||
(k.startsWith('montzar_') && !['montzar_base_url', 'montzar_closed'].includes(k)) ||
|
||||
k === 'display_montzar'
|
||||
},
|
||||
{
|
||||
id: 'store',
|
||||
title: 'سفارش خارجی',
|
||||
icon: 'vuesax-linear:shop',
|
||||
match: (k) => /^external_order/.test(k)
|
||||
},
|
||||
{
|
||||
id: 'support',
|
||||
title: 'پشتیبانی',
|
||||
icon: 'vuesax-linear:headphone',
|
||||
match: (k) => k.startsWith('support_messenger') || k === 'deposit_sms_support_number'
|
||||
},
|
||||
{
|
||||
id: 'bots',
|
||||
title: 'باتها',
|
||||
icon: 'vuesax-linear:messages-2',
|
||||
match: (k) => /^(telegram_bot|bale_bot)/.test(k)
|
||||
},
|
||||
{
|
||||
id: 'notifications',
|
||||
title: 'پیامک و اعلان',
|
||||
icon: 'vuesax-linear:notification',
|
||||
match: (k) => /^charge_notif/.test(k)
|
||||
},
|
||||
{
|
||||
id: 'features',
|
||||
title: 'قابلیتهای سیستم',
|
||||
icon: 'vuesax-linear:setting-2',
|
||||
match: (k) => /^(product_|main_wallet_products|price_from_nasiryan|profit_gold)/.test(k)
|
||||
},
|
||||
{
|
||||
id: 'misc',
|
||||
title: 'سایر',
|
||||
icon: 'vuesax-linear:more-circle',
|
||||
match: () => true
|
||||
}
|
||||
]
|
||||
|
||||
/** گروههای صفحه دیپلوی — شامل تنظیمات can_edit=0 */
|
||||
export const SYSTEM_SETTING_GROUPS: SettingGroupDef[] = [
|
||||
{
|
||||
id: 'general',
|
||||
title: 'عمومی و برند',
|
||||
icon: 'vuesax-linear:home-2',
|
||||
match: (k) =>
|
||||
/^(name_fa|name_en|app_url|admin_url|apk_download_link|banner_enabled|bace_url|server_url|logo_|title_pwa|title_fav|metal_type|unit$|open_register|auto_active_customer|store_status|key$|is_store|group_sms|has_page_earn_money)/.test(
|
||||
k
|
||||
)
|
||||
},
|
||||
{
|
||||
id: 'chart',
|
||||
title: 'نمودار قیمت',
|
||||
icon: 'vuesax-linear:chart-2',
|
||||
match: (k) => /^chart_/.test(k)
|
||||
},
|
||||
{
|
||||
id: 'pricing',
|
||||
title: 'منبع قیمت و تابلو',
|
||||
icon: 'vuesax-linear:dollar-circle',
|
||||
match: (k) =>
|
||||
/^(price_provider|zaarbox_|main_product$|default_vc_number)/.test(k) ||
|
||||
k.includes('charge_percentage')
|
||||
},
|
||||
{
|
||||
id: 'montzar',
|
||||
title: 'Montzar',
|
||||
icon: 'vuesax-linear:link-2',
|
||||
match: (k) => /^montzar_/.test(k) || k === 'display_montzar'
|
||||
},
|
||||
{
|
||||
id: 'store',
|
||||
title: 'اتصال فروشگاه',
|
||||
icon: 'vuesax-linear:shop',
|
||||
match: (k) => /^node_/.test(k) || k === 'montify_name' || k === 'external_order_api_enabled'
|
||||
},
|
||||
{
|
||||
id: 'payping',
|
||||
title: 'درگاه Payping',
|
||||
icon: 'vuesax-linear:card',
|
||||
match: (k) => k.startsWith('payping_')
|
||||
},
|
||||
{
|
||||
id: 'tahesab',
|
||||
title: 'تهحساب',
|
||||
icon: 'vuesax-linear:receipt-2',
|
||||
match: (k) => k.startsWith('tahesab_') || k === 'send_to_tahesab'
|
||||
},
|
||||
{
|
||||
id: 'infra',
|
||||
title: 'زیرساخت',
|
||||
icon: 'vuesax-linear:cpu',
|
||||
match: (k) => /^(wss_enabled|sse_path|wss_path|wss_link|wss_trigger_path|profit_gold_api_enabled)/.test(k)
|
||||
},
|
||||
{
|
||||
id: 'misc',
|
||||
title: 'سایر',
|
||||
icon: 'vuesax-linear:more-circle',
|
||||
match: () => true
|
||||
}
|
||||
]
|
||||
|
||||
export function getSettingGroupId(key: string, groups: SettingGroupDef[]): string {
|
||||
for (const g of groups) {
|
||||
if (g.id === 'misc') continue
|
||||
if (g.match(key)) return g.id
|
||||
}
|
||||
return 'misc'
|
||||
}
|
||||
Reference in New Issue
Block a user