add project deletion in storage & connect to ip port 3000
This commit is contained in:
@ -732,7 +732,7 @@ export default function CodeEditor({
|
||||
previewPanelRef.current?.expand();
|
||||
setIsPreviewCollapsed(false);
|
||||
}}
|
||||
sandboxId={sandboxData.id}
|
||||
ip={ip}
|
||||
/>
|
||||
</ResizablePanel>
|
||||
<ResizableHandle />
|
||||
|
@ -15,11 +15,11 @@ import { toast } from "sonner";
|
||||
export default function PreviewWindow({
|
||||
collapsed,
|
||||
open,
|
||||
sandboxId,
|
||||
ip,
|
||||
}: {
|
||||
collapsed: boolean;
|
||||
open: () => void;
|
||||
sandboxId: string;
|
||||
ip: string;
|
||||
}) {
|
||||
const ref = useRef<HTMLIFrameElement>(null);
|
||||
|
||||
@ -51,9 +51,7 @@ export default function PreviewWindow({
|
||||
|
||||
<PreviewButton
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(
|
||||
`http://${sandboxId}.sandbox.ishaand.com`
|
||||
);
|
||||
navigator.clipboard.writeText(`http://${ip}:3000`);
|
||||
toast.info("Copied preview link to clipboard");
|
||||
}}
|
||||
>
|
||||
@ -79,7 +77,7 @@ export default function PreviewWindow({
|
||||
ref={ref}
|
||||
width={"100%"}
|
||||
height={"100%"}
|
||||
src={`http://${sandboxId}.sandbox.ishaand.com`}
|
||||
src={`http://${ip}:3000`}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
@ -64,36 +64,6 @@ export function addNew(
|
||||
}
|
||||
}
|
||||
|
||||
// export async function startServer(
|
||||
// sandboxId: string,
|
||||
// userId: string,
|
||||
// callback: (success: boolean) => void
|
||||
// ) {
|
||||
// try {
|
||||
// const res = await fetch("http://localhost:4001/start", {
|
||||
// method: "POST",
|
||||
// headers: {
|
||||
// "Content-Type": "application/json",
|
||||
// },
|
||||
// body: JSON.stringify({
|
||||
// sandboxId,
|
||||
// userId,
|
||||
// }),
|
||||
// });
|
||||
|
||||
// if (res.status !== 200) {
|
||||
// console.error("Failed to start server", res);
|
||||
// callback(false);
|
||||
// }
|
||||
|
||||
// callback(true);
|
||||
// } catch (error) {
|
||||
// console.error("Failed to start server", error);
|
||||
|
||||
// callback(false);
|
||||
// }
|
||||
// }
|
||||
|
||||
export function checkServiceStatus(serviceName: string): Promise<Service> {
|
||||
return new Promise((resolve, reject) => {
|
||||
let tries = 0;
|
||||
|
Reference in New Issue
Block a user