mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-29 17:20:44 +02:00
remove non-EE public connector options
This commit is contained in:
committed by
Chris Weaver
parent
a3ea217f40
commit
cd22cca4e8
@ -94,7 +94,7 @@ export default function AddConnector({
|
|||||||
const [refreshFreq, setRefreshFreq] = useState<number>(defaultRefresh || 0);
|
const [refreshFreq, setRefreshFreq] = useState<number>(defaultRefresh || 0);
|
||||||
const [pruneFreq, setPruneFreq] = useState<number>(defaultPrune);
|
const [pruneFreq, setPruneFreq] = useState<number>(defaultPrune);
|
||||||
const [indexingStart, setIndexingStart] = useState<Date | null>(null);
|
const [indexingStart, setIndexingStart] = useState<Date | null>(null);
|
||||||
const [isPublic, setIsPublic] = useState(false);
|
const [isPublic, setIsPublic] = useState(true);
|
||||||
const [createConnectorToggle, setCreateConnectorToggle] = useState(false);
|
const [createConnectorToggle, setCreateConnectorToggle] = useState(false);
|
||||||
const formRef = useRef<FormikProps<any>>(null);
|
const formRef = useRef<FormikProps<any>>(null);
|
||||||
const [advancedFormPageState, setAdvancedFormPageState] = useState(true);
|
const [advancedFormPageState, setAdvancedFormPageState] = useState(true);
|
||||||
|
@ -9,6 +9,7 @@ import { TrashIcon } from "@/components/icons/icons";
|
|||||||
import { FileUpload } from "@/components/admin/connectors/FileUpload";
|
import { FileUpload } from "@/components/admin/connectors/FileUpload";
|
||||||
import { ConnectionConfiguration } from "@/lib/connectors/connectors";
|
import { ConnectionConfiguration } from "@/lib/connectors/connectors";
|
||||||
import { useFormContext } from "@/components/context/FormContext";
|
import { useFormContext } from "@/components/context/FormContext";
|
||||||
|
import { usePaidEnterpriseFeaturesEnabled } from "@/components/settings/usePaidEnterpriseFeaturesEnabled";
|
||||||
|
|
||||||
export interface DynamicConnectionFormProps {
|
export interface DynamicConnectionFormProps {
|
||||||
config: ConnectionConfiguration;
|
config: ConnectionConfiguration;
|
||||||
@ -54,7 +55,10 @@ const DynamicConnectionForm: React.FC<DynamicConnectionFormProps> = ({
|
|||||||
{} as Record<string, any>
|
{} as Record<string, any>
|
||||||
)),
|
)),
|
||||||
};
|
};
|
||||||
|
const isPaidEnterpriseFeaturesEnabled = usePaidEnterpriseFeaturesEnabled();
|
||||||
|
|
||||||
const { setAllowAdvanced } = useFormContext();
|
const { setAllowAdvanced } = useFormContext();
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
name: Yup.string().required("Connector Name is required"),
|
name: Yup.string().required("Connector Name is required"),
|
||||||
...config.values.reduce(
|
...config.values.reduce(
|
||||||
@ -274,7 +278,8 @@ const DynamicConnectionForm: React.FC<DynamicConnectionFormProps> = ({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
|
{isPaidEnterpriseFeaturesEnabled && (
|
||||||
|
<>
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
<EditingValue
|
<EditingValue
|
||||||
@ -288,6 +293,8 @@ const DynamicConnectionForm: React.FC<DynamicConnectionFormProps> = ({
|
|||||||
name={"public"}
|
name={"public"}
|
||||||
currentValue={isPublic}
|
currentValue={isPublic}
|
||||||
/>
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
@ -31,6 +31,7 @@ import { CustomTooltip } from "@/components/tooltip/CustomTooltip";
|
|||||||
import { Warning } from "@phosphor-icons/react";
|
import { Warning } from "@phosphor-icons/react";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import { TOGGLED_CONNECTORS_COOKIE_NAME } from "@/lib/constants";
|
import { TOGGLED_CONNECTORS_COOKIE_NAME } from "@/lib/constants";
|
||||||
|
import { usePaidEnterpriseFeaturesEnabled } from "@/components/settings/usePaidEnterpriseFeaturesEnabled";
|
||||||
|
|
||||||
const columnWidths = {
|
const columnWidths = {
|
||||||
first: "20%",
|
first: "20%",
|
||||||
@ -54,6 +55,7 @@ function SummaryRow({
|
|||||||
onToggle: () => void;
|
onToggle: () => void;
|
||||||
}) {
|
}) {
|
||||||
const activePercentage = (summary.active / summary.count) * 100;
|
const activePercentage = (summary.active / summary.count) * 100;
|
||||||
|
const isPaidEnterpriseFeaturesEnabled = usePaidEnterpriseFeaturesEnabled();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableRow
|
<TableRow
|
||||||
@ -98,12 +100,14 @@ function SummaryRow({
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
||||||
|
{isPaidEnterpriseFeaturesEnabled && (
|
||||||
<TableCell className={`py-4 w-[${columnWidths.fourth}]`}>
|
<TableCell className={`py-4 w-[${columnWidths.fourth}]`}>
|
||||||
<div className="text-sm text-gray-500">Public Connectors</div>
|
<div className="text-sm text-gray-500">Public Connectors</div>
|
||||||
<p className="flex text-xl mx-auto font-semibold items-center text-lg mt-1">
|
<p className="flex text-xl mx-auto font-semibold items-center text-lg mt-1">
|
||||||
{summary.public}/{summary.count}
|
{summary.public}/{summary.count}
|
||||||
</p>
|
</p>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
|
|
||||||
<TableCell className={`py-4 w-[${columnWidths.fifth}]`}>
|
<TableCell className={`py-4 w-[${columnWidths.fifth}]`}>
|
||||||
<div className="text-sm text-gray-500">Total Docs Indexed</div>
|
<div className="text-sm text-gray-500">Total Docs Indexed</div>
|
||||||
@ -134,6 +138,7 @@ function ConnectorRow({
|
|||||||
invisible?: boolean;
|
invisible?: boolean;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const isPaidEnterpriseFeaturesEnabled = usePaidEnterpriseFeaturesEnabled();
|
||||||
|
|
||||||
const handleManageClick = (e: any) => {
|
const handleManageClick = (e: any) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@ -227,6 +232,7 @@ function ConnectorRow({
|
|||||||
<TableCell className={`w-[${columnWidths.third}]`}>
|
<TableCell className={`w-[${columnWidths.third}]`}>
|
||||||
{getActivityBadge()}
|
{getActivityBadge()}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
{isPaidEnterpriseFeaturesEnabled && (
|
||||||
<TableCell className={`w-[${columnWidths.fourth}]`}>
|
<TableCell className={`w-[${columnWidths.fourth}]`}>
|
||||||
{ccPairsIndexingStatus.public_doc ? (
|
{ccPairsIndexingStatus.public_doc ? (
|
||||||
<FiCheck className="my-auto text-emerald-600" size="18" />
|
<FiCheck className="my-auto text-emerald-600" size="18" />
|
||||||
@ -234,6 +240,7 @@ function ConnectorRow({
|
|||||||
<FiXCircle className="my-auto text-red-600" />
|
<FiXCircle className="my-auto text-red-600" />
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
)}
|
||||||
<TableCell className={`w-[${columnWidths.sixth}]`}>
|
<TableCell className={`w-[${columnWidths.sixth}]`}>
|
||||||
{ccPairsIndexingStatus.docs_indexed}
|
{ccPairsIndexingStatus.docs_indexed}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@ -261,6 +268,7 @@ export function CCPairIndexingStatusTable({
|
|||||||
const [searchTerm, setSearchTerm] = useState("");
|
const [searchTerm, setSearchTerm] = useState("");
|
||||||
|
|
||||||
const searchInputRef = useRef<HTMLInputElement>(null);
|
const searchInputRef = useRef<HTMLInputElement>(null);
|
||||||
|
const isPaidEnterpriseFeaturesEnabled = usePaidEnterpriseFeaturesEnabled();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (searchInputRef.current) {
|
if (searchInputRef.current) {
|
||||||
@ -449,11 +457,13 @@ export function CCPairIndexingStatusTable({
|
|||||||
>
|
>
|
||||||
Activity
|
Activity
|
||||||
</TableHeaderCell>
|
</TableHeaderCell>
|
||||||
|
{isPaidEnterpriseFeaturesEnabled && (
|
||||||
<TableHeaderCell
|
<TableHeaderCell
|
||||||
className={`w-[${columnWidths.fourth}]`}
|
className={`w-[${columnWidths.fourth}]`}
|
||||||
>
|
>
|
||||||
Public
|
Public
|
||||||
</TableHeaderCell>
|
</TableHeaderCell>
|
||||||
|
)}
|
||||||
<TableHeaderCell
|
<TableHeaderCell
|
||||||
className={`w-[${columnWidths.sixth}]`}
|
className={`w-[${columnWidths.sixth}]`}
|
||||||
>
|
>
|
||||||
|
@ -42,6 +42,7 @@ import { PagesTab } from "./PagesTab";
|
|||||||
import { Tooltip } from "@/components/tooltip/Tooltip";
|
import { Tooltip } from "@/components/tooltip/Tooltip";
|
||||||
import KeyboardSymbol from "@/lib/browserUtilities";
|
import KeyboardSymbol from "@/lib/browserUtilities";
|
||||||
import { pageType } from "./types";
|
import { pageType } from "./types";
|
||||||
|
import { usePaidEnterpriseFeaturesEnabled } from "@/components/settings/usePaidEnterpriseFeaturesEnabled";
|
||||||
|
|
||||||
interface HistorySidebarProps {
|
interface HistorySidebarProps {
|
||||||
page: pageType;
|
page: pageType;
|
||||||
@ -199,7 +200,6 @@ export const HistorySidebar = forwardRef<HTMLDivElement, HistorySidebarProps>(
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="border-b border-border pb-4 mx-3" />
|
<div className="border-b border-border pb-4 mx-3" />
|
||||||
|
|
||||||
<PagesTab
|
<PagesTab
|
||||||
closeSidebar={removeToggle}
|
closeSidebar={removeToggle}
|
||||||
page={page}
|
page={page}
|
||||||
|
Reference in New Issue
Block a user