Skip to content

Commit

Permalink
chore: set default log level to 'info'
Browse files Browse the repository at this point in the history
  • Loading branch information
mcharytoniuk committed Nov 21, 2024
1 parent 3f9b173 commit 49bd16c
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 44 deletions.
70 changes: 35 additions & 35 deletions resources/css/page-dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,45 @@ table {
margin-top: var(--padding-half);
}
}
}

.agent-row.agent-row--error {
outline: 2px solid red;
}
.agent-row.agent-row--error {
outline: 2px solid red;
}

.agent-usage {
min-width: 100px;
padding: 0;
position: relative;
}
.agent-usage {
min-width: 100px;
padding: 0;
position: relative;
}

.agent-usage__progress {
background-image: linear-gradient(
to right,
#0000ff,
#0080ff,
#00ffff,
#80ff80,
#ffff00,
#ff8000,
#ff0000
);
bottom: var(--padding-half);
left: var(--padding-half);
position: absolute;
right: var(--padding-half);
top: var(--padding-half);
.agent-usage__progress {
background-image: linear-gradient(
to right,
#0000ff,
#0080ff,
#00ffff,
#80ff80,
#ffff00,
#ff8000,
#ff0000
);
bottom: var(--padding-half);
left: var(--padding-half);
position: absolute;
right: var(--padding-half);
top: var(--padding-half);

&:after {
/* mask the progress bar to show the agent's state */
background-color: var(--color-body-background);
content: "";
display: block;
height: 100%;
position: absolute;
right: 0;
transition: width 1s;
width: var(--slots-usage);
}
&:after {
/* mask the progress bar to show the agent's state */
background-color: var(--color-body-background);
content: "";
display: block;
height: 100%;
position: absolute;
right: 0;
transition: width 1s;
width: var(--slots-usage);
}
}

Expand Down
9 changes: 8 additions & 1 deletion resources/css/reset.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ ul {
padding: 0;
}

a {
color: inherit;
text-decoration-line: underline;
text-decoration-style: solid;
text-decoration-thickness: 2px;
text-underline-offset: 2px;
}

h1 {
font-size: var(--font-size-l2);
}
Expand Down Expand Up @@ -65,7 +73,6 @@ textarea {
}

a:active,
a.turbo-clicked,
button:not(:disabled):active {
filter: grayscale(0.5);
transform: translate3d(1px, 1px, 0);
Expand Down
18 changes: 11 additions & 7 deletions resources/ts/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ type AgentsResponse = z.infer<typeof agentsResponseSchema>;

const TICK_MS = 500;

function formatTimestamp(timestamp: number): string {
return new Date(timestamp * 1000).toLocaleString();
}

export function Dashboard() {
const [agents, setAgents] = useState<Agent[]>([]);
const [isError, setIsError] = useState(false);
Expand Down Expand Up @@ -173,20 +177,20 @@ export function Dashboard() {
<>
<p>
Quarantined until{" "}
{new Date(
agent.quarantined_until.secs_since_epoch * 1000,
).toLocaleString()}
{formatTimestamp(
agent.quarantined_until.secs_since_epoch,
)}
</p>
</>
)}
{!hasIssues && <p>None</p>}
</td>
<td>{agent.external_llamacpp_addr}</td>
<td>
{new Date(
agent.last_update.secs_since_epoch * 1000,
).toLocaleString()}
<a href={`http://${agent.external_llamacpp_addr}`}>
{agent.external_llamacpp_addr}
</a>
</td>
<td>{formatTimestamp(agent.last_update.secs_since_epoch)}</td>
<td>{agent.slots_idle}</td>
<td>{agent.slots_processing}</td>
<td
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ enum Commands {
}

fn main() -> Result<()> {
env_logger::init();
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init();

let cli = Cli::parse();

Expand Down

0 comments on commit 49bd16c

Please sign in to comment.