这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"Mintplex",
"moderations",
"numpages",
"odbc",
"Ollama",
"Oobabooga",
"openai",
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 \
libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 \
libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release \
xdg-utils git build-essential ffmpeg unixodbc unixodbc-dev && \
xdg-utils git build-essential ffmpeg && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
Expand Down Expand Up @@ -79,7 +79,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 \
libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 \
libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release \
xdg-utils git build-essential ffmpeg unixodbc unixodbc-dev && \
xdg-utils git build-essential ffmpeg && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import PostgreSQLLogo from "./icons/postgresql.png";
import MySQLLogo from "./icons/mysql.png";
import MSSQLLogo from "./icons/mssql.png";
import ODBCLogo from "./icons/odbc.png";
import { X } from "@phosphor-icons/react";

export const DB_LOGOS = {
postgresql: PostgreSQLLogo,
mysql: MySQLLogo,
"sql-server": MSSQLLogo,
odbc: ODBCLogo,
};

export default function DBConnection({ connection, onRemove, setHasChanges }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function assembleConnectionString({
host = "",
port = "",
database = "",
driver = "",
}) {
if ([username, password, host, database].every((i) => !!i) === false)
return `Please fill out all the fields above.`;
Expand All @@ -22,9 +21,6 @@ function assembleConnectionString({
return `mysql://${username}:${password}@${host}:${port}/${database}`;
case "sql-server":
return `mssql://${username}:${password}@${host}:${port}/${database}`;
case "odbc":
if (!driver) return `Please fill out the driver field.`;
return `Driver={${driver}};Server=${host};Port=${port};Database=${database};UID=${username};PWD=${password}`;
default:
return null;
}
Expand All @@ -37,7 +33,6 @@ const DEFAULT_CONFIG = {
host: null,
port: null,
database: null,
driver: null,
};

export default function NewSQLConnection({ isOpen, closeModal, onSubmit }) {
Expand All @@ -53,14 +48,12 @@ export default function NewSQLConnection({ isOpen, closeModal, onSubmit }) {

function onFormChange() {
const form = new FormData(document.getElementById("sql-connection-form"));

setConfig({
username: form.get("username").trim(),
password: form.get("password"),
host: form.get("host").trim(),
port: form.get("port").trim(),
database: form.get("database").trim(),
driver: form.get("driver")?.trim(),
});
}

Expand All @@ -81,7 +74,7 @@ export default function NewSQLConnection({ isOpen, closeModal, onSubmit }) {
// to the parent container form so we don't have nested forms.
return createPortal(
<ModalWrapper isOpen={isOpen}>
<div className="relative w-full md:w-fit max-w-2xl max-h-full md:mt-8">
<div className="relative w-full md:w-1/3 max-w-2xl max-h-full md:mt-8">
<div className="relative bg-main-gradient rounded-xl shadow-[0_4px_14px_rgba(0,0,0,0.25)] max-h-[85vh] overflow-y-scroll no-scroll">
<div className="flex items-start justify-between p-4 border-b rounded-t border-gray-500/50">
<h3 className="text-xl font-semibold text-white">
Expand Down Expand Up @@ -121,7 +114,7 @@ export default function NewSQLConnection({ isOpen, closeModal, onSubmit }) {
<label className="text-white text-sm font-semibold block my-4">
Select your SQL engine
</label>
<div className="flex flex-wrap gap-x-4 gap-y-4">
<div className="grid md:grid-cols-4 gap-4 grid-cols-2">
<DBEngine
provider="postgresql"
active={engine === "postgresql"}
Expand All @@ -137,11 +130,6 @@ export default function NewSQLConnection({ isOpen, closeModal, onSubmit }) {
active={engine === "sql-server"}
onClick={() => setEngine("sql-server")}
/>
<DBEngine
provider="odbc"
active={engine === "odbc"}
onClick={() => setEngine("odbc")}
/>
</div>
</div>

Expand Down Expand Up @@ -236,23 +224,6 @@ export default function NewSQLConnection({ isOpen, closeModal, onSubmit }) {
spellCheck={false}
/>
</div>

{engine === "odbc" && (
<div className="flex flex-col">
<label className="text-white text-sm font-semibold block mb-3">
Driver
</label>
<input
type="text"
name="driver"
className="border-none bg-zinc-900 text-white placeholder:text-white/20 text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5"
placeholder="the driver to use eg: MongoDB ODBC 1.2.0 ANSI Driver"
required={true}
autoComplete="off"
spellCheck={false}
/>
</div>
)}
<p className="text-white/40 text-sm">
{assembleConnectionString({ engine, ...config })}
</p>
Expand Down
Binary file not shown.
1 change: 0 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"mysql2": "^3.9.8",
"node-html-markdown": "^1.3.0",
"node-llama-cpp": "^2.8.0",
"odbc": "^2.4.8",
"ollama": "^0.5.0",
"openai": "4.38.5",
"pg": "^8.11.5",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { SystemSettings } = require("../../../../../../models/systemSettings");
const { safeJsonParse } = require("../../../../../http");

/**
* @typedef {('postgresql'|'mysql'|'sql-server'|'odbc')} SQLEngine
* @typedef {('postgresql'|'mysql'|'sql-server')} SQLEngine
*/

/**
Expand Down Expand Up @@ -36,9 +36,6 @@ function getDBClient(identifier = "", connectionConfig = {}) {
case "sql-server":
const { MSSQLConnector } = require("./MSSQL");
return new MSSQLConnector(connectionConfig);
case "odbc":
const { ODBCConnector } = require("./ODBC");
return new ODBCConnector(connectionConfig);
default:
throw new Error(
`There is no supported database connector for ${identifier}`
Expand Down
18 changes: 2 additions & 16 deletions server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@
"@langchain/core" "~0.1"
js-tiktoken "^1.0.11"

"@mapbox/node-pre-gyp@^1.0.11", "@mapbox/node-pre-gyp@^1.0.5":
"@mapbox/node-pre-gyp@^1.0.11":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz#417db42b7f5323d79e93b34a6d7a2a12c0df43fa"
integrity sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==
Expand Down Expand Up @@ -2599,7 +2599,7 @@ arrify@^2.0.0:
resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa"
integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==

async@^3.0.1, async@^3.2.3, async@^3.2.4:
async@^3.2.3, async@^3.2.4:
version "3.2.5"
resolved "https://registry.yarnpkg.com/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66"
integrity sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==
Expand Down Expand Up @@ -5854,11 +5854,6 @@ node-abort-controller@^3.1.1:
resolved "https://registry.yarnpkg.com/node-abort-controller/-/node-abort-controller-3.1.1.tgz#a94377e964a9a37ac3976d848cb5c765833b8548"
integrity sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==

node-addon-api@^3.0.2:
version "3.2.1"
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161"
integrity sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==

node-addon-api@^5.0.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.1.0.tgz#49da1ca055e109a23d537e9de43c09cca21eb762"
Expand Down Expand Up @@ -6111,15 +6106,6 @@ octokit@^3.1.0:
"@octokit/request-error" "^5.0.0"
"@octokit/types" "^12.0.0"

odbc@^2.4.8:
version "2.4.8"
resolved "https://registry.yarnpkg.com/odbc/-/odbc-2.4.8.tgz#56e34a1cafbaf1c2c53eec229b3a7604f890e3bf"
integrity sha512-W4VkBcr8iSe8hqpp2GoFPybCAJefC7eK837XThJkYCW4tBzyQisqkciwt1UYidU1OpKy1589y9dMN0tStiVB1Q==
dependencies:
"@mapbox/node-pre-gyp" "^1.0.5"
async "^3.0.1"
node-addon-api "^3.0.2"

ollama@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/ollama/-/ollama-0.5.0.tgz#cb9bc709d4d3278c9f484f751b0d9b98b06f4859"
Expand Down