fmt: frontend & flake.nix

This commit is contained in:
2025-12-18 17:30:10 +08:00
parent e2d2826d5b
commit cae7e87e06
4 changed files with 34 additions and 25 deletions

View File

@@ -21,8 +21,6 @@
{ {
default = pkgs.mkShell rec { default = pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
gcc
nodejs
(fenix.packages.${system}.complete.withComponents [ (fenix.packages.${system}.complete.withComponents [
"cargo" "cargo"
"clippy" "clippy"
@@ -31,15 +29,22 @@
"rustfmt" "rustfmt"
"rust-analyzer" "rust-analyzer"
]) ])
gcc
openssl openssl
pkg-config pkg-config
nodejs
biome
sqlite sqlite
sqlx-cli
lazysql
gemini-cli gemini-cli
claude-code claude-code
biome
sqlx-cli
typos typos
lazysql tokei
]; ];
buildInputs = [ ]; buildInputs = [ ];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (nativeBuildInputs ++ buildInputs); LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (nativeBuildInputs ++ buildInputs);

View File

@@ -1,15 +1,17 @@
import { InterceptionAction } from "../types" import { InterceptionAction } from "../types";
export const ActionBadge = (props: { action: InterceptionAction, class?: string }) => { export const ActionBadge = (props: { action: InterceptionAction; class?: string }) => {
return <span return (
class={`px-2 py-1 rounded-full text-xs ${ <span
props.action === "replace" class={`px-2 py-1 rounded-full text-xs ${
? "bg-purple-100 text-purple-800" props.action === "replace"
: props.action === "modify" ? "bg-purple-100 text-purple-800"
? "bg-blue-100 text-blue-800" : props.action === "modify"
: "bg-gray-100 text-gray-800" ? "bg-blue-100 text-blue-800"
} ${props.class ?? ""}`} : "bg-gray-100 text-gray-800"
> } ${props.class ?? ""}`}
{props.action} >
</span> {props.action}
} </span>
);
};

View File

@@ -77,20 +77,22 @@ const DataSection: Component<DataSectionProps> = (props) => {
<div class="flex text-xs rounded-md border border-gray-300 overflow-hidden"> <div class="flex text-xs rounded-md border border-gray-300 overflow-hidden">
<button <button
type="button" type="button"
class={`px-2 py-1 ${viewMode() === "tree" class={`px-2 py-1 ${
viewMode() === "tree"
? "bg-gray-200 text-gray-900 font-medium" ? "bg-gray-200 text-gray-900 font-medium"
: "bg-white text-gray-600 hover:bg-gray-50" : "bg-white text-gray-600 hover:bg-gray-50"
}`} }`}
onClick={() => setViewMode("tree")} onClick={() => setViewMode("tree")}
> >
Tree Tree
</button> </button>
<button <button
type="button" type="button"
class={`px-2 py-1 border-l border-gray-300 ${viewMode() === "raw" class={`px-2 py-1 border-l border-gray-300 ${
viewMode() === "raw"
? "bg-gray-200 text-gray-900 font-medium" ? "bg-gray-200 text-gray-900 font-medium"
: "bg-white text-gray-600 hover:bg-gray-50" : "bg-white text-gray-600 hover:bg-gray-50"
}`} }`}
onClick={() => setViewMode("raw")} onClick={() => setViewMode("raw")}
> >
Raw Raw

View File

@@ -80,8 +80,8 @@ const RequestLogs: Component = () => {
Request Logs Request Logs
<Show when={!logsData.loading}> <Show when={!logsData.loading}>
<span class="text-gray-500 text-base ml-2"> <span class="text-gray-500 text-base ml-2">
(Showing {(page() - 1) * PAGE_SIZE + 1}-{Math.min(page() * PAGE_SIZE, totalLogs())} of{" "} (Showing {totalLogs() === 0 ? 0 : (page() - 1) * PAGE_SIZE + 1}-
{totalLogs()}) {Math.min(page() * PAGE_SIZE, totalLogs())} of {totalLogs()})
</span> </span>
</Show> </Show>
</h2> </h2>