Skip to content

Commit 715c3e3

Browse files
committed
优化列表查询
1 parent f973d75 commit 715c3e3

File tree

18 files changed

+40
-762
lines changed

18 files changed

+40
-762
lines changed

src/OpenTask.Persistence/Contexts/MyOpenTaskContext.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,35 @@ public partial class OpenTaskContext : DbContext
1414
{
1515
partial void OnModelCreatingPartial(ModelBuilder modelBuilder)
1616
{
17-
_ = modelBuilder.Entity<OtUser>()
17+
modelBuilder.Entity<OtUser>()
1818
.HasData(new OtUser
1919
{
2020
Id = 1,
2121
UserName = "admin",
2222
Password = Md5Helper.MD5Encrypt64("OpenTask"),
2323
CreatedAt = DateTime.Now
2424
});
25+
26+
modelBuilder.Entity<OtTaskInfo>().HasData(new OtTaskInfo
27+
{
28+
Id = 1,
29+
AlarmConf = string.Empty,
30+
AlarmType = "none",
31+
Appid = "default",
32+
AttemptInterval = 5,
33+
AttemptMax = 3,
34+
Description = "一个示例作业",
35+
Enabled = true,
36+
HandleParams = "这是执行参数",
37+
Handler = "DemoJobHandler",
38+
Name = "示例作业",
39+
ScheduleMode = "alone",
40+
Slot = 1,
41+
TimeConf = "0/30 * * * * ?",
42+
TimeType = "cron",
43+
TriggerLastTime = 0,
44+
TriggerNextTime = 0,
45+
});
2546
}
2647
}
2748

ui/vite-opentask/src/apis/config.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Configuration } from "@/apis-gen";
22
const config = new Configuration({
33
basePath: import.meta.env.VITE_API_URL || location.origin,
44
accessToken: (name, scopes) => {
5-
console.log(name);
65
return (
76
localStorage.getItem("token")?.replace('"', "").replace('"', "") ?? ""
87
);
@@ -15,7 +14,7 @@ const config = new Configuration({
1514
localStorage.getItem("token")?.replace('"', "").replace('"', "") ??
1615
"";
1716

18-
console.log("headers", context.init.headers);
17+
// console.log("headers", context.init.headers);
1918
return new Promise((resolve, reject) => {
2019
context.init.headers = {
2120
...context.init.headers,
@@ -26,7 +25,7 @@ const config = new Configuration({
2625
},
2726
post(context) {
2827
return new Promise((resolve, reject) => {
29-
console.log("post", context);
28+
// console.log("post", context);
3029
if (context.response.status == 200) {
3130
resolve();
3231
}

ui/vite-opentask/src/components/dashboard-nav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function DashboardNav({
3333
return null;
3434
}
3535

36-
console.log('isActive', isMobileNav, isMinimized);
36+
// console.log('isActive', isMobileNav, isMinimized);
3737

3838
return (
3939
<nav className="grid items-start gap-2">

ui/vite-opentask/src/components/nav/nav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface NavProps {
2525

2626
export function Nav({ links, isCollapsed }: NavProps) {
2727
const { pathname } = useLocation()
28-
console.log("Nav", pathname);
28+
// console.log("Nav", pathname);
2929
let actives = links.filter(x => x.to).filter(x => pathname.endsWith(x.to!))
3030
let active: LinkInfo | undefined = undefined;
3131
if (actives.length > 0) {

ui/vite-opentask/src/components/sidebar/sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function SidebarNav({
4242
...props
4343
}: SidebarNavProps) {
4444
const { pathname } = useLocation();
45-
console.log(pathname, "pathname");
45+
// console.log(pathname, "pathname");
4646
const [minimized, setCounter] = useAtom(isMinimized);
4747

4848
return (

ui/vite-opentask/src/pages/home/components/tasklog-top.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const TaskLogTop = () => {
2929
<CardContent className="grid gap-8">
3030
{data?.result?.data?.map((x) => {
3131
return (
32-
<div className="flex items-center gap-4">
32+
<div className="flex items-center gap-4" key={x.taskId}>
3333
{/* <Avatar className="hidden h-9 w-9 sm:flex">
3434
<AvatarImage src="/avatars/01.png" alt="Avatar" />
3535
<AvatarFallback>OM</AvatarFallback>

ui/vite-opentask/src/pages/login/components/user-auth-form.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
3838
});
3939
},
4040
onSuccess: (data) => {
41-
console.log("登录成功", data);
4241
if (!data.success) {
4342
toast.error(data.message);
4443
return;
@@ -54,8 +53,7 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
5453
navigate(`/`, { replace: true });
5554
},
5655
onError: (error) => {
57-
console.log(error);
58-
56+
console.error(error);
5957
toast.error(error.message);
6058
},
6159
onSettled: () => {

ui/vite-opentask/src/pages/taskInfo/components/columns.tsx

Lines changed: 0 additions & 102 deletions
This file was deleted.

ui/vite-opentask/src/pages/taskInfo/components/data-table-row-actions.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)