api: rename 'show_mdns' -> 'list_mdns_services'
This commit is contained in:
@@ -4,7 +4,7 @@ import { Button } from "../../components/Button/Button";
|
|||||||
import Icon from "@/src/components/icon";
|
import Icon from "@/src/components/icon";
|
||||||
|
|
||||||
type ServiceModel = Extract<
|
type ServiceModel = Extract<
|
||||||
OperationResponse<"show_mdns">,
|
OperationResponse<"list_mdns_services">,
|
||||||
{ status: "success" }
|
{ status: "success" }
|
||||||
>["data"]["services"];
|
>["data"]["services"];
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ export const HostList: Component = () => {
|
|||||||
<div class="" data-tip="Refresh install targets">
|
<div class="" data-tip="Refresh install targets">
|
||||||
<Button
|
<Button
|
||||||
variant="light"
|
variant="light"
|
||||||
onClick={() => callApi("show_mdns", {})}
|
onClick={() => callApi("list_mdns_services", {})}
|
||||||
startIcon={<Icon icon="Update" />}
|
startIcon={<Icon icon="Update" />}
|
||||||
></Button>
|
></Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { Button } from "../../components/Button/Button";
|
|||||||
import Icon from "@/src/components/icon";
|
import Icon from "@/src/components/icon";
|
||||||
|
|
||||||
type ServiceModel = Extract<
|
type ServiceModel = Extract<
|
||||||
OperationResponse<"show_mdns">,
|
OperationResponse<"list_mdns_services">,
|
||||||
{ status: "success" }
|
{ status: "success" }
|
||||||
>["data"]["services"];
|
>["data"]["services"];
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ export const HostList: Component = () => {
|
|||||||
<div class="" data-tip="Refresh install targets">
|
<div class="" data-tip="Refresh install targets">
|
||||||
<Button
|
<Button
|
||||||
variant="light"
|
variant="light"
|
||||||
onClick={() => callApi("show_mdns", {})}
|
onClick={() => callApi("list_mdns_services", {})}
|
||||||
startIcon={<Icon icon="Update" />}
|
startIcon={<Icon icon="Update" />}
|
||||||
></Button>
|
></Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ def parse_avahi_output(output: str) -> DNSInfo:
|
|||||||
|
|
||||||
|
|
||||||
@API.register
|
@API.register
|
||||||
def show_mdns() -> DNSInfo:
|
def list_mdns_services() -> DNSInfo:
|
||||||
cmd = nix_shell(
|
cmd = nix_shell(
|
||||||
["avahi"],
|
["avahi"],
|
||||||
[
|
[
|
||||||
@@ -107,7 +107,7 @@ def show_mdns() -> DNSInfo:
|
|||||||
|
|
||||||
|
|
||||||
def mdns_command(args: argparse.Namespace) -> None:
|
def mdns_command(args: argparse.Namespace) -> None:
|
||||||
dns_info = show_mdns()
|
dns_info = list_mdns_services()
|
||||||
for name, info in dns_info.services.items():
|
for name, info in dns_info.services.items():
|
||||||
print(f"Hostname: {name} - ip: {info.ip}")
|
print(f"Hostname: {name} - ip: {info.ip}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user