Merge branch 'master' into preview

This commit is contained in:
xlsea 2025-01-24 09:44:49 +08:00
commit 85dd3efdf6
6 changed files with 46 additions and 15 deletions

2
.env
View File

@ -4,7 +4,7 @@ VITE_APP_TITLE=Snail Job
VITE_APP_DESC=A flexible, reliable, and fast platform for distributed task retry and distributed task scheduling.
VITE_APP_VERSION=1.3.0-beta1
VITE_APP_VERSION=1.3.0
VITE_APP_DEFAULT_TOKEN=SJ_Wyz3dmsdbDOkDujOTSSoBjGQP1BMsVnj

View File

@ -119,10 +119,10 @@ watch(
</script>
<template>
<div class="w-100% flex-x-center gap-8px">
<div class="w-100% flex gap-8px">
<CodeMirror
v-model="nodeExpression"
class="w-100%"
class="snial-code-mirror w-100%"
:readonly="readonly"
:disabled="disabled"
:theme="theme"
@ -158,3 +158,9 @@ watch(
</NModal>
</div>
</template>
<style scoped>
:deep(.snial-code-mirror) {
max-width: calc(100% - 58px);
}
</style>

View File

@ -7,6 +7,7 @@ import {
NDivider,
NDropdown,
NEmpty,
NScrollbar,
NSpin,
NVirtualList,
type VirtualListInst
@ -282,7 +283,11 @@ const SnailLogComponent = defineComponent({
return <></>;
}
const restOfText = throwable.replace(/^.+(\n|$)/m, '');
return <NCollapseItem title={firstLine[0]} name={`throwable-${message.index}`}>{`${restOfText}`}</NCollapseItem>;
return (
<NCollapseItem title={firstLine[0]} name={`throwable-${message.index}`}>
<NScrollbar content-class="p-8px" class="message-scroll-body">{`${restOfText}`}</NScrollbar>
</NCollapseItem>
);
};
const messageComponent = (message: Api.JobLog.JobMessage) => {
@ -297,7 +302,9 @@ const SnailLogComponent = defineComponent({
const restOfText = msg.replace(/^.+(\n|$)/m, '').replaceAll('\n', '\n - ');
if (restOfText) {
return (
<NCollapseItem title={firstLine[0]} name={`message-${message.index}`}>{` - ${restOfText}`}</NCollapseItem>
<NCollapseItem title={firstLine[0]} name={`message-${message.index}`}>
<NScrollbar content-class="p-8px" class="message-scroll-body">{` - ${restOfText}`}</NScrollbar>
</NCollapseItem>
);
}
return <div class="pl-6px">- {`${msg}`}</div>;
@ -322,12 +329,11 @@ const SnailLogComponent = defineComponent({
ref={virtualListInst}
class="virtual-list"
itemSize={85}
item-resizable
ignore-item-resize
padding-bottom={16}
itemResizable
paddingBottom={16}
items={logList.value}
scrollbar-props={{ xScrollable: true }}
on-resize={handleResize}
scrollbarProps={{ xScrollable: true }}
onResize={handleResize}
>
{{
default: ({ item: message }: { item: Api.JobLog.JobMessage }) => (
@ -592,4 +598,15 @@ const SnailLogComponent = defineComponent({
display: inline-block !important;
min-width: 100%;
}
:deep(.message-scroll-body) {
margin-top: 6px;
max-height: 150px;
border: 1px solid rgb(239, 239, 245);
border-radius: var(--n-border-radius);
}
:deep(.dark .message-scroll-body) {
border: 1px solid rgba(255, 255, 255, 0.09) !important;
}
</style>

View File

@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue';
import { $t } from '@/locales';
import { fetchGetUserPageList } from '@/service/api';
import { fetchGetUserSimpleList } from '@/service/api';
defineOptions({
name: 'SystemUser'
@ -27,9 +27,9 @@ const emit = defineEmits<Emits>();
const userNameList = ref();
async function getUserNameList() {
const { data, error } = await fetchGetUserPageList();
const { data, error } = await fetchGetUserSimpleList();
if (!error) {
userNameList.value = data?.data;
userNameList.value = data;
}
}

View File

@ -1,6 +1,6 @@
import { request } from '../request';
/** get user list */
/** get user page list */
export function fetchGetUserPageList(params?: Api.UserManager.UserManagerSearchParams) {
return request<Api.UserManager.UserManagerList>({
url: '/user/page/list',
@ -9,6 +9,14 @@ export function fetchGetUserPageList(params?: Api.UserManager.UserManagerSearchP
});
}
/** get user simple list */
export function fetchGetUserSimpleList() {
return request<Api.UserManager.UserManagerList>({
url: '/user/simple/list',
method: 'get'
});
}
/** add user */
export function fetchAddUser(data: Api.UserManager.UserManager) {
return request<boolean>({

View File

@ -467,7 +467,7 @@ const scriptMethodOptions = [
<SelectGroup v-model:value="model.groupName" :disabled="props.operateType === 'edit'" />
</NFormItem>
<NFormItem :label="$t('page.jobTask.ownerName')" path="ownerId">
<SystemUser v-model:value="model.ownerId" />
<SystemUser v-model:value="model.ownerId" :clearable="true" />
</NFormItem>
<NFormItem :label="$t('page.jobTask.jobStatus')" path="jobStatus">
<NRadioGroup v-model:value="model.jobStatus" name="jobStatus">