80 changed files with 1515 additions and 903 deletions
@ -0,0 +1,13 @@ |
|||
<template> |
|||
<div v-if="!Tools.isUndefinedOrNull(success)"> |
|||
<q-chip v-if="success === true || success === 'success'" color="green" text-color="white" :label="$t('success')" dense></q-chip> |
|||
<q-chip v-if="success !== true && success !== 'success'" color="red" text-color="white" :label="$t('failed')" dense></q-chip> |
|||
</div> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { Tools } from '@/platform/utils'; |
|||
|
|||
const props = defineProps({ |
|||
success: { type: [Boolean, String], default: true }, |
|||
}); |
|||
</script> |
@ -1,56 +1,58 @@ |
|||
<template> |
|||
<w-list-grid |
|||
:tree="true" |
|||
title="User List" |
|||
:no-action-icon="true" |
|||
:target-object-name="$t('菜单')" |
|||
:actions="[ |
|||
'query', |
|||
'refresh', |
|||
'expandAll', |
|||
'selectAll', |
|||
'separator', |
|||
'add', |
|||
'clone', |
|||
'edit', |
|||
'remove', |
|||
'removeAll', |
|||
'separator', |
|||
'detail', |
|||
|
|||
'addTop', |
|||
'addChild', |
|||
<w-grid |
|||
ref="auditLogGridRef" |
|||
:title="$t('system.user.grid.title')" |
|||
selection="multiple" |
|||
:data-url="Environment.apiContextPath('/api/system/monitor/auditlog')" |
|||
:query-form-fields="[ |
|||
{ name: 'code', label: $t('code'), type: 'text' }, |
|||
{ name: 'message', label: $t('i18nMessage'), type: 'text' }, |
|||
{ name: 'lang', label: $t('language'), type: 'select' }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom'), type: 'select' }, |
|||
]" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['query', 'refresh', 'separator', 'view', 'export']" |
|||
:columns="[ |
|||
{ width: 100, name: 'status', label: $t('status'), format: Formater.successTag() }, |
|||
{ width: 60, name: 'action', label: $t('action') }, |
|||
{ width: 100, name: 'startDate', label: $t('startDate') }, |
|||
{ width: 60, name: 'executeTime', label: $t('executeTime') }, |
|||
{ width: 80, name: 'loginName', label: $t('loginName') }, |
|||
{ width: 60, name: 'httpMethod', label: $t('httpMethod') }, |
|||
{ width: 200, name: 'url', label: $t('url') }, |
|||
{ width: 100, name: 'ip', label: $t('ip') }, |
|||
{ width: 100, name: 'className', label: $t('className') }, |
|||
{ width: 100, name: 'methodName', label: $t('methodName') }, |
|||
{ width: 100, name: 'oldValue', label: $t('oldValue') }, |
|||
{ width: 100, name: 'newValue', label: $t('newValue') }, |
|||
{ width: 100, name: 'exception', label: $t('exception') }, |
|||
{ width: 100, name: 'exceptionMessage', label: $t('exceptionMessage') }, |
|||
{ width: 100, name: 'exceptionStackTrace', label: $t('exceptionStackTrace') }, |
|||
]" |
|||
:columns="columns" |
|||
:auto-fetch-data="true" |
|||
:data-url="Environment.apiContextPath('/api/system/menu/allMenus')" |
|||
></w-list-grid> |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'lang', label: $t('language') }, |
|||
{ name: 'message', label: $t('i18nMessage') }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ name: 'creator', label: $t('creator') }, |
|||
{ name: 'createDate', label: $t('createDate') }, |
|||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: $t('lastModifyDate') }, |
|||
{ name: 'corporationCode', label: $t('corporationCode') }, |
|||
], |
|||
}, |
|||
}" |
|||
@row-click="(evt, row, index) => {}" |
|||
> |
|||
</w-grid> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import { useI18n } from 'vue-i18n'; |
|||
import { Environment } from '@/platform'; |
|||
import { Environment, axios, Formater, Options } from '@/platform'; |
|||
|
|||
const { t } = useI18n(); |
|||
|
|||
const columns = [ |
|||
{ |
|||
name: 'name', |
|||
required: true, |
|||
label: t('name'), |
|||
align: 'left', |
|||
field: 'name', |
|||
sortable: true, |
|||
format: (value, data) => { |
|||
return t(data.titleI18nKey); |
|||
}, |
|||
}, |
|||
{ name: 'type', align: 'center', label: 'type', field: 'type', sortable: true }, |
|||
{ name: 'enable', label: 'enable', field: 'enable', sortable: true }, |
|||
{ name: 'dataComeFrom', label: 'dataComeFrom', field: 'dataComeFrom' }, |
|||
{ name: 'lastModifier', label: 'lastModifier', field: 'lastModifier' }, |
|||
{ name: 'lastModifyDate', label: 'lastModifyDate', field: 'lastModifyDate' }, |
|||
{ name: 'corporationCode', label: 'corporationCode', field: 'corporationCode', sortable: true }, |
|||
]; |
|||
const auditLogGridRef = ref(); |
|||
</script> |
|||
|
@ -1,56 +1,58 @@ |
|||
<template> |
|||
<w-list-grid |
|||
:tree="true" |
|||
title="User List" |
|||
:no-action-icon="true" |
|||
:target-object-name="$t('菜单')" |
|||
:actions="[ |
|||
'query', |
|||
'refresh', |
|||
'expandAll', |
|||
'selectAll', |
|||
'separator', |
|||
'add', |
|||
'clone', |
|||
'edit', |
|||
'remove', |
|||
'removeAll', |
|||
'separator', |
|||
'detail', |
|||
|
|||
'addTop', |
|||
'addChild', |
|||
<w-grid |
|||
ref="auditLogGridRef" |
|||
:title="$t('system.user.grid.title')" |
|||
selection="multiple" |
|||
:data-url="Environment.apiContextPath('/api/system/monitor/auditlog')" |
|||
:query-form-fields="[ |
|||
{ name: 'code', label: $t('code'), type: 'text' }, |
|||
{ name: 'message', label: $t('i18nMessage'), type: 'text' }, |
|||
{ name: 'lang', label: $t('language'), type: 'select' }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom'), type: 'select' }, |
|||
]" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['query', 'refresh', 'separator', 'view', 'export']" |
|||
:columns="[ |
|||
{ width: 100, name: 'status', label: $t('status'), format: Formater.successTag() }, |
|||
{ width: 60, name: 'action', label: $t('action') }, |
|||
{ width: 100, name: 'startDate', label: $t('startDate') }, |
|||
{ width: 60, name: 'executeTime', label: $t('executeTime') }, |
|||
{ width: 80, name: 'loginName', label: $t('loginName') }, |
|||
{ width: 60, name: 'httpMethod', label: $t('httpMethod') }, |
|||
{ width: 200, name: 'url', label: $t('url') }, |
|||
{ width: 100, name: 'ip', label: $t('ip') }, |
|||
{ width: 100, name: 'className', label: $t('className') }, |
|||
{ width: 100, name: 'methodName', label: $t('methodName') }, |
|||
{ width: 100, name: 'oldValue', label: $t('oldValue') }, |
|||
{ width: 100, name: 'newValue', label: $t('newValue') }, |
|||
{ width: 100, name: 'exception', label: $t('exception') }, |
|||
{ width: 100, name: 'exceptionMessage', label: $t('exceptionMessage') }, |
|||
{ width: 100, name: 'exceptionStackTrace', label: $t('exceptionStackTrace') }, |
|||
]" |
|||
:columns="columns" |
|||
:auto-fetch-data="true" |
|||
:data-url="Environment.apiContextPath('/api/system/menu/allMenus')" |
|||
></w-list-grid> |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'lang', label: $t('language') }, |
|||
{ name: 'message', label: $t('i18nMessage') }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ name: 'creator', label: $t('creator') }, |
|||
{ name: 'createDate', label: $t('createDate') }, |
|||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: $t('lastModifyDate') }, |
|||
{ name: 'corporationCode', label: $t('corporationCode') }, |
|||
], |
|||
}, |
|||
}" |
|||
@row-click="(evt, row, index) => {}" |
|||
> |
|||
</w-grid> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import { useI18n } from 'vue-i18n'; |
|||
import { Environment } from '@/platform'; |
|||
import { Environment, axios, Formater, Options } from '@/platform'; |
|||
|
|||
const { t } = useI18n(); |
|||
|
|||
const columns = [ |
|||
{ |
|||
name: 'name', |
|||
required: true, |
|||
label: t('name'), |
|||
align: 'left', |
|||
field: 'name', |
|||
sortable: true, |
|||
format: (value, data) => { |
|||
return t(data.titleI18nKey); |
|||
}, |
|||
}, |
|||
{ name: 'type', align: 'center', label: 'type', field: 'type', sortable: true }, |
|||
{ name: 'enable', label: 'enable', field: 'enable', sortable: true }, |
|||
{ name: 'dataComeFrom', label: 'dataComeFrom', field: 'dataComeFrom' }, |
|||
{ name: 'lastModifier', label: 'lastModifier', field: 'lastModifier' }, |
|||
{ name: 'lastModifyDate', label: 'lastModifyDate', field: 'lastModifyDate' }, |
|||
{ name: 'corporationCode', label: 'corporationCode', field: 'corporationCode', sortable: true }, |
|||
]; |
|||
const auditLogGridRef = ref(); |
|||
</script> |
|||
|
@ -1,17 +0,0 @@ |
|||
package io.sc.platform.core.audit; |
|||
|
|||
/** |
|||
* 审计日志分类常量 |
|||
*/ |
|||
public class AuditLogAction { |
|||
public static final String ADD ="io.sc.platform.core.audit.AuditLogAction.ADD"; |
|||
public static final String REMOVE ="io.sc.platform.core.audit.AuditLogAction.REMOVE"; |
|||
public static final String UPDATE ="io.sc.platform.core.audit.AuditLogAction.UPDATE"; |
|||
public static final String QUERY ="io.sc.platform.core.audit.AuditLogAction.QUERY"; |
|||
public static final String FIND_ONE ="io.sc.platform.core.audit.AuditLogAction.FIND_ONE"; |
|||
public static final String EXPORT ="io.sc.platform.core.audit.AuditLogAction.EXPORT"; |
|||
public static final String LOGIN ="io.sc.platform.core.audit.AuditLogAction.LOGIN"; |
|||
public static final String LOGOUT ="io.sc.platform.core.audit.AuditLogAction.LOGOUT"; |
|||
|
|||
private AuditLogAction(){} |
|||
} |
@ -0,0 +1,23 @@ |
|||
package io.sc.platform.core.enums; |
|||
|
|||
public enum AuditLogAction { |
|||
UNKNOWN("UNKNOWN"), |
|||
ADD("ADD"), |
|||
REMOVE("REMOVE"), |
|||
UPDATE("UPDATE"), |
|||
QUERY("QUERY"), |
|||
FIND_ONE("FIND_ONE"), |
|||
EXPORT("EXPORT"), |
|||
LOGIN("LOGIN"), |
|||
LOGOUT("LOGOUT"); |
|||
|
|||
private final String value; |
|||
|
|||
private AuditLogAction(String value){ |
|||
this.value =value; |
|||
} |
|||
|
|||
public String getValue(){ |
|||
return this.value; |
|||
} |
|||
} |
@ -1,4 +1,4 @@ |
|||
package io.sc.platform.core.audit; |
|||
package io.sc.platform.core.enums; |
|||
|
|||
/** |
|||
* 审计日志状态枚举 |
@ -1,10 +1,9 @@ |
|||
package io.sc.platform.core.support; |
|||
package io.sc.platform.core.enums; |
|||
|
|||
/** |
|||
* 日志级别枚举 |
|||
*/ |
|||
public enum LogLevel { |
|||
OFF, //关闭
|
|||
ERROR, //错误
|
|||
WARN, //警告
|
|||
INFO, //信息
|
@ -1,21 +1,21 @@ |
|||
io.sc.platform.core.support.LogLevel.OFF=OFF |
|||
io.sc.platform.core.support.LogLevel.ERROR=ERROR |
|||
io.sc.platform.core.support.LogLevel.WARN=WARN |
|||
io.sc.platform.core.support.LogLevel.INFO=INFO |
|||
io.sc.platform.core.support.LogLevel.DEBUG=DEBUG |
|||
io.sc.platform.core.support.LogLevel.TRACE=TRACE |
|||
io.sc.platform.core.enums.LogLevel.ERROR=ERROR |
|||
io.sc.platform.core.enums.LogLevel.WARN=WARN |
|||
io.sc.platform.core.enums.LogLevel.INFO=INFO |
|||
io.sc.platform.core.enums.LogLevel.DEBUG=DEBUG |
|||
io.sc.platform.core.enums.LogLevel.TRACE=TRACE |
|||
|
|||
io.sc.platform.core.audit.AuditLogStatus.SUCCESS=Success |
|||
io.sc.platform.core.audit.AuditLogStatus.FAILED=Failed |
|||
io.sc.platform.core.enums.AuditLogStatus.SUCCESS=Success |
|||
io.sc.platform.core.enums.AuditLogStatus.FAILED=Failed |
|||
|
|||
io.sc.platform.core.audit.AuditLogAction.ADD=Add |
|||
io.sc.platform.core.audit.AuditLogAction.REMOVE=Remove |
|||
io.sc.platform.core.audit.AuditLogAction.UPDATE=Update |
|||
io.sc.platform.core.audit.AuditLogAction.QUERY=Query |
|||
io.sc.platform.core.audit.AuditLogAction.FIND_ONE=Find One |
|||
io.sc.platform.core.audit.AuditLogAction.EXPORT=Export |
|||
io.sc.platform.core.audit.AuditLogAction.LOGIN=Login |
|||
io.sc.platform.core.audit.AuditLogAction.LOGOUT=Logout |
|||
io.sc.platform.core.enums.AuditLogAction.UNKNOWN=Unknown |
|||
io.sc.platform.core.enums.AuditLogAction.ADD=Add |
|||
io.sc.platform.core.enums.AuditLogAction.REMOVE=Remove |
|||
io.sc.platform.core.enums.AuditLogAction.UPDATE=Update |
|||
io.sc.platform.core.enums.AuditLogAction.QUERY=Query |
|||
io.sc.platform.core.enums.AuditLogAction.FIND_ONE=Find One |
|||
io.sc.platform.core.enums.AuditLogAction.EXPORT=Export |
|||
io.sc.platform.core.enums.AuditLogAction.LOGIN=Login |
|||
io.sc.platform.core.enums.AuditLogAction.LOGOUT=Logout |
|||
|
|||
io.sc.platform.core.enums.Language.en=English |
|||
io.sc.platform.core.enums.Language.zh_CN=\u7B80\u4F53\u4E2D\u6587 |
|||
|
@ -1,21 +1,21 @@ |
|||
io.sc.platform.core.support.LogLevel.OFF=\u95DC\u9589 |
|||
io.sc.platform.core.support.LogLevel.ERROR=\u932F\u8AA4 |
|||
io.sc.platform.core.support.LogLevel.WARN=\u8B66\u544A |
|||
io.sc.platform.core.support.LogLevel.INFO=\u4FE1\u606F |
|||
io.sc.platform.core.support.LogLevel.DEBUG=\u8ABF\u8A66 |
|||
io.sc.platform.core.support.LogLevel.TRACE=\u8DDF\u8E64 |
|||
io.sc.platform.core.enums.LogLevel.ERROR=\u932F\u8AA4 |
|||
io.sc.platform.core.enums.LogLevel.WARN=\u8B66\u544A |
|||
io.sc.platform.core.enums.LogLevel.INFO=\u4FE1\u606F |
|||
io.sc.platform.core.enums.LogLevel.DEBUG=\u8ABF\u8A66 |
|||
io.sc.platform.core.enums.LogLevel.TRACE=\u8DDF\u8E64 |
|||
|
|||
io.sc.platform.core.audit.AuditLogStatus.SUCCESS=\u6210\u529F |
|||
io.sc.platform.core.audit.AuditLogStatus.FAILED=\u5931\u6557 |
|||
io.sc.platform.core.enums.AuditLogStatus.SUCCESS=\u6210\u529F |
|||
io.sc.platform.core.enums.AuditLogStatus.FAILED=\u5931\u6557 |
|||
|
|||
io.sc.platform.core.audit.AuditLogAction.ADD=\u65B0\u589E |
|||
io.sc.platform.core.audit.AuditLogAction.REMOVE=\u522A\u9664 |
|||
io.sc.platform.core.audit.AuditLogAction.UPDATE=\u66F4\u65B0 |
|||
io.sc.platform.core.audit.AuditLogAction.QUERY=\u67E5\u8A62 |
|||
io.sc.platform.core.audit.AuditLogAction.FIND_ONE=\u67E5\u627E\u55AE\u500B |
|||
io.sc.platform.core.audit.AuditLogAction.EXPORT=\u5C0E\u51FA |
|||
io.sc.platform.core.audit.AuditLogAction.LOGIN=\u767B\u9304 |
|||
io.sc.platform.core.audit.AuditLogAction.LOGOUT=\u9000\u51FA |
|||
io.sc.platform.core.enums.AuditLogAction.UNKNOWN=\u672A\u77E5 |
|||
io.sc.platform.core.enums.AuditLogAction.ADD=\u65B0\u589E |
|||
io.sc.platform.core.enums.AuditLogAction.REMOVE=\u522A\u9664 |
|||
io.sc.platform.core.enums.AuditLogAction.UPDATE=\u66F4\u65B0 |
|||
io.sc.platform.core.enums.AuditLogAction.QUERY=\u67E5\u8A62 |
|||
io.sc.platform.core.enums.AuditLogAction.FIND_ONE=\u67E5\u627E\u55AE\u500B |
|||
io.sc.platform.core.enums.AuditLogAction.EXPORT=\u5C0E\u51FA |
|||
io.sc.platform.core.enums.AuditLogAction.LOGIN=\u767B\u9304 |
|||
io.sc.platform.core.enums.AuditLogAction.LOGOUT=\u9000\u51FA |
|||
|
|||
io.sc.platform.core.enums.Language.en=English |
|||
io.sc.platform.core.enums.Language.zh_CN=\u7B80\u4F53\u4E2D\u6587 |
|||
|
@ -1,21 +1,21 @@ |
|||
io.sc.platform.core.support.LogLevel.OFF=\u5173\u95ED |
|||
io.sc.platform.core.support.LogLevel.ERROR=\u9519\u8BEF |
|||
io.sc.platform.core.support.LogLevel.WARN=\u8B66\u544A |
|||
io.sc.platform.core.support.LogLevel.INFO=\u4FE1\u606F |
|||
io.sc.platform.core.support.LogLevel.DEBUG=\u8C03\u8BD5 |
|||
io.sc.platform.core.support.LogLevel.TRACE=\u8DDF\u8E2A |
|||
io.sc.platform.core.enums.LogLevel.ERROR=\u9519\u8BEF |
|||
io.sc.platform.core.enums.LogLevel.WARN=\u8B66\u544A |
|||
io.sc.platform.core.enums.LogLevel.INFO=\u4FE1\u606F |
|||
io.sc.platform.core.enums.LogLevel.DEBUG=\u8C03\u8BD5 |
|||
io.sc.platform.core.enums.LogLevel.TRACE=\u8DDF\u8E2A |
|||
|
|||
io.sc.platform.core.audit.AuditLogStatus.SUCCESS=\u6210\u529F |
|||
io.sc.platform.core.audit.AuditLogStatus.FAILED=\u5931\u8D25 |
|||
io.sc.platform.core.enums.AuditLogStatus.SUCCESS=\u6210\u529F |
|||
io.sc.platform.core.enums.AuditLogStatus.FAILED=\u5931\u8D25 |
|||
|
|||
io.sc.platform.core.audit.AuditLogAction.ADD=\u65B0\u589E |
|||
io.sc.platform.core.audit.AuditLogAction.REMOVE=\u522A\u9664 |
|||
io.sc.platform.core.audit.AuditLogAction.UPDATE=\u66F4\u65B0 |
|||
io.sc.platform.core.audit.AuditLogAction.QUERY=\u67E5\u8BE2 |
|||
io.sc.platform.core.audit.AuditLogAction.FIND_ONE=\u67E5\u627E\u5355\u4E2A |
|||
io.sc.platform.core.audit.AuditLogAction.EXPORT=\u5BFC\u51FA |
|||
io.sc.platform.core.audit.AuditLogAction.LOGIN=\u767B\u5F55 |
|||
io.sc.platform.core.audit.AuditLogAction.LOGOUT=\u9000\u51FA |
|||
io.sc.platform.core.enums.AuditLogAction.UNKNOWN=\u672A\u77E5 |
|||
io.sc.platform.core.enums.AuditLogAction.ADD=\u65B0\u589E |
|||
io.sc.platform.core.enums.AuditLogAction.REMOVE=\u522A\u9664 |
|||
io.sc.platform.core.enums.AuditLogAction.UPDATE=\u66F4\u65B0 |
|||
io.sc.platform.core.enums.AuditLogAction.QUERY=\u67E5\u8BE2 |
|||
io.sc.platform.core.enums.AuditLogAction.FIND_ONE=\u67E5\u627E\u5355\u4E2A |
|||
io.sc.platform.core.enums.AuditLogAction.EXPORT=\u5BFC\u51FA |
|||
io.sc.platform.core.enums.AuditLogAction.LOGIN=\u767B\u5F55 |
|||
io.sc.platform.core.enums.AuditLogAction.LOGOUT=\u9000\u51FA |
|||
|
|||
io.sc.platform.core.enums.Language.en=English |
|||
io.sc.platform.core.enums.Language.zh_CN=\u7B80\u4F53\u4E2D\u6587 |
|||
|
@ -1,4 +1,79 @@ |
|||
<template> |
|||
<div>Menus</div> |
|||
<w-grid |
|||
:tree="true" |
|||
dense-body |
|||
:title="$t('menu.developer.plugin.menus')" |
|||
:data-url="Environment.apiContextPath('/api/system/menu/getAllMenuPlugins')" |
|||
primary-key="id" |
|||
foreign-key="parentId" |
|||
selection="multiple" |
|||
:checkbox-selection="false" |
|||
:pageable="false" |
|||
:full-screen-button="false" |
|||
:tree-icon=" |
|||
(row) => { |
|||
if (row.type === 'SEPARATOR') { |
|||
return { name: 'bi-dash-lg' }; |
|||
} else if (row.type === 'ROUTE_ACTION') { |
|||
return { name: 'sym_o_crop_16_9' }; |
|||
} else { |
|||
return { name: row.icon }; |
|||
} |
|||
} |
|||
" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
|||
:columns="[ |
|||
{ |
|||
width: 400, |
|||
name: 'titleI18nKey', |
|||
label: $t('name'), |
|||
sortable: false, |
|||
format: (value, row) => { |
|||
if (row.type === 'SEPARATOR') { |
|||
return `<hr style='width:100px'/>`; |
|||
} else if (row.type === 'ROUTE_ACTION') { |
|||
return $t(row.i18nKey); |
|||
} else { |
|||
return $t(value); |
|||
} |
|||
}, |
|||
}, |
|||
{ width: 100, name: 'order', label: $t('order'), align: 'right', sortable: false }, |
|||
{ width: '100%', name: 'configurationFileUrl', label: $t('url'), sortable: false }, |
|||
]" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'parentId', label: $t('parentId') }, |
|||
{ |
|||
name: 'titleI18nKey', |
|||
label: $t('system.menu.grid.entity.titleI18nKey'), |
|||
format: (value) => { |
|||
return value; |
|||
}, |
|||
}, |
|||
{ name: 'icon', label: $t('icon') }, |
|||
{ name: 'order', label: $t('order') }, |
|||
{ name: 'javaScript', label: $t('system.menu.grid.entity.javaScript') }, |
|||
{ name: 'url', label: $t('system.menu.grid.entity.url') }, |
|||
{ name: 'urlOpenType', label: $t('system.menu.grid.entity.urlOpenType') }, |
|||
{ name: 'routeName', label: $t('system.menu.grid.entity.routeName') }, |
|||
{ |
|||
name: 'routeQuery', |
|||
label: $t('system.menu.grid.entity.routeQuery'), |
|||
format: (value) => { |
|||
return JSON.stringify(value); |
|||
}, |
|||
}, |
|||
{ name: 'configurationFileUrl', label: $t('url') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"></script> |
|||
<script setup lang="ts"> |
|||
import { Environment } from 'platform-core'; |
|||
</script> |
|||
|
@ -0,0 +1,48 @@ |
|||
package io.sc.platform.security.handler; |
|||
|
|||
import io.sc.platform.core.audit.AuditLog; |
|||
import io.sc.platform.core.enums.AuditLogAction; |
|||
import io.sc.platform.core.enums.AuditLogStatus; |
|||
import io.sc.platform.core.service.AuditLogPersistenter; |
|||
import io.sc.platform.core.service.AuditLogPersistenterManager; |
|||
import io.sc.platform.core.util.IpUtil; |
|||
import io.sc.platform.security.support.SecurityUser; |
|||
import io.sc.platform.security.util.SecurityUtil; |
|||
import org.springframework.security.core.Authentication; |
|||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; |
|||
import org.springframework.security.web.authentication.logout.LogoutFilter; |
|||
import org.springframework.security.web.authentication.logout.LogoutHandler; |
|||
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; |
|||
|
|||
import javax.servlet.ServletException; |
|||
import javax.servlet.http.HttpServletRequest; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.IOException; |
|||
|
|||
public class PlatformLogoutSuccessHandler implements LogoutSuccessHandler { |
|||
private AuditLogPersistenterManager auditLogPersistenterManager; |
|||
|
|||
public PlatformLogoutSuccessHandler(AuditLogPersistenterManager auditLogPersistenterManager){ |
|||
this.auditLogPersistenterManager =auditLogPersistenterManager; |
|||
} |
|||
|
|||
@Override |
|||
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { |
|||
AuditLogPersistenter logger =auditLogPersistenterManager.getAuditLogPersister(); |
|||
if(logger!=null){ |
|||
AuditLog auditLog =new AuditLog(); |
|||
auditLog.setAction(AuditLogAction.LOGOUT.getValue()); |
|||
auditLog.setExecuteTime(10L); |
|||
auditLog.setClassName(LogoutHandler.class.getName()); |
|||
auditLog.setMethodName("logout"); |
|||
auditLog.setHttpMethod("POST"); |
|||
auditLog.setStatus(AuditLogStatus.SUCCESS.getValue()); |
|||
auditLog.setUrl(request.getRequestURL().toString()); |
|||
if(authentication!=null && authentication.getPrincipal() instanceof SecurityUser){ |
|||
auditLog.setLoginName(((SecurityUser)authentication.getPrincipal()).getLoginName()); |
|||
} |
|||
auditLog.setIp(IpUtil.getRemoteIp(request)); |
|||
logger.log(auditLog); |
|||
} |
|||
} |
|||
} |
@ -1,70 +1,102 @@ |
|||
<template> |
|||
<div> |
|||
<platform-grid |
|||
<w-grid |
|||
ref="i18nGridRef" |
|||
:table-props="{ borderded: false, flat: true }" |
|||
:table-title="i18nConfigure.tableTitle" |
|||
:table-init-load-data="i18nConfigure.tableInitLoadData" |
|||
:table-row-key="i18nConfigure.tableRowKey" |
|||
:table-data-url="i18nConfigure.tableDataUrl" |
|||
:table-columns="i18nConfigure.tableColumns" |
|||
:table-buttons="i18nConfigure.tableButtons" |
|||
:add-form-props="i18nConfigure.addFormProps" |
|||
:table-show-sort-no="false" |
|||
:table-dense="true" |
|||
:table-row-drag="true" |
|||
:table-pagination="i18nConfigure.tablePagination" |
|||
> |
|||
</platform-grid> |
|||
</div> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { onMounted, ref } from 'vue'; |
|||
import { useI18n } from 'vue-i18n'; |
|||
import { Environment, axios } from 'platform-core'; |
|||
|
|||
const { t } = useI18n(); |
|||
|
|||
const Language = { |
|||
en: '英文', |
|||
zh_CN: '简体中文', |
|||
tw_CN: '繁体中文', |
|||
}; |
|||
|
|||
const LanguageOptions = [ |
|||
{ label: '英文', value: 'en' }, |
|||
{ label: '简体中文', value: 'zh_CN' }, |
|||
{ label: '繁体中文', value: 'tw_CN' }, |
|||
]; |
|||
|
|||
const i18nGridRef = ref(); |
|||
const i18nConfigure = { |
|||
tableTitle: '多语言消息列表', |
|||
tableInitLoadData: true, |
|||
tableRowKey: 'id', |
|||
tableDataUrl: Environment.apiContextPath('/api/system/i18n'), |
|||
tablePagination: { |
|||
sortBy: 'code', |
|||
descending: false, |
|||
reqPageStart: 0, |
|||
rowsPerPage: 20, |
|||
:title="$t('system.user.grid.title')" |
|||
selection="multiple" |
|||
:data-url="Environment.apiContextPath('/api/system/i18n')" |
|||
:query-form-fields="[ |
|||
{ name: 'code', label: $t('code'), type: 'text' }, |
|||
{ name: 'message', label: $t('i18nMessage'), type: 'text' }, |
|||
{ name: 'lang', label: $t('language'), type: 'select', options: Options.enum(LanguageEnum), queryOperator: 'equals' }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom'), type: 'select', options: Options.enum(DataComeFromEnum), queryOperator: 'equals' }, |
|||
]" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="[ |
|||
'query', |
|||
'refresh', |
|||
'separator', |
|||
'add', |
|||
'clone', |
|||
'edit', |
|||
'remove', |
|||
{ |
|||
name: 'deleteAll', |
|||
label: $t('deleteAll'), |
|||
icon: 'bi-trash3', |
|||
click: () => { |
|||
DialogManager.confirm($t('system.i18n.grid.toolbar.removeAll.tip'), () => { |
|||
axios.post(Environment.apiContextPath('/api/system/i18n/removeMessages')).then(() => { |
|||
NotifyManager.info($t('operationSuccess')); |
|||
i18nGridRef.refresh(); |
|||
}); |
|||
}); |
|||
}, |
|||
}, |
|||
tableColumns: [ |
|||
{ name: 'code', label: t('code') }, |
|||
{ name: 'lang', label: t('lang'), format: (value) => Language[value] }, |
|||
{ name: 'message', label: t('message') }, |
|||
'separator', |
|||
{ |
|||
name: 'importAll', |
|||
label: $t('import'), |
|||
icon: 'bi-arrow-right-circle', |
|||
click: () => { |
|||
DialogManager.confirm($t('system.i18n.grid.toolbar.importAll.tip'), () => { |
|||
axios.post(Environment.apiContextPath('/api/system/i18n/importMessages')).then(() => { |
|||
NotifyManager.info($t('operationSuccess')); |
|||
i18nGridRef.refresh(); |
|||
}); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
'export', |
|||
]" |
|||
:columns="[ |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'lang', label: $t('language'), format: Formater.enum(LanguageEnum) }, |
|||
{ name: 'message', label: $t('i18nMessage') }, |
|||
{ width: 100, name: 'dataComeFrom', label: $t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
|||
{ width: 100, name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ width: 100, name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.dateOnly() }, |
|||
]" |
|||
:editor="{ |
|||
dialog: { |
|||
width: '600px', |
|||
height: '300px', |
|||
}, |
|||
form: { |
|||
colsNum: 1, |
|||
fields: [ |
|||
{ name: 'code', label: $t('code'), type: 'text', required: true }, |
|||
{ name: 'lang', label: $t('language'), type: 'select', required: true, options: Options.enum(LanguageEnum) }, |
|||
{ name: 'message', label: $t('i18nMessage'), type: 'text', required: true }, |
|||
], |
|||
tableButtons: ['refresh', 'add', 'edit', 'delete'], |
|||
addFormProps: { |
|||
dialogInitWidth: '50%', |
|||
dialogInitHeight: '90%', |
|||
formColsNumber: 1, |
|||
formColsAuto: false, |
|||
formFields: [ |
|||
{ modelName: 'code', label: t('code'), type: 'text', required: true }, |
|||
{ modelName: 'lang', label: t('lang'), type: 'select', required: true, options: LanguageOptions }, |
|||
{ modelName: 'message', label: t('message'), type: 'text', required: true }, |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'lang', label: $t('language') }, |
|||
{ name: 'message', label: $t('i18nMessage') }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ name: 'creator', label: $t('creator') }, |
|||
{ name: 'createDate', label: $t('createDate') }, |
|||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: $t('lastModifyDate') }, |
|||
{ name: 'corporationCode', label: $t('corporationCode') }, |
|||
], |
|||
}, |
|||
}; |
|||
}" |
|||
@row-click="(evt, row, index) => {}" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import { axios, Environment, EnumTools, Formater, Options, DialogManager, NotifyManager } from 'platform-core'; |
|||
|
|||
const i18nGridRef = ref(); |
|||
const DataComeFromEnum = await EnumTools.fetch('io.sc.platform.orm.api.enums.DataComeFrom'); |
|||
const LanguageEnum = await EnumTools.fetch('io.sc.platform.core.enums.Language'); |
|||
</script> |
|||
|
@ -0,0 +1,135 @@ |
|||
<template> |
|||
<w-dialog |
|||
ref="dialogRef" |
|||
:title="$t('system.shared.importMenuPlugin.dialog.title')" |
|||
width="800px" |
|||
height="500px" |
|||
:can-maximize="false" |
|||
:buttons="[ |
|||
{ |
|||
label: $t('confirm'), |
|||
click: () => { |
|||
const ids = Tools.extractProperties(gridRef.getSelectedRows(), 'id'); |
|||
emit('afterSelected', ids, dialogRef); |
|||
}, |
|||
}, |
|||
]" |
|||
> |
|||
<div class="px-2"> |
|||
<w-grid |
|||
:tree="true" |
|||
dense-body |
|||
:data-url="Environment.apiContextPath('/api/system/menu/getAllMenuPlugins')" |
|||
primary-key="id" |
|||
foreign-key="parentId" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
tick-strategy="strict" |
|||
:pageable="false" |
|||
:config-button="false" |
|||
:full-screen-button="false" |
|||
:tree-icon=" |
|||
(row) => { |
|||
if (row.type === 'SEPARATOR') { |
|||
return { name: 'bi-dash-lg' }; |
|||
} else if (row.type === 'ROUTE_ACTION') { |
|||
return { name: 'sym_o_crop_16_9' }; |
|||
} else { |
|||
return { name: row.icon }; |
|||
} |
|||
} |
|||
" |
|||
:columns="[ |
|||
{ |
|||
width: '100%', |
|||
name: 'titleI18nKey', |
|||
label: $t('name'), |
|||
sortable: false, |
|||
format: (value, row) => { |
|||
if (row.type === 'SEPARATOR') { |
|||
return `<hr style='width:100px'/>`; |
|||
} else if (row.type === 'ROUTE_ACTION') { |
|||
return $t(row.i18nKey); |
|||
} else { |
|||
return $t(value); |
|||
} |
|||
}, |
|||
}, |
|||
{ width: 100, name: 'order', label: $t('order'), align: 'right', sortable: false }, |
|||
]" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'parentId', label: $t('parentId') }, |
|||
{ |
|||
name: 'titleI18nKey', |
|||
label: $t('system.menu.grid.entity.titleI18nKey'), |
|||
format: (value) => { |
|||
return value; |
|||
}, |
|||
}, |
|||
{ name: 'icon', label: $t('icon') }, |
|||
{ name: 'order', label: $t('order') }, |
|||
{ name: 'javaScript', label: $t('system.menu.grid.entity.javaScript') }, |
|||
{ name: 'url', label: $t('system.menu.grid.entity.url') }, |
|||
{ name: 'urlOpenType', label: $t('system.menu.grid.entity.urlOpenType') }, |
|||
{ name: 'routeName', label: $t('system.menu.grid.entity.routeName') }, |
|||
{ |
|||
name: 'routeQuery', |
|||
label: $t('system.menu.grid.entity.routeQuery'), |
|||
format: (value) => { |
|||
return JSON.stringify(value); |
|||
}, |
|||
}, |
|||
{ name: 'configurationFileUrl', label: $t('url') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</div> |
|||
</w-dialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, nextTick } from 'vue'; |
|||
import { useI18n } from 'vue-i18n'; |
|||
import { Environment, Tools, EnumTools, Options, Formater } from 'platform-core'; |
|||
|
|||
const props = defineProps({ |
|||
opener: { type: Object, default: undefined }, |
|||
fetchDataUrl: { type: String, default: '' }, |
|||
foreignKey: { type: String, default: '' }, |
|||
foreignValue: { type: String, default: '' }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'afterSelected', ids: string[], dialogComponent: any): void; |
|||
}>(); |
|||
|
|||
const { t } = useI18n(); |
|||
|
|||
const dialogRef = ref(); |
|||
const gridRef = ref(); |
|||
const foreignKeyRef = ref(); |
|||
|
|||
const open = (foreignKey: string) => { |
|||
foreignKeyRef.value = foreignKey; |
|||
dialogRef.value.show(); |
|||
|
|||
nextTick(() => { |
|||
gridRef.value.refresh(); |
|||
}); |
|||
}; |
|||
|
|||
const close = () => { |
|||
dialogRef.value.hide(); |
|||
}; |
|||
|
|||
defineExpose({ |
|||
open, |
|||
close, |
|||
}); |
|||
|
|||
const DataComeFromEnum = await EnumTools.fetch('io.sc.platform.orm.api.enums.DataComeFrom'); |
|||
</script> |
@ -1,94 +1,88 @@ |
|||
<template> |
|||
<div> |
|||
<platform-grid |
|||
ref="auditlogGridRef" |
|||
:table-props="{ borderded: false, flat: true }" |
|||
:query-form-cols-number="auditlogConfigure.queryFormColsNumber" |
|||
:query-form-cols-auto="auditlogConfigure.queryFormColsAuto" |
|||
:table-title="auditlogConfigure.tableTitle" |
|||
:table-row-key="auditlogConfigure.tableRowKey" |
|||
:table-init-load-data="auditlogConfigure.tableInitLoadData" |
|||
:table-data-url="auditlogConfigure.tableDataUrl" |
|||
:table-show-sort-no="false" |
|||
:table-columns="auditlogConfigure.tableColumns" |
|||
:table-left-column-sticky-number="auditlogConfigure.tableLeftColumnStickyNumber" |
|||
:table-buttons="auditlogConfigure.tableButtons" |
|||
:query-form-fields="auditlogConfigure.queryFormFields" |
|||
:table-pagination="auditlogConfigure.tablePagination" |
|||
:add-form-props="auditlogConfigure.addFormProps" |
|||
:table-dense="false" |
|||
<w-grid |
|||
ref="auditLogGridRef" |
|||
:title="$t('system.user.grid.title')" |
|||
selection="multiple" |
|||
:data-url="Environment.apiContextPath('/api/system/monitor/auditlog')" |
|||
:query-form-fields="[ |
|||
{ name: 'status', label: $t('status'), type: 'select', queryOperator: 'equals', options: Options.successFailed() }, |
|||
{ name: 'action', label: $t('action'), type: 'select', queryOperator: 'equals', options: Options.enum(AuditLogActionEnum) }, |
|||
{ name: 'loginName', label: $t('loginName'), type: 'text' }, |
|||
{ name: 'startDate', label: $t('startDate'), type: 'text' }, |
|||
]" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['query', 'refresh', 'separator', 'view', 'export']" |
|||
:pagination="{ |
|||
sortBy: 'startDate', |
|||
descending: true, |
|||
}" |
|||
:checkbox-selection="false" |
|||
:columns="[ |
|||
{ width: 80, name: 'status', label: $t('status'), format: Formater.successTag() }, |
|||
{ |
|||
width: 80, |
|||
name: 'action', |
|||
label: $t('action'), |
|||
format: Formater.enum(AuditLogActionEnum), |
|||
}, |
|||
{ width: 150, name: 'startDate', label: $t('startDate') }, |
|||
{ width: 100, name: 'executeTime', label: $t('executeTime') }, |
|||
{ width: 200, name: 'loginName', label: $t('loginName') }, |
|||
{ width: 100, name: 'httpMethod', label: $t('httpMethod') }, |
|||
{ width: 200, name: 'url', label: $t('url') }, |
|||
{ width: 100, name: 'ip', label: $t('ip') }, |
|||
{ width: 200, name: 'className', label: $t('className') }, |
|||
{ width: 100, name: 'methodName', label: $t('methodName') }, |
|||
{ width: 100, name: 'oldValue', label: $t('oldValue') }, |
|||
{ width: 100, name: 'newValue', label: $t('newValue') }, |
|||
{ width: 100, name: 'exception', label: $t('exception') }, |
|||
{ width: 100, name: 'exceptionMessage', label: $t('exceptionMessage') }, |
|||
{ width: 100, name: 'exceptionStackTrace', label: $t('exceptionStackTrace') }, |
|||
]" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ |
|||
name: 'status', |
|||
label: $t('status'), |
|||
format: (value) => { |
|||
return value; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'action', |
|||
label: $t('action'), |
|||
format: (value) => { |
|||
return value; |
|||
}, |
|||
}, |
|||
{ name: 'startDate', label: $t('startDate') }, |
|||
{ name: 'executeTime', label: $t('executeTime') }, |
|||
{ name: 'loginName', label: $t('loginName') }, |
|||
{ name: 'httpMethod', label: $t('httpMethod') }, |
|||
{ name: 'url', label: $t('url') }, |
|||
{ name: 'ip', label: $t('ip') }, |
|||
{ name: 'className', label: $t('className') }, |
|||
{ name: 'methodName', label: $t('methodName') }, |
|||
{ name: 'oldValue', label: $t('oldValue') }, |
|||
{ name: 'newValue', label: $t('newValue') }, |
|||
{ name: 'exception', label: $t('exception') }, |
|||
{ name: 'exceptionMessage', label: $t('exceptionMessage') }, |
|||
{ name: 'exceptionStackTrace', label: $t('exceptionStackTrace') }, |
|||
], |
|||
}, |
|||
}" |
|||
@row-click="(evt, row, index) => {}" |
|||
> |
|||
</platform-grid> |
|||
</div> |
|||
</w-grid> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import { useI18n } from 'vue-i18n'; |
|||
import { Environment, axios } from 'platform-core'; |
|||
import { Environment, EnumTools, Formater, Options } from 'platform-core'; |
|||
|
|||
const { t } = useI18n(); |
|||
const AuditLogActionEnum = await EnumTools.fetch('io.sc.platform.core.enums.AuditLogAction'); |
|||
|
|||
const Status = { |
|||
success: t('success'), |
|||
failed: t('failed'), |
|||
}; |
|||
|
|||
const Actions = { |
|||
'io.sc.platform.core.audit.AuditLogAction.ADD': t('io.sc.platform.core.audit.AuditLogAction.ADD'), |
|||
'io.sc.platform.core.audit.AuditLogAction.REMOVE': t('io.sc.platform.core.audit.AuditLogAction.REMOVE'), |
|||
'io.sc.platform.core.audit.AuditLogAction.UPDATE': t('io.sc.platform.core.audit.AuditLogAction.UPDATE'), |
|||
'io.sc.platform.core.audit.AuditLogAction.QUERY': t('io.sc.platform.core.audit.AuditLogAction.QUERY'), |
|||
'io.sc.platform.core.audit.AuditLogAction.FIND_ONE': t('io.sc.platform.core.audit.AuditLogAction.FIND_ONE'), |
|||
'io.sc.platform.core.audit.AuditLogAction.EXPORT': t('io.sc.platform.core.audit.AuditLogAction.EXPORT'), |
|||
'io.sc.platform.core.audit.AuditLogAction.LOGIN': t('io.sc.platform.core.audit.AuditLogAction.LOGIN'), |
|||
'io.sc.platform.core.audit.AuditLogAction.LOGOUT': t('io.sc.platform.core.audit.AuditLogAction.LOGOUT'), |
|||
}; |
|||
|
|||
console.log(Status); |
|||
|
|||
const auditlogConfigure = { |
|||
queryFormColsNumber: 4, |
|||
queryFormColsAuto: false, |
|||
hideBottom: false, |
|||
tableInitLoadData: true, |
|||
tableLeftColumnStickyNumber: 0, |
|||
tableTitle: t('system.monitor.auditlog.gridTitle'), |
|||
tableRowKey: 'id', |
|||
tableDataUrl: Environment.apiContextPath('/api/system/monitor/auditlog'), |
|||
tablePagination: { |
|||
sortBy: 'startDate', |
|||
descending: true, |
|||
reqPageStart: 0, |
|||
rowsPerPage: 10, |
|||
}, |
|||
queryFormFields: [], |
|||
tableButtons: ['view', 'inFullscreen'], |
|||
tableColumns: [ |
|||
{ width: 60, name: 'status', label: t('status'), format: (value) => Status[value] }, |
|||
{ width: 60, name: 'action', label: t('action'), format: (value) => Actions[value] }, |
|||
{ width: 100, name: 'startDate', label: t('startDate') }, |
|||
{ width: 60, name: 'executeTime', label: t('executeTime') }, |
|||
{ width: 80, name: 'loginName', label: t('loginName') }, |
|||
{ width: 60, name: 'httpMethod', label: t('httpMethod') }, |
|||
{ width: 200, name: 'url', label: t('url') }, |
|||
{ width: 100, name: 'ip', label: t('ip') }, |
|||
{ width: 100, name: 'className', label: t('className') }, |
|||
{ width: 100, name: 'methodName', label: t('methodName') }, |
|||
{ width: 100, name: 'oldValue', label: t('oldValue') }, |
|||
{ width: 100, name: 'newValue', label: t('newValue') }, |
|||
{ width: 100, name: 'exception', label: t('exception') }, |
|||
{ width: 100, name: 'exceptionMessage', label: t('exceptionMessage') }, |
|||
{ width: 100, name: 'exceptionStackTrace', label: t('exceptionStackTrace') }, |
|||
], |
|||
addFormProps: { |
|||
dialogInitWidth: '50%', |
|||
dialogInitHeight: '90%', |
|||
formColsNumber: 1, |
|||
formColsAuto: false, |
|||
formFields: [ |
|||
{ modelName: 'title', label: t('title'), type: 'text', required: true }, |
|||
{ modelName: 'content', label: t('content'), type: 'textarea', required: true }, |
|||
], |
|||
}, |
|||
}; |
|||
const auditLogGridRef = ref(); |
|||
</script> |
|||
|
@ -1,73 +1,91 @@ |
|||
<template> |
|||
<q-splitter :model-value="70" class="w-full h-full"> |
|||
<template #before> |
|||
<w-tree-grid ref="parameterTreeGridRef" title="系统参数树" label-key="code" label-i18n @update:selected="parameterSelected" /> |
|||
</template> |
|||
<template #after> |
|||
<div class="row"> |
|||
<div class="col-12"> |
|||
<q-input v-model="code" label="代码" outlined class="p-1" /> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-12"> |
|||
<q-input v-model="value" label="值" outlined class="p-1" /> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-12 flex justify-center q-gutter-md pt-5"> |
|||
<q-btn label="保存" color="primary" outlined class="p-1" style="width: 100px" @click="save" /> |
|||
</div> |
|||
</div> |
|||
<div class="row" style="height: 200px"></div> |
|||
</template> |
|||
</q-splitter> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, onMounted } from 'vue'; |
|||
import { useI18n } from 'vue-i18n'; |
|||
import { Environment, axios } from 'platform-core'; |
|||
|
|||
const { t } = useI18n(); |
|||
|
|||
const parameterTreeGridRef = ref(); |
|||
const id = ref(''); |
|||
const code = ref(''); |
|||
const value = ref(''); |
|||
|
|||
const parameterSelected = (target) => { |
|||
if (target) { |
|||
const node = parameterTreeGridRef.value.getNodeById(target); |
|||
id.value = node.id; |
|||
code.value = node.code; |
|||
value.value = node.value; |
|||
} else { |
|||
id.value = ''; |
|||
code.value = ''; |
|||
value.value = ''; |
|||
<w-grid |
|||
ref="parameterTreeGridRef" |
|||
:tree="true" |
|||
dense-body |
|||
:title="$t('system.menu.grid.title')" |
|||
:data-url="Environment.apiContextPath('/api/system/parameter')" |
|||
selection="multiple" |
|||
:checkbox-selection="false" |
|||
:pageable="false" |
|||
:full-screen-button="false" |
|||
default-expand-all |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
'expand', |
|||
{ |
|||
extend: 'edit', |
|||
enableIf: (selecteds) => { |
|||
if (selecteds && selecteds.length > 0) { |
|||
return !Tools.isUndefinedOrNull(selecteds[0].value); |
|||
} |
|||
}; |
|||
return false; |
|||
}, |
|||
}, |
|||
'separator', |
|||
'export', |
|||
]" |
|||
:columns="[ |
|||
{ |
|||
width: 300, |
|||
name: 'code', |
|||
label: $t('code'), |
|||
sortable: false, |
|||
format: (value) => { |
|||
return $t(value); |
|||
}, |
|||
}, |
|||
{ width: '100%', name: 'value', label: $t('value'), sortable: false }, |
|||
{ width: 100, name: 'dataComeFrom', label: $t('dataComeFrom'), sortable: false, format: Formater.enum(DataComeFromEnum) }, |
|||
{ width: 100, name: 'lastModifier', label: $t('lastModifier'), sortable: false }, |
|||
{ width: 100, name: 'lastModifyDate', label: $t('lastModifyDate'), sortable: false, format: Formater.dateOnly() }, |
|||
]" |
|||
:editor="{ |
|||
dialog: { |
|||
width: '600px', |
|||
height: '250px', |
|||
}, |
|||
form: { |
|||
colsNum: 1, |
|||
fields: [ |
|||
{ name: 'code', label: $t('code'), type: 'text' }, |
|||
{ name: 'value', label: $t('value'), type: 'text' }, |
|||
], |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'type', label: $t('type') }, |
|||
{ name: 'name', label: $t('name') }, |
|||
{ name: 'titleI18nKey', label: $t('titleI18nKey') }, |
|||
{ name: 'icon', label: $t('icon') }, |
|||
{ name: 'enable', label: $t('enable') }, |
|||
{ name: 'order', label: $t('order') }, |
|||
{ name: 'javaScript', label: $t('javaScript') }, |
|||
{ name: 'url', label: $t('url') }, |
|||
{ name: 'urlOpenType', label: $t('urlOpenType') }, |
|||
{ name: 'routeName', label: $t('routeName') }, |
|||
{ name: 'routeQuery', label: $t('routeQuery') }, |
|||
|
|||
const save = () => { |
|||
const node = parameterTreeGridRef.value.getNodeById(id.value); |
|||
const data = { |
|||
id: node.id, |
|||
code: node.code, |
|||
value: value.value, |
|||
parent: node.parentId, |
|||
corporationCode: node.corporationCode, |
|||
dataComeFrom: node.dataComeFrom, |
|||
creator: node.creator, |
|||
createDate: node.createDate, |
|||
lastModifier: node.lastModifier, |
|||
lastModifyDate: node.lastModifyDate, |
|||
}; |
|||
axios.put(Environment.apiContextPath('/api/system/parameter/') + id.value, data).then((response) => {}); |
|||
}; |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ name: 'creator', label: $t('creator') }, |
|||
{ name: 'createDate', label: $t('createDate') }, |
|||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: $t('lastModifyDate') }, |
|||
{ name: 'corporationCode', label: $t('corporationCode') }, |
|||
], |
|||
}, |
|||
}" |
|||
@row-click="(evt, row, index) => {}" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { Environment, Tools, EnumTools, Formater, Options } from 'platform-core'; |
|||
|
|||
onMounted(() => { |
|||
axios.get(Environment.apiContextPath('/api/system/parameter?pageable=false&sortBy=code')).then((response) => { |
|||
parameterTreeGridRef.value.setNodes(response.data.content); |
|||
}); |
|||
}); |
|||
const DataComeFromEnum = await EnumTools.fetch('io.sc.platform.orm.api.enums.DataComeFrom'); |
|||
</script> |
|||
|
@ -0,0 +1,36 @@ |
|||
package io.sc.platform.system.monitor.support; |
|||
|
|||
import io.sc.platform.core.support.FileWrapper; |
|||
|
|||
import java.util.Comparator; |
|||
|
|||
public class LogFileLastModifyDateComparator implements Comparator<FileWrapper> { |
|||
private boolean asc =true; |
|||
|
|||
public LogFileLastModifyDateComparator(){} |
|||
|
|||
public LogFileLastModifyDateComparator(boolean asc){ |
|||
this.asc =asc; |
|||
} |
|||
|
|||
@Override |
|||
public int compare(FileWrapper o1, FileWrapper o2) { |
|||
if(asc) { |
|||
if(o1.getLastModifyDate().getTime()>o2.getLastModifyDate().getTime()){ |
|||
return 1; |
|||
}else if(o1.getLastModifyDate().getTime()==o2.getLastModifyDate().getTime()){ |
|||
return 0; |
|||
}else{ |
|||
return -1; |
|||
} |
|||
}else{ |
|||
if(o2.getLastModifyDate().getTime()>o1.getLastModifyDate().getTime()){ |
|||
return 1; |
|||
}else if(o2.getLastModifyDate().getTime()==o1.getLastModifyDate().getTime()){ |
|||
return 0; |
|||
}else{ |
|||
return -1; |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,25 @@ |
|||
package io.sc.platform.system.monitor.support; |
|||
|
|||
import io.sc.platform.core.support.FileWrapper; |
|||
import io.sc.platform.core.util.PinyinUtil; |
|||
|
|||
import java.util.Comparator; |
|||
|
|||
public class LogFileNameComparator implements Comparator<FileWrapper> { |
|||
private boolean asc =true; |
|||
|
|||
public LogFileNameComparator(){} |
|||
|
|||
public LogFileNameComparator(boolean asc){ |
|||
this.asc =asc; |
|||
} |
|||
|
|||
@Override |
|||
public int compare(FileWrapper o1, FileWrapper o2) { |
|||
if(asc) { |
|||
return PinyinUtil.compare(o1.getName(), o2.getName()); |
|||
}else{ |
|||
return PinyinUtil.compare(o2.getName(), o1.getName()); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,38 @@ |
|||
package io.sc.platform.system.monitor.support; |
|||
|
|||
import io.sc.platform.core.support.FileWrapper; |
|||
import io.sc.platform.core.util.PinyinUtil; |
|||
import io.sc.platform.system.api.org.OrgVo; |
|||
|
|||
import java.util.Comparator; |
|||
|
|||
public class LogFileSizeComparator implements Comparator<FileWrapper> { |
|||
private boolean asc =true; |
|||
|
|||
public LogFileSizeComparator(){} |
|||
|
|||
public LogFileSizeComparator(boolean asc){ |
|||
this.asc =asc; |
|||
} |
|||
|
|||
@Override |
|||
public int compare(FileWrapper o1, FileWrapper o2) { |
|||
if(asc) { |
|||
if(o1.getSize()>o2.getSize()){ |
|||
return 1; |
|||
}else if(o1.getSize()==o2.getSize()){ |
|||
return 0; |
|||
}else{ |
|||
return -1; |
|||
} |
|||
}else{ |
|||
if(o2.getSize()>o1.getSize()){ |
|||
return 1; |
|||
}else if(o2.getSize()==o1.getSize()){ |
|||
return 0; |
|||
}else{ |
|||
return -1; |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,25 @@ |
|||
package io.sc.platform.system.monitor.support; |
|||
|
|||
import io.sc.platform.core.support.LoggerLevelInfo; |
|||
import io.sc.platform.core.util.EnumUtil; |
|||
|
|||
import java.util.Comparator; |
|||
|
|||
public class LogLevelConfiguredLevelComparator implements Comparator<LoggerLevelInfo> { |
|||
private boolean asc =true; |
|||
|
|||
public LogLevelConfiguredLevelComparator(){} |
|||
|
|||
public LogLevelConfiguredLevelComparator(boolean asc){ |
|||
this.asc =asc; |
|||
} |
|||
|
|||
@Override |
|||
public int compare(LoggerLevelInfo o1, LoggerLevelInfo o2) { |
|||
if(asc) { |
|||
return EnumUtil.compare(o1.getConfiguredLevel(),o2.getConfiguredLevel()); |
|||
}else{ |
|||
return EnumUtil.compare(o2.getConfiguredLevel(),o1.getConfiguredLevel()); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
package io.sc.platform.system.monitor.support; |
|||
|
|||
import io.sc.platform.core.support.LoggerLevelInfo; |
|||
|
|||
import java.util.Comparator; |
|||
|
|||
public class LogLevelEffectiveLevelComparator implements Comparator<LoggerLevelInfo> { |
|||
private boolean asc =true; |
|||
|
|||
public LogLevelEffectiveLevelComparator(){} |
|||
|
|||
public LogLevelEffectiveLevelComparator(boolean asc){ |
|||
this.asc =asc; |
|||
} |
|||
|
|||
@Override |
|||
public int compare(LoggerLevelInfo o1, LoggerLevelInfo o2) { |
|||
if(asc) { |
|||
return o1.getEffectiveLevel().compareTo(o2.getEffectiveLevel()); |
|||
}else{ |
|||
return o2.getEffectiveLevel().compareTo(o1.getEffectiveLevel()); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
package io.sc.platform.system.monitor.support; |
|||
|
|||
import io.sc.platform.core.support.FileWrapper; |
|||
import io.sc.platform.core.support.LoggerLevelInfo; |
|||
import io.sc.platform.core.util.PinyinUtil; |
|||
|
|||
import java.util.Comparator; |
|||
|
|||
public class LogLevelNameComparator implements Comparator<LoggerLevelInfo> { |
|||
private boolean asc =true; |
|||
|
|||
public LogLevelNameComparator(){} |
|||
|
|||
public LogLevelNameComparator(boolean asc){ |
|||
this.asc =asc; |
|||
} |
|||
|
|||
@Override |
|||
public int compare(LoggerLevelInfo o1, LoggerLevelInfo o2) { |
|||
if(asc) { |
|||
return o1.getName().compareTo(o2.getName()); |
|||
}else{ |
|||
return o2.getName().compareTo(o1.getName()); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,5 @@ |
|||
{ |
|||
"ignoredPatterns":[ |
|||
"^insert into sys_audit_log" |
|||
] |
|||
} |
Loading…
Reference in new issue