Skip to content

Commit

Permalink
优化列表查询
Browse files Browse the repository at this point in the history
  • Loading branch information
SpringHgui committed Jul 19, 2024
1 parent f973d75 commit 715c3e3
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 762 deletions.
23 changes: 22 additions & 1 deletion src/OpenTask.Persistence/Contexts/MyOpenTaskContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,35 @@ public partial class OpenTaskContext : DbContext
{
partial void OnModelCreatingPartial(ModelBuilder modelBuilder)
{
_ = modelBuilder.Entity<OtUser>()
modelBuilder.Entity<OtUser>()
.HasData(new OtUser
{
Id = 1,
UserName = "admin",
Password = Md5Helper.MD5Encrypt64("OpenTask"),
CreatedAt = DateTime.Now
});

modelBuilder.Entity<OtTaskInfo>().HasData(new OtTaskInfo
{
Id = 1,
AlarmConf = string.Empty,
AlarmType = "none",
Appid = "default",
AttemptInterval = 5,
AttemptMax = 3,
Description = "一个示例作业",
Enabled = true,
HandleParams = "这是执行参数",
Handler = "DemoJobHandler",
Name = "示例作业",
ScheduleMode = "alone",
Slot = 1,
TimeConf = "0/30 * * * * ?",
TimeType = "cron",
TriggerLastTime = 0,
TriggerNextTime = 0,
});
}
}

5 changes: 2 additions & 3 deletions ui/vite-opentask/src/apis/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Configuration } from "@/apis-gen";
const config = new Configuration({
basePath: import.meta.env.VITE_API_URL || location.origin,
accessToken: (name, scopes) => {
console.log(name);
return (
localStorage.getItem("token")?.replace('"', "").replace('"', "") ?? ""
);
Expand All @@ -15,7 +14,7 @@ const config = new Configuration({
localStorage.getItem("token")?.replace('"', "").replace('"', "") ??
"";

console.log("headers", context.init.headers);
// console.log("headers", context.init.headers);
return new Promise((resolve, reject) => {
context.init.headers = {
...context.init.headers,
Expand All @@ -26,7 +25,7 @@ const config = new Configuration({
},
post(context) {
return new Promise((resolve, reject) => {
console.log("post", context);
// console.log("post", context);
if (context.response.status == 200) {
resolve();
}
Expand Down
2 changes: 1 addition & 1 deletion ui/vite-opentask/src/components/dashboard-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function DashboardNav({
return null;
}

console.log('isActive', isMobileNav, isMinimized);
// console.log('isActive', isMobileNav, isMinimized);

return (
<nav className="grid items-start gap-2">
Expand Down
2 changes: 1 addition & 1 deletion ui/vite-opentask/src/components/nav/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface NavProps {

export function Nav({ links, isCollapsed }: NavProps) {
const { pathname } = useLocation()
console.log("Nav", pathname);
// console.log("Nav", pathname);
let actives = links.filter(x => x.to).filter(x => pathname.endsWith(x.to!))
let active: LinkInfo | undefined = undefined;
if (actives.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion ui/vite-opentask/src/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function SidebarNav({
...props
}: SidebarNavProps) {
const { pathname } = useLocation();
console.log(pathname, "pathname");
// console.log(pathname, "pathname");
const [minimized, setCounter] = useAtom(isMinimized);

return (
Expand Down
2 changes: 1 addition & 1 deletion ui/vite-opentask/src/pages/home/components/tasklog-top.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const TaskLogTop = () => {
<CardContent className="grid gap-8">
{data?.result?.data?.map((x) => {
return (
<div className="flex items-center gap-4">
<div className="flex items-center gap-4" key={x.taskId}>
{/* <Avatar className="hidden h-9 w-9 sm:flex">
<AvatarImage src="/avatars/01.png" alt="Avatar" />
<AvatarFallback>OM</AvatarFallback>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
});
},
onSuccess: (data) => {
console.log("登录成功", data);
if (!data.success) {
toast.error(data.message);
return;
Expand All @@ -54,8 +53,7 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
navigate(`/`, { replace: true });
},
onError: (error) => {
console.log(error);

console.error(error);
toast.error(error.message);
},
onSettled: () => {
Expand Down
102 changes: 0 additions & 102 deletions ui/vite-opentask/src/pages/taskInfo/components/columns.tsx

This file was deleted.

This file was deleted.

Loading

0 comments on commit 715c3e3

Please sign in to comment.