فهرست منبع

fix(namespace-tabs): remove remoteNamespaces computed property and use namespaces directly in tab rendering

0xJacky 5 روز پیش
والد
کامیت
372af98307
2فایلهای تغییر یافته به همراه5 افزوده شده و 16 حذف شده
  1. 3 6
      app/components.d.ts
  2. 2 10
      app/src/components/NamespaceTabs/NamespaceTabs.vue

+ 3 - 6
app/components.d.ts

@@ -17,8 +17,6 @@ declare module 'vue' {
     ABreadcrumbItem: typeof import('ant-design-vue/es')['BreadcrumbItem']
     AButton: typeof import('ant-design-vue/es')['Button']
     ACard: typeof import('ant-design-vue/es')['Card']
-    ACheckbox: typeof import('ant-design-vue/es')['Checkbox']
-    ACheckboxGroup: typeof import('ant-design-vue/es')['CheckboxGroup']
     ACol: typeof import('ant-design-vue/es')['Col']
     ACollapse: typeof import('ant-design-vue/es')['Collapse']
     ACollapsePanel: typeof import('ant-design-vue/es')['CollapsePanel']
@@ -46,23 +44,22 @@ declare module 'vue' {
     APopover: typeof import('ant-design-vue/es')['Popover']
     AppProviderAppProvider: typeof import('./src/components/AppProvider/AppProvider.vue')['default']
     AProgress: typeof import('ant-design-vue/es')['Progress']
-    ARangePicker: typeof import('ant-design-vue/es')['RangePicker']
+    AResult: typeof import('ant-design-vue/es')['Result']
     ARow: typeof import('ant-design-vue/es')['Row']
-    ASegmented: typeof import('ant-design-vue/es')['Segmented']
     ASelect: typeof import('ant-design-vue/es')['Select']
     ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
     ASpace: typeof import('ant-design-vue/es')['Space']
     AStatistic: typeof import('ant-design-vue/es')['Statistic']
+    AStep: typeof import('ant-design-vue/es')['Step']
+    ASteps: typeof import('ant-design-vue/es')['Steps']
     ASubMenu: typeof import('ant-design-vue/es')['SubMenu']
     ASwitch: typeof import('ant-design-vue/es')['Switch']
-    ATable: typeof import('ant-design-vue/es')['Table']
     ATabPane: typeof import('ant-design-vue/es')['TabPane']
     ATabs: typeof import('ant-design-vue/es')['Tabs']
     ATag: typeof import('ant-design-vue/es')['Tag']
     ATextarea: typeof import('ant-design-vue/es')['Textarea']
     ATooltip: typeof import('ant-design-vue/es')['Tooltip']
     ATypographyText: typeof import('ant-design-vue/es')['TypographyText']
-    ATypographyTitle: typeof import('ant-design-vue/es')['TypographyTitle']
     AutoCertFormAutoCertForm: typeof import('./src/components/AutoCertForm/AutoCertForm.vue')['default']
     AutoCertFormDNSChallenge: typeof import('./src/components/AutoCertForm/DNSChallenge.vue')['default']
     BaseEditorBaseEditor: typeof import('./src/components/BaseEditor/BaseEditor.vue')['default']

+ 2 - 10
app/src/components/NamespaceTabs/NamespaceTabs.vue

@@ -56,14 +56,6 @@ const currentNamespace = computed(() => {
   return namespaces.value.find(g => g.id === Number(modelValue.value))
 })
 
-// Filter namespaces for remote tabs
-const remoteNamespaces = computed(() => {
-  return namespaces.value.filter(ns =>
-    ns.deploy_mode === 'remote'
-    || (ns.sync_node_ids && ns.sync_node_ids.length > 0),
-  )
-})
-
 // Get the list of nodes in the current group
 const syncNodes = computed(() => {
   if (!currentNamespace.value)
@@ -120,10 +112,10 @@ async function handleRestartNginx() {
 
 <template>
   <div>
-    <ATabs :active-key="modelValue" @update:active-key="modelValue = $event">
+    <ATabs v-model:active-key="modelValue">
       <ATabPane :key="0" :tab="$gettext('Local')" />
       <ATabPane
-        v-for="ns in remoteNamespaces"
+        v-for="ns in namespaces"
         :key="ns.id"
         :tab="ns.name"
       />