Skip to content

Commit

Permalink
Merge branch 'refs/heads/develop-v3' into master-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Scorrt-2021 committed Jun 20, 2024
2 parents d1adc2d + 12024e5 commit 13db7e3
Show file tree
Hide file tree
Showing 15 changed files with 90 additions and 52 deletions.
2 changes: 1 addition & 1 deletion diboot-admin-ui/src/layout/header/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const enableI18n = import.meta.env.VITE_APP_ENABLE_I18N === 'true'
<slot name="topNav" />
</div>
<menu-search class="item" />
<div class="item">
<div v-if="router.hasRoute('ChatAI')" class="item">
<el-tooltip effect="dark" :content="$t('layout.header.chatAi')" placement="bottom" :show-after="300">
<el-icon :size="24" style="color: #21ba45">
<icon name="Local:ChatAi" @click="openChatAi" />
Expand Down
2 changes: 1 addition & 1 deletion diboot-admin-ui/src/views/org-structure/position/List.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts" name="Position">
import { Search, Plus } from '@element-plus/icons-vue'
import { Search, Plus, ArrowDown } from '@element-plus/icons-vue'
import type { Position } from './type'
import Detail from './Detail.vue'
import Form from './Form.vue'
Expand Down
3 changes: 0 additions & 3 deletions diboot-admin-ui/src/views/system/role/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ const { queryParam, onSearch, resetFilter, getList, loading, dataList, paginatio
getList()
// 搜索区折叠
const searchState = ref(false)
const formRef = ref()
const openForm = (id?: string) => {
formRef.value?.open(id)
Expand Down
4 changes: 3 additions & 1 deletion diboot-admin-ui/src/views/system/schedule-job/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ const logListPermission = checkPermission('logList')
<el-dropdown-item v-if="updatePermission" @click="openForm(item.id)">
{{ $t('operation.update') }}
</el-dropdown-item>
<el-dropdown-item v-if="logListPermission" @click="openLog(item.id)"> 日志 </el-dropdown-item>
<el-dropdown-item v-if="logListPermission" @click="openLog(item.id)">
{{ $t('scheduleJobLog.title') }}
</el-dropdown-item>
<el-dropdown-item v-if="deletePermission" divided @click="remove(item.id)">
{{ $t('operation.delete') }}
</el-dropdown-item>
Expand Down
8 changes: 7 additions & 1 deletion diboot-admin-ui/src/views/system/schedule-job/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,20 @@ const en: Locale = {
},
scheduleJobLog: {
startTime: 'Start Time',
startTimeAlias: 'Execute Time',
endTime: 'End Time',
runStatus: 'Execution Status',
triggerMode: 'Trigger Mode',
elapsedSeconds: 'Elapsed Time',
paramJson: 'Parameters',
executeMsg: 'Execution Result Information',
success: 'Success',
fail: 'Failure'
fail: 'Failure',
title: 'Job Log',
triggerModeOptions: {
auto: 'Auto',
manual: 'Manual'
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ const zhCN = {
},
scheduleJobLog: {
startTime: '开始时间',
startTimeAlias: '执行时间',
endTime: '结束时间',
runStatus: '执行状态',
triggerMode: '触发方式',
elapsedSeconds: '耗时',
paramJson: '参数',
executeMsg: '执行结果信息',
success: '成功',
fail: '失败'
fail: '失败',
title: '日志',
triggerModeOptions: {
auto: '自动',
manual: '手动'
}
}
}

Expand Down
80 changes: 43 additions & 37 deletions diboot-admin-ui/src/views/system/schedule-job/log/List.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { Refresh, Search } from '@element-plus/icons-vue'
import { ArrowUp, ArrowDown, Search } from '@element-plus/icons-vue'
import type { ScheduleJobLog } from '../type'
import Detail from './Detail.vue'
Expand Down Expand Up @@ -47,68 +47,74 @@ const openDetail = (id: string) => {
</script>

<template>
<el-drawer v-model="visible" title="日志" size="850px">
<el-drawer v-model="visible" :title="$t('scheduleJobLog.title')" size="850px">
<div class="list-page">
<el-header>
<el-space wrap class="list-operation">
<el-button v-has-permission="'logDelete'" @click="batchRemove(selectedKeys)">{{
$t('operation.batchDelete')
}}</el-button>
<el-space>
<el-select
v-model="queryParam.runStatus"
:label="$t('scheduleJobLog.runStatus')"
clearable
@change="onSearch"
>
<el-option :label="$t('scheduleJobLog.success')" value="S" />
<el-option :label="$t('scheduleJobLog.fail')" value="F" />
</el-select>
<el-button :icon="Search" type="primary" @click="onSearch">{{ $t('operation.search') }}</el-button>
<el-button :title="$t('title.reset')" @click="resetFilter">{{ $t('operation.reset') }}</el-button>
<el-button
:icon="searchState ? ArrowUp : ArrowDown"
:title="searchState ? $t('searchState.up') : $t('searchState.down')"
@click="searchState = !searchState"
/>
</el-space>
</el-space>
</el-header>

<el-form v-show="searchState" label-width="80px" class="list-search" @submit.prevent>
<el-row :gutter="18">
<el-col :md="12" :sm="24">
<el-form-item label="执行结果">
<el-select v-model="queryParam.runStatus" clearable @change="onSearch">
<el-option label="成功" value="S" />
<el-option label="失败" value="F" />
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="触发方式">
<el-form-item :label="$t('scheduleJobLog.triggerMode')">
<el-select v-model="queryParam.triggerMode" clearable @change="onSearch">
<el-option label="自动" value="AUTO" />
<el-option label="手动" value="MANUAL" />
<el-option :label="$t('scheduleJobLog.triggerModeOptions.auto')" value="AUTO" />
<el-option :label="$t('scheduleJobLog.triggerModeOptions.manual')" value="MANUAL" />
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="执行时间">
<el-form-item :label="$t('scheduleJobLog.startTimeAlias')">
<date-range
:model-value="dateRangeQuery.startTime as [string, string]"
@update:model-value="dateRangeQuery.startTime = $event as [string, string]"
@change="onSearch"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" style="margin-left: auto">
<el-form-item>
<el-button type="primary" @click="onSearch">{{ $t('operation.search') }}</el-button>
<el-button @click="resetFilter">{{ $t('operation.reset') }}</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-header>
<el-space wrap class="list-operation">
<el-button v-has-permission="'logDelete'" @click="batchRemove(selectedKeys)">批量删除</el-button>
<el-space>
<el-button :icon="Refresh" circle @click="getList()" />
<el-button :icon="Search" circle @click="searchState = !searchState" />
</el-space>
</el-space>
</el-header>

<el-table
ref="tableRef"
v-loading="loading"
:data="dataList"
height="100%"
stripe
style="border-top: 1px solid var(--el-border-color-lighter)"
@selection-change="(arr: ScheduleJobLog[]) => (selectedKeys = arr.map(e => e.id))"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="startTime" label="执行时间" align="center" width="165" />
<el-table-column prop="endTime" label="结束时间" align="center" width="165" />
<el-table-column prop="elapsedSeconds" label="耗时(s)" align="right" width="100" />
<el-table-column prop="triggerModeLabel" align="center" label="触发方式" />
<el-table-column prop="runStatus" align="center" label="执行结果">
<el-table-column prop="startTime" :label="$t('scheduleJobLog.startTimeAlias')" align="center" width="140" />
<el-table-column prop="endTime" :label="$t('scheduleJobLog.endTime')" align="center" width="140" />
<el-table-column prop="elapsedSeconds" :label="$t('scheduleJobLog.elapsedSeconds')" align="right" width="120" />
<el-table-column prop="triggerModeLabel" align="center" :label="$t('scheduleJobLog.triggerMode')" />
<el-table-column prop="runStatus" align="center" :label="$t('scheduleJobLog.runStatus')">
<template #default="{ row }">
<el-tag v-if="row.runStatus === 'S'">成功</el-tag>
<el-tag v-else type="danger">失败</el-tag>
<el-tag v-if="row.runStatus === 'S'">{{ $t('scheduleJobLog.success') }}</el-tag>
<el-tag v-else type="danger">{{ $t('scheduleJobLog.fail') }}</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('operation.label')" align="center" width="130" fixed="right">
Expand All @@ -117,7 +123,7 @@ const openDetail = (id: string) => {
>{{ $t('title.detail') }}
</el-button>
<el-button v-has-permission="'logDelete'" text bg type="primary" size="small" @click="remove(row.id)">
删除
{{ $t('operation.delete') }}
</el-button>
</template>
</el-table-column>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
public class DefaultAiConfigurator implements AiConfigurator{
@Override
public void configure(AiConfiguration aiConfiguration) {
log.info("---------> enabled DefaultAiConfigurator");
log.info("启用 DefaultAiConfigurator");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ private synchronized void insertInitData() {
// 初始化chat ai相关资源
if (resourcePermissionService != null && !resourcePermissionService.exists(IamResource::getResourceCode, "ChatAI")) {
List<IamResourceListVO> permissionListVOs = new ArrayList<>();
IamResourceListVO chatAIPermission = (IamResourceListVO) new IamResourceListVO().setChildren(new ArrayList<>()).setParentId("0").setDisplayType("MENU").setDisplayName("ChatAI").setDisplayNameI18n("Resource.ChatAI").setRoutePath("chat-ai").setResourceCode("ChatAI").setPermissionCode("").setMeta("{\"icon\":\"Element:Cpu\",\"componentPath\":\"@/views/chat-ai/index.vue\",\"keepAlive\":false,\"hidden\":true}").setSortId(90L);
IamResourceListVO chatAIPermission = (IamResourceListVO) new IamResourceListVO()
.setChildren(new ArrayList<>())
.setParentId("0").setDisplayType("MENU").setDisplayName("ChatAI").setDisplayNameI18n("Resource.ChatAI")
.setRoutePath("chat-ai").setResourceCode("ChatAI").setPermissionCode("AiSession:read,AiSession:write,AiSessionRecord:read,AiSessionRecord:write")
.setMeta("{\"icon\":\"Element:Cpu\",\"componentPath\":\"@/views/chat-ai/index.vue\",\"keepAlive\":false,\"hidden\":true}")
.setSortId(90L);
permissionListVOs.add(chatAIPermission);
// 插入多层级资源权限初始数据
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class AiAutoConfig implements WebMvcConfigurer {
private AiProperties aiProperties;

public AiAutoConfig() {
log.info("初始化 AI 内核 自动配置");
log.info("初始化 AI 组件自动配置");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.diboot.core.cache.DictionaryCacheManager;
import com.diboot.core.cache.DynamicRedisCacheManager;
import com.diboot.core.cache.I18nCacheManager;
import com.diboot.core.config.Cons;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonInclude;
Expand Down Expand Up @@ -111,4 +112,19 @@ public DictionaryCacheManager dictionaryCacheManager(RedisTemplate redisTemplate
return new DictionaryCacheManager(redisCacheManager);
}

/**
* 国际化等基础数据缓存管理器
* @return
*/
@Bean
@ConditionalOnMissingBean
public I18nCacheManager i18nCacheManager(RedisTemplate redisTemplate) {
log.info("初始化 I18n Redis缓存: DynamicRedisCacheManager");
Map<String, Integer> cacheName2ExpireMap = new HashMap<>() {{
put(Cons.CACHE_NAME_I18N, 24*60);
}};
DynamicRedisCacheManager memoryCacheManager = new DynamicRedisCacheManager(redisTemplate, cacheName2ExpireMap);
return new I18nCacheManager(memoryCacheManager);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public Date parse(String dateStr) {
public Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder() {
Jackson2ObjectMapperBuilder objectMapperBuilder = new Jackson2ObjectMapperBuilder();
jsonCustomizer().customize(objectMapperBuilder);
log.info("启用diboot默认的Jackson自定义配置");
log.info("启用默认的Jackson自定义配置");
return objectMapperBuilder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public Date parse(String dateStr) {
public Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder() {
Jackson2ObjectMapperBuilder objectMapperBuilder = new Jackson2ObjectMapperBuilder();
jsonCustomizer().customize(objectMapperBuilder);
log.info("启用diboot默认的Jackson自定义配置");
log.info("启用默认的Jackson自定义配置");
return objectMapperBuilder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void doBindingI18n(List voList, FieldAnnotation fieldAnnotation) {
// 国际化绑定接口化
i18nConfigService.bindI18nContent(voList, i18nCodeField, fieldAnnotation.getFieldName());
} else {
log.warn("I18nConfigService未实现,无法翻译I18n注解: {}", i18nCodeField);
log.debug("I18nConfigService未初始化,无法翻译I18n注解: {}", i18nCodeField);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public static List<Map<String,Object>> executeQuery(String sqlStatement, Object.
* @return
* @throws Exception
*/
public static boolean executeUpdate(String sqlStatement, List params) throws Exception{
public static boolean executeUpdate(String sqlStatement, Object... params) throws Exception{
if (V.isEmpty(sqlStatement)){
return false;
}
Expand Down

0 comments on commit 13db7e3

Please sign in to comment.