props.showModalRef,
- () => {
- props.showModalRef && getListData()
- }
- )
-
- watch(
- () => props.statusRef,
- () => {
- if (props.statusRef === 0) {
- variables.model.namespace = ''
- variables.model.clusterCode = ''
- variables.model.limitsCpu = ''
- variables.model.limitsMemory = ''
- variables.model.userId = ''
- } else {
- variables.model.id = props.row.id
- variables.model.namespace = props.row.namespace
- variables.model.clusterCode = props.row.clusterCode
- variables.model.limitsCpu = props.row.limitsCpu + ''
- variables.model.limitsMemory = props.row.limitsMemory + ''
- variables.model.userId = props.row.userId
- }
- }
+ () => props.showModalRef,
+ () => {
+ props.showModalRef && getListData()
+ }
)
watch(
- () => props.row,
- () => {
+ () => props.statusRef,
+ () => {
+ if (props.statusRef === 0) {
+ variables.model.namespace = ''
+ variables.model.clusterCode = ''
+ variables.model.limitsCpu = ''
+ variables.model.limitsMemory = ''
+ variables.model.userId = ''
+ } else {
variables.model.id = props.row.id
variables.model.namespace = props.row.namespace
variables.model.clusterCode = props.row.clusterCode
@@ -103,6 +96,19 @@ const K8sNamespaceModal = defineComponent({
variables.model.limitsMemory = props.row.limitsMemory + ''
variables.model.userId = props.row.userId
}
+ }
+ )
+
+ watch(
+ () => props.row,
+ () => {
+ variables.model.id = props.row.id
+ variables.model.namespace = props.row.namespace
+ variables.model.clusterCode = props.row.clusterCode
+ variables.model.limitsCpu = props.row.limitsCpu + ''
+ variables.model.limitsMemory = props.row.limitsMemory + ''
+ variables.model.userId = props.row.userId
+ }
)
return { t, ...toRefs(variables), cancelModal, confirmModal, trim }
@@ -110,83 +116,87 @@ const K8sNamespaceModal = defineComponent({
render() {
const { t } = this
return (
-
-
- {{
- default: () => (
-
-
-
-
-
-
-
-
-
-
- CORE
-
-
-
-
-
- GB
-
-
-
- )
- }}
-
-
+
+
+ {{
+ default: () => (
+
+
+
+
+
+
+
+
+
+
+ CORE
+
+
+
+
+
+ GB
+
+
+
+ )
+ }}
+
+
)
}
})
-export default K8sNamespaceModal
\ No newline at end of file
+export default K8sNamespaceModal
diff --git a/dolphinscheduler-ui/src/views/security/k8s-namespace-manage/components/use-modal.ts b/dolphinscheduler-ui/src/views/security/k8s-namespace-manage/components/use-modal.ts
index 92248c7175..63c75ba29c 100644
--- a/dolphinscheduler-ui/src/views/security/k8s-namespace-manage/components/use-modal.ts
+++ b/dolphinscheduler-ui/src/views/security/k8s-namespace-manage/components/use-modal.ts
@@ -26,8 +26,8 @@ import { queryAllClusterList } from '@/service/modules/cluster'
import { useAsyncState } from '@vueuse/core'
export function useModal(
- props: any,
- ctx: SetupContext<('cancelModal' | 'confirmModal')[]>
+ props: any,
+ ctx: SetupContext<('cancelModal' | 'confirmModal')[]>
) {
const { t } = useI18n()
@@ -73,8 +73,8 @@ export function useModal(
try {
statusRef === 0
- ? await submitK8SNamespaceModal()
- : await updateK8SNamespaceModal()
+ ? await submitK8SNamespaceModal()
+ : await updateK8SNamespaceModal()
variables.saving = false
} catch (err) {
variables.saving = false
@@ -83,23 +83,23 @@ export function useModal(
const getListData = () => {
const { state } = useAsyncState(
- queryAllClusterList().then((res: any) => {
- variables.model.clusterOptions = res
- .filter((item: any) => {
- if (item.config) {
- const k8s = JSON.parse(item.config).k8s
- return !!k8s
- }
- return false
- })
- .map((item: any) => {
- return {
- label: item.name,
- value: item.code
- }
- })
- }),
- {}
+ queryAllClusterList().then((res: any) => {
+ variables.model.clusterOptions = res
+ .filter((item: any) => {
+ if (item.config) {
+ const k8s = JSON.parse(item.config).k8s
+ return !!k8s
+ }
+ return false
+ })
+ .map((item: any) => {
+ return {
+ label: item.name,
+ value: item.code
+ }
+ })
+ }),
+ {}
)
return state
@@ -120,9 +120,9 @@ export function useModal(
const updateK8SNamespaceModal = () => {
updateK8sNamespace(variables.model, variables.model.id).then(
- (ignored: any) => {
- ctx.emit('confirmModal', props.showModalRef)
- }
+ (ignored: any) => {
+ ctx.emit('confirmModal', props.showModalRef)
+ }
)
}
@@ -131,4 +131,4 @@ export function useModal(
handleValidate,
getListData
}
-}
\ No newline at end of file
+}
diff --git a/dolphinscheduler-ui/src/views/security/k8s-namespace-manage/index.tsx b/dolphinscheduler-ui/src/views/security/k8s-namespace-manage/index.tsx
index 07eda28cea..e41c79cc27 100644
--- a/dolphinscheduler-ui/src/views/security/k8s-namespace-manage/index.tsx
+++ b/dolphinscheduler-ui/src/views/security/k8s-namespace-manage/index.tsx
@@ -15,7 +15,13 @@
* limitations under the License.
*/
-import { defineComponent, getCurrentInstance, onMounted, toRefs, watch } from 'vue'
+import {
+ defineComponent,
+ getCurrentInstance,
+ onMounted,
+ toRefs,
+ watch
+} from 'vue'
import {
NButton,
NDataTable,
@@ -112,7 +118,7 @@ const k8sNamespaceManage = defineComponent({
1
- ? variables.page - 1
- : variables.page,
+ variables.tableData.length === 1 && variables.page > 1
+ ? variables.page - 1
+ : variables.page,
searchVal: variables.searchVal
})
})
@@ -104,61 +104,61 @@ export function useTable() {
return h(NSpace, null, {
default: () => [
h(
- NTooltip,
- {},
- {
- trigger: () =>
- h(
+ NTooltip,
+ {},
+ {
+ trigger: () =>
+ h(
+ NButton,
+ {
+ circle: true,
+ type: 'info',
+ size: 'small',
+ onClick: () => {
+ handleEdit(row)
+ }
+ },
+ {
+ icon: () =>
+ h(NIcon, null, { default: () => h(EditOutlined) })
+ }
+ ),
+ default: () => t('security.k8s_namespace.edit')
+ }
+ ),
+ h(
+ NPopconfirm,
+ {
+ onPositiveClick: () => {
+ handleDelete(row)
+ }
+ },
+ {
+ trigger: () =>
+ h(
+ NTooltip,
+ {},
+ {
+ trigger: () =>
+ h(
NButton,
{
circle: true,
- type: 'info',
- size: 'small',
- onClick: () => {
- handleEdit(row)
- }
+ type: 'error',
+ size: 'small'
},
{
icon: () =>
- h(NIcon, null, { default: () => h(EditOutlined) })
+ h(NIcon, null, {
+ default: () => h(DeleteOutlined)
+ })
}
- ),
- default: () => t('security.k8s_namespace.edit')
- }
- ),
- h(
- NPopconfirm,
- {
- onPositiveClick: () => {
- handleDelete(row)
- }
- },
- {
- trigger: () =>
- h(
- NTooltip,
- {},
- {
- trigger: () =>
- h(
- NButton,
- {
- circle: true,
- type: 'error',
- size: 'small'
- },
- {
- icon: () =>
- h(NIcon, null, {
- default: () => h(DeleteOutlined)
- })
- }
- ),
- default: () => t('security.k8s_namespace.delete')
- }
- ),
- default: () => t('security.k8s_namespace.delete_confirm')
- }
+ ),
+ default: () => t('security.k8s_namespace.delete')
+ }
+ ),
+ default: () => t('security.k8s_namespace.delete_confirm')
+ }
)
]
})
@@ -188,24 +188,24 @@ export function useTable() {
if (variables.loadingRef) return
variables.loadingRef = true
const { state } = useAsyncState(
- queryNamespaceListPaging({ ...params }).then((res: NamespaceListRes) => {
- variables.tableData = res.totalList.map((item, unused) => {
- item.createTime = format(
- parseTime(item.createTime),
- 'yyyy-MM-dd HH:mm:ss'
- )
- item.updateTime = format(
- parseTime(item.updateTime),
- 'yyyy-MM-dd HH:mm:ss'
- )
- return {
- ...item
- }
- }) as any
- variables.totalPage = res.totalPage
- variables.loadingRef = false
- }),
- {}
+ queryNamespaceListPaging({ ...params }).then((res: NamespaceListRes) => {
+ variables.tableData = res.totalList.map((item, unused) => {
+ item.createTime = format(
+ parseTime(item.createTime),
+ 'yyyy-MM-dd HH:mm:ss'
+ )
+ item.updateTime = format(
+ parseTime(item.updateTime),
+ 'yyyy-MM-dd HH:mm:ss'
+ )
+ return {
+ ...item
+ }
+ }) as any
+ variables.totalPage = res.totalPage
+ variables.loadingRef = false
+ }),
+ {}
)
return state
@@ -216,4 +216,4 @@ export function useTable() {
getTableData,
createColumns
}
-}
\ No newline at end of file
+}
diff --git a/dolphinscheduler-ui/src/views/security/tenant-manage/components/tenant-modal.tsx b/dolphinscheduler-ui/src/views/security/tenant-manage/components/tenant-modal.tsx
index fd3086d843..ffdc73534f 100644
--- a/dolphinscheduler-ui/src/views/security/tenant-manage/components/tenant-modal.tsx
+++ b/dolphinscheduler-ui/src/views/security/tenant-manage/components/tenant-modal.tsx
@@ -15,7 +15,13 @@
* limitations under the License.
*/
-import { defineComponent, getCurrentInstance, PropType, toRefs, watch } from 'vue'
+import {
+ defineComponent,
+ getCurrentInstance,
+ PropType,
+ toRefs,
+ watch
+} from 'vue'
import Modal from '@/components/modal'
import { NForm, NFormItem, NInput, NSelect } from 'naive-ui'
import { useModalData } from './use-modalData'
@@ -123,7 +129,7 @@ const TenantModal = defineComponent({
path='tenantCode'
>
+ allowInput={this.trim}
+ v-model:value={this.searchVal}
+ size='small'
+ clearable
+ />
diff --git a/dolphinscheduler-ui/src/views/security/worker-group-manage/components/worker-group-modal.tsx b/dolphinscheduler-ui/src/views/security/worker-group-manage/components/worker-group-modal.tsx
index b84f0ba84b..156810e21d 100644
--- a/dolphinscheduler-ui/src/views/security/worker-group-manage/components/worker-group-modal.tsx
+++ b/dolphinscheduler-ui/src/views/security/worker-group-manage/components/worker-group-modal.tsx
@@ -15,7 +15,13 @@
* limitations under the License.
*/
-import { defineComponent, getCurrentInstance, PropType, toRefs, watch } from 'vue'
+import {
+ defineComponent,
+ getCurrentInstance,
+ PropType,
+ toRefs,
+ watch
+} from 'vue'
import Modal from '@/components/modal'
import { NForm, NFormItem, NInput, NSelect } from 'naive-ui'
import { useModal } from './use-modal'
@@ -118,7 +124,7 @@ const WorkerGroupModal = defineComponent({
path='name'
>