Skip to content

Commit

Permalink
Merge branch 'zetane:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
TeerthaDeb authored Aug 29, 2024
2 parents 380c95b + ad85f65 commit 0488ea4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions frontend/src/components/ui/WorkspaceTabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ import { useEffect, useState } from "react";
import { Tabs, TabList, Tab, TabPanels, TabPanel } from "@carbon/react";
import { workspaceAtom } from "@/atoms/pipelineAtom";
import { useImmerAtom } from "jotai-immer";
import { useAtom } from "jotai";
import { drawflowEditorAtom } from "@/atoms/drawflowAtom";

export default function WorkspaceTabs() {
const [workspace, setWorkspace] = useImmerAtom(workspaceAtom);
const [renderedTabs, setRenderedTabs] = useState([]);
const [selectedIndex, setSelectedIndex] = useState(0);
const [zoomLevels, setZoomLevels] = useState({});

const [editor] = useAtom(drawflowEditorAtom);

useEffect(() => {
const pipelineTabs = [];
Expand All @@ -27,9 +32,20 @@ export default function WorkspaceTabs() {
const handleTabChange = (evt) => {
const index = evt.selectedIndex;
const key = renderedTabs[index]?.id;

setZoomLevels((prevZoomLevels) => ({
...prevZoomLevels,
[workspace.active]: editor?.zoom,
}));

setWorkspace((draft) => {
draft.active = key;
});

if (editor) {
editor.zoom = zoomLevels[key] ?? 1;
editor.zoom_refresh(); // Refresh after setting zoom, *required.
}
};

const handleCloseTabRequest = (deleteIndex) => {
Expand Down
17 changes: 17 additions & 0 deletions translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,26 @@ func blockTemplate(block *zjson.Block, blockKey string, key string, organization
Image: image,
Command: block.Action.Container.CommandLine,
ImagePullPolicy: "IfNotPresent",
VolumeMounts: []corev1.VolumeMount{
{
Name: "dshm",
MountPath: "/dev/shm",
},
},
},
Inputs: wfv1.Inputs{Artifacts: []wfv1.Artifact{entrypoint, computations}},
Metadata: wfv1.Metadata{Annotations: idMap},
Volumes: []corev1.Volume{
{
//https://stackoverflow.com/questions/46085748/define-size-for-dev-shm-on-container-engine
Name: "dshm",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{
Medium: "Memory",
},
},
},
},
}
}

Expand Down

0 comments on commit 0488ea4

Please sign in to comment.