mirror of
https://github.com/khairul169/code-share.git
synced 2025-04-28 16:49:36 +07:00
feat: adjust api address, fix project visibility not updated
This commit is contained in:
parent
85e71c2983
commit
7bdd995394
@ -92,7 +92,7 @@ const Actions = ({ stats }: any) => {
|
|||||||
},
|
},
|
||||||
onSuccess: () => stats.refetch(),
|
onSuccess: () => stats.refetch(),
|
||||||
});
|
});
|
||||||
const proxyUrl = `/api/sandbox/${project.slug}/proxy`;
|
const { address } = stats.data?.result;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
@ -108,26 +108,26 @@ const Actions = ({ stats }: any) => {
|
|||||||
icon={FaCopy}
|
icon={FaCopy}
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="md"
|
size="md"
|
||||||
onClick={() => copy(proxyUrl)}
|
onClick={() => copy(address)}
|
||||||
/>
|
/>
|
||||||
<ActionButton
|
<ActionButton
|
||||||
icon={FaExternalLinkAlt}
|
icon={FaExternalLinkAlt}
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="md"
|
size="md"
|
||||||
onClick={() => window.open(getUrl(proxyUrl), "_blank")}
|
onClick={() => window.open(address, "_blank")}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const Stats = ({ data }: any) => {
|
const Stats = ({ data }: any) => {
|
||||||
const { cpu, mem, memUsage, network, status, addr } = data;
|
const { cpu, mem, memUsage, network, status, address } = data;
|
||||||
const [memUsed, memTotal] = memUsage || [];
|
const [memUsed, memTotal] = memUsage || [];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col text-sm flex-1">
|
<div className="flex flex-col text-sm flex-1">
|
||||||
<p>Status: {status}</p>
|
<p>Status: {status}</p>
|
||||||
<p>Address: {addr}</p>
|
<p>Address: {address}</p>
|
||||||
<p>CPU: {cpu}%</p>
|
<p>CPU: {cpu}%</p>
|
||||||
<p>
|
<p>
|
||||||
Memory: {memUsed != null ? `${memUsed} / ${memTotal} (${mem}%)` : "-"}
|
Memory: {memUsed != null ? `${memUsed} / ${memTotal} (${mem}%)` : "-"}
|
||||||
|
@ -47,8 +47,8 @@ const SettingsDialog = () => {
|
|||||||
const initialValues = useMemo(() => {
|
const initialValues = useMemo(() => {
|
||||||
return Object.assign(defaultValues, {
|
return Object.assign(defaultValues, {
|
||||||
title: project.title,
|
title: project.title,
|
||||||
// slug: project.slug,
|
|
||||||
settings: project.settings,
|
settings: project.settings,
|
||||||
|
visibility: project.visibility,
|
||||||
});
|
});
|
||||||
}, [project]);
|
}, [project]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user