This commit is contained in:
alirehmani
2024-05-06 17:35:56 +05:00
parent a969ab41ed
commit 43459be8c5
7 changed files with 70 additions and 29 deletions

4
definition-web-ui Normal file
View File

@@ -0,0 +1,4 @@
{
"schemaVersion": 2,
"dockerfilePath": "./src/Managing.WebApp/Dockerfile-web-ui-dev"
}

View File

@@ -3,3 +3,5 @@ node_modules
dist dist
dist-ssr dist-ssr
*.local *.local
.env

View File

@@ -0,0 +1,32 @@
# Stage 1: Build the Vite application
FROM node:20 AS builder
# Set the working directory in the container
WORKDIR /app
# Copy the package.json and package-lock.json first to leverage Docker's cache
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
# Copy the application code
COPY . .
# Build the Vite application
RUN npm run build
# Stage 2: Create the runtime image
FROM nginx:alpine
# Copy the built Vite application from the builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy a custom Nginx configuration file (if you need one)
# COPY nginx.conf /etc/nginx/nginx.conf
# Expose port 80
EXPOSE 80
# Start the Nginx server
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -18,13 +18,14 @@
"dependencies": { "dependencies": {
"@heroicons/react": "^1.0.6", "@heroicons/react": "^1.0.6",
"@microsoft/signalr": "^6.0.5", "@microsoft/signalr": "^6.0.5",
"@tanstack/react-query": "^4.33.0", "@tanstack/react-query": "^5.0.0",
"@wagmi/chains": "^0.2.9", "@wagmi/chains": "^0.2.9",
"@wagmi/core": "^1.3.9", "@wagmi/connectors": "^4.3.2",
"@wagmi/core": "^2.9.0",
"@walletconnect/universal-provider": "^2.8.6", "@walletconnect/universal-provider": "^2.8.6",
"axios": "^0.27.2", "axios": "^0.27.2",
"classnames": "^2.3.1", "classnames": "^2.3.1",
"connectkit": "^1.1.3", "connectkit": "^1.7.3",
"date-fns": "^2.30.0", "date-fns": "^2.30.0",
"jotai": "^1.6.7", "jotai": "^1.6.7",
"lightweight-charts": "git+https://github.com/ntf/lightweight-charts.git", "lightweight-charts": "git+https://github.com/ntf/lightweight-charts.git",
@@ -44,8 +45,8 @@
"react-table": "^7.8.0", "react-table": "^7.8.0",
"react-toastify": "^9.0.1", "react-toastify": "^9.0.1",
"reactflow": "^11.8.3", "reactflow": "^11.8.3",
"viem": "^1.4.2", "viem": "^2.0.6",
"wagmi": "^1.3.10", "wagmi": "^2.2.1",
"web3": "^4.0.2", "web3": "^4.0.2",
"zustand": "^4.4.1" "zustand": "^4.4.1"
}, },

View File

@@ -2,7 +2,7 @@ import { Suspense, lazy } from 'react'
import { Route, Routes } from 'react-router-dom' import { Route, Routes } from 'react-router-dom'
import LayoutMain from '../../layouts' import LayoutMain from '../../layouts'
import Desk from '../../pages/desk/desk' import Desk from '../../pages/desk/Desk'
import Scenario from '../../pages/scenarioPage/scenario' import Scenario from '../../pages/scenarioPage/scenario'
import Tools from '../../pages/toolsPage/tools' import Tools from '../../pages/toolsPage/tools'
import Workflows from '../../pages/workflow/workflows' import Workflows from '../../pages/workflow/workflows'

View File

@@ -1,26 +1,26 @@
import { useConnect } from 'wagmi' import { useConnect } from 'wagmi'
export function Profile() { // export function Profile() {
const { connect, connectors, error, isLoading, pendingConnector } = // const { connect, connectors, error, isLoading, pendingConnector } =
useConnect() // useConnect()
return ( // return (
<div> // <div>
{connectors.map((connector) => ( // {connectors.map((connector) => (
<button // <button
disabled={!connector.ready} // disabled={!connector.ready}
key={connector.id} // key={connector.id}
onClick={() => connect({ connector })} // onClick={() => connect({ connector })}
> // >
{connector.name} // {connector.name}
{!connector.ready && ' (unsupported)'} // {!connector.ready && ' (unsupported)'}
{isLoading && // {isLoading &&
connector.id === pendingConnector?.id && // connector.id === pendingConnector?.id &&
' (connecting)'} // ' (connecting)'}
</button> // </button>
))} // ))}
{error && <div>{error.message}</div>} // {error && <div>{error.message}</div>}
</div> // </div>
) // )
} // }

View File

@@ -6,7 +6,7 @@ const loadWidget = (component: any) => {
return React.lazy(() => import(`./widgets/${component}.tsx`)) return React.lazy(() => import(`./widgets/${component}.tsx`))
} }
export const DeskWidget = React.forwardRef((props: any, ref) => { const DeskWidget = React.forwardRef((props: any, ref) => {
const widget = props const widget = props
const widgetProperties = widget['data-properties'] as IWidgetProperties const widgetProperties = widget['data-properties'] as IWidgetProperties
const WidgetComponent = loadWidget(widgetProperties.id) const WidgetComponent = loadWidget(widgetProperties.id)
@@ -19,3 +19,5 @@ export const DeskWidget = React.forwardRef((props: any, ref) => {
</div> </div>
) )
}) })
export default DeskWidget