Skip to content
Snippets Groups Projects
Commit a7df605f authored by deep1401's avatar deep1401
Browse files
parents 2ceeacbf 9f2a12fd
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,17 @@ export default function ImportRecipeModal({ open, setOpen, mutate }) { ...@@ -35,6 +35,17 @@ export default function ImportRecipeModal({ open, setOpen, mutate }) {
const recipes = recipesData; const recipes = recipesData;
const {
data: pluginsData,
error: pluginsError,
isLoading: pluginsLoading,
} = useSWR(chatAPI.Endpoints.Plugins.List(), fetcher);
const installedPlugins = pluginsData
? pluginsData.map(plugin => plugin.uniqueId)
: [];
// For any variables that need to be reset on close // For any variables that need to be reset on close
const handleClose = () => { const handleClose = () => {
mutate(); mutate();
...@@ -225,6 +236,7 @@ export default function ImportRecipeModal({ open, setOpen, mutate }) { ...@@ -225,6 +236,7 @@ export default function ImportRecipeModal({ open, setOpen, mutate }) {
<td> <td>
<Button <Button
size="sm" size="sm"
disabled = {!(installedPlugins.includes(row.training?.plugin))}
onClick={() => { onClick={() => {
const recipe_text = YAML.stringify(row); const recipe_text = YAML.stringify(row);
uploadRecipe(row.metadata?.name, recipe_text); uploadRecipe(row.metadata?.name, recipe_text);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment