4 changed files with 0 additions and 430 deletions
@ -1,56 +0,0 @@ |
|||
import { FormSchema } from '/@/components/Table'; |
|||
import { BasicColumn } from '/@/components/Table'; |
|||
import { useI18n } from '/@/hooks/web/useI18n'; |
|||
|
|||
const { t } = useI18n(); |
|||
import { formatToDateTime, dateUtil } from '/@/utils/dateUtil'; |
|||
import { EsLogServiceProxy, PagingElasticSearchLogInput } from '/@/services/ServiceProxies'; |
|||
|
|||
export const searchFormSchema: FormSchema[] = [ |
|||
{ |
|||
field: 'filter', |
|||
component: 'Input', |
|||
label: t('common.key'), |
|||
labelWidth: 120, |
|||
colProps: { |
|||
span: 6, |
|||
}, |
|||
}, |
|||
{ |
|||
field: 'time', |
|||
component: 'RangePicker', |
|||
label: t('common.creationTime'), |
|||
labelWidth: 80, |
|||
colProps: { span: 6 }, |
|||
defaultValue: [dateUtil().subtract(0, 'days'), dateUtil().add(1, 'days')], |
|||
}, |
|||
]; |
|||
export const tableColumns: BasicColumn[] = [ |
|||
{ |
|||
title: t('routes.admin.logLevel'), |
|||
dataIndex: 'level', |
|||
width: 200, |
|||
}, |
|||
{ |
|||
title: t('common.creationTime'), |
|||
dataIndex: 'creationTime', |
|||
customRender: ({ text }) => { |
|||
return formatToDateTime(text); |
|||
}, |
|||
width: 200, |
|||
}, |
|||
{ |
|||
title: t('routes.admin.logContent'), |
|||
dataIndex: 'message', |
|||
}, |
|||
]; |
|||
|
|||
/** |
|||
* ES日志 |
|||
* @param request |
|||
* @returns |
|||
*/ |
|||
export async function getElasticSearchLogAsync(request: PagingElasticSearchLogInput) { |
|||
const _elasticSearchServiceProxy = new EsLogServiceProxy(); |
|||
return await _elasticSearchServiceProxy.page(request); |
|||
} |
|||
@ -1,81 +0,0 @@ |
|||
<template> |
|||
<div> |
|||
<BasicTable @register="registerTable" size="small"> |
|||
|
|||
<template #bodyCell="{ column, record }"> |
|||
<template v-if="column.key === 'message'"> |
|||
<a-button type="link" size="small" @click="lookJson(record)"> |
|||
{{ t("common.detail") }} |
|||
</a-button> |
|||
</template> |
|||
</template> |
|||
</BasicTable> |
|||
<BasicModal :canFullscreen="false" @register="registerModal" :showOkButton="false"> |
|||
{{ content }} |
|||
</BasicModal> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { defineComponent, ref } from "vue"; |
|||
import { useI18n } from "/@/hooks/web/useI18n"; |
|||
import { BasicModal, useModal } from "/@/components/Modal"; |
|||
import { BasicTable, useTable } from "/@/components/Table"; |
|||
import { |
|||
getElasticSearchLogAsync, |
|||
tableColumns, |
|||
searchFormSchema |
|||
} from "/@/views/admin/elasticSearch/ElasticSearch"; |
|||
|
|||
export default defineComponent({ |
|||
name: "ElasticSearch", |
|||
components: { |
|||
BasicTable, |
|||
BasicModal |
|||
}, |
|||
setup() { |
|||
const { t } = useI18n(); |
|||
const [registerModal, { openModal: openJsonModal }] = useModal(); |
|||
const [registerTable, { reload }] = useTable({ |
|||
columns: tableColumns, |
|||
formConfig: { |
|||
labelWidth: 100, |
|||
schemas: searchFormSchema, |
|||
fieldMapToTime: [["time", ["startCreationTime", "endCreationTime"]]] |
|||
}, |
|||
api: getElasticSearchLogAsync, |
|||
useSearchForm: true, |
|||
showTableSetting: true, |
|||
bordered: true, |
|||
canResize: true, |
|||
showIndexColumn: true, |
|||
actionColumn: { |
|||
title: t("common.action"), |
|||
dataIndex: "action", |
|||
slots: { |
|||
customRender: "action" |
|||
}, |
|||
width: 150, |
|||
fixed: "right" |
|||
} |
|||
}); |
|||
let content = ref(""); |
|||
const lookJson = async (record) => { |
|||
openJsonModal(); |
|||
content.value = record.message; |
|||
}; |
|||
|
|||
return { |
|||
t, |
|||
registerTable, |
|||
reload, |
|||
lookJson, |
|||
registerModal, |
|||
openJsonModal, |
|||
content |
|||
}; |
|||
} |
|||
}); |
|||
</script> |
|||
|
|||
<style lang="less" scoped></style> |
|||
Loading…
Reference in new issue