Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* 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
*
* http://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 { getNodeLogs } from '@/service/node-log'
import type { NodeLog } from '@/service/node-log/types'
import { NCollapse, NCollapseItem } from 'naive-ui'
import { defineComponent, ref } from 'vue'

export default defineComponent({
setup(props) {
const logList = ref([] as NodeLog[])
getNodeLogs().then((res) => (logList.value = res))
return () => (
<div class="p-6">
<NCollapse accordion>
{logList.value.map((log) => (
<NCollapseItem title={log.logName}>
<iframe src={log.logLink} width="100%" height="700px" style="border: none" />
</NCollapseItem>
))}
</NCollapse>
</div>
)
}
})
12 changes: 12 additions & 0 deletions seatunnel-engine/seatunnel-engine-ui/src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,23 @@ const routes: RouteRecordRaw[] = [
meta: { title: 'workers', showSide: true, activeSide: 'workers' },
component: () => import('@/views/managers')
},
{
path: 'managers/workers/logs/:hostname',
name: 'managers-workers-logs',
meta: { title: 'workers', showSide: true, activeSide: 'workers' },
component: () => import('@/views/managers/logs')
},
{
path: 'managers/master',
name: 'managers-master',
meta: { title: 'master', showSide: true, activeSide: 'master' },
component: () => import('@/views/managers')
},
{
path: 'managers/master/logs/:master-hostname',
name: 'managers-master-logs',
meta: { title: 'master', showSide: true, activeSide: 'master' },
component: () => import('@/views/managers/logs')
}
]
}
Expand Down
27 changes: 27 additions & 0 deletions seatunnel-engine/seatunnel-engine-ui/src/service/node-log/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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
*
* http://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 { get } from '@/service/service'
import type { NodeLog } from './types'

export const getNodeLogs = () => get<NodeLog[]>(`/logs?format=json`)
export const getNodeLogContent = (logName: string) => get<NodeLog[]>(`/log/${logName}`)

export const JobLogService = {
getNodeLogs,
getNodeLogContent
}
22 changes: 22 additions & 0 deletions seatunnel-engine/seatunnel-engine-ui/src/service/node-log/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* 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
*
* http://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.
*/

export interface NodeLog {
node: string
logLink: string
logName: string
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { NButton } from 'naive-ui'
import { NSpace, NLayout, NLayoutContent } from 'naive-ui'
import { managerService } from '@/service/manager'
import type { Monitor } from '@/service/manager/types'
import { useRoute } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'

export default defineComponent({
setup() {
Expand All @@ -40,6 +40,10 @@ export default defineComponent({

function createColumns(): DataTableColumns<Monitor> {
const view = (row: Monitor) => {}
const router = useRouter()
const logView = (row: Monitor) => {
router.push({name: "managers-workers-logs", params: {'hostname': `${row.host}_${row.port}`}})
}
return [
{
title: 'Host',
Expand Down Expand Up @@ -72,6 +76,22 @@ export default defineComponent({
// { default: () => 'View' }
// )
// }
},
{
title: 'Action',
key: 'actions',
render(row) {
return h(
NButton,
{
strong: true,
tertiary: true,
size: 'small',
onClick: () => logView(row)
},
{ default: () => 'ViewLog' }
)
}
}
]
}
Expand Down
15 changes: 15 additions & 0 deletions seatunnel-engine/seatunnel-engine-ui/src/views/managers/logs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import NodeLog from "@/components/node-log";
import { NLayout, NLayoutContent } from "naive-ui";
import { defineComponent } from "vue";

export default defineComponent({
setup() {
return () => (
<NLayout>
<NLayoutContent>
<NodeLog></NodeLog>
</NLayoutContent>
</NLayout>
)
}
})