diff --git a/package.json b/package.json index 520c6659..aa0dc210 100644 --- a/package.json +++ b/package.json @@ -50,4 +50,4 @@ "postcss": "^8.4.28", "tailwindcss": "^3.1.8" } -} \ No newline at end of file +} diff --git a/src/components/config/Config.tsx b/src/components/config/Config.tsx deleted file mode 100644 index 963bea0f..00000000 --- a/src/components/config/Config.tsx +++ /dev/null @@ -1,201 +0,0 @@ -import { CacheEnum, selectCachedValue } from "@/src/reduxStore/states/cachedValues"; -import { selectOrganization, setOrganization } from "@/src/reduxStore/states/general"; -import { ConfigManager } from "@/src/services/base/config"; -import { Configuration, LocalConfig } from "@/src/types/components/config/config" -import { snakeCaseToCamelCase } from "@/submodules/javascript-functions/case-types-parser"; -import KernDropdown from "@/submodules/react-components/components/KernDropdown"; -import { IconPlus, IconTrash } from "@tabler/icons-react"; -import { useEffect, useState } from "react" -import { useSelector, useDispatch } from "react-redux"; -import { changeOrganization, getOrganization, updateConfig } from "@/src/services/base/organization"; - -export default function Config() { - const dispatch = useDispatch(); - const organization = useSelector(selectOrganization); - const tokenizerValues = useSelector(selectCachedValue(CacheEnum.TOKENIZER_VALUES)); - - const [localConfig, setLocalConfig] = useState(null); - const [configuration, setConfiguration] = useState(null); - const [prepareTokenizedValues, setPrepareTokenizedValues] = useState([]); - const [preparedOptions, setPreparedOptions] = useState([]); - - useEffect(() => { - if (!ConfigManager.isInit()) return; - setLocalConfig({ - allowDataTracking: ConfigManager.getConfigValue("allow_data_tracking"), - limitChecks: ConfigManager.getConfigValue("limit_checks"), - spacyDownloads: Array.from(ConfigManager.getConfigValue("spacy_downloads")), - }); - }, [ConfigManager.isInit()]); - - useEffect(() => { - if (!organization) return; - setConfiguration({ - maxRows: organization.maxRows, - maxCols: organization.maxCols, - maxCharCount: organization.maxCharCount, - }); - }, [organization]); - - useEffect(() => { - if (!tokenizerValues || !localConfig) return; - const tokenizerValuesDisplay = [...tokenizerValues]; - tokenizerValuesDisplay.forEach((tokenizer: any, index: number) => { - const tokenizerNameContainsBrackets = tokenizer.name.includes('(') && tokenizer.name.includes(')'); - const tokenizerCopy = { ...tokenizer }; - tokenizerCopy.name = tokenizer.name + (tokenizer.configString != undefined && !tokenizerNameContainsBrackets ? ` (${tokenizer.configString})` : ''); - tokenizerValuesDisplay[index] = tokenizerCopy; - }); - const filtered = tokenizerValuesDisplay.filter((tokenizer: any) => tokenizer.configString); - setPrepareTokenizedValues(filtered); - const removeDuplicates = filtered.filter((tokenizer: any) => !localConfig?.spacyDownloads.includes(tokenizer.configString)); - setPreparedOptions(removeDuplicates); - }, [tokenizerValues, localConfig]); - - useEffect(() => { - return () => { - ConfigManager.refreshConfig(); - } - }, []); - - function checkAndSaveValue(value: any, key: string, subkey: string = null) { - if (key == "limit_checks") { - if (Number(value) == organization[snakeCaseToCamelCase(subkey)]) return; - } else if (ConfigManager.getConfigValue(key, subkey) == value) return; - - const updateDict: any = {}; - if (subkey) { - updateDict[key] = {}; - if (key == "limit_checks") updateDict[key][subkey] = Number(value); - else updateDict[key][subkey] = value; - } else { - updateDict[key] = value; - } - if (subkey == 'max_rows' || subkey == 'max_cols' || subkey == 'max_char_count') { - changeOrganization(organization.id, JSON.stringify(updateDict.limit_checks), (res) => { - if (!res?.data?.changeOrganization) { - window.alert('something went wrong with the update'); - } else { - getOrganization((res) => { - if (res.data["userOrganization"]) { - dispatch(setOrganization(res.data["userOrganization"])); - } - }); - } - }); - } else { - updateConfig(JSON.stringify(updateDict), (res) => { - if (!res?.data?.updateConfig) { - window.alert('something went wrong with the update'); - } - }); - } - } - - function removeSpacyTokenizer(valueToRemove: string) { - const localConfigCopy = { ...localConfig }; - localConfigCopy.spacyDownloads = localConfig.spacyDownloads.filter(i => i != valueToRemove); - setLocalConfig(localConfigCopy); - checkAndSaveValue(localConfigCopy.spacyDownloads, "spacy_downloads"); - - } - - function changeConfigString(value: any, index: number) { - const localConfigCopy = { ...localConfig }; - localConfigCopy.spacyDownloads[index] = value.name.split('(')[1].split(')')[0]; - setLocalConfig(localConfigCopy); - checkAndSaveValue(localConfigCopy.spacyDownloads, "spacy_downloads"); - } - - function addSpacyConfig() { - const existingConfigs = localConfig.spacyDownloads; - for (const tok of preparedOptions) { - if (!existingConfigs.includes(tok.configString)) { - existingConfigs.push(tok.configString); - checkAndSaveValue(existingConfigs, "spacy_downloads"); - const preparedOptionsCopy = [...preparedOptions]; - const index = preparedOptionsCopy.findIndex((tokenizer: any) => tokenizer.configString == tok.configString); - preparedOptionsCopy.splice(index, 1); - setPreparedOptions(preparedOptionsCopy); - break; - } - } - } - - function updateConfiguration(value: number, field: string) { - const configurationCopy = { ...configuration }; - configurationCopy[field] = value; - setConfiguration(configurationCopy); - } - - return (
-
-

Configuration

-

Here, you can change application settings for your self-hosted version.

-
- {localConfig &&
-
- -

Maximum number of records per project.

-
- { - checkAndSaveValue(e.target.value, 'limit_checks', 'max_rows'); - updateConfiguration(Number(e.target.value), 'maxRows'); - }} /> - -
- -

Maximum number of attributes per project.

-
- { - checkAndSaveValue(e.target.value, 'limit_checks', 'max_cols'); - updateConfiguration(Number(e.target.value), 'maxCols'); - }} /> - -
- -

Maximum number of characters per record.

-
- { - checkAndSaveValue(e.target.value, 'limit_checks', 'max_char_count'); - updateConfiguration(Number(e.target.value), 'maxCharCount'); - }} /> - -
- -

Availability of spaCy language models. You can add new options.

-
- {localConfig.spacyDownloads &&
- {localConfig.spacyDownloads.map((myConfig, index) =>
- tokenizer.configString == myConfig)?.name} - selectedOption={(option) => changeConfigString(option, index)} - dropdownItemsClasses="max-h-80 overflow-y-auto" - buttonClasses="whitespace-nowrap" - dropdownWidth="w-72" - disabled={index < 2} - /> - {index > 1 && } -
)} -
- {tokenizerValues && localConfig.spacyDownloads.length < tokenizerValues.length && - - } -
-
} -
} -
) -} \ No newline at end of file diff --git a/src/components/models-download/ModelsDownload.tsx b/src/components/models-download/ModelsDownload.tsx index a27e661e..b5f8d7d0 100644 --- a/src/components/models-download/ModelsDownload.tsx +++ b/src/components/models-download/ModelsDownload.tsx @@ -1,14 +1,14 @@ import { selectModelsDownloaded, setModelsDownloaded } from "@/src/reduxStore/states/pages/models-downloaded"; import { ModelsDownloaded, ModelsDownloadedStatus } from "@/src/types/components/models-downloaded/models-downloaded"; import { Tooltip } from "@nextui-org/react"; -import { IconAlertTriangleFilled, IconArrowLeft, IconBan, IconCheckbox, IconCircleCheckFilled, IconExternalLink, IconLoader, IconPlus, IconTrash } from "@tabler/icons-react"; +import { IconAlertTriangleFilled, IconArrowLeft, IconCircleCheckFilled, IconExternalLink, IconLoader, IconPlus, IconTrash } from "@tabler/icons-react"; import { useRouter } from "next/router"; import { useCallback, useEffect } from "react"; import { useDispatch, useSelector } from "react-redux"; import LoadingIcon from "../shared/loading/LoadingIcon"; import { openModal, setModalStates } from "@/src/reduxStore/states/modal"; import { ModalEnum } from "@/src/types/shared/modal"; -import { selectIsAdmin, selectIsManaged, selectOrganizationId } from "@/src/reduxStore/states/general"; +import { selectIsAdmin, selectOrganizationId } from "@/src/reduxStore/states/general"; import { timer } from "rxjs"; import { TOOLTIPS_DICT } from "@/src/util/tooltip-constants"; import AddModelDownloadModal from "./AddModelDownloadModal"; @@ -20,8 +20,6 @@ import { Application, CurrentPage } from "@/submodules/react-components/hooks/we export default function ModelsDownload() { const router = useRouter(); const dispatch = useDispatch(); - - const isManaged = useSelector(selectIsManaged); const isAdmin = useSelector(selectIsAdmin); const modelsDownloaded = useSelector(selectModelsDownloaded); @@ -139,7 +137,6 @@ export default function ModelsDownload() {
- - - +
) : (

{key}

{value}

diff --git a/src/components/projects/projectId/heuristics/HeuristicsHeader.tsx b/src/components/projects/projectId/heuristics/HeuristicsHeader.tsx index c018f801..0897cda1 100644 --- a/src/components/projects/projectId/heuristics/HeuristicsHeader.tsx +++ b/src/components/projects/projectId/heuristics/HeuristicsHeader.tsx @@ -1,5 +1,5 @@ import { Loading } from "@nextui-org/react"; -import { selectIsManaged, selectOrganizationId } from '@/src/reduxStore/states/general'; +import { selectOrganizationId } from '@/src/reduxStore/states/general'; import { openModal, selectModal } from '@/src/reduxStore/states/modal'; import { selectHeuristicsAll, setHeuristicType } from '@/src/reduxStore/states/pages/heuristics'; import { selectLabelingTasksAll } from '@/src/reduxStore/states/pages/settings'; @@ -30,7 +30,6 @@ export default function HeuristicsHeader(props: HeuristicsHeaderProps) { const dispatch = useDispatch(); const router = useRouter(); - const isManaged = useSelector(selectIsManaged); const projectId = useSelector(selectProjectId); const heuristics = useSelector(selectHeuristicsAll); const labelingTasks = useSelector(selectLabelingTasksAll); diff --git a/src/components/projects/projectId/settings/embeddings/Embeddings.tsx b/src/components/projects/projectId/settings/embeddings/Embeddings.tsx index 7a62fc51..72b234bb 100644 --- a/src/components/projects/projectId/settings/embeddings/Embeddings.tsx +++ b/src/components/projects/projectId/settings/embeddings/Embeddings.tsx @@ -1,6 +1,6 @@ import LoadingIcon from "@/src/components/shared/loading/LoadingIcon"; -import { selectIsManaged, selectOrganizationId } from "@/src/reduxStore/states/general"; -import { closeModal, openModal, setModalStates } from "@/src/reduxStore/states/modal"; +import { selectOrganizationId } from "@/src/reduxStore/states/general"; +import { openModal, setModalStates } from "@/src/reduxStore/states/modal"; import { selectAttributes, selectEmbeddings } from "@/src/reduxStore/states/pages/settings"; import { selectProjectId } from "@/src/reduxStore/states/project"; import { Embedding, EmbeddingState, EmbeddingType } from "@/src/types/components/projects/projectId/settings/embeddings"; @@ -24,7 +24,6 @@ export default function Embeddings(props: { refetchEmbeddings: () => void }) { const router = useRouter(); const attributes = useSelector(selectAttributes); - const isManaged = useSelector(selectIsManaged); const embeddings = useSelector(selectEmbeddings); const projectId = useSelector(selectProjectId); @@ -176,8 +175,8 @@ export default function Embeddings(props: { refetchEmbeddings: () => void }) { Generate embedding - -
) ) diff --git a/src/components/shared/sidebar/VersionOverviewModal.tsx b/src/components/shared/sidebar/VersionOverviewModal.tsx index 8446a11a..b58b5312 100644 --- a/src/components/shared/sidebar/VersionOverviewModal.tsx +++ b/src/components/shared/sidebar/VersionOverviewModal.tsx @@ -1,38 +1,19 @@ -import { ModalButton, ModalEnum } from "@/src/types/shared/modal"; +import { ModalEnum } from "@/src/types/shared/modal"; import Modal from "../modal/Modal"; import { IconAlertCircle, IconArrowRight, IconExternalLink } from "@tabler/icons-react"; -import { useDispatch, useSelector } from "react-redux"; +import { useSelector } from "react-redux"; import { CacheEnum, selectCachedValue } from "@/src/reduxStore/states/cachedValues"; import style from '@/src/styles/shared/sidebar.module.css'; import { VersionOverview } from "@/src/types/shared/sidebar"; import { TOOLTIPS_DICT } from "@/src/util/tooltip-constants"; import { Tooltip } from "@nextui-org/react"; import LoadingIcon from "../loading/LoadingIcon"; -import { useCallback, useEffect, useState } from "react"; -import { selectIsManaged } from "@/src/reduxStore/states/general"; -import { closeModal, openModal } from "@/src/reduxStore/states/modal"; -const ACCEPT_BUTTON = { buttonCaption: "How to update", useButton: true }; export default function VersionOverviewModal() { - const dispatch = useDispatch(); - - const isManaged = useSelector(selectIsManaged); const versionOverviewData = useSelector(selectCachedValue(CacheEnum.VERSION_OVERVIEW)); - const howToUpdate = useCallback(() => { - dispatch(closeModal(ModalEnum.VERSION_OVERVIEW)); - dispatch(openModal(ModalEnum.HOW_TO_UPDATE)); - }, []); - - useEffect(() => { - setAcceptButton({ ...ACCEPT_BUTTON, useButton: !isManaged, emitFunction: howToUpdate }); - }, [howToUpdate, isManaged]); - - const [acceptButton, setAcceptButton] = useState(ACCEPT_BUTTON); - - - return ( + return (
Version overview @@ -66,7 +47,7 @@ export default function VersionOverviewModal() { {versionOverviewData.map((service: VersionOverview, index: number) => ( - {service.service} + {service.service} {service.installedVersion}
@@ -76,7 +57,7 @@ export default function VersionOverviewModal() { }
- {service.parseDate} + {service.parseDate} diff --git a/src/components/users/UsersList.tsx b/src/components/users/UsersList.tsx index f3e59984..461ee4ec 100644 --- a/src/components/users/UsersList.tsx +++ b/src/components/users/UsersList.tsx @@ -1,4 +1,4 @@ -import { selectAnnotators, selectEngineers, selectExperts, selectInactiveOrganization, selectIsManaged } from "@/src/reduxStore/states/general"; +import { selectAnnotators, selectEngineers, selectExperts, selectInactiveOrganization } from "@/src/reduxStore/states/general"; import { useSelector } from "react-redux" import YoutubeIntroduction from "../projects/YoutubeIntroduction"; import { User } from "@/src/types/shared/general"; @@ -6,179 +6,13 @@ import { IconUsersGroup } from "@tabler/icons-react"; import { UNKNOWN_USER } from "@/src/util/constants"; export default function UsersList() { - const isManaged = useSelector(selectIsManaged); const organizationInactive = useSelector(selectInactiveOrganization); const engineers = useSelector(selectEngineers); const annotators = useSelector(selectAnnotators); const experts = useSelector(selectExperts); return
- {/* Intentionally commented */} - {/* {!isManaged &&
-
-
-
-

- Tailored pricing, - fitting your requirements. -

-

- refinery comes both via managed cloud or as an on-prem enterprise solution. Also, - you can let us manage your crowdlabeling tasks in the managed cloud. -

-
- -
- -
-
- -
-

What's included

-
    -
  • - - Free forever. -
  • -
  • - - Ideal for smaller projects, e.g. - side-projects or Proof-of-Concepts. -
  • -
-
-
- -
-
-

Managed cloud

-

We do all the heavy-lifting for you.

-
-
-

- Starting at - 300€ - - /mo. -

-

- Depending on workload, dedicated - vs. shared instances, and labeling services. -

- - 14-day trial - -
-
- - Talk to sales - -
-
-

What's included

-
    -
  • - - Managed and monitored by us. -
  • -
  • - - Work together with your team. -
  • -
  • - - GPU-acceleration of large language model - (LLM)-services. -
  • -
  • - - On-demand managed labeling - services. -
  • -
-
-
- -
-
-

On-premise deployment -

-

You run refinery, we help you make it a - success.

-
-
-

- 3000€ - - /mo. -

-

- Running on your own - infrastructure. -

- - Early bird offer - -
-
- - Talk to sales - -
-
-

What's included

-
    -
  • - - Deployed on your own - infrastructure. -
  • -
  • - - Work together with your team. -
  • -
  • - - Custom API. -
  • -
  • - - Dedicated engineer support. -
  • -
-
-
-
-
-
} */} - {!organizationInactive && isManaged &&
+ {!organizationInactive &&
@@ -277,7 +111,7 @@ export default function UsersList() {
} - {organizationInactive && isManaged &&
+ {organizationInactive &&