Merge branch 'dev-v1.1.1' of http://120.26.58.240:8888/r/flexJobAdmin into dev-v1.1.1
| | |
| | | <ProTableQueryFilterBar :show-reset-btn="false"> |
| | | <template #query> |
| | | <QueryFilterItem> |
| | | <SearchInput |
| | | v-model="state.traceId" |
| | | style="width: 260px" |
| | | placeholder="traceID" |
| | | @on-click-search="refetch" |
| | | > |
| | | <SearchInput v-model="state.traceId" style="width: 260px" placeholder="traceID"> |
| | | </SearchInput> |
| | | </QueryFilterItem> |
| | | </template> |
| | | </ProTableQueryFilterBar> |
| | | <ProTabs v-model="state.tabType" hasBorder> |
| | | <ProTabPane lazy label="资源日志" name="resourceLogs"> |
| | | <ResourceLogsView |
| | | :resourceLogs="detail.resourceLogs" |
| | | @resend="refetch" |
| | | ></ResourceLogsView> |
| | | <ResourceLogsView :resourceLogs="detail.resourceLogs"></ResourceLogsView> |
| | | </ProTabPane> |
| | | <ProTabPane lazy label="第三方资源日志" name="threeResourceLogs"> |
| | | <ThreeResourceLogsView |
| | |
| | | <template> |
| | | <el-collapse v-model="activeName" accordion> |
| | | <!-- <el-collapse v-model="activeName" accordion> |
| | | <el-collapse-item |
| | | v-for="item in dbAuditLogs" |
| | | :key="item.createdTime" |
| | |
| | | > |
| | | </ProForm> |
| | | </el-collapse-item> |
| | | </el-collapse> |
| | | </el-collapse> --> |
| | | <AppContainer> |
| | | <ProTableV2 |
| | | :columns="columns" |
| | | :show-pagination="false" |
| | | :table-data="dbAuditLogs" |
| | | :column-render-map="columnsRenderProps" |
| | | > |
| | | <template #oldValues="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.stringify(row.oldValues) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | <template #newValues="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.stringify(row.newValues) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | <template #createdUser="{ row }"> |
| | | <el-button |
| | | type="primary" |
| | | link |
| | | @click="handleAdd({ json: JSON.parse(JSON.stringify(row.createdUser)) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | </ProTableV2> |
| | | <JsonViewerDialog v-bind="dialogProps" /> |
| | | </AppContainer> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ProForm, ProFormItemV2 } from '@bole-core/components'; |
| | | import { EnumDbAuditOperateText } from '@/constants'; |
| | | import JsonViewer from 'vue-json-viewer'; |
| | | |
| | | import { format } from '@/utils'; |
| | | import { |
| | | AppContainer, |
| | | ProTableV2, |
| | | defineColumns, |
| | | ProTableV2Props, |
| | | useFormDialog, |
| | | } from '@bole-core/components'; |
| | | import JsonViewerDialog from './JsonViewerDialog.vue'; |
| | | |
| | | defineOptions({ |
| | | name: 'DbAuditLogsView', |
| | |
| | | const props = withDefaults(defineProps<Props>(), { |
| | | dbAuditLogs: () => [] as API.GetDbAuditLogsQueryResultItem[], |
| | | }); |
| | | |
| | | const columns = defineColumns( |
| | | [ |
| | | 'tableName', |
| | | 'primaryKey', |
| | | 'operate', |
| | | 'oldValues', |
| | | 'newValues', |
| | | 'createdUser', |
| | | 'createdTime', |
| | | ].map((x, index) => ({ |
| | | id: index + '', |
| | | enCode: x, |
| | | name: x, |
| | | })) |
| | | ); |
| | | |
| | | const columnsRenderProps: ProTableV2Props['columnRenderMap'] = { |
| | | operate: { type: 'enum', valueEnum: EnumDbAuditOperateText }, |
| | | createdTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' }, |
| | | }; |
| | | |
| | | const { dialogProps, handleAdd } = useFormDialog({ |
| | | defaultFormParams: { |
| | | json: null, |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | <template> |
| | | <el-collapse v-model="activeName" accordion> |
| | | <!-- <el-collapse v-model="activeName" accordion> |
| | | <el-collapse-item |
| | | v-for="item in exceptionLogs" |
| | | :key="item.createdTime" |
| | |
| | | > |
| | | </ProForm> |
| | | </el-collapse-item> |
| | | </el-collapse> |
| | | </el-collapse> --> |
| | | <AppContainer> |
| | | <ProTableV2 |
| | | :columns="columns" |
| | | :show-pagination="false" |
| | | :table-data="exceptionLogs" |
| | | :column-render-map="columnsRenderProps" |
| | | > |
| | | <template #createdUser="{ row }"> |
| | | <el-button |
| | | type="primary" |
| | | link |
| | | @click="handleAdd({ json: JSON.parse(JSON.stringify(row.createdUser)) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | </ProTableV2> |
| | | <JsonViewerDialog v-bind="dialogProps" /> |
| | | </AppContainer> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ProForm, ProFormItemV2 } from '@bole-core/components'; |
| | | import JsonViewer from 'vue-json-viewer'; |
| | | |
| | | import { format } from '@/utils'; |
| | | import { |
| | | AppContainer, |
| | | ProTableV2, |
| | | defineColumns, |
| | | ProTableV2Props, |
| | | useFormDialog, |
| | | } from '@bole-core/components'; |
| | | import JsonViewerDialog from './JsonViewerDialog.vue'; |
| | | |
| | | defineOptions({ |
| | | name: 'ExceptionLogsView', |
| | |
| | | type Props = { |
| | | exceptionLogs: API.GetExceptionLogsQueryResultItem[]; |
| | | }; |
| | | const activeName = ref('1'); |
| | | const props = withDefaults(defineProps<Props>(), { |
| | | exceptionLogs: () => [] as API.GetExceptionLogsQueryResultItem[], |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @use '@/style/common.scss' as *; |
| | | </style> |
| | | const columns = defineColumns( |
| | | ['type', 'code', 'message', 'stackTrace', 'createdUser', 'createdTime'].map((x, index) => ({ |
| | | id: index + '', |
| | | enCode: x, |
| | | name: x, |
| | | })) |
| | | ); |
| | | |
| | | const columnsRenderProps: ProTableV2Props['columnRenderMap'] = { |
| | | createdTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' }, |
| | | }; |
| | | |
| | | const { dialogProps, handleAdd } = useFormDialog({ |
| | | defaultFormParams: { |
| | | json: null, |
| | | }, |
| | | }); |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <ProDialog title="查看" v-model="visible" destroy-on-close draggable> |
| | | <json-viewer |
| | | :copyable="true" |
| | | :boxed="true" |
| | | :preview-mode="true" |
| | | :value="form.json" |
| | | expanded |
| | | ></json-viewer> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="emit('onCancel')">取 消</el-button> |
| | | <el-button type="primary" @click="handleConfirm">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </ProDialog> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ProDialog } from '@bole-core/components'; |
| | | import JsonViewer from 'vue-json-viewer'; |
| | | |
| | | defineOptions({ |
| | | name: 'JsonViewerDialog', |
| | | }); |
| | | |
| | | // type Props = {}; |
| | | |
| | | // const props = withDefaults(defineProps<Props>(), {}); |
| | | |
| | | const visible = defineModel({ type: Boolean }); |
| | | |
| | | type Form = { |
| | | title?: string; |
| | | json: object; |
| | | }; |
| | | |
| | | const form = defineModel<Form>('form'); |
| | | |
| | | const emit = defineEmits<{ |
| | | (e: 'onConfirm'): void; |
| | | (e: 'onCancel'): void; |
| | | }>(); |
| | | |
| | | function handleConfirm() { |
| | | emit('onConfirm'); |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <el-collapse v-model="activeName" accordion> |
| | | <!-- <el-collapse v-model="activeName" accordion> |
| | | <el-collapse-item |
| | | v-for="item in resourceLogs" |
| | | :key="item.id" |
| | |
| | | > |
| | | </ProForm> |
| | | </el-collapse-item> |
| | | </el-collapse> |
| | | </el-collapse> --> |
| | | <AppContainer> |
| | | <ProTableV2 |
| | | :columns="columns" |
| | | :operationBtns="operationBtns" |
| | | :show-pagination="false" |
| | | :table-data="resourceLogs" |
| | | :column-render-map="columnsRenderProps" |
| | | > |
| | | <template #requestHeaders="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.parse(row.requestHeaders) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | <template #request="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.parse(row.request) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | <template #responseHeaders="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.parse(row.responseHeaders) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | <template #response="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.parse(row.response) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | <template #createdUser="{ row }"> |
| | | <el-button |
| | | type="primary" |
| | | link |
| | | @click="handleAdd({ json: JSON.parse(JSON.stringify(row.createdUser)) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | </ProTableV2> |
| | | <JsonViewerDialog v-bind="dialogProps" /> |
| | | </AppContainer> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ProForm, ProFormItemV2 } from '@bole-core/components'; |
| | | import { |
| | | AppContainer, |
| | | ProTableV2, |
| | | defineColumns, |
| | | defineOperationBtns, |
| | | ProTableV2Props, |
| | | useFormDialog, |
| | | } from '@bole-core/components'; |
| | | import { EnumResourceMethodText } from '@/constants'; |
| | | import JsonViewer from 'vue-json-viewer'; |
| | | import * as logRecordsServices from '@/services/api/logRecords'; |
| | | |
| | | import { format } from '@/utils'; |
| | | import { Message } from '@bole-core/core'; |
| | | import JsonViewerDialog from './JsonViewerDialog.vue'; |
| | | |
| | | defineOptions({ |
| | | name: 'ResourceLogsView', |
| | |
| | | resourceLogs: API.GetResourceLogsQueryResultItem[]; |
| | | }; |
| | | |
| | | const activeName = ref('1'); |
| | | |
| | | const props = withDefaults(defineProps<Props>(), { |
| | | resourceLogs: () => [] as API.GetResourceLogsQueryResultItem[], |
| | | }); |
| | | |
| | | const emit = defineEmits<{ |
| | | (e: 'resend'): void; |
| | | }>(); |
| | | const columns = defineColumns( |
| | | [ |
| | | 'method', |
| | | 'domain', |
| | | 'path', |
| | | 'requestHeaders', |
| | | 'request', |
| | | 'responseHeaders', |
| | | 'response', |
| | | 'isSuccess', |
| | | 'clientIpAddress', |
| | | 'refererUrl', |
| | | 'consoleLogs', |
| | | 'elapsedMilliseconds', |
| | | 'createdUser', |
| | | 'createdTime', |
| | | ].map((x, index) => ({ |
| | | id: index + '', |
| | | enCode: x, |
| | | name: x, |
| | | width: 160, |
| | | })) |
| | | ); |
| | | |
| | | const operationBtns = defineOperationBtns([ |
| | | { |
| | | data: { |
| | | enCode: 'reSendBtn', |
| | | name: '重新发送', |
| | | }, |
| | | emits: { |
| | | onClick: (row) => resend(row.id), |
| | | }, |
| | | }, |
| | | ]); |
| | | |
| | | const columnsRenderProps: ProTableV2Props['columnRenderMap'] = { |
| | | method: { type: 'enum', valueEnum: EnumResourceMethodText }, |
| | | isSuccess: { |
| | | formatter: (row: API.GetResourceLogsQueryResultItem) => { |
| | | return row.isSuccess ? '是' : '否'; |
| | | }, |
| | | }, |
| | | createdTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' }, |
| | | }; |
| | | |
| | | const { dialogProps, handleAdd } = useFormDialog({ |
| | | defaultFormParams: { |
| | | json: null, |
| | | }, |
| | | }); |
| | | |
| | | async function resend(id: string) { |
| | | try { |
| | |
| | | <template> |
| | | <el-collapse v-model="activeName" accordion> |
| | | <!-- <el-collapse v-model="activeName" accordion> |
| | | <el-collapse-item |
| | | v-for="item in threeResourceLogs" |
| | | :key="item.id" |
| | |
| | | > |
| | | </ProForm> |
| | | </el-collapse-item> |
| | | </el-collapse> |
| | | </el-collapse> --> |
| | | <AppContainer> |
| | | <ProTableV2 |
| | | :columns="columns" |
| | | :show-pagination="false" |
| | | :table-data="threeResourceLogs" |
| | | :column-render-map="columnsRenderProps" |
| | | > |
| | | <template #requestHeaders="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.parse(row.requestHeaders) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | <template #request="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.parse(row.request) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | <template #responseHeaders="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.parse(row.responseHeaders) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | <template #response="{ row }"> |
| | | <el-button type="primary" link @click="handleAdd({ json: JSON.parse(row.response) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | <template #createdUser="{ row }"> |
| | | <el-button |
| | | type="primary" |
| | | link |
| | | @click="handleAdd({ json: JSON.parse(JSON.stringify(row.createdUser)) })" |
| | | >查看</el-button |
| | | > |
| | | </template> |
| | | </ProTableV2> |
| | | <JsonViewerDialog v-bind="dialogProps" /> |
| | | </AppContainer> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ProForm, ProFormItemV2 } from '@bole-core/components'; |
| | | import { |
| | | AppContainer, |
| | | ProTableV2, |
| | | defineColumns, |
| | | ProTableV2Props, |
| | | useFormDialog, |
| | | } from '@bole-core/components'; |
| | | import { EnumResourceMethodText } from '@/constants'; |
| | | import JsonViewer from 'vue-json-viewer'; |
| | | |
| | | import { format } from '@/utils'; |
| | | import JsonViewerDialog from './JsonViewerDialog.vue'; |
| | | |
| | | defineOptions({ |
| | | name: 'ThreeResourceLogsView', |
| | |
| | | type Props = { |
| | | threeResourceLogs: API.GetThreeResourceLogsQueryResultItem[]; |
| | | }; |
| | | const activeName = ref('1'); |
| | | const props = withDefaults(defineProps<Props>(), { |
| | | threeResourceLogs: () => [] as API.GetThreeResourceLogsQueryResultItem[], |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @use '@/style/common.scss' as *; |
| | | </style> |
| | | const columns = defineColumns( |
| | | [ |
| | | 'method', |
| | | 'domain', |
| | | 'path', |
| | | 'requestHeaders', |
| | | 'request', |
| | | 'responseHeaders', |
| | | 'response', |
| | | 'isSuccess', |
| | | 'elapsedMilliseconds', |
| | | 'createdUser', |
| | | 'createdTime', |
| | | ].map((x, index) => ({ |
| | | id: index + '', |
| | | enCode: x, |
| | | name: x, |
| | | width: 160, |
| | | })) |
| | | ); |
| | | |
| | | const columnsRenderProps: ProTableV2Props['columnRenderMap'] = { |
| | | method: { type: 'enum', valueEnum: EnumResourceMethodText }, |
| | | isSuccess: { |
| | | formatter: (row: API.GetResourceLogsQueryResultItem) => { |
| | | return row.isSuccess ? '是' : '否'; |
| | | }, |
| | | }, |
| | | createdTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' }, |
| | | }; |
| | | |
| | | const { dialogProps, handleAdd } = useFormDialog({ |
| | | defaultFormParams: { |
| | | json: null, |
| | | }, |
| | | }); |
| | | </script> |