diff --git a/src/api/link/log.ts b/src/api/link/log.ts new file mode 100644 index 00000000..c0e68404 --- /dev/null +++ b/src/api/link/log.ts @@ -0,0 +1,7 @@ +import server from '@/utils/request'; + +export const queryAccess = (data: object) => + server.post(`/logger/access/_query`, data); + +export const querySystem = (data: object) => + server.post(`/logger/system/_query`, data); diff --git a/src/api/link/protocol.ts b/src/api/link/protocol.ts new file mode 100644 index 00000000..e1a88586 --- /dev/null +++ b/src/api/link/protocol.ts @@ -0,0 +1,10 @@ +import server from '@/utils/request'; + +export const detail = (id: string) => server.get(`/gateway/device/${id}`); + +export const save = (data: Object) => server.post(`/gateway/device`, data); + +export const list = (data: Object) => + server.post(`/protocol/_query`, data); + +export const remove = (id: string) => server.remove(`/gateway/device/${id}`); diff --git a/src/utils/comm.ts b/src/utils/comm.ts index e7b4363f..26d09dd9 100644 --- a/src/utils/comm.ts +++ b/src/utils/comm.ts @@ -76,3 +76,23 @@ export function getSlotVNode(slots: Slots, props: Record, pr } return (props[prop] || slots[prop]?.()) as T; } + + +/** + * 修改Select参数column的值 + * @param e // 查询参数 e + * @param column {Object} {需要修改的值: 修改后的值} + * { + username: 'context.username', + } + */ +export const modifySearchColumnValue = (e: any, column: object) => { + e.terms.forEach((item: any) => { + item.terms.forEach((t: any) => { + if (column[t.column]) { + t.column = column[t.column]; + } + }); + }); + return e; +}; \ No newline at end of file diff --git a/src/views/Log/Access/index.vue b/src/views/Log/Access/index.vue new file mode 100644 index 00000000..48679537 --- /dev/null +++ b/src/views/Log/Access/index.vue @@ -0,0 +1,255 @@ + + diff --git a/src/views/Log/System/index.vue b/src/views/Log/System/index.vue new file mode 100644 index 00000000..982cc922 --- /dev/null +++ b/src/views/Log/System/index.vue @@ -0,0 +1,246 @@ + + + + diff --git a/src/views/Log/index.vue b/src/views/Log/index.vue new file mode 100644 index 00000000..9193b21f --- /dev/null +++ b/src/views/Log/index.vue @@ -0,0 +1,28 @@ + + diff --git a/src/views/Log/typings.d.ts b/src/views/Log/typings.d.ts new file mode 100644 index 00000000..bccebed0 --- /dev/null +++ b/src/views/Log/typings.d.ts @@ -0,0 +1,31 @@ +export type AccessLogItem = { + id: string; + context: any; + describe: string; + exception: string; + httpHeaders: any; + httpMethod: string; + ip: string; + method: string; + parameters: any; + requestTime: number; + responseTime: number; + target: string; + url: string; + action: string; +}; + +export type SystemLogItem = { + id: string; + className: string; + context: any; + createTime: number; + exceptionStack: string; + level: string; + lineNumber: number; + message: string; + methodName: string; + name: string; + threadId: string; + threadName: string; +}; diff --git a/src/views/link/AccessConfig/Detail/index.vue b/src/views/link/AccessConfig/Detail/index.vue index 3211fd75..f15fcdf3 100644 --- a/src/views/link/AccessConfig/Detail/index.vue +++ b/src/views/link/AccessConfig/Detail/index.vue @@ -1,42 +1,44 @@ + diff --git a/src/views/link/Log/Access/index.vue b/src/views/link/Log/Access/index.vue deleted file mode 100644 index 9c87e8c8..00000000 --- a/src/views/link/Log/Access/index.vue +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/src/views/link/Log/System/index.vue b/src/views/link/Log/System/index.vue deleted file mode 100644 index 1fd97c0d..00000000 --- a/src/views/link/Log/System/index.vue +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/src/views/link/Log/index.vue b/src/views/link/Log/index.vue deleted file mode 100644 index 4fbaf127..00000000 --- a/src/views/link/Log/index.vue +++ /dev/null @@ -1,17 +0,0 @@ - - diff --git a/src/views/link/Protocol/Save/index.vue b/src/views/link/Protocol/Save/index.vue new file mode 100644 index 00000000..9a60a0be --- /dev/null +++ b/src/views/link/Protocol/Save/index.vue @@ -0,0 +1,37 @@ + + + + diff --git a/src/views/link/Protocol/index.vue b/src/views/link/Protocol/index.vue new file mode 100644 index 00000000..8798fe9c --- /dev/null +++ b/src/views/link/Protocol/index.vue @@ -0,0 +1,327 @@ + + + diff --git a/src/views/link/Protocol/typings.d.ts b/src/views/link/Protocol/typings.d.ts new file mode 100644 index 00000000..91ac930a --- /dev/null +++ b/src/views/link/Protocol/typings.d.ts @@ -0,0 +1,7 @@ +import type { BaseItem } from '@/utils/typings'; + +type ProtocolItem = { + state: number; + type: string; + configuration: Record; +} & BaseItem;