refactor(times): added a better view for times as we save all db as there respective timezone
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m50s
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m50s
This commit is contained in:
@@ -46,7 +46,8 @@ const createApp = async () => {
|
|||||||
server: ${JSON.stringify(umamiConfig.server ?? "unknown")},
|
server: ${JSON.stringify(umamiConfig.server ?? "unknown")},
|
||||||
appVersion: ${JSON.stringify(umamiConfig.appVersion ?? "dev")},
|
appVersion: ${JSON.stringify(umamiConfig.appVersion ?? "dev")},
|
||||||
umamiHost: ${JSON.stringify(umamiConfig.umamiHost ?? "")},
|
umamiHost: ${JSON.stringify(umamiConfig.umamiHost ?? "")},
|
||||||
umamiWebsiteId: ${JSON.stringify(umamiConfig.umamiWebsiteId ?? "")}
|
umamiWebsiteId: ${JSON.stringify(umamiConfig.umamiWebsiteId ?? "")},
|
||||||
|
timezone: ${JSON.stringify(process.env.TIMEZONE ?? "America/Chicago")}
|
||||||
};
|
};
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ type RuntimeConfig = {
|
|||||||
appVersion: string;
|
appVersion: string;
|
||||||
umamiHost: string;
|
umamiHost: string;
|
||||||
umamiWebsiteId: string;
|
umamiWebsiteId: string;
|
||||||
|
timezone: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
@@ -23,6 +24,7 @@ export const runtimeConfig: RuntimeConfig = {
|
|||||||
appVersion: window.LST_CONFIG?.appVersion ?? "dev",
|
appVersion: window.LST_CONFIG?.appVersion ?? "dev",
|
||||||
umamiHost: window.LST_CONFIG?.umamiHost ?? "",
|
umamiHost: window.LST_CONFIG?.umamiHost ?? "",
|
||||||
umamiWebsiteId: window.LST_CONFIG?.umamiWebsiteId ?? "",
|
umamiWebsiteId: window.LST_CONFIG?.umamiWebsiteId ?? "",
|
||||||
|
timezone: window.LST_CONFIG?.timezone ?? "America/Chicago",
|
||||||
};
|
};
|
||||||
|
|
||||||
export function loadUmami() {
|
export function loadUmami() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||||
import { createColumnHelper } from "@tanstack/react-table";
|
import { createColumnHelper } from "@tanstack/react-table";
|
||||||
import { format } from "date-fns-tz";
|
import { formatInTimeZone } from "date-fns-tz";
|
||||||
import { useSocketRoom } from "@/hooks/socket.io.hook";
|
import { useSocketRoom } from "@/hooks/socket.io.hook";
|
||||||
import { authClient } from "@/lib/auth-client";
|
import { authClient } from "@/lib/auth-client";
|
||||||
import { Badge } from "../../components/ui/badge";
|
import { Badge } from "../../components/ui/badge";
|
||||||
@@ -73,11 +73,17 @@ function LevelBadge({ level }: { level: string }) {
|
|||||||
function RouteComponent() {
|
function RouteComponent() {
|
||||||
const { data: logs } = useSocketRoom<LogEntry>("logs");
|
const { data: logs } = useSocketRoom<LogEntry>("logs");
|
||||||
const columnHelper = createColumnHelper<any>();
|
const columnHelper = createColumnHelper<any>();
|
||||||
|
|
||||||
const column = [
|
const column = [
|
||||||
columnHelper.accessor("createdAt", {
|
columnHelper.accessor("createdAt", {
|
||||||
header: ({ column }) => <SearchableHeader column={column} title="Time" />,
|
header: ({ column }) => <SearchableHeader column={column} title="Time" />,
|
||||||
filterFn: "includesString",
|
filterFn: "includesString",
|
||||||
cell: (i) => format(i.getValue(), "MM/dd/yyyy HH:mm:ss"),
|
cell: (i) =>
|
||||||
|
formatInTimeZone(
|
||||||
|
i.getValue(),
|
||||||
|
`${window.LST_CONFIG?.timezone}`,
|
||||||
|
"MM/dd/yyyy HH:mm:ss",
|
||||||
|
),
|
||||||
}),
|
}),
|
||||||
columnHelper.accessor("level", {
|
columnHelper.accessor("level", {
|
||||||
header: ({ column }) => (
|
header: ({ column }) => (
|
||||||
@@ -112,7 +118,20 @@ function RouteComponent() {
|
|||||||
<SearchableHeader column={column} title="Message" />
|
<SearchableHeader column={column} title="Message" />
|
||||||
),
|
),
|
||||||
filterFn: "includesString",
|
filterFn: "includesString",
|
||||||
cell: (i) => i.getValue(),
|
cell: (i) => {
|
||||||
|
return i.getValue().length > 50 ? (
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger>
|
||||||
|
<p>{i.getValue().slice(0, 50)}...</p>
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent>
|
||||||
|
<p className="text-wrap max-w-48">{i.getValue()}</p>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
) : (
|
||||||
|
i.getValue()
|
||||||
|
);
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
columnHelper.accessor("stack", {
|
columnHelper.accessor("stack", {
|
||||||
header: ({ column }) => (
|
header: ({ column }) => (
|
||||||
@@ -126,12 +145,9 @@ function RouteComponent() {
|
|||||||
return (
|
return (
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger>
|
<TooltipTrigger>
|
||||||
<button
|
<p className="max-w-[350px] truncate text-left font-mono text-xs text-muted-foreground hover:text-foreground">
|
||||||
type="button"
|
|
||||||
className="max-w-[350px] truncate text-left font-mono text-xs text-muted-foreground hover:text-foreground"
|
|
||||||
>
|
|
||||||
{stack.length !== 0 ? "Hover to see stack error" : "-"}
|
{stack.length !== 0 ? "Hover to see stack error" : "-"}
|
||||||
</button>
|
</p>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent
|
<TooltipContent
|
||||||
side="left"
|
side="left"
|
||||||
|
|||||||
69
migrations/0059_sparkling_joystick.sql
Normal file
69
migrations/0059_sparkling_joystick.sql
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
ALTER TABLE "alpla_purchase_history" ALTER COLUMN "add_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "alpla_purchase_history" ALTER COLUMN "add_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "alpla_purchase_history" ALTER COLUMN "upd_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "alpla_purchase_history" ALTER COLUMN "upd_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "alpla_purchase_history" ALTER COLUMN "created_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "alpla_purchase_history" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "alpla_purchase_history" ALTER COLUMN "updated_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "alpla_purchase_history" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "analytics" ALTER COLUMN "created_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "analytics" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "job_audit_log" ALTER COLUMN "finished_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "job_audit_log" ALTER COLUMN "created_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "job_audit_log" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "user" ALTER COLUMN "updated_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "user" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "deployment_history" ALTER COLUMN "created_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "deployment_history" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "analytics_daily" ALTER COLUMN "first_hit_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "analytics_daily" ALTER COLUMN "last_hit_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "analytics_daily" ALTER COLUMN "created_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "analytics_daily" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "analytics_daily" ALTER COLUMN "updated_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "analytics_daily" ALTER COLUMN "updated_at" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "datamart" ALTER COLUMN "add_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "datamart" ALTER COLUMN "add_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "datamart" ALTER COLUMN "upd_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "datamart" ALTER COLUMN "upd_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "dock_door_scanners" ALTER COLUMN "add_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "dock_door_scanners" ALTER COLUMN "add_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "dock_door_scanners" ALTER COLUMN "upd_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "dock_door_scanners" ALTER COLUMN "upd_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "inv_historical_data" ALTER COLUMN "upd_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "inv_historical_data" ALTER COLUMN "upd_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "logs" ALTER COLUMN "created_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "logs" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "opendock_apt" ALTER COLUMN "upd_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "opendock_apt" ALTER COLUMN "upd_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "opendock_apt" ALTER COLUMN "created_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "opendock_apt" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "opendock_article_setup" ALTER COLUMN "upd_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "opendock_article_setup" ALTER COLUMN "upd_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "opendock_article_setup" ALTER COLUMN "created_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "opendock_article_setup" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "opendock_dock_setup" ALTER COLUMN "upd_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "opendock_dock_setup" ALTER COLUMN "upd_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "opendock_dock_setup" ALTER COLUMN "created_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "opendock_dock_setup" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "printer_log" ALTER COLUMN "created_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "printer_log" ALTER COLUMN "created_at" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "printer_data" ALTER COLUMN "add_Date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "printer_data" ALTER COLUMN "add_Date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "printer_data" ALTER COLUMN "upd_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "printer_data" ALTER COLUMN "upd_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "scan_log" ALTER COLUMN "add_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "scan_log" ALTER COLUMN "add_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "scan_users" ALTER COLUMN "add_Date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "scan_users" ALTER COLUMN "add_Date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "scan_users" ALTER COLUMN "upd_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "scan_users" ALTER COLUMN "upd_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "server_data" ALTER COLUMN "last_updated" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "server_data" ALTER COLUMN "last_updated" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "settings" ALTER COLUMN "add_Date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "settings" ALTER COLUMN "add_Date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "settings" ALTER COLUMN "upd_date" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "settings" ALTER COLUMN "upd_date" SET DEFAULT now();--> statement-breakpoint
|
||||||
|
ALTER TABLE "app_stats" ALTER COLUMN "last_build_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "app_stats" ALTER COLUMN "last_deploy_at" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "app_stats" ALTER COLUMN "last_updated" SET DATA TYPE timestamp with time zone;--> statement-breakpoint
|
||||||
|
ALTER TABLE "app_stats" ALTER COLUMN "last_updated" SET DEFAULT now();
|
||||||
2603
migrations/meta/0059_snapshot.json
Normal file
2603
migrations/meta/0059_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -414,6 +414,13 @@
|
|||||||
"when": 1779846894283,
|
"when": 1779846894283,
|
||||||
"tag": "0058_damp_donald_blake",
|
"tag": "0058_damp_donald_blake",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 59,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1780349486711,
|
||||||
|
"tag": "0059_sparkling_joystick",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user