UI: improve open clan from directory & list machines
This commit is contained in:
@@ -54,17 +54,20 @@ pyApi.show_machine_deployment_target.receive((r) => {
|
||||
export const MachineListItem = (props: MachineListItemProps) => {
|
||||
const { name, info } = props;
|
||||
|
||||
pyApi.show_machine_hardware_info.dispatch({
|
||||
op_key: name,
|
||||
clan_dir: currClanURI(),
|
||||
machine_name: name,
|
||||
});
|
||||
const clan_dir = currClanURI();
|
||||
if (clan_dir) {
|
||||
pyApi.show_machine_hardware_info.dispatch({
|
||||
op_key: name,
|
||||
clan_dir,
|
||||
machine_name: name,
|
||||
});
|
||||
|
||||
pyApi.show_machine_deployment_target.dispatch({
|
||||
op_key: name,
|
||||
clan_dir: currClanURI(),
|
||||
machine_name: name,
|
||||
});
|
||||
pyApi.show_machine_deployment_target.dispatch({
|
||||
op_key: name,
|
||||
clan_dir,
|
||||
machine_name: name,
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<li>
|
||||
@@ -91,25 +94,22 @@ export const MachineListItem = (props: MachineListItemProps) => {
|
||||
</div>
|
||||
<div class="flex flex-row flex-wrap gap-4 py-2">
|
||||
<div class="badge badge-primary flex flex-row gap-1 py-4 align-middle">
|
||||
<span class="material-icons">
|
||||
{hwInfo()[name]?.system ? "check" : "pending"}
|
||||
</span>
|
||||
|
||||
<Switch fallback={<div class="skeleton h-8 w-full"></div>}>
|
||||
<Match when={hwInfo()[name]?.system}>
|
||||
{(system) => "System: " + system()}
|
||||
</Match>
|
||||
<Match when={hwInfo()[name]?.system === null}>
|
||||
{"No hardware info"}
|
||||
</Match>
|
||||
</Switch>
|
||||
<span>System:</span>
|
||||
{hwInfo()[name]?.system ? (
|
||||
<span class="text-primary">{hwInfo()[name]?.system}</span>
|
||||
) : (
|
||||
<span class="text-warning">Not set</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div class="badge badge-primary flex flex-row gap-1 py-4 align-middle">
|
||||
<span class="material-icons">
|
||||
{deploymentInfo()[name] ? "check" : "pending"}
|
||||
</span>
|
||||
<Show
|
||||
<div class="badge badge-ghost flex flex-row gap-1 py-4 align-middle">
|
||||
<span>Target Host:</span>
|
||||
{deploymentInfo()[name] ? (
|
||||
<span class="text-primary">{deploymentInfo()[name]}</span>
|
||||
) : (
|
||||
<span class="text-warning">Not set</span>
|
||||
)}
|
||||
{/* <Show
|
||||
when={deploymentInfo()[name]}
|
||||
fallback={
|
||||
<Switch fallback={<div class="skeleton h-8 w-full"></div>}>
|
||||
@@ -119,8 +119,8 @@ export const MachineListItem = (props: MachineListItemProps) => {
|
||||
</Switch>
|
||||
}
|
||||
>
|
||||
{(i) => "Deploys to: " + i()}
|
||||
</Show>
|
||||
{(i) => + i()}
|
||||
</Show> */}
|
||||
</div>
|
||||
</div>
|
||||
{/* Show only the first error at the bottom */}
|
||||
|
||||
Reference in New Issue
Block a user