From e0005dbf87c4e1e8b62cb5d823e39fd3bdf7092e Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 8 May 2026 13:10:43 +0200 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20Phase=205d-v=20=E2=80=94=20se?= =?UTF-8?q?ttings=20Subscription=20general=20tab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ports the subscription/general partial — four collapse panels covering the master enable switches, presentation/template fields, certs, and update interval. - Sub path goes through a strip-on-input + normalize-on-blur computed: legacy stripped `:` and `*` and ensured the value starts and ends with a single `/` — same here. - Both `subEnableRouting` and the announce/profile/title/support URLs are bound directly on AllSetting. - The "Subscription URI override" placeholder mirrors the legacy pattern for the manual full-URL form. Co-Authored-By: Claude Opus 4.7 --- frontend/src/pages/settings/SettingsPage.vue | 3 +- .../pages/settings/SubscriptionGeneralTab.vue | 215 ++++++++++++++++++ 2 files changed, 217 insertions(+), 1 deletion(-) create mode 100644 frontend/src/pages/settings/SubscriptionGeneralTab.vue diff --git a/frontend/src/pages/settings/SettingsPage.vue b/frontend/src/pages/settings/SettingsPage.vue index 08a02d94..3eaed232 100644 --- a/frontend/src/pages/settings/SettingsPage.vue +++ b/frontend/src/pages/settings/SettingsPage.vue @@ -17,6 +17,7 @@ import { useAllSetting } from './useAllSetting.js'; import GeneralTab from './GeneralTab.vue'; import SecurityTab from './SecurityTab.vue'; import TelegramTab from './TelegramTab.vue'; +import SubscriptionGeneralTab from './SubscriptionGeneralTab.vue'; const antdThemeConfig = computed(() => ({ algorithm: themeState.isDark ? antdTheme.darkAlgorithm : antdTheme.defaultAlgorithm, @@ -230,7 +231,7 @@ const alertVisible = ref(true); Subscription - + +import { computed } from 'vue'; +import SettingListItem from '@/components/SettingListItem.vue'; + +const props = defineProps({ + allSetting: { type: Object, required: true }, +}); + +// Sub path is constrained: no `:` or `*`, must start and end with `/`, +// and no double slashes. Strip on input, normalize on blur — same +// behavior as the legacy template. +const subPath = computed({ + get: () => props.allSetting.subPath, + set: (v) => { + props.allSetting.subPath = String(v ?? '').replace(/[:*]/g, ''); + }, +}); + +function normalizeSubPath() { + let p = props.allSetting.subPath || '/'; + if (!p.startsWith('/')) p = '/' + p; + if (!p.endsWith('/')) p += '/'; + p = p.replace(/\/+/g, '/'); + props.allSetting.subPath = p; +} + + +