mirror of https://github.com/portainer/portainer
feat(openai): remove OpenAI BE-12018 (#873)
parent
a3bfe7cb0c
commit
2c08becf6c
|
@ -258,9 +258,6 @@ func (m *Migrator) initMigrations() {
|
||||||
|
|
||||||
m.addMigrations("2.33.0-rc1", m.migrateEdgeGroupEndpointsToRoars_2_33_0)
|
m.addMigrations("2.33.0-rc1", m.migrateEdgeGroupEndpointsToRoars_2_33_0)
|
||||||
|
|
||||||
//m.addMigrations("2.33.0", m.migrateEdgeGroupEndpointsToRoars_2_33_0)
|
|
||||||
// when we release 2.33.0 it will also run the rc-1 migration function
|
|
||||||
|
|
||||||
// Add new migrations above...
|
// Add new migrations above...
|
||||||
// One function per migration, each versions migration funcs in the same file.
|
// One function per migration, each versions migration funcs in the same file.
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
import { useField } from 'formik';
|
|
||||||
|
|
||||||
import { FormControl } from '@@/form-components/FormControl';
|
|
||||||
import { Switch } from '@@/form-components/SwitchField/Switch';
|
|
||||||
|
|
||||||
const fieldKey = 'OpenAIIntegration';
|
|
||||||
|
|
||||||
export function EnableOpenAIIntegrationSwitch() {
|
|
||||||
const [inputProps, meta, helpers] = useField<boolean>(fieldKey);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<FormControl
|
|
||||||
inputId="experimental_openAI"
|
|
||||||
label="Enable OpenAI integration"
|
|
||||||
size="medium"
|
|
||||||
errors={meta.error}
|
|
||||||
>
|
|
||||||
<Switch
|
|
||||||
id="experimental_openAI"
|
|
||||||
data-cy="enable-openai-integration-switch"
|
|
||||||
name={fieldKey}
|
|
||||||
className="space-right"
|
|
||||||
checked={inputProps.value}
|
|
||||||
onChange={handleChange}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
);
|
|
||||||
|
|
||||||
function handleChange(enable: boolean) {
|
|
||||||
helpers.setValue(enable);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -10,14 +10,9 @@ import { useUpdateExperimentalSettingsMutation } from '@/react/portainer/setting
|
||||||
import { LoadingButton } from '@@/buttons/LoadingButton';
|
import { LoadingButton } from '@@/buttons/LoadingButton';
|
||||||
import { TextTip } from '@@/Tip/TextTip';
|
import { TextTip } from '@@/Tip/TextTip';
|
||||||
|
|
||||||
import { EnableOpenAIIntegrationSwitch } from './EnableOpenAIIntegrationSwitch';
|
interface FormValues {}
|
||||||
|
|
||||||
interface FormValues {
|
const validation = yup.object({});
|
||||||
OpenAIIntegration: boolean;
|
|
||||||
}
|
|
||||||
const validation = yup.object({
|
|
||||||
OpenAIIntegration: yup.boolean(),
|
|
||||||
});
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
settings: ExperimentalFeatures;
|
settings: ExperimentalFeatures;
|
||||||
|
@ -30,12 +25,9 @@ export function ExperimentalFeaturesSettingsForm({ settings }: Props) {
|
||||||
|
|
||||||
const { mutate: updateSettings } = mutation;
|
const { mutate: updateSettings } = mutation;
|
||||||
|
|
||||||
const handleSubmit = useCallback(
|
const handleSubmit = useCallback(() => {
|
||||||
(variables: FormValues) => {
|
|
||||||
updateSettings(
|
updateSettings(
|
||||||
{
|
{},
|
||||||
OpenAIIntegration: variables.OpenAIIntegration,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
onSuccess() {
|
onSuccess() {
|
||||||
notifySuccess(
|
notifySuccess(
|
||||||
|
@ -45,9 +37,7 @@ export function ExperimentalFeaturesSettingsForm({ settings }: Props) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
}, [updateSettings]);
|
||||||
[updateSettings]
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Formik<FormValues>
|
<Formik<FormValues>
|
||||||
|
@ -76,8 +66,6 @@ export function ExperimentalFeaturesSettingsForm({ settings }: Props) {
|
||||||
experimental feature will prevent access to it.
|
experimental feature will prevent access to it.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<EnableOpenAIIntegrationSwitch />
|
|
||||||
|
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<div className="col-sm-12">
|
<div className="col-sm-12">
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { PageHeader } from '@@/PageHeader';
|
||||||
|
|
||||||
import { useSettings } from '../queries';
|
import { useSettings } from '../queries';
|
||||||
import { Settings } from '../types';
|
import { Settings } from '../types';
|
||||||
import { isBE } from '../../feature-flags/feature-flags.service';
|
|
||||||
|
|
||||||
import { ApplicationSettingsPanel } from './ApplicationSettingsPanel';
|
import { ApplicationSettingsPanel } from './ApplicationSettingsPanel';
|
||||||
import { BackupSettingsPanel } from './BackupSettingsView';
|
import { BackupSettingsPanel } from './BackupSettingsView';
|
||||||
|
@ -15,7 +14,6 @@ import { HelmCertPanel } from './HelmCertPanel';
|
||||||
import { HiddenContainersPanel } from './HiddenContainersPanel/HiddenContainersPanel';
|
import { HiddenContainersPanel } from './HiddenContainersPanel/HiddenContainersPanel';
|
||||||
import { KubeSettingsPanel } from './KubeSettingsPanel';
|
import { KubeSettingsPanel } from './KubeSettingsPanel';
|
||||||
import { SSLSettingsPanelWrapper } from './SSLSettingsPanel/SSLSettingsPanel';
|
import { SSLSettingsPanelWrapper } from './SSLSettingsPanel/SSLSettingsPanel';
|
||||||
import { ExperimentalFeatures } from './ExperimentalFeatures';
|
|
||||||
|
|
||||||
export function SettingsView() {
|
export function SettingsView() {
|
||||||
const settingsQuery = useSettings();
|
const settingsQuery = useSettings();
|
||||||
|
@ -50,8 +48,6 @@ export function SettingsView() {
|
||||||
|
|
||||||
<SSLSettingsPanelWrapper />
|
<SSLSettingsPanelWrapper />
|
||||||
|
|
||||||
{isBE && <ExperimentalFeatures />}
|
|
||||||
|
|
||||||
<HiddenContainersPanel />
|
<HiddenContainersPanel />
|
||||||
|
|
||||||
<BackupSettingsPanel />
|
<BackupSettingsPanel />
|
||||||
|
|
|
@ -99,9 +99,7 @@ export interface DefaultRegistry {
|
||||||
Hide: boolean;
|
Hide: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ExperimentalFeatures {
|
export interface ExperimentalFeatures {}
|
||||||
OpenAIIntegration: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Settings {
|
export interface Settings {
|
||||||
LogoURL: string;
|
LogoURL: string;
|
||||||
|
|
Loading…
Reference in New Issue