summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src
diff options
context:
space:
mode:
authorralph isenmann2020-11-06 10:26:40 +0100
committerralph isenmann2020-11-06 10:26:40 +0100
commit034ee6f782e5cdcb7077b1c9598203cd1d40c5c8 (patch)
treee6898ca45c0945fd420a1797e59d9287955a98ee /dozentenmodul/src
parent[client] change hint text (diff)
downloadtutor-module-034ee6f782e5cdcb7077b1c9598203cd1d40c5c8.tar.gz
tutor-module-034ee6f782e5cdcb7077b1c9598203cd1d40c5c8.tar.xz
tutor-module-034ee6f782e5cdcb7077b1c9598203cd1d40c5c8.zip
[client] do not allow alter version or push to master-sat by user when editing Container Images
- disabled buttons in ImageDetails to upload new Version or push to master sat - hide VM-Versions Panel
Diffstat (limited to 'dozentenmodul/src')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java11
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java18
2 files changed, 21 insertions, 8 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java
index 1d769089..b9081850 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java
@@ -882,9 +882,9 @@ import java.util.*;
*/
private void makeEditable(boolean editable) {
// always disable all buttons unless image's share mode is LOCAL or PUBLISH
- if (image != null)
+ if (image != null) {
editable &= image.shareMode == ShareMode.LOCAL || image.shareMode == ShareMode.PUBLISH;
-
+ }
// now do the regular permission check
editable = editable && (ImagePerms.canEdit(image) || ImagePerms.canAdmin(image));
txtTitle.setEditable(editable);
@@ -896,6 +896,13 @@ import java.util.*;
btnUpdateImage.setEnabled(editable);
if (actionHandler.isImagePublishSupported())
btnUploadToMaster.setEnabled(editable);
+
+ if (image != null && TConst.VIRT_DOCKER.equals(image.getVirtId())) {
+ // TODO Currently, do not allow user to upload a new version or share an Container Image.
+ btnUpdateImage.setEnabled(false);
+ btnUploadToMaster.setEnabled(false);
+ }
+
}
/**
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java
index 73e981c8..69bfe634 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java
@@ -9,7 +9,6 @@ import org.openslx.dozmod.gui.control.ComboBox;
import org.openslx.dozmod.gui.control.ComboBox.ComboBoxRenderer;
import org.openslx.dozmod.gui.control.PersonLabel;
import org.openslx.dozmod.gui.control.QLabel;
-import org.openslx.dozmod.gui.control.table.ContainerBindMountTable;
import org.openslx.dozmod.gui.control.table.ImageVersionTable;
import org.openslx.dozmod.gui.control.table.QScrollPane;
import org.openslx.dozmod.gui.helper.GridManager;
@@ -22,6 +21,10 @@ import java.awt.*;
private static final int ICON_SIZE_Y = 24;
+ private final String TAB_OVERVIEW_TITEL = "Übersicht";
+ private final String TAB_VERSIONS_TITEL = "VM-Versionen";
+ private final String TAB_PERMISSIONS_TITEL = "Berechtigungen";
+
protected final JTextField txtTitle;
protected final JTextArea txtDescription;
@@ -287,10 +290,10 @@ import java.awt.*;
grdContainerMeta.nextRow();
bindMountConfigurator = new ContainerBindMountConfigurator();
- grdContainerMeta.add(bindMountConfigurator,3).fill(true,true).expand(true,true);
+ grdContainerMeta.add(bindMountConfigurator, 3).fill(true, true).expand(true, true);
grdContainerMeta.finish(true);
- GridManager grdContainer = new GridManager(pnlTabContainer, 1,false, new Insets(8, 2, 8, 2));
+ GridManager grdContainer = new GridManager(pnlTabContainer, 1, false, new Insets(8, 2, 8, 2));
grdContainer.add(scrollableTextArea, 1).fill(true, true).expand(true, true);
grdContainer.add(pnlContainerMeta, 1).fill(true, true).expand(true, true);
//grdContainer.add(Box.createVerticalGlue()).fill(true, true).expand(true,true);
@@ -322,9 +325,10 @@ import java.awt.*;
*
********************************************************************************/
pnlTabs = new JTabbedPane();
- pnlTabs.addTab("Übersicht", pnlTabOverview);
- pnlTabs.addTab("VM-Versionen", pnlTabVersions);
- pnlTabs.addTab("Berechtigungen", pnlTabPermissions);
+
+ pnlTabs.addTab(TAB_OVERVIEW_TITEL, pnlTabOverview);
+ pnlTabs.addTab(TAB_VERSIONS_TITEL, pnlTabVersions);
+ pnlTabs.addTab(TAB_PERMISSIONS_TITEL, pnlTabPermissions);
add(pnlTabs, BorderLayout.CENTER);
add(pnlButtons, BorderLayout.PAGE_END);
@@ -332,5 +336,7 @@ import java.awt.*;
protected void showContainerTab() {
pnlTabs.addTab("Container", pnlTabContainer);
+ // TODO currently, do not allow to alter the version of a container image.
+ pnlTabs.remove(pnlTabs.indexOfTab(TAB_VERSIONS_TITEL));
}
}