From 4d25688f963dbe5761f1a74885dff81e0e2ac9e1 Mon Sep 17 00:00:00 2001 From: Duncan Blythe Date: Mon, 7 Oct 2024 21:47:52 +0200 Subject: [PATCH] Add frontend --- .gitignore | 1 + CHANGELOG.md | 1 + MANIFEST.in | 3 +- pyproject.toml | 3 +- superduper/cli/main.py | 21 ++++- superduper/rest/base.py | 8 +- superduper/rest/build.py | 76 ++++++++++++++++++ superduper/rest/out/404.html | 1 + .../chunks/0e5ce63c-ead5432328c51640.js | 1 + .../static/chunks/108-58207d3a3812fed0.js | 1 + .../static/chunks/125-cb08adbf044617a4.js | 1 + .../static/chunks/208-0ffe25bb41393c16.js | 1 + .../static/chunks/214-dacce76fc3d55545.js | 1 + .../static/chunks/224-9ddb69db062cc4ea.js | 14 ++++ .../static/chunks/23-826c8670610b69f2.js | 2 + .../static/chunks/231-d9cf399ecf8e45f9.js | 1 + .../static/chunks/27-2e3c86235fbdd031.js | 1 + .../static/chunks/314-12cd07c2bda84fb3.js | 1 + .../static/chunks/361-26396b3726ce3adc.js | 9 +++ .../static/chunks/479-228a39e09a20c473.js | 1 + .../static/chunks/532-0e67ac734667d3a4.js | 9 +++ .../static/chunks/549-b7d160913f282604.js | 1 + .../static/chunks/702-d1852419c015a96d.js | 1 + .../static/chunks/708-6ba372a6bfa56b58.js | 1 + .../static/chunks/726-245b5a45db2a1347.js | 1 + .../static/chunks/731-5ddb855da8ade6dc.js | 1 + .../static/chunks/74-c6b4fcb11d20eec7.js | 1 + .../chunks/7589b812-ce58bf1a1bef49c7.js | 1 + .../static/chunks/76-7928bae0065b3a6a.js | 1 + .../static/chunks/769-32b454ce79c56f70.js | 1 + .../static/chunks/797-ff4f736f070c73a1.js | 1 + .../static/chunks/84-d0acdfbc98c06dc4.js | 11 +++ .../static/chunks/961-2e7cf064038e290c.js | 1 + .../app/_not-found/page-ff9adb5dc9099aaa.js | 1 + .../chunks/app/layout-410275617432b0ca.js | 1 + .../chunks/app/not-found-d03cfc12dc19fbbb.js | 1 + .../chunks/app/page-d71b1733327438ab.js | 1 + .../add-application/page-2bd7a465c0246bf1.js | 1 + .../add-components/page-750f591cee7e0dd5.js | 1 + .../add-template/page-24ad26e0f768e0a5.js | 1 + .../application/page-2ac1b54a2e8d14f2.js | 1 + .../webui/deployment/page-cc12d0a243da5e87.js | 1 + .../app/webui/login/page-790d55773770adec.js | 1 + .../chunks/app/webui/page-5cce8442e7ef7c0c.js | 1 + .../app/webui/query/page-11ea62e102ae0a21.js | 6 ++ .../app/webui/show/page-7a08e5b18a51edf4.js | 1 + .../webui/support/page-e10e3ebbe2454365.js | 1 + .../webui/templates/page-480fe3cb8fb8091f.js | 1 + .../app/webui/update/page-63abf3de3b7fa6ca.js | 1 + .../chunks/fd9d1056-4ed9fe495d6d5770.js | 1 + .../chunks/framework-aec844d2ccbe7592.js | 33 ++++++++ .../static/chunks/main-762426b56b8b112f.js | 6 ++ .../chunks/main-app-bd936c06284ec9cf.js | 1 + .../chunks/pages/_app-6a626577ffa902a4.js | 1 + .../chunks/pages/_error-1be831200e60c5c0.js | 1 + .../chunks/polyfills-78c92fac7aa8fdd8.js | 1 + .../static/chunks/webpack-22c91002c2a64cc5.js | 1 + .../out/_next/static/css/3e415ce24b168a6e.css | 3 + .../u7kQQ-ZckL3eMsoMMqmR4/_buildManifest.js | 1 + .../u7kQQ-ZckL3eMsoMMqmR4/_ssgManifest.js | 1 + superduper/rest/out/favicon.ico | Bin 0 -> 15086 bytes superduper/rest/out/icon.ico | Bin 0 -> 15086 bytes superduper/rest/out/index.html | 1 + superduper/rest/out/index.txt | 10 +++ superduper/rest/out/webui.html | 1 + superduper/rest/out/webui.txt | 10 +++ .../rest/out/webui/add-application.html | 1 + superduper/rest/out/webui/add-application.txt | 10 +++ superduper/rest/out/webui/add-components.html | 1 + superduper/rest/out/webui/add-components.txt | 10 +++ superduper/rest/out/webui/add-template.html | 1 + superduper/rest/out/webui/add-template.txt | 10 +++ superduper/rest/out/webui/application.html | 1 + superduper/rest/out/webui/application.txt | 10 +++ superduper/rest/out/webui/deployment.html | 1 + superduper/rest/out/webui/deployment.txt | 10 +++ superduper/rest/out/webui/login.html | 1 + superduper/rest/out/webui/login.txt | 10 +++ superduper/rest/out/webui/query.html | 1 + superduper/rest/out/webui/query.txt | 10 +++ superduper/rest/out/webui/show.html | 1 + superduper/rest/out/webui/show.txt | 10 +++ superduper/rest/out/webui/support.html | 1 + superduper/rest/out/webui/support.txt | 8 ++ superduper/rest/out/webui/templates.html | 1 + superduper/rest/out/webui/templates.txt | 10 +++ superduper/rest/out/webui/update.html | 1 + superduper/rest/out/webui/update.txt | 10 +++ .../webui_asset/android-chrome-192x192.png | Bin 0 -> 14543 bytes .../rest/out/webui_asset/background-4.png | Bin 0 -> 69480 bytes .../rest/out/webui_asset/background-5.jpg | Bin 0 -> 100452 bytes superduper/rest/out/webui_asset/favicon.ico | Bin 0 -> 15086 bytes .../out/webui_asset/fonts/Inter-Black.woff2 | Bin 0 -> 108748 bytes .../out/webui_asset/fonts/Inter-Bold.woff2 | Bin 0 -> 111040 bytes .../webui_asset/fonts/Inter-ExtraBold.woff2 | Bin 0 -> 111360 bytes .../out/webui_asset/fonts/Inter-Medium.woff2 | Bin 0 -> 111380 bytes .../out/webui_asset/fonts/Inter-Regular.woff2 | Bin 0 -> 108488 bytes .../webui_asset/fonts/Inter-SemiBold.woff2 | Bin 0 -> 111588 bytes superduper/rest/out/webui_asset/icon.ico | Bin 0 -> 15086 bytes .../rest/out/webui_asset/purple-dark.png | Bin 0 -> 24876 bytes 100 files changed, 385 insertions(+), 6 deletions(-) create mode 100644 superduper/rest/out/404.html create mode 100644 superduper/rest/out/_next/static/chunks/0e5ce63c-ead5432328c51640.js create mode 100644 superduper/rest/out/_next/static/chunks/108-58207d3a3812fed0.js create mode 100644 superduper/rest/out/_next/static/chunks/125-cb08adbf044617a4.js create mode 100644 superduper/rest/out/_next/static/chunks/208-0ffe25bb41393c16.js create mode 100644 superduper/rest/out/_next/static/chunks/214-dacce76fc3d55545.js create mode 100644 superduper/rest/out/_next/static/chunks/224-9ddb69db062cc4ea.js create mode 100644 superduper/rest/out/_next/static/chunks/23-826c8670610b69f2.js create mode 100644 superduper/rest/out/_next/static/chunks/231-d9cf399ecf8e45f9.js create mode 100644 superduper/rest/out/_next/static/chunks/27-2e3c86235fbdd031.js create mode 100644 superduper/rest/out/_next/static/chunks/314-12cd07c2bda84fb3.js create mode 100644 superduper/rest/out/_next/static/chunks/361-26396b3726ce3adc.js create mode 100644 superduper/rest/out/_next/static/chunks/479-228a39e09a20c473.js create mode 100644 superduper/rest/out/_next/static/chunks/532-0e67ac734667d3a4.js create mode 100644 superduper/rest/out/_next/static/chunks/549-b7d160913f282604.js create mode 100644 superduper/rest/out/_next/static/chunks/702-d1852419c015a96d.js create mode 100644 superduper/rest/out/_next/static/chunks/708-6ba372a6bfa56b58.js create mode 100644 superduper/rest/out/_next/static/chunks/726-245b5a45db2a1347.js create mode 100644 superduper/rest/out/_next/static/chunks/731-5ddb855da8ade6dc.js create mode 100644 superduper/rest/out/_next/static/chunks/74-c6b4fcb11d20eec7.js create mode 100644 superduper/rest/out/_next/static/chunks/7589b812-ce58bf1a1bef49c7.js create mode 100644 superduper/rest/out/_next/static/chunks/76-7928bae0065b3a6a.js create mode 100644 superduper/rest/out/_next/static/chunks/769-32b454ce79c56f70.js create mode 100644 superduper/rest/out/_next/static/chunks/797-ff4f736f070c73a1.js create mode 100644 superduper/rest/out/_next/static/chunks/84-d0acdfbc98c06dc4.js create mode 100644 superduper/rest/out/_next/static/chunks/961-2e7cf064038e290c.js create mode 100644 superduper/rest/out/_next/static/chunks/app/_not-found/page-ff9adb5dc9099aaa.js create mode 100644 superduper/rest/out/_next/static/chunks/app/layout-410275617432b0ca.js create mode 100644 superduper/rest/out/_next/static/chunks/app/not-found-d03cfc12dc19fbbb.js create mode 100644 superduper/rest/out/_next/static/chunks/app/page-d71b1733327438ab.js create mode 100644 superduper/rest/out/_next/static/chunks/app/webui/add-application/page-2bd7a465c0246bf1.js create mode 100644 superduper/rest/out/_next/static/chunks/app/webui/add-components/page-750f591cee7e0dd5.js create mode 100644 superduper/rest/out/_next/static/chunks/app/webui/add-template/page-24ad26e0f768e0a5.js create mode 100644 superduper/rest/out/_next/static/chunks/app/webui/application/page-2ac1b54a2e8d14f2.js create mode 100644 superduper/rest/out/_next/static/chunks/app/webui/deployment/page-cc12d0a243da5e87.js create mode 100644 superduper/rest/out/_next/static/chunks/app/webui/login/page-790d55773770adec.js create mode 100644 superduper/rest/out/_next/static/chunks/app/webui/page-5cce8442e7ef7c0c.js create mode 100644 superduper/rest/out/_next/static/chunks/app/webui/query/page-11ea62e102ae0a21.js create mode 100644 superduper/rest/out/_next/static/chunks/app/webui/show/page-7a08e5b18a51edf4.js create mode 100644 superduper/rest/out/_next/static/chunks/app/webui/support/page-e10e3ebbe2454365.js create mode 100644 superduper/rest/out/_next/static/chunks/app/webui/templates/page-480fe3cb8fb8091f.js create mode 100644 superduper/rest/out/_next/static/chunks/app/webui/update/page-63abf3de3b7fa6ca.js create mode 100644 superduper/rest/out/_next/static/chunks/fd9d1056-4ed9fe495d6d5770.js create mode 100644 superduper/rest/out/_next/static/chunks/framework-aec844d2ccbe7592.js create mode 100644 superduper/rest/out/_next/static/chunks/main-762426b56b8b112f.js create mode 100644 superduper/rest/out/_next/static/chunks/main-app-bd936c06284ec9cf.js create mode 100644 superduper/rest/out/_next/static/chunks/pages/_app-6a626577ffa902a4.js create mode 100644 superduper/rest/out/_next/static/chunks/pages/_error-1be831200e60c5c0.js create mode 100644 superduper/rest/out/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js create mode 100644 superduper/rest/out/_next/static/chunks/webpack-22c91002c2a64cc5.js create mode 100644 superduper/rest/out/_next/static/css/3e415ce24b168a6e.css create mode 100644 superduper/rest/out/_next/static/u7kQQ-ZckL3eMsoMMqmR4/_buildManifest.js create mode 100644 superduper/rest/out/_next/static/u7kQQ-ZckL3eMsoMMqmR4/_ssgManifest.js create mode 100644 superduper/rest/out/favicon.ico create mode 100644 superduper/rest/out/icon.ico create mode 100644 superduper/rest/out/index.html create mode 100644 superduper/rest/out/index.txt create mode 100644 superduper/rest/out/webui.html create mode 100644 superduper/rest/out/webui.txt create mode 100644 superduper/rest/out/webui/add-application.html create mode 100644 superduper/rest/out/webui/add-application.txt create mode 100644 superduper/rest/out/webui/add-components.html create mode 100644 superduper/rest/out/webui/add-components.txt create mode 100644 superduper/rest/out/webui/add-template.html create mode 100644 superduper/rest/out/webui/add-template.txt create mode 100644 superduper/rest/out/webui/application.html create mode 100644 superduper/rest/out/webui/application.txt create mode 100644 superduper/rest/out/webui/deployment.html create mode 100644 superduper/rest/out/webui/deployment.txt create mode 100644 superduper/rest/out/webui/login.html create mode 100644 superduper/rest/out/webui/login.txt create mode 100644 superduper/rest/out/webui/query.html create mode 100644 superduper/rest/out/webui/query.txt create mode 100644 superduper/rest/out/webui/show.html create mode 100644 superduper/rest/out/webui/show.txt create mode 100644 superduper/rest/out/webui/support.html create mode 100644 superduper/rest/out/webui/support.txt create mode 100644 superduper/rest/out/webui/templates.html create mode 100644 superduper/rest/out/webui/templates.txt create mode 100644 superduper/rest/out/webui/update.html create mode 100644 superduper/rest/out/webui/update.txt create mode 100644 superduper/rest/out/webui_asset/android-chrome-192x192.png create mode 100644 superduper/rest/out/webui_asset/background-4.png create mode 100644 superduper/rest/out/webui_asset/background-5.jpg create mode 100644 superduper/rest/out/webui_asset/favicon.ico create mode 100644 superduper/rest/out/webui_asset/fonts/Inter-Black.woff2 create mode 100644 superduper/rest/out/webui_asset/fonts/Inter-Bold.woff2 create mode 100644 superduper/rest/out/webui_asset/fonts/Inter-ExtraBold.woff2 create mode 100644 superduper/rest/out/webui_asset/fonts/Inter-Medium.woff2 create mode 100644 superduper/rest/out/webui_asset/fonts/Inter-Regular.woff2 create mode 100644 superduper/rest/out/webui_asset/fonts/Inter-SemiBold.woff2 create mode 100644 superduper/rest/out/webui_asset/icon.ico create mode 100644 superduper/rest/out/webui_asset/purple-dark.png diff --git a/.gitignore b/.gitignore index 8167a4acc..ebd6a6d90 100644 --- a/.gitignore +++ b/.gitignore @@ -193,3 +193,4 @@ test/sleep.json /.superduperdb /output/ /deploy/testenv/requirements.txt +/superduper/rest/superdupertmp \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b01b3f653..635eb6a9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated CONTRIBUTING.md - Add README.md files for the plugins. - Add templates to project +- Add frontend to project #### New Features & Functionality diff --git a/MANIFEST.in b/MANIFEST.in index c914d04a4..4c2a1f0be 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,2 @@ -recursive-include templates *.zip \ No newline at end of file +recursive-include templates * +recursive-include superduper/rest/out * \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6f37910d3..c66a774dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,9 +46,10 @@ dependencies = [ "numpy>=1.24.3", "overrides>=7", "tenacity>=8.1.0,<=8.2.3", - "PyYAML>=6.0.0", + "packaging", "prettytable", "python-dotenv", + "PyYAML>=6.0.0", "uvicorn>=0.24.0", "fastapi>=0.103.2", "ruamel.yaml>=0.18", diff --git a/superduper/cli/main.py b/superduper/cli/main.py index 9953bd038..a9076776b 100644 --- a/superduper/cli/main.py +++ b/superduper/cli/main.py @@ -19,8 +19,25 @@ def apply(name: str, variables: str | None = None): @command(help='Start rest server and user interface') def start(port: int = 8000, host: str = 'localhost'): - """Start the rest server and user interface.""" - ... + """Start the rest server and user interface. + + :param port: Port to run the server on. + :param host: Host to run the server on. + """ + from superduper.rest.base import SuperDuperApp + from superduper.rest.build import build_frontend, build_rest_app + + app = SuperDuperApp('rest', port=port) + + if host == 'localhost': + # host frontend and server together + build_rest_app(app) + app.add_default_endpoints() + else: + logging.warn('Frontend pointing to remote server!') + + build_frontend(app, port=port, host=host) + app.start() @command(help='Apply a template or application to a `superduper` deployment') diff --git a/superduper/rest/base.py b/superduper/rest/base.py index b2830014d..5102a6805 100644 --- a/superduper/rest/base.py +++ b/superduper/rest/base.py @@ -138,8 +138,9 @@ def add_default_endpoints(self): - /health: Health check endpoint - /handshake/config: Handshake endpoint """ + logging.info(f"Adding default endpoints to '{self.service}' app") - @self.router.get('/health') + @self.add('/health', method='get') def health(): return {'status': 200} @@ -152,7 +153,10 @@ def print_routes(self): # Add rows to the table for route in self._app.routes: - table.add_row([route.path, ", ".join(route.methods), route.name]) + try: + table.add_row([route.path, ", ".join(route.methods), route.name]) + except AttributeError: + logging.warn(f"Route {route} has no name") logging.info(f"Routes for '{self.service}' app: \n{table}") diff --git a/superduper/rest/build.py b/superduper/rest/build.py index 2ec5efd49..4cde2a2d1 100644 --- a/superduper/rest/build.py +++ b/superduper/rest/build.py @@ -1,4 +1,5 @@ import hashlib +import shutil import typing as t import magic @@ -132,3 +133,78 @@ def db_execute( if 'score' in result[0][0]: result = sorted(result, key=lambda x: -x[0]['score']) return result + + +def build_frontend(app: SuperDuperApp, host: str = 'localhost', port: int = 8000): + """Add the frontend to the FastAPI app. + + :param app: app instance SuperDuperApp + :param host: host address + :param port: port number + """ + import os + + from fastapi import HTTPException, Request + from fastapi.responses import FileResponse + from fastapi.staticfiles import StaticFiles + + ROOT = os.path.dirname(os.path.abspath(__file__)) + + try: + shutil.rmtree(f"{ROOT}/superdupertmp") + except FileNotFoundError: + pass + + shutil.copytree(f"{ROOT}/out", f"{ROOT}/superdupertmp") + + DIRECTORY = f"{ROOT}/superdupertmp" + + if host != 'localhost' or port != 8000: + for root, _, files in os.walk(DIRECTORY): + for file in files: + if file.endswith('.js'): + with open(os.path.join(root, file), "r") as f: + content = f.read() + content = content.replace("localhost:8000", f"{ host }:{ port }") + with open(os.path.join(root, file), "w") as f: + f.write(content) + + app.app.mount("/static", StaticFiles(directory=DIRECTORY), name="static") + + @app.app.get("/{path:path}") + async def serve_file(request: Request, path: str): + """Serve files from the default 'out' directory. + + :param request: Request + :param path: path to file + """ + # Special case: if path is 'webui', serve the 'index.html' + # from the 'out' directory + if path == "webui": + webui_index = os.path.join(DIRECTORY, "index.html") + if os.path.exists(webui_index): + return FileResponse(webui_index) + else: + raise HTTPException( + status_code=404, detail="index.html not found for /webui" + ) + + # Normal case: serve files from the 'out' directory + requested_path = os.path.join(DIRECTORY, path.lstrip("/")) + + # If the path is a directory, attempt to serve index.html + if os.path.isdir(requested_path): + index_file = os.path.join(requested_path, "index.html") + if os.path.exists(index_file): + return FileResponse(index_file) + + if os.path.exists(requested_path): + return FileResponse(requested_path) + + # Try appending .html to the requested path + path_with_html = f"{requested_path}.html" + if os.path.exists(path_with_html): + return FileResponse(path_with_html) + + # If file not found, raise a 404 error + raise HTTPException(status_code=404, detail="File not found") diff --git a/superduper/rest/out/404.html b/superduper/rest/out/404.html new file mode 100644 index 000000000..1b38f972b --- /dev/null +++ b/superduper/rest/out/404.html @@ -0,0 +1 @@ +Superduper EnterpriseSuperduper Enterprise

404

Page Not Found

Go back home
\ No newline at end of file diff --git a/superduper/rest/out/_next/static/chunks/0e5ce63c-ead5432328c51640.js b/superduper/rest/out/_next/static/chunks/0e5ce63c-ead5432328c51640.js new file mode 100644 index 000000000..56cca8756 --- /dev/null +++ b/superduper/rest/out/_next/static/chunks/0e5ce63c-ead5432328c51640.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[310],{4867:function(e,r,n){n.d(r,{LPM:function(){return E},Pxu:function(){return g},TIy:function(){return s},WCv:function(){return O},XCv:function(){return v},_Ve:function(){return b},g8U:function(){return a},jXb:function(){return m},jnn:function(){return C},nQG:function(){return c},nWS:function(){return M},v4q:function(){return d}});var t=n(2265);function o(e,r){if(null==e)return{};var n,t,o={},l=Object.keys(e);for(t=0;t=0||(o[n]=e[n]);return o}var l=["color"],C=(0,t.forwardRef)(function(e,r){var n=e.color,C=o(e,l);return(0,t.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C,{ref:r}),(0,t.createElement)("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:void 0===n?"currentColor":n,fillRule:"evenodd",clipRule:"evenodd"}))}),i=["color"],c=(0,t.forwardRef)(function(e,r){var n=e.color,l=o(e,i);return(0,t.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:r}),(0,t.createElement)("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:void 0===n?"currentColor":n,fillRule:"evenodd",clipRule:"evenodd"}))}),f=["color"],d=(0,t.forwardRef)(function(e,r){var n=e.color,l=o(e,f);return(0,t.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:r}),(0,t.createElement)("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:void 0===n?"currentColor":n,fillRule:"evenodd",clipRule:"evenodd"}))}),u=["color"],v=(0,t.forwardRef)(function(e,r){var n=e.color,l=o(e,u);return(0,t.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:r}),(0,t.createElement)("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:void 0===n?"currentColor":n,fillRule:"evenodd",clipRule:"evenodd"}))}),w=["color"],a=(0,t.forwardRef)(function(e,r){var n=e.color,l=o(e,w);return(0,t.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:r}),(0,t.createElement)("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:void 0===n?"currentColor":n,fillRule:"evenodd",clipRule:"evenodd"}))}),L=["color"],s=(0,t.forwardRef)(function(e,r){var n=e.color,l=o(e,L);return(0,t.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:r}),(0,t.createElement)("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:void 0===n?"currentColor":n,fillRule:"evenodd",clipRule:"evenodd"}))}),h=["color"],g=(0,t.forwardRef)(function(e,r){var n=e.color,l=o(e,h);return(0,t.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:r}),(0,t.createElement)("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:void 0===n?"currentColor":n,fillRule:"evenodd",clipRule:"evenodd"}))}),p=["color"],m=(0,t.forwardRef)(function(e,r){var n=e.color,l=o(e,p);return(0,t.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:r}),(0,t.createElement)("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:void 0===n?"currentColor":n}))}),R=["color"],M=(0,t.forwardRef)(function(e,r){var n=e.color,l=o(e,R);return(0,t.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:r}),(0,t.createElement)("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:void 0===n?"currentColor":n,fillRule:"evenodd",clipRule:"evenodd"}))}),x=["color"],E=(0,t.forwardRef)(function(e,r){var n=e.color,l=o(e,x);return(0,t.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:r}),(0,t.createElement)("path",{d:"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z",fill:void 0===n?"currentColor":n,fillRule:"evenodd",clipRule:"evenodd"}))}),Z=["color"],b=(0,t.forwardRef)(function(e,r){var n=e.color,l=o(e,Z);return(0,t.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:r}),(0,t.createElement)("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:void 0===n?"currentColor":n,fillRule:"evenodd",clipRule:"evenodd"}))}),j=["color"],O=(0,t.forwardRef)(function(e,r){var n=e.color,l=o(e,j);return(0,t.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:r}),(0,t.createElement)("path",{d:"M6.85357 3.85355L7.65355 3.05353C8.2981 2.40901 9.42858 1.96172 10.552 1.80125C11.1056 1.72217 11.6291 1.71725 12.0564 1.78124C12.4987 1.84748 12.7698 1.97696 12.8965 2.10357C13.0231 2.23018 13.1526 2.50125 13.2188 2.94357C13.2828 3.37086 13.2779 3.89439 13.1988 4.44801C13.0383 5.57139 12.591 6.70188 11.9464 7.34645L7.49999 11.7929L6.35354 10.6465C6.15827 10.4512 5.84169 10.4512 5.64643 10.6465C5.45117 10.8417 5.45117 11.1583 5.64643 11.3536L7.14644 12.8536C7.34171 13.0488 7.65829 13.0488 7.85355 12.8536L8.40073 12.3064L9.57124 14.2572C9.65046 14.3893 9.78608 14.4774 9.9389 14.4963C10.0917 14.5151 10.2447 14.4624 10.3535 14.3536L12.3535 12.3536C12.4648 12.2423 12.5172 12.0851 12.495 11.9293L12.0303 8.67679L12.6536 8.05355C13.509 7.19808 14.0117 5.82855 14.1887 4.58943C14.2784 3.9618 14.2891 3.33847 14.2078 2.79546C14.1287 2.26748 13.9519 1.74482 13.6035 1.39645C13.2552 1.04809 12.7325 0.871332 12.2045 0.792264C11.6615 0.710945 11.0382 0.721644 10.4105 0.8113C9.17143 0.988306 7.80189 1.491 6.94644 2.34642L6.32322 2.96968L3.07071 2.50504C2.91492 2.48278 2.75773 2.53517 2.64645 2.64646L0.646451 4.64645C0.537579 4.75533 0.484938 4.90829 0.50375 5.0611C0.522563 5.21391 0.61073 5.34954 0.742757 5.42876L2.69364 6.59928L2.14646 7.14645C2.0527 7.24022 2.00002 7.3674 2.00002 7.50001C2.00002 7.63261 2.0527 7.75979 2.14646 7.85356L3.64647 9.35356C3.84173 9.54883 4.15831 9.54883 4.35357 9.35356C4.54884 9.1583 4.54884 8.84172 4.35357 8.64646L3.20712 7.50001L3.85357 6.85356L6.85357 3.85355ZM10.0993 13.1936L9.12959 11.5775L11.1464 9.56067L11.4697 11.8232L10.0993 13.1936ZM3.42251 5.87041L5.43935 3.85356L3.17678 3.53034L1.80638 4.90074L3.42251 5.87041ZM2.35356 10.3535C2.54882 10.1583 2.54882 9.8417 2.35356 9.64644C2.1583 9.45118 1.84171 9.45118 1.64645 9.64644L0.646451 10.6464C0.451188 10.8417 0.451188 11.1583 0.646451 11.3535C0.841713 11.5488 1.1583 11.5488 1.35356 11.3535L2.35356 10.3535ZM3.85358 11.8536C4.04884 11.6583 4.04885 11.3417 3.85359 11.1465C3.65833 10.9512 3.34175 10.9512 3.14648 11.1465L1.14645 13.1464C0.95119 13.3417 0.951187 13.6583 1.14645 13.8535C1.34171 14.0488 1.65829 14.0488 1.85355 13.8536L3.85358 11.8536ZM5.35356 13.3535C5.54882 13.1583 5.54882 12.8417 5.35356 12.6464C5.1583 12.4512 4.84171 12.4512 4.64645 12.6464L3.64645 13.6464C3.45119 13.8417 3.45119 14.1583 3.64645 14.3535C3.84171 14.5488 4.1583 14.5488 4.35356 14.3535L5.35356 13.3535ZM9.49997 6.74881C10.1897 6.74881 10.7488 6.1897 10.7488 5.5C10.7488 4.8103 10.1897 4.25118 9.49997 4.25118C8.81026 4.25118 8.25115 4.8103 8.25115 5.5C8.25115 6.1897 8.81026 6.74881 9.49997 6.74881Z",fill:void 0===n?"currentColor":n,fillRule:"evenodd",clipRule:"evenodd"}))})}}]); \ No newline at end of file diff --git a/superduper/rest/out/_next/static/chunks/108-58207d3a3812fed0.js b/superduper/rest/out/_next/static/chunks/108-58207d3a3812fed0.js new file mode 100644 index 000000000..890907131 --- /dev/null +++ b/superduper/rest/out/_next/static/chunks/108-58207d3a3812fed0.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[108],{548:function(e,t,s){s.d(t,{Z:function(){return o}});var r=s(7437);s(2265);var n=s(9908),a=s(7138),i=()=>(0,r.jsx)(r.Fragment,{});function o(e){let{header:t,description:s,createDeployment:o,showIconPart:l=!0,showHeadUp:d=!1}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),l&&(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",className:"mx-auto h-12 w-12 text-gray-400",children:(0,r.jsx)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"})}),(0,r.jsx)("h3",{className:"mt-2 text-sm font-semibold text-gray-900",children:t||"No Deployments Found"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:s||"Get started by creating a new deployment."})]}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),o&&"hide"==o?"":(0,r.jsxs)("div",{children:[d&&(0,r.jsx)(i,{}),(0,r.jsx)("div",{className:"flex items-center justify-center",children:(0,r.jsx)("div",{className:"bg-white shadow sm:rounded-lg",children:(0,r.jsx)("div",{className:"px-4 py-5 sm:p-6",children:(0,r.jsxs)("div",{className:"sm:flex sm:items-start sm:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-base font-semibold leading-6 text-gray-900",children:"Create Deployment"}),(0,r.jsx)("div",{className:"mt-2 max-w-xl text-sm text-gray-500",children:(0,r.jsx)("p",{children:"You have to create a deployment to use SuperDuper, first you need to deploy instances and then we will manage everything for you."})})]}),(0,r.jsx)("div",{className:"mt-5 sm:ml-6 sm:mt-0 sm:flex sm:flex-shrink-0 sm:items-center",children:(0,r.jsx)(a.default,{href:"/webui/deployment",children:(0,r.jsxs)("button",{type:"button",className:"inline-flex items-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600",children:["Start Here",(0,r.jsx)("span",{children:" "}),(0,r.jsx)(n.Z,{className:"ml-0.5 -mr.5 h-5 w-5","aria-hidden":"true"})]})})})]})})})})]})]})}},7166:function(e,t,s){s.d(t,{J2:function(){return o},xo:function(){return l},yk:function(){return d}});var r=s(7437),n=s(2265),a=s(1485),i=s(7700);let o=a.fC,l=a.xz;a.ee;let d=n.forwardRef((e,t)=>{let{className:s,align:n="center",sideOffset:o=4,...l}=e;return(0,r.jsx)(a.h_,{children:(0,r.jsx)(a.VY,{ref:t,align:n,sideOffset:o,className:(0,i.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...l})})});d.displayName=a.VY.displayName},5797:function(e,t,s){s.d(t,{B:function(){return l},x:function(){return o}});var r=s(7437),n=s(2265),a=s(23),i=s(7700);let o=n.forwardRef((e,t)=>{let{className:s,children:n,...o}=e;return(0,r.jsxs)(a.fC,{ref:t,className:(0,i.cn)("relative overflow-hidden",s),...o,children:[(0,r.jsx)(a.l_,{className:"h-full w-full rounded-[inherit]",children:n}),(0,r.jsx)(l,{}),(0,r.jsx)(a.Ns,{})]})});o.displayName=a.fC.displayName;let l=n.forwardRef((e,t)=>{let{className:s,orientation:n="vertical",...o}=e;return(0,r.jsx)(a.gb,{ref:t,orientation:n,className:(0,i.cn)("flex touch-none select-none transition-colors","vertical"===n&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===n&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",s),...o,children:(0,r.jsx)(a.q4,{className:"relative flex-1 rounded-full bg-border"})})});l.displayName=a.gb.displayName},6055:function(e,t,s){s.d(t,{Ei:function(){return v},FF:function(){return g},Tu:function(){return p},aM:function(){return c},bC:function(){return b},sw:function(){return u},ue:function(){return h},yo:function(){return d}});var r=s(7437),n=s(2265),a=s(3304),i=s(2218),o=s(4697),l=s(7700);let d=a.fC,c=a.xz,u=a.x8,f=a.h_,m=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)(a.aV,{className:(0,l.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...n,ref:t})});m.displayName=a.aV.displayName;let x=(0,i.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),h=n.forwardRef((e,t)=>{let{side:s="right",className:n,children:i,...d}=e;return(0,r.jsxs)(f,{children:[(0,r.jsx)(m,{}),(0,r.jsxs)(a.VY,{ref:t,className:(0,l.cn)(x({side:s}),n),...d,children:[i,(0,r.jsxs)(a.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,r.jsx)(o.Z,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});h.displayName=a.VY.displayName;let p=e=>{let{className:t,...s}=e;return(0,r.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...s})};p.displayName="SheetHeader";let g=e=>{let{className:t,...s}=e;return(0,r.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s})};g.displayName="SheetFooter";let b=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)(a.Dx,{ref:t,className:(0,l.cn)("text-lg font-semibold text-foreground",s),...n})});b.displayName=a.Dx.displayName;let v=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)(a.dk,{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",s),...n})});v.displayName=a.dk.displayName},5236:function(e,t,s){s.d(t,{SP:function(){return d},dr:function(){return l},mQ:function(){return o},nU:function(){return c}});var r=s(7437),n=s(2265),a=s(2447),i=s(7700);let o=a.fC,l=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)(a.aV,{ref:t,className:(0,i.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...n})});l.displayName=a.aV.displayName;let d=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)(a.xz,{ref:t,className:(0,i.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",s),...n})});d.displayName=a.xz.displayName;let c=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)(a.VY,{ref:t,className:(0,i.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...n})});c.displayName=a.VY.displayName},1806:function(e,t,s){var r=s(7437),n=s(2265),a=s(5244);t.Z=function(e){let{children:t,label:s,popovercontent:i,popoverheader:o,trigger:l="hover"}=e,[d,c]=(0,n.useState)(!1),u=(0,n.useRef)(null);return(0,n.useEffect)(()=>{function e(e){u.current&&!u.current.contains(e.target)&&c(!1)}if(d)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[d,u]),(0,r.jsxs)("div",{ref:u,onMouseEnter:()=>{"hover"===l&&c(!0)},onMouseLeave:()=>{"hover"===l&&c(!1)},className:"w-fit h-fit relative flex justify-center",children:[(0,r.jsx)("div",{onClick:()=>c(!d),children:(0,r.jsx)("label",{htmlFor:s,className:"text-sm font-medium leading-6 text-gray-900 inline-flex overflow-visible",children:(0,r.jsxs)("p",{children:[s," ",(0,r.jsx)("button",{type:"button",className:"opacity-50 cursor-pointer flex items-center space-x-1 rounded-full bg-gray-600 p-2 text-white shadow-sm hover:bg-gray-500 focus:ring focus:outline-none",children:(0,r.jsx)(a.Z,{className:"h-6 w-6","aria-hidden":"true"})})]})})}),(0,r.jsx)("div",{hidden:!d,className:"bottom-[100%] absolute z-50 w-32 text-sm text-gray-500 transition-opacity duration-300 bg-white border border-gray-200 rounded-lg shadow-sm",children:(0,r.jsx)("div",{className:"px-3 py-2 bg-gray-100 border-b border-gray-200 rounded-t-lg dark:border-gray-600 dark:bg-gray-700",children:(0,r.jsx)("h3",{className:"font-semibold text-gray-900 dark:text-white ",children:o})})})]})}},3598:function(e,t,s){s.d(t,{Z:function(){return a}});var r=s(7437),n=s(6360);function a(e){let{header:t,description:s}=e;return(0,r.jsx)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center bg-background px-4 py-12 sm:px-6 lg:px-8",children:(0,r.jsxs)("div",{className:"mx-auto max-w-md text-center",children:[(0,r.jsx)(i,{className:"mx-auto h-12 w-12 text-primary"}),(0,r.jsx)("h2",{className:"mt-4 text-2xl font-bold tracking-tight text-foreground sm:text-3xl",children:t||"Oops, API Server is currently unavailable"}),(0,r.jsx)("p",{className:"mt-4 text-muted-foreground",children:s||(0,r.jsx)("span",{children:"We're sorry, but we're having trouble connecting to the API. Please try again in a moment."})}),(0,r.jsx)(n.z,{variant:"outline",className:"mt-6 rounded-full px-4 py-2 text-primary transition-colors hover:bg-primary hover:text-primary-foreground",onClick:()=>{window.location.reload()},children:"Retry Connection"})]})})}function i(e){return(0,r.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),(0,r.jsx)("path",{d:"M12 9v4"}),(0,r.jsx)("path",{d:"M12 17h.01"})]})}},1411:function(e,t,s){s.d(t,{O:function(){return l}});var r=s(7437),n=s(2265),a=s(2431),i=s(7700);let o=n.forwardRef((e,t)=>{let{className:s,value:n,...o}=e;return(0,r.jsx)(a.fC,{ref:t,className:(0,i.cn)("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",s),...o,children:(0,r.jsx)(a.z$,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:"translateX(-".concat(100-(n||0),"%)")}})})});function l(){let[e,t]=(0,n.useState)(0);return(0,n.useEffect)(()=>{let s=setInterval(()=>{e<95&&t(e=>e+1)},1e3);return()=>clearInterval(s)},[e,95]),(0,r.jsx)(o,{value:e,max:95,className:"w-[100%]"})}o.displayName=a.fC.displayName}}]); \ No newline at end of file diff --git a/superduper/rest/out/_next/static/chunks/125-cb08adbf044617a4.js b/superduper/rest/out/_next/static/chunks/125-cb08adbf044617a4.js new file mode 100644 index 000000000..50f255be3 --- /dev/null +++ b/superduper/rest/out/_next/static/chunks/125-cb08adbf044617a4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[125],{273:function(e,s,t){t.d(s,{Ol:function(){return i},SZ:function(){return d},Zb:function(){return n},aY:function(){return c},eW:function(){return u},ll:function(){return o}});var a=t(7437),r=t(2265),l=t(7700);let n=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("div",{ref:s,className:(0,l.cn)("rounded-xl border bg-card text-card-foreground shadow",t),...r})});n.displayName="Card";let i=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("div",{ref:s,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",t),...r})});i.displayName="CardHeader";let o=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("h3",{ref:s,className:(0,l.cn)("font-semibold leading-none tracking-tight",t),...r})});o.displayName="CardTitle";let d=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("p",{ref:s,className:(0,l.cn)("text-sm text-muted-foreground",t),...r})});d.displayName="CardDescription";let c=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("div",{ref:s,className:(0,l.cn)("p-6 pt-0",t),...r})});c.displayName="CardContent";let u=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)("div",{ref:s,className:(0,l.cn)("flex items-center p-6 pt-0",t),...r})});u.displayName="CardFooter"},1125:function(e,s,t){t.d(s,{Z:function(){return C}});var a=t(7437),r=t(2265),l=t(8429),n=t(2126),i=t(8726),o=t(1444),d=t(841),c=t(8930),u=t(6360),p=t(9129),h=t(9155),x=e=>{let{fileId:s}=e;(0,o.v9)(e=>e.environment.environmentLoadedValues);let t=(0,o.v9)(e=>{var s;return null==e?void 0:null===(s=e.userInfo)||void 0===s?void 0:s.userInfoLoadedValues}),[l,i]=(0,r.useState)(null),[d,c]=(0,r.useState)(null),[x,j]=(0,r.useState)("");return((0,r.useEffect)(()=>{(async()=>{try{let e=await n.Z.get("".concat("".concat("http://localhost:8000","/db/artifact_store/get?file_id=").concat(s)),{responseType:"blob",headers:{Accept:"application/json",Authorization:(0,h.Z)(t),superduper_reverse_proxy:"http://localhost:8000"}}),a=new Blob([e.data],{type:e.headers["content-type"]}),r=window.URL.createObjectURL(a);if(i(r),c(e.headers["content-type"]),e.headers["content-type"].startsWith("text/")){let s=await new Response(e.data).text();j(s)}}catch(e){console.error("Error fetching file:",e)}})()},[s]),l)?d.startsWith("image/")?(0,a.jsx)("img",{src:l,alt:"File Preview",className:"max-w-sm"}):d.startsWith("text/")?(0,a.jsx)("pre",{className:"bg-gray-100 p-4 rounded-lg dark:bg-gray-800 whitespace-pre-wrap",children:(0,a.jsx)("code",{children:x})}):d.startsWith("audio/")?(0,a.jsxs)("audio",{controls:!0,children:[(0,a.jsx)("source",{src:l,type:d}),"Your browser does not support the audio element."]}):d.startsWith("video/")?(0,a.jsxs)("video",{controls:!0,children:[(0,a.jsx)("source",{src:l,type:d}),"Your browser does not support the video element."]}):(0,a.jsxs)("section",{className:"p-6 border-dashed border-2 border-gray-200 rounded-lg flex flex-col items-center gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(f,{className:"h-10 w-10"}),(0,a.jsx)("div",{className:"text-sm text-gray-500",children:(0,a.jsx)("div",{className:"font-medium",children:"Uploaded Byte file"})})]}),(0,a.jsx)("a",{href:l,download:!0,className:"pl-2 pr-2",children:(0,a.jsxs)(u.z,{size:"sm",variant:"outline",children:[(0,a.jsx)(m,{className:"mr-2 h-4 w-4"}),"Download"]})})]}):(0,a.jsxs)("span",{children:["Loading Artifact...",(0,a.jsx)("br",{}),(0,a.jsx)(p.Z,{})]})};function m(e){return(0,a.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,a.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,a.jsx)("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]})}function f(e){return(0,a.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),(0,a.jsx)("polyline",{points:"14 2 14 8 20 8"})]})}var j=t(4867),g=t(8639),v=t(273),w=t(2404),y=t(464);function N(e){return(0,a.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,a.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,a.jsx)("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]})}function b(e){return(0,a.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M3 6h18"}),(0,a.jsx)("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),(0,a.jsx)("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]})}function k(e){return(0,a.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"m9 18 6-6-6-6"})})}var C=function(){(0,o.v9)(e=>e.environment.environmentLoadedValues);let e=(0,o.v9)(e=>{var s;return null==e?void 0:null===(s=e.userInfo)||void 0===s?void 0:s.userInfoLoadedValues}),[s,t]=(0,r.useState)("bytes"),[p,m]=(0,r.useState)([]),[f,C]=(0,r.useState)(""),[_,L]=(0,r.useState)(!1),z=()=>{navigator.clipboard.writeText(f),L(!0),setTimeout(()=>L(!1),2e3)},Z=(0,o.I0)(),F=(0,o.v9)(e=>e.uploadFiles.uploadFilesLoadedValues||[]),D=(0,o.v9)(e=>e.uploadFiles.uploadFilesLoadedValuesSchema||[]),R=(0,o.v9)(e=>e.uploadFiles.uploadFilesLoadedValuesComponent||[]),[A,S]=(0,r.useState)(null),[U,V]=(0,r.useState)({success:!1,message:""}),W=(0,r.useRef)(null),B=async s=>{try{let t=await n.Z.get("".concat("".concat("http://localhost:8000","/db/artifact_store/get_artifact?file_id=").concat(s)),{responseType:"blob",headers:{accept:"application/json",Authorization:(0,h.Z)(e),superduper_reverse_proxy:"http://localhost:8000"}}),a=new Blob([t.data],{type:t.headers["content-type"]}),r=window.URL.createObjectURL(a),l=document.createElement("a");l.href=r,l.setAttribute("download",s),document.body.appendChild(l),l.click(),document.body.removeChild(l)}catch(e){console.error("Error downloading file:",e)}},I=async t=>{if(!t){V({success:!1,message:"Please select a file to upload."});return}V({success:!0,message:"Uploading. Please wait patiently."});let a=new FormData;a.append("raw",t,t.name);try{let t=await n.Z.put("".concat("".concat("http://localhost:8000","/db/artifact_store/put")),a,{headers:{"Content-Type":"multipart/form-data",accept:"application/json",Authorization:(0,h.Z)(e),superduper_reverse_proxy:"http://localhost:8000"}});t.data?(console.log("FILE UPLOADED",t.data),V({success:!0,message:"Successfully uploaded files"}),Z((0,d.Xs)([...F,t.data.file_id])),Z((0,d.nh)([...D,{_content:{file_id:t.data.file_id,datatype:s}}])),console.log("file uploading log",t.data.file_id),Z((0,d.QL)([...R,{leaf_type:"blob",type_id:"blob",cls:"Artifact",module:"superduperdb/components/datatype",dict:{file_id:t.data.file_id}}])),i.ZP.success("Artifact uploaded successfully")):V({success:!1,message:"Upload failed. Try again with proper datatype."})}catch(e){V({success:!1,message:"Error uploading file."}),console.error("Error uploading file:",e)}},E=e=>()=>{B(e)},T=e=>()=>{console.log("Deleting:",e),Z((0,d.Xs)(F.filter(s=>s!==e))),Z((0,d.nh)(D.filter(s=>s._content.file_id!==e)))};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(v.Zb,{className:"w-full",children:[(0,a.jsx)(v.Ol,{className:"space-y-1",children:(0,a.jsx)(v.ll,{children:(0,a.jsx)(c.Z,{label:(0,a.jsx)("span",{className:"text-base font-semibold leading-7 text-gray-900",children:"Upload Artifacts"}),popoverheader:"",popovercontent:(0,a.jsx)("p",{children:"You can upload various artifacts, such as bytes, images, and videos, and reference them by artifact ID."})})})}),(0,a.jsx)(v.aY,{children:(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsx)("div",{className:"col-span-4 mt-4",children:(0,a.jsx)("div",{className:"mt-2 flex justify-center rounded-lg border border-dashed border-gray-900/25 px-6 py-10",onDragOver:e=>{e.preventDefault()},onDrop:e=>{e.preventDefault();let s=e.dataTransfer.files[0];S(s),I(s)},ref:W,children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(l.Z,{className:"mx-auto h-12 w-12 text-gray-300","aria-hidden":"true"}),(0,a.jsx)("div",{className:"mx-auto mt-2"}),(0,a.jsxs)("div",{className:"mt-4 flex text-sm leading-6 text-gray-600",children:[(0,a.jsxs)("label",{htmlFor:"file-upload",className:"relative cursor-pointer rounded-md bg-white font-semibold text-indigo-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-indigo-600 focus-within:ring-offset-2 hover:text-indigo-500",children:[(0,a.jsx)("span",{children:"Upload an artifact"}),(0,a.jsx)("input",{id:"file-upload",name:"file-upload",type:"file",className:"sr-only",onChange:e=>{S(e.target.files[0]),I(e.target.files[0])}})]}),(0,a.jsx)("p",{className:"pl-1",children:"or drag and drop"})]}),(0,a.jsx)("p",{className:"text-xs leading-5 text-gray-600",children:"Max filesize is 1024MB"}),U.message&&(0,a.jsx)("p",{className:"mt-2 text-sm ".concat(U.success?"text-green-500":"text-red-500"),children:U.message})]})})})})}),(0,a.jsx)(v.eW,{className:""})]}),F&&0!==F.length&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"pt-2 mt-4 pb-4",children:(0,a.jsx)("label",{htmlFor:"component-type",className:"text-sm font-medium leading-6 text-gray-900",children:"Uploaded Artifacts"})}),(0,a.jsx)("div",{children:F.map((e,s)=>(0,a.jsx)(v.Zb,{className:"mb-4",children:(0,a.jsxs)(v.Ol,{className:"flex gap-2 items-start",children:[(0,a.jsxs)("div",{className:"grid gap-0.5",children:[(0,a.jsx)(v.ll,{className:"text-sm",children:(0,a.jsx)("span",{className:"flex justify-end w-full",children:(0,a.jsx)("span",{children:e})})}),(0,a.jsx)(v.SZ,{className:"text-[#666] text-xs leading-none",children:"Refer this artifact with the reference above"})]}),(0,a.jsxs)("div",{className:"flex ml-auto gap-1.5",children:[(0,a.jsxs)(g.Vq,{children:[(0,a.jsx)(g.hg,{asChild:!0,children:(0,a.jsxs)(u.z,{size:"sm",variant:"outline",onClick:()=>{C(e)},children:["View Uploaded File"," ",(0,a.jsx)(k,{className:"ml-1 h-4 w-4"})]})}),(0,a.jsxs)(g.cZ,{className:"sm:max-w-md",children:[(0,a.jsxs)(g.fK,{children:[(0,a.jsx)(g.$N,{children:"Artifact"}),(0,a.jsx)(g.Be,{children:"Refer this artifact with the reference"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)("div",{className:"grid flex-1 gap-2",children:[(0,a.jsx)(y._,{htmlFor:"link",className:"sr-only",children:"Artifact Reference Id"}),(0,a.jsx)(w.I,{id:"link",value:"@artifact/".concat(e),readOnly:!0})]}),(0,a.jsxs)(u.z,{type:"button",size:"sm",className:"px-3",onClick:z,"aria-label":_?"Copied":"Copy",children:[(0,a.jsx)("span",{className:"sr-only",children:_?"Copied":"Copy"}),(0,a.jsx)(j.TIy,{className:"h-4 w-4"})]})]}),(0,a.jsx)(g.Be,{children:(0,a.jsx)(x,{fileId:e,className:"pb-2"})}),(0,a.jsx)(g.cN,{className:"sm:justify-start",children:(0,a.jsxs)(u.z,{size:"sm",variant:"outline",onClick:E(e),children:["Download",(0,a.jsx)(N,{className:"ml-2 w-4 h-4"})," ",(0,a.jsx)("span",{className:"sr-only",children:"Download"})]})})]})]}),(0,a.jsxs)(u.z,{size:"sm",variant:"outline",onClick:E(e),children:[(0,a.jsx)(N,{className:"w-4 h-4"})," ",(0,a.jsx)("span",{className:"sr-only",children:"Download"})]}),(0,a.jsxs)(u.z,{size:"sm",variant:"outline",onClick:T(e),children:[(0,a.jsx)(b,{className:"h-4 w-4"})," ",(0,a.jsx)("span",{className:"sr-only",children:"Delete"})]})]})]})},s))})]})]})}},841:function(e,s,t){t.d(s,{QL:function(){return n},Xs:function(){return r},nh:function(){return l}});var a=t(9642);let r=e=>s=>s({type:a.Tj,payload:e}),l=e=>s=>s({type:a.tX,payload:e}),n=e=>s=>s({type:a.bk,payload:e})}}]); \ No newline at end of file diff --git a/superduper/rest/out/_next/static/chunks/208-0ffe25bb41393c16.js b/superduper/rest/out/_next/static/chunks/208-0ffe25bb41393c16.js new file mode 100644 index 000000000..ed80c7743 --- /dev/null +++ b/superduper/rest/out/_next/static/chunks/208-0ffe25bb41393c16.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[208],{3003:function(e,t,n){n.d(t,{_:function(){return s},b:function(){return d}});var r=n(2265),o=n(6584),a=n(2955),l=n(1463),i=n(1469),u=n(3600);let c=(0,r.createContext)(null);function d(){let[e,t]=(0,r.useState)([]);return[e.length>0?e.join(" "):void 0,(0,r.useMemo)(()=>function(e){let n=(0,o.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),a=(0,r.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return r.createElement(c.Provider,{value:a},e.children)},[t])]}let s=Object.assign((0,u.yV)(function(e,t){let n=(0,a.M)(),{id:o="headlessui-label-".concat(n),passive:d=!1,...s}=e,p=function e(){let t=(0,r.useContext)(c);if(null===t){let t=Error("You used a