kevinw66 commented on code in PR #25:
URL: https://github.com/apache/bigtop-manager/pull/25#discussion_r1690953792
##########
bigtop-manager-ui/src/components/job-info/job.vue:
##########
@@ -191,52 +199,47 @@
breadcrumbs.value.splice(idx + 1, len)
}
- const handlePageChange = (page: number) => {
- paginationProps.current = page
- jobsPageState.pageNum = page
- loading.value = true
- getJobsList()
+ const handleClose = () => {
+ intervalId.value?.pause()
+ breadcrumbs.value = [{ name: 'Job Info' }]
+ restState()
+ emits('update:visible', false)
}
- const handlePageSizeChange = (_current: number, size: number) => {
- paginationProps.pageSize = size
- jobsPageState.pageSize = size
- loading.value = true
- getJobsList()
+ const setShowLogAwaitMsg = (status: boolean) => {
+ showLogAwaitMsg.value = status
}
- const initPagedProps = () => {
- return {
- current: 1,
- pageSize: 10,
- size: 'small',
- showSizeChanger: true,
- pageSizeOptions: ['10', '20', '30', '40', '50'],
- total: 0,
- onChange: handlePageChange,
- onShowSizeChange: handlePageSizeChange
- }
+ const onLogCompalete = (status: boolean) => {
+ isComplete.value = status
}
- const handleClose = () => {
- intervalId.value?.pause()
- breadcrumbs.value = [{ name: 'Job Info' }]
- jobs.value = []
- Object.assign(jobsPageState, {
- pageNum: 1,
- pageSize: 10,
- sort: 'desc'
- })
- emits('update:visible', false)
+ const onTableChange = (pagination: TablePaginationConfig) => {
+ onChange(pagination)
+ loading.value = true
+ getJobsList()
}
</script>
<template>
<a-modal :open="props.visible" width="95%" @cancel="handleClose">
<template #footer>
- <a-button key="back" type="primary" @click="handleClose">
- {{ $t('common.confirm') }}
- </a-button>
+ <div :class="{ 'footer-btns': showLogAwaitMsg }">
+ <div
+ v-if="showLogAwaitMsg"
+ class="logs_wait_msg"
Review Comment:
please use "-" instead of "_"
##########
bigtop-manager-ui/src/components/job-info/job.vue:
##########
@@ -77,38 +78,39 @@
const emits = defineEmits(['update:visible', 'closed'])
- const loading = ref(false)
+ const showLogAwaitMsg = ref(false)
+ const isComplete = ref(false)
const stages = ref<StageVO[]>([])
const tasks = ref<TaskVO[]>([])
const breadcrumbs = ref<any[]>([{ name: 'Job Info' }])
const currTaskInfo = ref<TaskVO>()
- const jobs = ref<JobVO[]>([])
const intervalId = ref<Pausable | undefined>()
- const logRef = ref<InstanceType<typeof TaskLog> | null>()
+ const logRef = ref<InstanceType<typeof TaskLog> | null>(null)
const currPage = ref<string[]>([
'isJobTable',
'isStageTable',
'isTaskTable',
'isTaskLogs'
])
- const paginationProps = reactive<PaginationConfig>({})
- const jobsPageState = reactive<Pagination>({
- pageNum: 1,
- pageSize: 10,
- sort: 'desc'
- })
+ const {
+ loading,
+ columnsProp,
+ dataSource: jobs,
+ paginateProp,
+ onChange,
+ restState
Review Comment:
this should be resetState
##########
bigtop-manager-ui/src/composables/useBaseTable.ts:
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { ref, onUnmounted } from 'vue'
+import type { TablePaginationConfig, TableColumnType } from 'ant-design-vue'
+
+const useBaseTable = <T>(
+ columns: TableColumnType[],
+ rows?: T[],
+ pagination?: TablePaginationConfig | false | undefined
+) => {
+ const loading = ref(false)
+ const dataSource = ref<T[]>(rows || [])
+ const columnsProp = ref<TableColumnType[]>(columns)
+ const paginateProp = ref<TablePaginationConfig>({
Review Comment:
will paginationProps be better?
##########
bigtop-manager-ui/src/composables/useBaseTable.ts:
##########
Review Comment:
I think it's better to split words by "-" for ts file
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]