{
9 | await queryRunner.query(`ALTER TABLE "custom_template" DROP COLUMN "workspaceId";`)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/packages/server/src/enterprise/routes/audit/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import auditController from '../../controllers/audit'
3 | import { checkPermission } from '../../rbac/PermissionCheck'
4 | const router = express.Router()
5 |
6 | router.post(['/', '/login-activity'], checkPermission('loginActivity:view'), auditController.fetchLoginActivity)
7 | router.post(['/', '/login-activity/delete'], checkPermission('loginActivity:delete'), auditController.deleteLoginActivity)
8 |
9 | export default router
10 |
--------------------------------------------------------------------------------
/packages/server/src/enterprise/routes/auth/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import authController from '../../controllers/auth'
3 | const router = express.Router()
4 |
5 | // RBAC
6 | router.get(['/', '/permissions'], authController.getAllPermissions)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/enterprise/routes/role.route.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import { RoleController } from '../controllers/role.controller'
3 | import { checkPermission } from '../rbac/PermissionCheck'
4 |
5 | const router = express.Router()
6 | const roleController = new RoleController()
7 |
8 | router.get('/', roleController.read)
9 |
10 | router.post('/', checkPermission('roles:manage'), roleController.create)
11 |
12 | router.put('/', checkPermission('roles:manage'), roleController.update)
13 |
14 | router.delete('/', checkPermission('roles:manage'), roleController.delete)
15 |
16 | export default router
17 |
--------------------------------------------------------------------------------
/packages/server/src/enterprise/routes/user.route.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import { UserController } from '../controllers/user.controller'
3 |
4 | const router = express.Router()
5 | const userController = new UserController()
6 |
7 | router.get('/', userController.read)
8 | router.get('/test', userController.test)
9 |
10 | router.post('/', userController.create)
11 |
12 | router.put('/', userController.update)
13 |
14 | export default router
15 |
--------------------------------------------------------------------------------
/packages/server/src/enterprise/utils/ControllerServiceUtils.ts:
--------------------------------------------------------------------------------
1 | import { Equal } from 'typeorm'
2 | import { Request } from 'express'
3 |
4 | export const getWorkspaceSearchOptions = (workspaceId?: string) => {
5 | return workspaceId ? { workspaceId: Equal(workspaceId) } : {}
6 | }
7 |
8 | export const getWorkspaceSearchOptionsFromReq = (req: Request) => {
9 | const workspaceId = req.user?.activeWorkspaceId
10 | return workspaceId ? { workspaceId: Equal(workspaceId) } : {}
11 | }
12 |
--------------------------------------------------------------------------------
/packages/server/src/errors/internalFlowiseError/index.ts:
--------------------------------------------------------------------------------
1 | export class InternalFlowiseError extends Error {
2 | statusCode: number
3 | constructor(statusCode: number, message: string) {
4 | super(message)
5 | this.statusCode = statusCode
6 | // capture the stack trace of the error from anywhere in the application
7 | Error.captureStackTrace(this, this.constructor)
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/server/src/routes/agentflowv2-generator/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import agentflowv2GeneratorController from '../../controllers/agentflowv2-generator'
3 | const router = express.Router()
4 |
5 | router.post('/generate', agentflowv2GeneratorController.generateAgentflowv2)
6 |
7 | export default router
8 |
--------------------------------------------------------------------------------
/packages/server/src/routes/attachments/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import attachmentsController from '../../controllers/attachments'
3 | import { getMulterStorage } from '../../utils'
4 |
5 | const router = express.Router()
6 |
7 | // CREATE
8 | router.post('/:chatflowId/:chatId', getMulterStorage().array('files'), attachmentsController.createAttachment)
9 |
10 | export default router
11 |
--------------------------------------------------------------------------------
/packages/server/src/routes/chat-messages/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import chatMessageController from '../../controllers/chat-messages'
3 | const router = express.Router()
4 |
5 | // CREATE
6 | router.post(['/', '/:id'], chatMessageController.createChatMessage)
7 |
8 | // READ
9 | router.get(['/', '/:id'], chatMessageController.getAllChatMessages)
10 |
11 | // UPDATE
12 | router.put(['/abort/', '/abort/:chatflowid/:chatid'], chatMessageController.abortChatMessage)
13 |
14 | // DELETE
15 | router.delete(['/', '/:id'], chatMessageController.removeAllChatMessages)
16 |
17 | export default router
18 |
--------------------------------------------------------------------------------
/packages/server/src/routes/chatflows-streaming/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import chatflowsController from '../../controllers/chatflows'
3 |
4 | const router = express.Router()
5 |
6 | // READ
7 | router.get(['/', '/:id'], chatflowsController.checkIfChatflowIsValidForStreaming)
8 |
9 | export default router
10 |
--------------------------------------------------------------------------------
/packages/server/src/routes/chatflows-uploads/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import chatflowsController from '../../controllers/chatflows'
3 |
4 | const router = express.Router()
5 |
6 | // READ
7 | router.get(['/', '/:id'], chatflowsController.checkIfChatflowIsValidForUploads)
8 |
9 | export default router
10 |
--------------------------------------------------------------------------------
/packages/server/src/routes/components-credentials-icon/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import componentsCredentialsController from '../../controllers/components-credentials'
3 | const router = express.Router()
4 |
5 | // CREATE
6 |
7 | // READ
8 | router.get(['/', '/:name'], componentsCredentialsController.getSingleComponentsCredentialIcon)
9 |
10 | // UPDATE
11 |
12 | // DELETE
13 |
14 | export default router
15 |
--------------------------------------------------------------------------------
/packages/server/src/routes/components-credentials/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import componentsCredentialsController from '../../controllers/components-credentials'
3 | const router = express.Router()
4 |
5 | // READ
6 | router.get('/', componentsCredentialsController.getAllComponentsCredentials)
7 | router.get(['/', '/:name'], componentsCredentialsController.getComponentByName)
8 |
9 | export default router
10 |
--------------------------------------------------------------------------------
/packages/server/src/routes/export-import/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import exportImportController from '../../controllers/export-import'
3 | import { checkPermission } from '../../enterprise/rbac/PermissionCheck'
4 | const router = express.Router()
5 |
6 | router.post('/export', checkPermission('workspace:export'), exportImportController.exportData)
7 |
8 | router.post('/import', checkPermission('workspace:import'), exportImportController.importData)
9 |
10 | export default router
11 |
--------------------------------------------------------------------------------
/packages/server/src/routes/feedback/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import feedbackController from '../../controllers/feedback'
3 | const router = express.Router()
4 |
5 | // CREATE
6 | router.post(['/', '/:id'], feedbackController.createChatMessageFeedbackForChatflow)
7 |
8 | // READ
9 | router.get(['/', '/:id'], feedbackController.getAllChatMessageFeedback)
10 |
11 | // UPDATE
12 | router.put(['/', '/:id'], feedbackController.updateChatMessageFeedbackForChatflow)
13 |
14 | export default router
15 |
--------------------------------------------------------------------------------
/packages/server/src/routes/fetch-links/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import fetchLinksController from '../../controllers/fetch-links'
3 | const router = express.Router()
4 |
5 | // READ
6 | router.get('/', fetchLinksController.getAllLinks)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/routes/files/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import filesController from '../../controllers/files'
3 | const router = express.Router()
4 |
5 | // READ
6 | router.get('/', filesController.getAllFiles)
7 |
8 | // DELETE
9 | router.delete('/', filesController.deleteFile)
10 |
11 | export default router
12 |
--------------------------------------------------------------------------------
/packages/server/src/routes/flow-config/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import flowConfigsController from '../../controllers/flow-configs'
3 | const router = express.Router()
4 |
5 | // CREATE
6 |
7 | // READ
8 | router.get(['/', '/:id'], flowConfigsController.getSingleFlowConfig)
9 |
10 | // UPDATE
11 |
12 | // DELETE
13 |
14 | export default router
15 |
--------------------------------------------------------------------------------
/packages/server/src/routes/get-upload-file/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import getUploadFileController from '../../controllers/get-upload-file'
3 | const router = express.Router()
4 |
5 | // READ
6 | router.get('/', getUploadFileController.streamUploadedFile)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/routes/get-upload-path/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import getUploadPathController from '../../controllers/get-upload-path'
3 | const router = express.Router()
4 |
5 | // READ
6 | router.get('/', getUploadPathController.getPathForUploads)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/routes/internal-chat-messages/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import chatMessagesController from '../../controllers/chat-messages'
3 | const router = express.Router()
4 |
5 | // CREATE
6 |
7 | // READ
8 | router.get(['/', '/:id'], chatMessagesController.getAllInternalChatMessages)
9 |
10 | // UPDATE
11 |
12 | // DELETE
13 |
14 | export default router
15 |
--------------------------------------------------------------------------------
/packages/server/src/routes/internal-predictions/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import internalPredictionsController from '../../controllers/internal-predictions'
3 | const router = express.Router()
4 |
5 | // CREATE
6 | router.post(['/', '/:id'], internalPredictionsController.createInternalPrediction)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/routes/leads/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import leadsController from '../../controllers/leads'
3 | const router = express.Router()
4 |
5 | // CREATE
6 | router.post('/', leadsController.createLeadInChatflow)
7 |
8 | // READ
9 | router.get(['/', '/:id'], leadsController.getAllLeadsForChatflow)
10 |
11 | export default router
12 |
--------------------------------------------------------------------------------
/packages/server/src/routes/load-prompts/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import loadPromptsController from '../../controllers/load-prompts'
3 | const router = express.Router()
4 |
5 | // CREATE
6 | router.post('/', loadPromptsController.createPrompt)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/routes/log/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import logController from '../../controllers/log'
3 | import { checkAnyPermission } from '../../enterprise/rbac/PermissionCheck'
4 | const router = express.Router()
5 |
6 | // READ
7 | router.get('/', checkAnyPermission('logs:view'), logController.getLogs)
8 |
9 | export default router
10 |
--------------------------------------------------------------------------------
/packages/server/src/routes/node-configs/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import nodeConfigsController from '../../controllers/node-configs'
3 | const router = express.Router()
4 |
5 | // CREATE
6 | router.post('/', nodeConfigsController.getAllNodeConfigs)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/routes/node-custom-functions/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import nodesRouter from '../../controllers/nodes'
3 | const router = express.Router()
4 |
5 | // CREATE
6 |
7 | // READ
8 | router.post('/', nodesRouter.executeCustomFunction)
9 |
10 | // UPDATE
11 |
12 | // DELETE
13 |
14 | export default router
15 |
--------------------------------------------------------------------------------
/packages/server/src/routes/node-icons/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import nodesController from '../../controllers/nodes'
3 | const router = express.Router()
4 |
5 | // CREATE
6 |
7 | // READ
8 | router.get(['/', '/:name'], nodesController.getSingleNodeIcon)
9 |
10 | // UPDATE
11 |
12 | // DELETE
13 |
14 | export default router
15 |
--------------------------------------------------------------------------------
/packages/server/src/routes/node-load-methods/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import nodesRouter from '../../controllers/nodes'
3 | const router = express.Router()
4 |
5 | router.post(['/', '/:name'], nodesRouter.getSingleNodeAsyncOptions)
6 |
7 | export default router
8 |
--------------------------------------------------------------------------------
/packages/server/src/routes/nodes/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import nodesController from '../../controllers/nodes'
3 | const router = express.Router()
4 |
5 | // READ
6 | router.get('/', nodesController.getAllNodes)
7 | router.get(['/', '/:name'], nodesController.getNodeByName)
8 | router.get('/category/:name', nodesController.getNodesByCategory)
9 |
10 | export default router
11 |
--------------------------------------------------------------------------------
/packages/server/src/routes/openai-assistants-files/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import openaiAssistantsController from '../../controllers/openai-assistants'
3 | import { getMulterStorage } from '../../utils'
4 |
5 | const router = express.Router()
6 |
7 | router.post('/download/', openaiAssistantsController.getFileFromAssistant)
8 | router.post('/upload/', getMulterStorage().array('files'), openaiAssistantsController.uploadAssistantFiles)
9 |
10 | export default router
11 |
--------------------------------------------------------------------------------
/packages/server/src/routes/openai-assistants/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import openaiAssistantsController from '../../controllers/openai-assistants'
3 | const router = express.Router()
4 |
5 | // CREATE
6 |
7 | // READ
8 | router.get('/', openaiAssistantsController.getAllOpenaiAssistants)
9 | router.get(['/', '/:id'], openaiAssistantsController.getSingleOpenaiAssistant)
10 |
11 | // UPDATE
12 |
13 | // DELETE
14 |
15 | export default router
16 |
--------------------------------------------------------------------------------
/packages/server/src/routes/openai-realtime/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import openaiRealTimeController from '../../controllers/openai-realtime'
3 |
4 | const router = express.Router()
5 |
6 | // GET
7 | router.get(['/', '/:id'], openaiRealTimeController.getAgentTools)
8 |
9 | // EXECUTE
10 | router.post(['/', '/:id'], openaiRealTimeController.executeAgentTool)
11 |
12 | export default router
13 |
--------------------------------------------------------------------------------
/packages/server/src/routes/ping/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import pingController from '../../controllers/ping'
3 | const router = express.Router()
4 |
5 | // GET
6 | router.get('/', pingController.getPing)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/routes/predictions/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import predictionsController from '../../controllers/predictions'
3 | import { getMulterStorage } from '../../utils'
4 |
5 | const router = express.Router()
6 |
7 | // CREATE
8 | router.post(
9 | ['/', '/:id'],
10 | getMulterStorage().array('files'),
11 | predictionsController.getRateLimiterMiddleware,
12 | predictionsController.createPrediction
13 | )
14 |
15 | export default router
16 |
--------------------------------------------------------------------------------
/packages/server/src/routes/pricing/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import pricingController from '../../controllers/pricing'
3 | const router = express.Router()
4 |
5 | // GET
6 | router.get('/', pricingController.getPricing)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/routes/prompts-lists/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import promptsListController from '../../controllers/prompts-lists'
3 | const router = express.Router()
4 |
5 | // CREATE
6 | router.post('/', promptsListController.createPromptsList)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/routes/public-chatbots/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import chatflowsController from '../../controllers/chatflows'
3 | const router = express.Router()
4 |
5 | // CREATE
6 |
7 | // READ
8 | router.get(['/', '/:id'], chatflowsController.getSinglePublicChatbotConfig)
9 |
10 | // UPDATE
11 |
12 | // DELETE
13 |
14 | export default router
15 |
--------------------------------------------------------------------------------
/packages/server/src/routes/public-chatflows/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import chatflowsController from '../../controllers/chatflows'
3 | const router = express.Router()
4 |
5 | // CREATE
6 |
7 | // READ
8 | router.get(['/', '/:id'], chatflowsController.getSinglePublicChatflow)
9 |
10 | // UPDATE
11 |
12 | // DELETE
13 |
14 | export default router
15 |
--------------------------------------------------------------------------------
/packages/server/src/routes/public-executions/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import executionController from '../../controllers/executions'
3 | const router = express.Router()
4 |
5 | // CREATE
6 |
7 | // READ
8 | router.get(['/', '/:id'], executionController.getPublicExecutionById)
9 |
10 | // UPDATE
11 |
12 | // DELETE
13 |
14 | export default router
15 |
--------------------------------------------------------------------------------
/packages/server/src/routes/settings/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import settingsController from '../../controllers/settings'
3 | const router = express.Router()
4 |
5 | // CREATE
6 | router.get('/', settingsController.getSettingsList)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/routes/stats/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import statsController from '../../controllers/stats'
3 |
4 | const router = express.Router()
5 |
6 | // READ
7 | router.get(['/', '/:id'], statsController.getChatflowStats)
8 |
9 | export default router
10 |
--------------------------------------------------------------------------------
/packages/server/src/routes/upsert-history/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import upsertHistoryController from '../../controllers/upsert-history'
3 | const router = express.Router()
4 |
5 | // CREATE
6 |
7 | // READ
8 | router.get(['/', '/:id'], upsertHistoryController.getAllUpsertHistory)
9 |
10 | // PATCH
11 | router.patch('/', upsertHistoryController.patchDeleteUpsertHistory)
12 |
13 | // DELETE
14 |
15 | export default router
16 |
--------------------------------------------------------------------------------
/packages/server/src/routes/validation/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import validationController from '../../controllers/validation'
3 | const router = express.Router()
4 |
5 | // READ
6 | router.get('/:id', validationController.checkFlowValidation)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/routes/vectors/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import vectorsController from '../../controllers/vectors'
3 | import { getMulterStorage } from '../../utils'
4 |
5 | const router = express.Router()
6 |
7 | // CREATE
8 | router.post(
9 | ['/upsert/', '/upsert/:id'],
10 | getMulterStorage().array('files'),
11 | vectorsController.getRateLimiterMiddleware,
12 | vectorsController.upsertVectorMiddleware
13 | )
14 | router.post(['/internal-upsert/', '/internal-upsert/:id'], getMulterStorage().array('files'), vectorsController.createInternalUpsert)
15 |
16 | export default router
17 |
--------------------------------------------------------------------------------
/packages/server/src/routes/verify/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import apikeyController from '../../controllers/apikey'
3 | const router = express.Router()
4 |
5 | // READ
6 | router.get(['/apikey/', '/apikey/:apikey'], apikeyController.verifyApiKey)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/routes/versions/index.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import versionsController from '../../controllers/versions'
3 | const router = express.Router()
4 |
5 | // READ
6 | router.get('/', versionsController.getVersion)
7 |
8 | export default router
9 |
--------------------------------------------------------------------------------
/packages/server/src/utils/getRunningExpressApp.ts:
--------------------------------------------------------------------------------
1 | import * as Server from '../index'
2 |
3 | export const getRunningExpressApp = function () {
4 | const runningExpressInstance = Server.getInstance()
5 | if (
6 | typeof runningExpressInstance === 'undefined' ||
7 | typeof runningExpressInstance.nodesPool === 'undefined' ||
8 | typeof runningExpressInstance.telemetry === 'undefined'
9 | ) {
10 | throw new Error(`Error: getRunningExpressApp failed!`)
11 | }
12 | return runningExpressInstance
13 | }
14 |
--------------------------------------------------------------------------------
/packages/server/src/utils/typeormDataSource.ts:
--------------------------------------------------------------------------------
1 | import { DataSource } from 'typeorm'
2 | import { getDataSource } from '../DataSource'
3 |
4 | export const dataSource: DataSource = getDataSource()
5 |
--------------------------------------------------------------------------------
/packages/server/test/utils/api-key.util.test.ts:
--------------------------------------------------------------------------------
1 | import { generateAPIKey } from '../../src/utils/apiKey'
2 |
3 | export function apiKeyTest() {
4 | describe('Api Key', () => {
5 | it('should be able to generate a new api key', () => {
6 | const apiKey = generateAPIKey()
7 | expect(typeof apiKey === 'string').toEqual(true)
8 | })
9 | })
10 | }
11 |
--------------------------------------------------------------------------------
/packages/ui/.env.example:
--------------------------------------------------------------------------------
1 | VITE_PORT=8080
2 |
3 | # VITE_API_BASE_URL=http://localhost:3000
4 | # VITE_UI_BASE_URL=http://localhost:3000
--------------------------------------------------------------------------------
/packages/ui/.npmignore:
--------------------------------------------------------------------------------
1 | /tests
2 | /src
3 | /public
4 | !build
5 |
6 | yarn-debug.log*
7 | yarn-error.log*
8 |
9 | .eslintrc
10 | .prettierignore
11 | .prettierrc
12 | jsconfig.json
13 |
14 |
--------------------------------------------------------------------------------
/packages/ui/README-ZH.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # 流程界面
4 |
5 | [English](./README.md) | 中文
6 |
7 | Flowise 的 React 前端界面。
8 |
9 | 
10 |
11 | 安装:
12 |
13 | ```bash
14 | npm i flowise-ui
15 | ```
16 |
17 | ## 许可证
18 |
19 | 本仓库中的源代码在[Apache License Version 2.0 许可证](https://github.com/FlowiseAI/Flowise/blob/master/LICENSE.md)下提供。
20 |
--------------------------------------------------------------------------------
/packages/ui/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Flowise UI
4 |
5 | English | [中文](./README-ZH.md)
6 |
7 | React frontend ui for Flowise.
8 |
9 | 
10 |
11 | Install:
12 |
13 | ```bash
14 | npm i flowise-ui
15 | ```
16 |
17 | ## License
18 |
19 | Source code in this repository is made available under the [Apache License Version 2.0](https://github.com/FlowiseAI/Flowise/blob/master/LICENSE.md).
20 |
--------------------------------------------------------------------------------
/packages/ui/craco.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | webpack: {
3 | configure: {
4 | module: {
5 | rules: [
6 | {
7 | test: /\.m?js$/,
8 | resolve: {
9 | fullySpecified: false
10 | }
11 | }
12 | ]
13 | },
14 | ignoreWarnings: [/Failed to parse source map/] // Ignore warnings about source maps
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/ui/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "esnext",
4 | "module": "commonjs",
5 | "paths": {
6 | "@/*": ["./src/*"]
7 | }
8 | },
9 | "include": ["src/**/*"],
10 | "exclude": ["node_modules"]
11 | }
12 |
--------------------------------------------------------------------------------
/packages/ui/public/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/public/favicon-16x16.png
--------------------------------------------------------------------------------
/packages/ui/public/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/public/favicon-32x32.png
--------------------------------------------------------------------------------
/packages/ui/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/public/favicon.ico
--------------------------------------------------------------------------------
/packages/ui/src/api/apikey.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const getAllAPIKeys = () => client.get('/apikey')
4 |
5 | const createNewAPI = (body) => client.post(`/apikey`, body)
6 |
7 | const updateAPI = (id, body) => client.put(`/apikey/${id}`, body)
8 |
9 | const deleteAPI = (id) => client.delete(`/apikey/${id}`)
10 |
11 | const importAPI = (body) => client.post(`/apikey/import`, body)
12 |
13 | export default {
14 | getAllAPIKeys,
15 | createNewAPI,
16 | updateAPI,
17 | deleteAPI,
18 | importAPI
19 | }
20 |
--------------------------------------------------------------------------------
/packages/ui/src/api/attachments.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const createAttachment = (chatflowid, chatid, formData) =>
4 | client.post(`/attachments/${chatflowid}/${chatid}`, formData, {
5 | headers: { 'Content-Type': 'multipart/form-data' }
6 | })
7 |
8 | export default {
9 | createAttachment
10 | }
11 |
--------------------------------------------------------------------------------
/packages/ui/src/api/audit.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const fetchLoginActivity = (body) => client.post(`/audit/login-activity`, body)
4 | const deleteLoginActivity = (body) => client.post(`/audit/login-activity/delete`, body)
5 |
6 | export default {
7 | fetchLoginActivity,
8 | deleteLoginActivity
9 | }
10 |
--------------------------------------------------------------------------------
/packages/ui/src/api/auth.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | // auth
4 | const resolveLogin = (body) => client.post(`/auth/resolve`, body)
5 | const login = (body) => client.post(`/auth/login`, body)
6 |
7 | // permissions
8 | const getAllPermissions = () => client.get(`/auth/permissions`)
9 |
10 | export default {
11 | resolveLogin,
12 | login,
13 | getAllPermissions
14 | }
15 |
--------------------------------------------------------------------------------
/packages/ui/src/api/chatmessagefeedback.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const addFeedback = (id, body) => client.post(`/feedback/${id}`, body)
4 | const updateFeedback = (id, body) => client.put(`/feedback/${id}`, body)
5 |
6 | export default {
7 | addFeedback,
8 | updateFeedback
9 | }
10 |
--------------------------------------------------------------------------------
/packages/ui/src/api/config.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const getConfig = (id) => client.get(`/flow-config/${id}`)
4 | const getNodeConfig = (body) => client.post(`/node-config`, body)
5 |
6 | export default {
7 | getConfig,
8 | getNodeConfig
9 | }
10 |
--------------------------------------------------------------------------------
/packages/ui/src/api/evaluators.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const getAllEvaluators = () => client.get('/evaluators')
4 |
5 | //evaluators
6 | const createEvaluator = (body) => client.post(`/evaluators`, body)
7 | const getEvaluator = (id) => client.get(`/evaluators/${id}`)
8 | const updateEvaluator = (id, body) => client.put(`/evaluators/${id}`, body)
9 | const deleteEvaluator = (id) => client.delete(`/evaluators/${id}`)
10 |
11 | export default {
12 | getAllEvaluators,
13 | createEvaluator,
14 | getEvaluator,
15 | updateEvaluator,
16 | deleteEvaluator
17 | }
18 |
--------------------------------------------------------------------------------
/packages/ui/src/api/executions.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const getAllExecutions = (params = {}) => client.get('/executions', { params })
4 | const deleteExecutions = (executionIds) => client.delete('/executions', { data: { executionIds } })
5 | const getExecutionById = (executionId) => client.get(`/executions/${executionId}`)
6 | const getExecutionByIdPublic = (executionId) => client.get(`/public-executions/${executionId}`)
7 | const updateExecution = (executionId, body) => client.put(`/executions/${executionId}`, body)
8 |
9 | export default {
10 | getAllExecutions,
11 | deleteExecutions,
12 | getExecutionById,
13 | getExecutionByIdPublic,
14 | updateExecution
15 | }
16 |
--------------------------------------------------------------------------------
/packages/ui/src/api/exportimport.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const exportData = (body) => client.post('/export-import/export', body)
4 | const importData = (body) => client.post('/export-import/import', body)
5 |
6 | export default {
7 | exportData,
8 | importData
9 | }
10 |
--------------------------------------------------------------------------------
/packages/ui/src/api/feedback.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const getStatsFromChatflow = (id, params) => client.get(`/stats/${id}`, { params: { ...params } })
4 |
5 | export default {
6 | getStatsFromChatflow
7 | }
8 |
--------------------------------------------------------------------------------
/packages/ui/src/api/files.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const getAllFiles = () => client.get('/files')
4 |
5 | const deleteFile = (path) => client.delete(`/files`, { params: { path } })
6 |
7 | export default {
8 | getAllFiles,
9 | deleteFile
10 | }
11 |
--------------------------------------------------------------------------------
/packages/ui/src/api/lead.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const getLeads = (id) => client.get(`/leads/${id}`)
4 | const addLead = (body) => client.post(`/leads/`, body)
5 |
6 | export default {
7 | getLeads,
8 | addLead
9 | }
10 |
--------------------------------------------------------------------------------
/packages/ui/src/api/log.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const getLogs = (startDate, endDate) => client.get(`/logs?startDate=${startDate}&endDate=${endDate}`)
4 |
5 | export default {
6 | getLogs
7 | }
8 |
--------------------------------------------------------------------------------
/packages/ui/src/api/loginmethod.js:
--------------------------------------------------------------------------------
1 | import client from '@/api/client'
2 |
3 | // TODO: use this endpoint but without the org id because org id will be null
4 | const getLoginMethods = (organizationId) => client.get(`/loginmethod?organizationId=${organizationId}`)
5 | // TODO: don't use this endpoint.
6 | const getDefaultLoginMethods = () => client.get(`/loginmethod/default`)
7 | const updateLoginMethods = (body) => client.put(`/loginmethod`, body)
8 |
9 | const testLoginMethod = (body) => client.post(`/loginmethod/test`, body)
10 |
11 | export default {
12 | getLoginMethods,
13 | updateLoginMethods,
14 | testLoginMethod,
15 | getDefaultLoginMethods
16 | }
17 |
--------------------------------------------------------------------------------
/packages/ui/src/api/nodes.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const getAllNodes = () => client.get('/nodes')
4 |
5 | const getSpecificNode = (name) => client.get(`/nodes/${name}`)
6 | const getNodesByCategory = (name) => client.get(`/nodes/category/${name}`)
7 |
8 | const executeCustomFunctionNode = (body) => client.post(`/node-custom-function`, body)
9 |
10 | const executeNodeLoadMethod = (name, body) => client.post(`/node-load-method/${name}`, body)
11 |
12 | export default {
13 | getAllNodes,
14 | getSpecificNode,
15 | executeCustomFunctionNode,
16 | getNodesByCategory,
17 | executeNodeLoadMethod
18 | }
19 |
--------------------------------------------------------------------------------
/packages/ui/src/api/platformsettings.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const getSettings = () => client.get('/settings')
4 |
5 | export default {
6 | getSettings
7 | }
8 |
--------------------------------------------------------------------------------
/packages/ui/src/api/prediction.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const sendMessageAndGetPrediction = (id, input) => client.post(`/internal-prediction/${id}`, input)
4 | const sendMessageAndStreamPrediction = (id, input) => client.post(`/internal-prediction/stream/${id}`, input)
5 | const sendMessageAndGetPredictionPublic = (id, input) => client.post(`/prediction/${id}`, input)
6 |
7 | export default {
8 | sendMessageAndGetPrediction,
9 | sendMessageAndStreamPrediction,
10 | sendMessageAndGetPredictionPublic
11 | }
12 |
--------------------------------------------------------------------------------
/packages/ui/src/api/pricing.js:
--------------------------------------------------------------------------------
1 | import client from '@/api/client'
2 |
3 | const getPricingPlans = (body) => client.get(`/pricing`, body)
4 |
5 | export default {
6 | getPricingPlans
7 | }
8 |
--------------------------------------------------------------------------------
/packages/ui/src/api/prompt.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const getAvailablePrompts = (body) => client.post(`/prompts-list`, body)
4 | const getPrompt = (body) => client.post(`/load-prompt`, body)
5 |
6 | export default {
7 | getAvailablePrompts,
8 | getPrompt
9 | }
10 |
--------------------------------------------------------------------------------
/packages/ui/src/api/scraper.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const fetchLinks = (url, relativeLinksMethod, relativeLinksLimit) =>
4 | client.get(`/fetch-links?url=${encodeURIComponent(url)}&relativeLinksMethod=${relativeLinksMethod}&limit=${relativeLinksLimit}`)
5 |
6 | export default {
7 | fetchLinks
8 | }
9 |
--------------------------------------------------------------------------------
/packages/ui/src/api/sso.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const ssoLogin = (providerName) => client.get(`/${providerName}/login`)
4 |
5 | export default {
6 | ssoLogin
7 | }
8 |
--------------------------------------------------------------------------------
/packages/ui/src/api/tools.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const getAllTools = () => client.get('/tools')
4 |
5 | const getSpecificTool = (id) => client.get(`/tools/${id}`)
6 |
7 | const createNewTool = (body) => client.post(`/tools`, body)
8 |
9 | const updateTool = (id, body) => client.put(`/tools/${id}`, body)
10 |
11 | const deleteTool = (id) => client.delete(`/tools/${id}`)
12 |
13 | export default {
14 | getAllTools,
15 | getSpecificTool,
16 | createNewTool,
17 | updateTool,
18 | deleteTool
19 | }
20 |
--------------------------------------------------------------------------------
/packages/ui/src/api/validation.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const checkValidation = (id) => client.get(`/validation/${id}`)
4 |
5 | export default {
6 | checkValidation
7 | }
8 |
--------------------------------------------------------------------------------
/packages/ui/src/api/variables.js:
--------------------------------------------------------------------------------
1 | import client from './client'
2 |
3 | const getAllVariables = () => client.get('/variables')
4 |
5 | const createVariable = (body) => client.post(`/variables`, body)
6 |
7 | const updateVariable = (id, body) => client.put(`/variables/${id}`, body)
8 |
9 | const deleteVariable = (id) => client.delete(`/variables/${id}`)
10 |
11 | export default {
12 | getAllVariables,
13 | createVariable,
14 | updateVariable,
15 | deleteVariable
16 | }
17 |
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/Exporting.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/Exporting.gif
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/account.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/account.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/agentflow-generator.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/agentflow-generator.gif
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/agentgraph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/agentgraph.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/anthropic.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/arize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/arize.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/assemblyai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/assemblyai.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/auth0.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/cURL.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/chathistory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/chathistory.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/fileAttachment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/fileAttachment.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/floppy-disc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/floppy-disc.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/flowise_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/flowise_logo.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/flowise_logo_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/flowise_logo_dark.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/google-login-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/google-login-white.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/groq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/groq.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/langchain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/langchain.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/langfuse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/langfuse.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/llamaindex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/llamaindex.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/llmonitor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/llmonitor.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/localai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/localai.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/microsoft-azure.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/multiagent_supervisor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/multiagent_supervisor.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/multiagent_worker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/multiagent_worker.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/next-agent.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/next-agent.gif
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/opik.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/opik.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/phoenix.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/phoenix.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/robot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/robot.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/sharing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/sharing.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/tool.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/utilNodes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/utilNodes.png
--------------------------------------------------------------------------------
/packages/ui/src/assets/images/wave-sound.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlowiseAI/Flowise/63ff703e7a223bdb37d8fe0dcf0a06800adc2755/packages/ui/src/assets/images/wave-sound.jpg
--------------------------------------------------------------------------------
/packages/ui/src/config.js:
--------------------------------------------------------------------------------
1 | const config = {
2 | // basename: only at build time to set, and Don't add '/' at end off BASENAME for breadcrumbs, also Don't put only '/' use blank('') instead,
3 | basename: '',
4 | defaultPath: '/chatflows',
5 | // You can specify multiple fallback fonts
6 | fontFamily: `'Inter', 'Roboto', 'Arial', sans-serif`,
7 | borderRadius: 12
8 | }
9 |
10 | export default config
11 |
--------------------------------------------------------------------------------
/packages/ui/src/hooks/useScriptRef.jsx:
--------------------------------------------------------------------------------
1 | import { useEffect, useRef } from 'react'
2 |
3 | // ==============================|| ELEMENT REFERENCE HOOKS ||============================== //
4 |
5 | const useScriptRef = () => {
6 | const scripted = useRef(true)
7 |
8 | useEffect(
9 | () => () => {
10 | scripted.current = false
11 | },
12 | []
13 | )
14 |
15 | return scripted
16 | }
17 |
18 | export default useScriptRef
19 |
--------------------------------------------------------------------------------
/packages/ui/src/layout/MainLayout/Header/ProfileSection/index.css:
--------------------------------------------------------------------------------
1 | .ps__rail-x {
2 | display: none !important;
3 | }
4 | .ps__thumb-x {
5 | display: none !important;
6 | }
7 |
--------------------------------------------------------------------------------
/packages/ui/src/layout/MainLayout/LogoSection/index.jsx:
--------------------------------------------------------------------------------
1 | import { Link } from 'react-router-dom'
2 |
3 | // material-ui
4 | import { ButtonBase } from '@mui/material'
5 |
6 | // project imports
7 | import config from '@/config'
8 | import Logo from '@/ui-component/extended/Logo'
9 |
10 | // ==============================|| MAIN LOGO ||============================== //
11 |
12 | const LogoSection = () => (
13 |
14 |
15 |
16 | )
17 |
18 | export default LogoSection
19 |
--------------------------------------------------------------------------------
/packages/ui/src/layout/MinimalLayout/index.jsx:
--------------------------------------------------------------------------------
1 | import { Outlet } from 'react-router-dom'
2 |
3 | // ==============================|| MINIMAL LAYOUT ||============================== //
4 |
5 | const MinimalLayout = () => (
6 | <>
7 |
8 | >
9 | )
10 |
11 | export default MinimalLayout
12 |
--------------------------------------------------------------------------------
/packages/ui/src/menu-items/index.js:
--------------------------------------------------------------------------------
1 | import dashboard from './dashboard'
2 |
3 | // ==============================|| MENU ITEMS ||============================== //
4 |
5 | export const menuItems = {
6 | items: [dashboard]
7 | }
8 |
--------------------------------------------------------------------------------
/packages/ui/src/routes/ChatbotRoutes.jsx:
--------------------------------------------------------------------------------
1 | import { lazy } from 'react'
2 |
3 | // project imports
4 | import Loadable from '@/ui-component/loading/Loadable'
5 | import MinimalLayout from '@/layout/MinimalLayout'
6 |
7 | // canvas routing
8 | const ChatbotFull = Loadable(lazy(() => import('@/views/chatbot')))
9 |
10 | // ==============================|| CANVAS ROUTING ||============================== //
11 |
12 | const ChatbotRoutes = {
13 | path: '/',
14 | element: ,
15 | children: [
16 | {
17 | path: '/chatbot/:id',
18 | element:
19 | }
20 | ]
21 | }
22 |
23 | export default ChatbotRoutes
24 |
--------------------------------------------------------------------------------
/packages/ui/src/routes/index.jsx:
--------------------------------------------------------------------------------
1 | import { useRoutes } from 'react-router-dom'
2 |
3 | // routes
4 | import MainRoutes from './MainRoutes'
5 | import CanvasRoutes from './CanvasRoutes'
6 | import ChatbotRoutes from './ChatbotRoutes'
7 | import config from '@/config'
8 | import AuthRoutes from '@/routes/AuthRoutes'
9 | import ExecutionRoutes from './ExecutionRoutes'
10 |
11 | // ==============================|| ROUTING RENDER ||============================== //
12 |
13 | export default function ThemeRoutes() {
14 | return useRoutes([MainRoutes, AuthRoutes, CanvasRoutes, ChatbotRoutes, ExecutionRoutes], config.basename)
15 | }
16 |
--------------------------------------------------------------------------------
/packages/ui/src/store/context/ConfirmContext.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | const ConfirmContext = React.createContext()
4 |
5 | export default ConfirmContext
6 |
--------------------------------------------------------------------------------
/packages/ui/src/store/context/ConfirmContextProvider.jsx:
--------------------------------------------------------------------------------
1 | import { useReducer } from 'react'
2 | import PropTypes from 'prop-types'
3 | import alertReducer, { initialState } from '../reducers/dialogReducer'
4 | import ConfirmContext from './ConfirmContext'
5 |
6 | const ConfirmContextProvider = ({ children }) => {
7 | const [state, dispatch] = useReducer(alertReducer, initialState)
8 |
9 | return {children}
10 | }
11 |
12 | ConfirmContextProvider.propTypes = {
13 | children: PropTypes.any
14 | }
15 |
16 | export default ConfirmContextProvider
17 |
--------------------------------------------------------------------------------
/packages/ui/src/store/index.jsx:
--------------------------------------------------------------------------------
1 | import { createStore } from 'redux'
2 | import reducer from './reducer'
3 |
4 | // ==============================|| REDUX - MAIN STORE ||============================== //
5 |
6 | const store = createStore(reducer)
7 | const persister = 'Free'
8 |
9 | export { store, persister }
10 |
--------------------------------------------------------------------------------
/packages/ui/src/ui-component/button/StyledFab.jsx:
--------------------------------------------------------------------------------
1 | import { styled } from '@mui/material/styles'
2 | import { Fab } from '@mui/material'
3 |
4 | export const StyledFab = styled(Fab)(({ theme, color = 'primary' }) => ({
5 | color: 'white',
6 | backgroundColor: theme.palette[color].main,
7 | '&:hover': {
8 | backgroundColor: theme.palette[color].main,
9 | backgroundImage: `linear-gradient(rgb(0 0 0/10%) 0 0)`
10 | }
11 | }))
12 |
--------------------------------------------------------------------------------
/packages/ui/src/ui-component/cards/StarterPromptsCard.css:
--------------------------------------------------------------------------------
1 | .button-container {
2 | display: flex;
3 | flex-wrap: wrap;
4 | overflow-x: auto;
5 | -webkit-overflow-scrolling: touch; /* For momentum scroll on mobile devices */
6 | scrollbar-width: none; /* For Firefox */
7 | }
8 |
9 | .button {
10 | flex: 0 0 auto; /* Don't grow, don't shrink, base width on content */
11 | }
12 |
--------------------------------------------------------------------------------
/packages/ui/src/ui-component/dialog/ExpandTextDialog.css:
--------------------------------------------------------------------------------
1 | .editor__textarea {
2 | outline: 0;
3 | }
4 | .editor__textarea::placeholder {
5 | color: rgba(120, 120, 120, 0.5);
6 | }
7 |
--------------------------------------------------------------------------------
/packages/ui/src/ui-component/loading/BackdropLoader.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types'
2 | import { Backdrop, CircularProgress } from '@mui/material'
3 |
4 | export const BackdropLoader = ({ open }) => {
5 | return (
6 |
7 | theme.zIndex.drawer + 1 }} open={open}>
8 |
9 |
10 |
11 | )
12 | }
13 |
14 | BackdropLoader.propTypes = {
15 | open: PropTypes.bool
16 | }
17 |
--------------------------------------------------------------------------------
/packages/ui/src/ui-component/loading/Loadable.jsx:
--------------------------------------------------------------------------------
1 | import { Suspense } from 'react'
2 |
3 | // project imports
4 | import Loader from './Loader'
5 |
6 | // ==============================|| LOADABLE - LAZY LOADING ||============================== //
7 |
8 | const Loadable = (Component) =>
9 | function WithLoader(props) {
10 | return (
11 | }>
12 |
13 |
14 | )
15 | }
16 |
17 | export default Loadable
18 |
--------------------------------------------------------------------------------
/packages/ui/src/ui-component/loading/Loader.jsx:
--------------------------------------------------------------------------------
1 | // material-ui
2 | import LinearProgress from '@mui/material/LinearProgress'
3 | import { styled } from '@mui/material/styles'
4 |
5 | // styles
6 | const LoaderWrapper = styled('div')({
7 | position: 'fixed',
8 | top: 0,
9 | left: 0,
10 | zIndex: 1301,
11 | width: '100%'
12 | })
13 |
14 | // ==============================|| LOADER ||============================== //
15 | const Loader = () => (
16 |
17 |
18 |
19 | )
20 |
21 | export default Loader
22 |
--------------------------------------------------------------------------------
/packages/ui/src/ui-component/markdown/Markdown.css:
--------------------------------------------------------------------------------
1 | .react-markdown table {
2 | border-spacing: 0 !important;
3 | border-collapse: collapse !important;
4 | border-color: inherit !important;
5 | display: block !important;
6 | width: max-content !important;
7 | max-width: 100% !important;
8 | overflow: auto !important;
9 | }
10 |
11 | .react-markdown tbody,
12 | .react-markdown td,
13 | .react-markdown tfoot,
14 | .react-markdown th,
15 | .react-markdown thead,
16 | .react-markdown tr {
17 | border-color: inherit !important;
18 | border-style: solid !important;
19 | border-width: 1px !important;
20 | padding: 10px !important;
21 | }
22 |
--------------------------------------------------------------------------------
/packages/ui/src/ui-component/rbac/available.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types'
2 | import { useAuth } from '@/hooks/useAuth'
3 |
4 | export const Available = ({ permission, children }) => {
5 | const { hasPermission } = useAuth()
6 | if (hasPermission(permission)) {
7 | return children
8 | }
9 | }
10 |
11 | Available.propTypes = {
12 | permission: PropTypes.string,
13 | children: PropTypes.element
14 | }
15 |
--------------------------------------------------------------------------------
/packages/ui/src/ui-component/tabs/TabPanel.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types'
2 | import { Box } from '@mui/material'
3 |
4 | export const TabPanel = (props) => {
5 | const { children, value, index, ...other } = props
6 | return (
7 |
8 | {value === index && {children}}
9 |
10 | )
11 | }
12 |
13 | TabPanel.propTypes = {
14 | children: PropTypes.node,
15 | index: PropTypes.number.isRequired,
16 | value: PropTypes.number.isRequired
17 | }
18 |
--------------------------------------------------------------------------------
/packages/ui/src/ui-component/tabs/TabsList.jsx:
--------------------------------------------------------------------------------
1 | import { styled } from '@mui/system'
2 | import { TabsList as BaseTabsList } from '@mui/base/TabsList'
3 | import { blue } from './tabColors'
4 |
5 | export const TabsList = styled(BaseTabsList)(
6 | ({ theme, ...props }) => `
7 | min-width: 400px;
8 | background-color: ${props.sx?.backgroundColor || blue[500]};
9 | border-radius: 20px;
10 | margin-top: 16px;
11 | margin-bottom: 16px;
12 | display: flex;
13 | align-items: center;
14 | justify-content: center;
15 | align-content: space-between;
16 | box-shadow: 0px 4px 6px ${theme.palette.mode === 'dark' ? 'rgba(0,0,0, 0.4)' : 'rgba(0,0,0, 0.2)'};
17 | `
18 | )
19 |
--------------------------------------------------------------------------------
/packages/ui/src/ui-component/tabs/tabColors.js:
--------------------------------------------------------------------------------
1 | export const blue = {
2 | 50: '#F0F7FF',
3 | 100: '#C2E0FF',
4 | 200: '#80BFFF',
5 | 300: '#66B2FF',
6 | 400: '#3399FF',
7 | 500: '#007FFF',
8 | 600: '#0072E5',
9 | 700: '#0059B2',
10 | 800: '#004C99',
11 | 900: '#003A75'
12 | }
13 |
--------------------------------------------------------------------------------
/packages/ui/src/ui-component/tooltip/NodeTooltip.jsx:
--------------------------------------------------------------------------------
1 | import { styled } from '@mui/material/styles'
2 | import Tooltip, { tooltipClasses } from '@mui/material/Tooltip'
3 |
4 | const NodeTooltip = styled(({ className, ...props }) => )(({ theme }) => ({
5 | [`& .${tooltipClasses.tooltip}`]: {
6 | backgroundColor: theme.palette.nodeToolTip.background,
7 | color: theme.palette.nodeToolTip.color,
8 | boxShadow: theme.shadows[1]
9 | }
10 | }))
11 |
12 | export default NodeTooltip
13 |
--------------------------------------------------------------------------------
/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | - 'packages/*'
3 |
--------------------------------------------------------------------------------
/turbo.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://turbo.build/schema.json",
3 | "pipeline": {
4 | "build": {
5 | "dependsOn": ["^build"],
6 | "outputs": ["dist/**"]
7 | },
8 | "test": {},
9 | "dev": {
10 | "cache": false
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------