From 732b3f51aa4bd0e5201edf3f099a7c334a751f17 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 8 May 2026 12:58:56 +0200 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20Phase=205c-v=20=E2=80=94=20cu?= =?UTF-8?q?stom-geo=20section=20in=20VersionModal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the third collapse panel ("Custom geo") that lets users register external geosite/geoip files referenced by routing rules via ext::tag. Backend endpoints are unchanged. - CustomGeoSection.vue: bordered table over /panel/api/custom-geo/list with per-row edit, download (refetch), and delete actions, plus an Add button and Update-all. Lazy-loads the list when the parent collapse opens this panel — closed panels don't fetch. - CustomGeoFormModal.vue: shared add/edit form with the same alias regex (^[a-z0-9_-]+$) and URL validation as legacy. Type and alias are immutable when editing — backend rejects changes anyway. - ext::tag value is click-to-copy via ClipboardManager. - Relative time is computed inline (no moment dep); tooltip shows the absolute timestamp. Co-Authored-By: Claude Opus 4.7 --- .../src/pages/index/CustomGeoFormModal.vue | 112 +++++++ frontend/src/pages/index/CustomGeoSection.vue | 309 ++++++++++++++++++ frontend/src/pages/index/VersionModal.vue | 5 + 3 files changed, 426 insertions(+) create mode 100644 frontend/src/pages/index/CustomGeoFormModal.vue create mode 100644 frontend/src/pages/index/CustomGeoSection.vue diff --git a/frontend/src/pages/index/CustomGeoFormModal.vue b/frontend/src/pages/index/CustomGeoFormModal.vue new file mode 100644 index 00000000..ee85c7fa --- /dev/null +++ b/frontend/src/pages/index/CustomGeoFormModal.vue @@ -0,0 +1,112 @@ + + + diff --git a/frontend/src/pages/index/CustomGeoSection.vue b/frontend/src/pages/index/CustomGeoSection.vue new file mode 100644 index 00000000..c5351071 --- /dev/null +++ b/frontend/src/pages/index/CustomGeoSection.vue @@ -0,0 +1,309 @@ + + + + + diff --git a/frontend/src/pages/index/VersionModal.vue b/frontend/src/pages/index/VersionModal.vue index 30d044ae..c9c6fbac 100644 --- a/frontend/src/pages/index/VersionModal.vue +++ b/frontend/src/pages/index/VersionModal.vue @@ -3,6 +3,7 @@ import { ref, watch } from 'vue'; import { Modal } from 'ant-design-vue'; import { ReloadOutlined } from '@ant-design/icons-vue'; import { HttpUtil } from '@/utils'; +import CustomGeoSection from './CustomGeoSection.vue'; const props = defineProps({ open: { type: Boolean, default: false }, @@ -113,6 +114,10 @@ watch(() => props.open, (next) => { if (next) fetchVersions(); }); Update all + + + +