diff options
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java index 37008e78..028b9878 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java @@ -103,12 +103,21 @@ public class ContainerPanel extends JPanel { txtContainerImageName.setText(image.imageName); txtContainerImageName.setEnabled(false); - // TODO simplify this mess. ContainerBuildContextMethod is to complex - if (containerDefinition.getBuildContextMethod() == ContainerBuildContextMethod.FILE) { + // TODO simplify this mess. ContainerBuildContextMethod is to complex or useless + switch (containerDefinition.getBuildContextMethod()) + { + case FILE: txtContainerRecipe.setText(containerDefinition.getContainerRecipe()); - } else if (containerDefinition.getBuildContextMethod() - == ContainerBuildContextMethod.GIT_REPOSITORY) { + break; + case IMAGE_REPO: + txtContainerRecipe.setText(containerDefinition.getContainerMeta().getImageRepo()); + break; + case GIT_REPOSITORY: txtContainerRecipe.setText(containerDefinition.getContainerMeta().getBuildContextUrl()); + break; + default: + LOGGER.error("Unknown Build Context"); + break; } if (context.equals(IMAGE_CONTEXT)) { @@ -118,12 +127,11 @@ public class ContainerPanel extends JPanel { } else { LOGGER.error("Container Panel init failed: Please use proper context"); } - } private void initImageDetails() { - // currently do not allow user to change the Dockerfile in the suite. + // currently do not allow user to change the Image Repository or Dockerfile in the suite. txtContainerRecipe.setEnabled(false); lblContainerRunOpt.setVisible(false); txtContainerRun.setVisible(false); |