Skip to content

Commit

Permalink
Enable color hash
Browse files Browse the repository at this point in the history
  • Loading branch information
adb-sh committed Sep 12, 2024
1 parent e79b93e commit aa7c1fa
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/routes/cloud/apps/[app]/logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { createAsync } from "@solidjs/router";
import { useParams } from "@solidjs/router";
import { cache } from "@solidjs/router";
import { For, Show, createSignal } from "solid-js";
// import ColorHash from "color-hash";
import ch from "color-hash";

// const colorHash = new ColorHash();
const colorHash = new ch.default({ saturation: 0.7, lightness: 0.7 });

const getLogs = cache(async (app: string) => {
"use server";
Expand Down Expand Up @@ -102,7 +102,8 @@ export default () => {
<span class="label-text">Pod</span>
</div>
<select
onchange={(e) => setSelect(e.target.value)}
value={select()}
onInput={(e) => setSelect(e.target.value)}
class="select select-bordered"
>
<option value="all">all</option>
Expand All @@ -127,11 +128,15 @@ export default () => {
{(logItem) => (
<tr>
<th>{logItem.date.toLocaleString()}</th>
{/* <Show when={select() === "all"}>
<td class={`text-[${colorHash.hex(logItem.pod ?? "")}]`}>
<Show when={select() === "all"}>
<td
style={{
color: colorHash.hex(logItem.pod ?? ""),
}}
>
{logItem.pod}
</td>
</Show> */}
</Show>
<td>{logItem.log}</td>
</tr>
)}
Expand Down

0 comments on commit aa7c1fa

Please sign in to comment.