Merge branch 'master' into spi
Signed-off-by: Alexander Garagatyi <agaragatyi@codenvy.com>6.19.x
commit
21c4589086
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-agents-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-api-agent-shared</artifactId>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-agents-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-api-agent</artifactId>
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ public abstract class AbstractAgentLauncher implements AgentLauncher {
|
|||
agentName,
|
||||
machine.getWorkspaceId(),
|
||||
machine.getId(),
|
||||
machine.getNode(),
|
||||
machine.getNode().getHost(),
|
||||
logs);
|
||||
} else {
|
||||
LOG.error("An error occurs while starting '{}' agent in '{}' workspace in '{}' machine on '{}' node. " +
|
||||
|
|
@ -153,7 +153,7 @@ public abstract class AbstractAgentLauncher implements AgentLauncher {
|
|||
agentName,
|
||||
machine.getWorkspaceId(),
|
||||
machine.getId(),
|
||||
machine.getNode());
|
||||
machine.getNode().getHost());
|
||||
}
|
||||
}*/
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import org.eclipse.che.api.core.util.LineConsumer;
|
|||
import org.eclipse.che.api.machine.server.exception.MachineException;
|
||||
import org.eclipse.che.api.machine.server.model.impl.CommandImpl;
|
||||
import org.eclipse.che.api.machine.server.spi.Instance;
|
||||
import org.eclipse.che.api.machine.server.spi.InstanceNode;
|
||||
import org.eclipse.che.api.machine.server.spi.InstanceProcess;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
|
@ -34,6 +35,7 @@ import static org.mockito.Matchers.eq;
|
|||
import static org.mockito.Mockito.atLeast;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.doThrow;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.times;
|
||||
|
|
@ -68,6 +70,7 @@ public class AbstractAgentLauncherTest {
|
|||
when(agentChecker.isLaunched(any(Agent.class),
|
||||
any(InstanceProcess.class),
|
||||
any(Instance.class))).thenReturn(true);
|
||||
when(machine.getNode()).thenReturn(mock(InstanceNode.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-agents-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>exec-agent</artifactId>
|
||||
<name>Agent :: Exec</name>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-agents-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>go-agents</artifactId>
|
||||
<name>Agent :: Golang agents</name>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-agents-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>ls-csharp-agent</artifactId>
|
||||
<name>Language Server C# Agent</name>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-agents-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>ls-json-agent</artifactId>
|
||||
<name>Language Server Json Agent</name>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-agents-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>ls-php-agent</artifactId>
|
||||
<name>Language Server PHP Agent</name>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-agents-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>ls-python-agent</artifactId>
|
||||
<name>Language Server python Agent</name>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-agents-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>ls-typescript-agent</artifactId>
|
||||
<name>Language Server typescript Agent</name>
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@
|
|||
<parent>
|
||||
<artifactId>che-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>che-agents-parent</artifactId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Che Agents Parent</name>
|
||||
<modules>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-agents-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>ssh-agent</artifactId>
|
||||
<name>SSH Agent</name>
|
||||
|
|
|
|||
|
|
@ -128,14 +128,11 @@ command -v pidof >/dev/null 2>&1 && {
|
|||
ps -fC sshd >/dev/null 2>&1 && exit
|
||||
}
|
||||
|
||||
# generate host keys and running sshd
|
||||
|
||||
${SUDO} mkdir -p /var/run/sshd
|
||||
|
||||
if echo ${LINUX_TYPE} | grep -qi "CentOS"; then
|
||||
${SUDO} /usr/bin/ssh-keygen -q -P '' -t rsa -f ~/.ssh/id_rsa
|
||||
else
|
||||
${SUDO} /usr/bin/ssh-keygen -A
|
||||
fi
|
||||
${SUDO} /usr/bin/ssh-keygen -A
|
||||
|
||||
${SUDO} /usr/sbin/sshd -D
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-agents-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>terminal-agent</artifactId>
|
||||
<name>Agent :: Terminal</name>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-agents-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>unison-agent</artifactId>
|
||||
<name>Unison Agent</name>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-assembly-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>assembly-ide-war</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-assembly-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>assembly-main</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-assembly-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>assembly-wsagent-server</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-assembly-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>assembly-wsagent-war</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
|
@ -91,6 +91,10 @@
|
|||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-php-lang-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-pullrequest-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-python-lang-server</artifactId>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-assembly-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>assembly-wsmaster-war</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
|
@ -212,10 +212,6 @@
|
|||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-openshift-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-pullrequest-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.che.plugin</groupId>
|
||||
<artifactId>che-plugin-ssh-machine</artifactId>
|
||||
|
|
|
|||
|
|
@ -211,11 +211,28 @@ che.docker.ip.external=NULL
|
|||
# - 'default': internal address is address of docker host and ephemeral port are used
|
||||
# - 'docker-local': internal address is address of container within docker network, and exposed ports
|
||||
# are used.
|
||||
# - 'custom': The evaluation strategy may be customized through a template property.
|
||||
# The 'docker-local' strategy may be useful if a firewall prevents communication between che-server and
|
||||
# workspace containers, but will prevent communication when che-server and workspace containers are not
|
||||
# on the same Docker network.
|
||||
che.docker.server_evaluation_strategy=default
|
||||
|
||||
|
||||
# Here are macros available for the custom server evaluation strategy
|
||||
# serverName: server reference exposing the port (like tomcat8, ws-agent, etc)
|
||||
# machineName: name of the machine of the workspace. (like devMachine)
|
||||
# workspaceId: id of the workspace
|
||||
# internalIp: IP of the internal address of che (che.docker.ip property)
|
||||
# externalIP: IP of the external address of che
|
||||
# externalAddresss : external address of che (che.docker.ip.external or if null che.docker.ip)
|
||||
# chePort : Che listening port number of workspace master
|
||||
# wildcardNipDomain : get external address transformed into a nip.io DNS sub-domain
|
||||
# wildcardXipDomain : get external address transformed into a xip.io DNS sub-domain
|
||||
che.docker.server_evaluation_strategy.custom.template=<serverName>.<machineName>.<workspaceId>.<wildcardNipDomain>:<chePort>
|
||||
|
||||
# Protocol to use for http access (for example it can be set to https)
|
||||
che.docker.server_evaluation_strategy.custom.external.protocol=http
|
||||
|
||||
# Provides a Docker network where Che server is running.
|
||||
# Workspace containers created by Che will be added to this Docker network.
|
||||
# Communications between the Che server and container occur over this network.
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@
|
|||
<parent>
|
||||
<artifactId>che-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<artifactId>che-assembly-parent</artifactId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Che IDE :: Parent</name>
|
||||
<modules>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-api-core</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-api-dto-maven-plugin</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-api-dto</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-api-model</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-db-vendor-h2</artifactId>
|
||||
<name>Che Core :: DB :: Vendor H2</name>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-db-vendor-postgresql</artifactId>
|
||||
<name>Che Core :: DB :: Vendor PostgreSQL</name>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-db</artifactId>
|
||||
<name>Che Core :: DB</name>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-typescript-dto-maven-plugin</artifactId>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-annotations</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-inject</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-j2ee</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-json</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-lang</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-schedule</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-test</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-xml</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@
|
|||
<parent>
|
||||
<artifactId>che-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Che Core Parent</name>
|
||||
<modules>
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@
|
|||
<parent>
|
||||
<artifactId>che-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.dashboard</groupId>
|
||||
<artifactId>che-dashboard-war</artifactId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
<name>Che Dashboard :: Web App</name>
|
||||
<inceptionYear>2015</inceptionYear>
|
||||
|
|
|
|||
|
|
@ -14,8 +14,10 @@
|
|||
che-place-holder="Enter value"
|
||||
aria-label="Enter value"
|
||||
required
|
||||
ng-maxlength="255"
|
||||
ng-model="factoryActionBoxCtrl.selectedParam">
|
||||
<div ng-message="required">Param is required.</div>
|
||||
<div ng-message="maxlength">The value has to be less than 255 characters long.</div>
|
||||
</che-input>
|
||||
</div>
|
||||
<che-button-primary che-button-title="Add"
|
||||
|
|
@ -23,34 +25,35 @@
|
|||
ng-disabled="actionsForm.$invalid"></che-button-primary>
|
||||
</div>
|
||||
|
||||
<div ng-if="factoryActionBoxCtrl.factoryObject.ide.onProjectsLoaded.actions.length > 0"
|
||||
class="factory-actions-list">
|
||||
<che-list>
|
||||
<che-list-item ng-repeat="action in factoryActionBoxCtrl.factoryObject.ide.onProjectsLoaded.actions"
|
||||
flex-gt-sm="100" flex-sm="33">
|
||||
<div layout="row" flex>
|
||||
<div layout="column"
|
||||
layout-align="start start"
|
||||
class="factory-actions-row-action-name">
|
||||
<span>{{action.id}}</span>
|
||||
</div>
|
||||
<div flex layout-align="start start"
|
||||
class="factory-actions-row-action-param"
|
||||
ng-click="factoryActionBoxCtrl.editAction($event, $index)">
|
||||
{{action.properties.name ? action.properties.name : action.properties.file}}
|
||||
</div>
|
||||
<div flex="10" layout="row" layout-align="center start"
|
||||
class="che-list-actions">
|
||||
<div ng-click="factoryActionBoxCtrl.removeAction($index)" class="factory-commands-widget-actions">
|
||||
<span class="fa fa-times-circle"></span>
|
||||
<md-content md-scroll-y flex class="factory-actions-list">
|
||||
<div ng-if="factoryActionBoxCtrl.factoryObject.ide.onProjectsLoaded.actions.length > 0">
|
||||
<che-list>
|
||||
<che-list-item ng-repeat="action in factoryActionBoxCtrl.factoryObject.ide.onProjectsLoaded.actions"
|
||||
flex-gt-sm="100" flex-sm="33">
|
||||
<div layout="row" flex>
|
||||
<div layout="column"
|
||||
layout-align="start start"
|
||||
class="factory-actions-row-action-name">
|
||||
<span>{{action.id}}</span>
|
||||
</div>
|
||||
<div ng-click="factoryActionBoxCtrl.editAction($event, $index)" class="factory-commands-widget-actions">
|
||||
<span class="fa fa-edit"></span>
|
||||
<div flex layout-align="start start"
|
||||
class="factory-actions-row-action-param"
|
||||
ng-click="factoryActionBoxCtrl.editAction($event, $index)">
|
||||
{{action.properties.name ? action.properties.name : action.properties.file}}
|
||||
</div>
|
||||
<div flex="10" layout="row" layout-align="center start"
|
||||
class="che-list-actions">
|
||||
<div ng-click="factoryActionBoxCtrl.removeAction($index)" class="factory-commands-widget-actions">
|
||||
<span class="fa fa-times-circle"></span>
|
||||
</div>
|
||||
<div ng-click="factoryActionBoxCtrl.editAction($event, $index)" class="factory-commands-widget-actions">
|
||||
<span class="fa fa-edit"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</che-list-item>
|
||||
</che-list>
|
||||
</div>
|
||||
</che-list-item>
|
||||
</che-list>
|
||||
</div>
|
||||
</md-content>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
margin-right 20px
|
||||
|
||||
.factory-actions-list
|
||||
max-height 500px
|
||||
max-width 600px
|
||||
|
||||
md-list
|
||||
|
|
@ -34,6 +35,8 @@
|
|||
min-height 100%
|
||||
cursor pointer
|
||||
outline none
|
||||
margin-right 0
|
||||
margin-left 10px
|
||||
|
||||
span
|
||||
line-height inherit
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
ng-click="factoryActionDialogEditCtrl.abort()">
|
||||
</che-button-notice>
|
||||
<che-button-primary
|
||||
che-button-title="Edit" ng-disabled="editActionForm.$invalid"
|
||||
che-button-title="Save" ng-disabled="editActionForm.$invalid"
|
||||
ng-click="factoryActionDialogEditCtrl.edit()"></che-button-primary>
|
||||
</form>
|
||||
</che-popup>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
ng-click="factoryCommandDialogEditCtrl.abort()">
|
||||
</che-button-notice>
|
||||
<che-button-primary
|
||||
che-button-title="Edit" ng-disabled="editActionForm.$invalid"
|
||||
che-button-title="Save" ng-disabled="editActionForm.$invalid"
|
||||
ng-click="factoryCommandDialogEditCtrl.edit()"></che-button-primary>
|
||||
</form>
|
||||
</che-popup>
|
||||
|
|
|
|||
|
|
@ -39,36 +39,37 @@
|
|||
ng-disabled="commandsForm.$invalid"></che-button-primary>
|
||||
</div>
|
||||
|
||||
<div ng-if="factoryCommandCtrl.factoryObject.workspace.commands.length > 0"
|
||||
class="factory-commands-list">
|
||||
<che-list>
|
||||
<che-list-item ng-repeat="command in factoryCommandCtrl.factoryObject.workspace.commands"
|
||||
flex="100">
|
||||
<div layout="row" flex>
|
||||
<div layout="column"
|
||||
layout-align="start start"
|
||||
class="factory-commands-row-command-name">
|
||||
<span>{{command.name}}</span>
|
||||
</div>
|
||||
<div flex
|
||||
layout="column"
|
||||
layout-align="start start"
|
||||
ng-click="factoryCommandCtrl.editCommand($event, $index)"
|
||||
class="factory-commands-row-command">
|
||||
{{command.commandLine}}
|
||||
</div>
|
||||
<div flex="10" layout="row" layout-align="center start"
|
||||
class="che-list-actions">
|
||||
<div ng-click="factoryCommandCtrl.removeCommand($index)" class="factory-commands-widget-actions">
|
||||
<span class="fa fa-times-circle"></span>
|
||||
<md-content md-scroll-y flex class="factory-commands-list">
|
||||
<div ng-if="factoryCommandCtrl.factoryObject.workspace.commands.length > 0">
|
||||
<che-list>
|
||||
<che-list-item ng-repeat="command in factoryCommandCtrl.factoryObject.workspace.commands"
|
||||
flex="100">
|
||||
<div layout="row" flex>
|
||||
<div layout="column"
|
||||
layout-align="start start"
|
||||
class="factory-commands-row-command-name">
|
||||
<span>{{command.name}}</span>
|
||||
</div>
|
||||
<div ng-click="factoryCommandCtrl.editCommand($event, $index)" class="factory-commands-widget-actions">
|
||||
<span class="fa fa-edit"></span>
|
||||
<div flex
|
||||
layout="column"
|
||||
layout-align="start start"
|
||||
ng-click="factoryCommandCtrl.editCommand($event, $index)"
|
||||
class="factory-commands-row-command">
|
||||
{{command.commandLine}}
|
||||
</div>
|
||||
<div flex="10" layout="row" layout-align="center start"
|
||||
class="che-list-actions">
|
||||
<div ng-click="factoryCommandCtrl.removeCommand($index)" class="factory-commands-widget-actions">
|
||||
<span class="fa fa-times-circle"></span>
|
||||
</div>
|
||||
<div ng-click="factoryCommandCtrl.editCommand($event, $index)" class="factory-commands-widget-actions">
|
||||
<span class="fa fa-edit"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</che-list-item>
|
||||
</che-list>
|
||||
</div>
|
||||
</che-list-item>
|
||||
</che-list>
|
||||
</div>
|
||||
</md-content>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
margin-right 20px
|
||||
|
||||
.factory-commands-list
|
||||
max-height 500px
|
||||
max-width 600px
|
||||
|
||||
md-list
|
||||
|
|
@ -33,6 +34,8 @@
|
|||
min-height 100%
|
||||
cursor pointer
|
||||
outline none
|
||||
margin-right 0
|
||||
margin-left 10px
|
||||
|
||||
span
|
||||
line-height inherit
|
||||
|
|
|
|||
|
|
@ -1081,10 +1081,11 @@ export class CreateProjectController {
|
|||
* Update creation flow state when source option changes
|
||||
*/
|
||||
onSourceOptionChanged(): void {
|
||||
if ('select-source-existing' === this.selectSourceOption) {
|
||||
// need to call selection of current tab
|
||||
this.setCurrentTab(this.currentTab);
|
||||
if ('select-source-existing' !== this.selectSourceOption) {
|
||||
this.isReady = true;
|
||||
return;
|
||||
}
|
||||
this.setCurrentTab(this.currentTab);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
-->
|
||||
<che-toolbar che-title="Stacks" border-none></che-toolbar>
|
||||
<che-description che-link-title="Learn more." che-link="/docs/workspace/stacks/index.html">
|
||||
<che-description che-link-title="Learn more." che-link="{{branding.docs.stack}}">
|
||||
A stack is environment configuration for workspace defined by its runtime recipe. Create workspaces from stacks that define projects, runtimes
|
||||
and commands.
|
||||
</che-description>
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@
|
|||
ng-change="stackController.updateStackFromJson()"
|
||||
aria-label="Stack configuration editor">
|
||||
</textarea>
|
||||
<a target="_blank" ng-href="https://www.eclipse.org/che/docs/workspace/stacks/index.html">Docs: Stack Structure</a>
|
||||
<a target="_blank" ng-href="{{branding.docs.stack}}">Docs: Stack Structure</a>
|
||||
</div>
|
||||
</che-show-area>
|
||||
</che-label-container>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
-->
|
||||
<che-toolbar che-title="Workspaces" border-none></che-toolbar>
|
||||
<che-description che-link-title="Learn more." che-link="/docs/workspace/admin-intro/index.html">A workspace is where your projects live and run. Create workspaces from stacks that define projects, runtimes, and commands.</che-description>
|
||||
<che-description che-link-title="Learn more." che-link="{{branding.docs.workspace}}">A workspace is where your projects live and run. Create workspaces from stacks that define projects, runtimes, and commands.</che-description>
|
||||
<md-content md-scroll-y flex layout="column" md-theme="maincontent-theme">
|
||||
<md-progress-linear md-mode="indeterminate" class="workspaces-list-progress"
|
||||
ng-show="listWorkspacesCtrl.isInfoLoading"></md-progress-linear>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
* Codenvy, S.A. - initial API and implementation
|
||||
*/
|
||||
'use strict';
|
||||
import {CheStack} from '../../../../../components/api/che-stack.factory';
|
||||
|
||||
/**
|
||||
* This class is handling the controller for the ready-to-go stacks
|
||||
|
|
@ -17,20 +18,22 @@
|
|||
*/
|
||||
export class ReadyToGoStacksController {
|
||||
|
||||
private $scope: ng.IScope;
|
||||
private lodash: _.LoDashStatic;
|
||||
private tabName: string;
|
||||
private selectedStackId: string;
|
||||
private allStackTags: Array<any> = [];
|
||||
private generalStacks: Array<che.IStack> = [];
|
||||
private filteredStackIds: Array<string> = [];
|
||||
private stackIconsMap: Map<string, string> = new Map();
|
||||
|
||||
/**
|
||||
* Default constructor that is using resource
|
||||
* @ngInject for Dependency injection
|
||||
*/
|
||||
constructor($timeout, $scope, lodash, cheStack) {
|
||||
this.$timeout = $timeout;
|
||||
constructor($scope: ng.IScope, lodash: _.LoDashStatic, cheStack: CheStack) {
|
||||
this.$scope = $scope;
|
||||
this.lodash = lodash;
|
||||
this.cheStack = cheStack;
|
||||
|
||||
this.generalStacks = [];
|
||||
this.allStackTags = [];
|
||||
this.filteredStackIds = [];
|
||||
this.stackIconsMap = new Map();
|
||||
|
||||
let stacks = cheStack.getStacks();
|
||||
if (stacks.length) {
|
||||
|
|
@ -40,50 +43,48 @@ export class ReadyToGoStacksController {
|
|||
this.updateData(stacks);
|
||||
});
|
||||
}
|
||||
|
||||
// create array of id of stacks which contain selected tags
|
||||
// to make filtration faster
|
||||
$scope.$on('event:updateFilter', (event, tags) => {
|
||||
this.allStackTags = [];
|
||||
this.filteredStackIds = [];
|
||||
|
||||
if (!tags) {
|
||||
tags = [];
|
||||
}
|
||||
this.generalStacks.forEach((stack) => {
|
||||
let matches = 0,
|
||||
stackTags = stack.tags.map(tag => tag.toLowerCase());
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
if (stackTags.indexOf(tags[i].toLowerCase()) > -1) {
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
if (matches === tags.length) {
|
||||
this.filteredStackIds.push(stack.id);
|
||||
this.allStackTags = this.allStackTags.concat(stack.tags);
|
||||
}
|
||||
});
|
||||
this.allStackTags = this.lodash.uniq(this.allStackTags);
|
||||
});
|
||||
|
||||
// set first stack as selected after filtration finished
|
||||
$scope.$watch('filteredStacks && filteredStacks.length', (length) => {
|
||||
if (length) {
|
||||
this.setStackSelectionById($scope.filteredStacks[0].id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update stacks' data
|
||||
* @param stacks
|
||||
* Update filtered stack keys depends on tags.
|
||||
* @param tags {Array<string>}
|
||||
*/
|
||||
updateData(stacks) {
|
||||
stacks.forEach((stack) => {
|
||||
onTagsChanges(tags?: Array<string>): void {
|
||||
if (!angular.isArray(tags) || !tags.length) {
|
||||
this.filteredStackIds = this.generalStacks.map((stack: che.IStack) => stack.id);
|
||||
this.setStackSelectionById(this.filteredStackIds[0]);
|
||||
return;
|
||||
}
|
||||
this.filteredStackIds = this.generalStacks.filter((stack: che.IStack) => {
|
||||
let stackTags = stack.tags.map((tag: string) => tag.toLowerCase());
|
||||
return tags.every((tag: string) => {
|
||||
return stackTags.indexOf(tag.toLowerCase()) !== -1;
|
||||
});
|
||||
}).map((stack: che.IStack) => stack.id);
|
||||
if (this.filteredStackIds.length) {
|
||||
this.setStackSelectionById(this.filteredStackIds[0]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets icon src.
|
||||
* @param stackId {string}
|
||||
* @returns {undefined|string}
|
||||
*/
|
||||
getIconSrc(stackId: string): string {
|
||||
return this.stackIconsMap.get(stackId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update stack data.
|
||||
* @param stacks {Array<che.IStack>}
|
||||
*/
|
||||
updateData(stacks: Array<che.IStack>): void {
|
||||
stacks.forEach((stack: che.IStack) => {
|
||||
if (stack.scope !== 'general') {
|
||||
return;
|
||||
}
|
||||
let findLink = this.lodash.find(stack.links, (link) => {
|
||||
let findLink = this.lodash.find(stack.links, (link: any) => {
|
||||
return link.rel === 'get icon link';
|
||||
});
|
||||
if (findLink) {
|
||||
|
|
@ -93,38 +94,25 @@ export class ReadyToGoStacksController {
|
|||
this.allStackTags = this.allStackTags.concat(stack.tags);
|
||||
});
|
||||
this.allStackTags = this.lodash.uniq(this.allStackTags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Joins the tags into a string
|
||||
* @param tags
|
||||
* @returns String
|
||||
*/
|
||||
tagsToString(tags) {
|
||||
return tags.join(', ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets privileged stack position
|
||||
* @param item
|
||||
* @returns number
|
||||
*/
|
||||
getPrivilegedSortPosition(item) {
|
||||
let privilegedNames = ['Java', 'Java-MySQL', 'Blank'];
|
||||
|
||||
let sortPos = privilegedNames.indexOf(item.name);
|
||||
if (sortPos > -1) {
|
||||
return sortPos;
|
||||
}
|
||||
|
||||
return privilegedNames.length;
|
||||
this.generalStacks.sort((stackA: che.IStack, stackB: che.IStack) => {
|
||||
const nameA = stackA.name.toLowerCase();
|
||||
const nameB = stackB.name.toLowerCase();
|
||||
if (nameA < nameB) {
|
||||
return -1;
|
||||
}
|
||||
if (nameA > nameB) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
this.onTagsChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* Select stack by Id
|
||||
* @param stackId
|
||||
* @param stackId {string}
|
||||
*/
|
||||
setStackSelectionById(stackId) {
|
||||
setStackSelectionById(stackId: string): void {
|
||||
this.selectedStackId = stackId;
|
||||
if (this.selectedStackId) {
|
||||
this.$scope.$emit('event:selectStackId', {tabName: this.tabName, stackId: this.selectedStackId});
|
||||
|
|
|
|||
|
|
@ -14,22 +14,26 @@
|
|||
<div class="stack-label-info">Create a new workspace with a ready-to-go stack.</div>
|
||||
<div layout="row" flex="100">
|
||||
<che-stack-library-filter layout="row" flex
|
||||
ng-model="readyToGoStacksCtrl.allStackTags">
|
||||
stack-tags="readyToGoStacksCtrl.allStackTags"
|
||||
on-tags-changes="readyToGoStacksCtrl.onTagsChanges(tags)">
|
||||
</che-stack-library-filter>
|
||||
</div>
|
||||
<div layout="row" layout-wrap>
|
||||
<md-card layout="column" class="che-simple-selector"
|
||||
ng-repeat="stack in filteredStacks = (readyToGoStacksCtrl.generalStacks | stackSelectedStackFilter:readyToGoStacksCtrl.filteredStackIds) | orderBy:[readyToGoStacksCtrl.getPrivilegedSortPosition, 'name']"
|
||||
ng-repeat="stack in readyToGoStacksCtrl.generalStacks"
|
||||
ng-init="$first && readyToGoStacksCtrl.setStackSelectionById(stack.id)"
|
||||
ng-click="readyToGoStacksCtrl.setStackSelectionById(stack.id)"
|
||||
ng-hide="readyToGoStacksCtrl.filteredStackIds.indexOf(stack.id) === -1"
|
||||
ng-class="{'che-simple-selector-active' : '{{stack.id}}' === readyToGoStacksCtrl.selectedStackId}">
|
||||
<div layout="row">
|
||||
<div class="selector-icon" ng-class="{'chefont cheico-type-blank' : !readyToGoStacksCtrl.stackIconsMap.has(stack.id)}">
|
||||
<img ng-src="{{readyToGoStacksCtrl.stackIconsMap.get(stack.id)}}"/>
|
||||
<div class="selector-icon" ng-class="{'chefont cheico-type-blank' : !readyToGoStacksCtrl.getIconSrc(stack.id)}">
|
||||
<img ng-src="{{readyToGoStacksCtrl.getIconSrc(stack.id)}}"/>
|
||||
</div>
|
||||
<div flex="70" class="title">
|
||||
<div>{{stack.name}}</div>
|
||||
</div>
|
||||
<div flex="70" class="title">{{stack.name}}</div>
|
||||
</div>
|
||||
<div class="description">{{readyToGoStacksCtrl.tagsToString(stack.tags)}}</div>
|
||||
<div class="description">{{stack.description}}</div>
|
||||
</md-card>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
$che-simple-selector-color = $label-info-color
|
||||
|
||||
.create-project-stack-selector .create-project-stack-selected
|
||||
box-shadow 0px 3px 1px -2px rgba(0, 0, 200, 0.14), 0px 2px 2px 0px rgba(0, 0, 200, 0.098), 0px 1px 5px 0px rgba(0, 0, 200, 0.084);
|
||||
color $primary-color
|
||||
|
||||
.che-simple-selector
|
||||
outline none
|
||||
height 90px
|
||||
|
|
@ -27,68 +23,76 @@ $che-simple-selector-color = $label-info-color
|
|||
&:focus
|
||||
outline none
|
||||
|
||||
.che-simple-selector .title
|
||||
position relative
|
||||
border 1px solid $che-simple-selector-color
|
||||
border-right none
|
||||
border-left none
|
||||
line-height 22px
|
||||
.title
|
||||
position relative
|
||||
border 1px solid $che-simple-selector-color
|
||||
border-right none
|
||||
border-left none
|
||||
line-height 22px
|
||||
|
||||
.che-simple-selector:hover .title
|
||||
border-color $background-color
|
||||
&:before
|
||||
position absolute
|
||||
border-top 24px solid transparent
|
||||
border-right 24px solid $che-simple-selector-color
|
||||
content ""
|
||||
left -24px
|
||||
bottom -1px
|
||||
|
||||
.che-simple-selector .title:before
|
||||
position absolute
|
||||
border-top 24px solid transparent
|
||||
border-right 24px solid $che-simple-selector-color
|
||||
content ""
|
||||
left -24px
|
||||
bottom -1px
|
||||
&:after
|
||||
position absolute
|
||||
border-top 23px solid transparent
|
||||
border-right 23px solid $background-color
|
||||
content ""
|
||||
left -22px
|
||||
bottom 0
|
||||
|
||||
.che-simple-selector:hover .title:before
|
||||
border-right-color $background-color
|
||||
div
|
||||
text-overflow ellipsis
|
||||
white-space nowrap
|
||||
overflow hidden
|
||||
|
||||
.che-simple-selector .title:after
|
||||
position absolute
|
||||
border-top 23px solid transparent
|
||||
border-right 23px solid $background-color
|
||||
content ""
|
||||
left -22px
|
||||
bottom 0
|
||||
&:hover .title
|
||||
border-color $background-color
|
||||
|
||||
.che-simple-selector:hover .title:after
|
||||
border-right-color $che-simple-selector-color
|
||||
&:before
|
||||
border-right-color $background-color
|
||||
|
||||
.che-simple-selector .selector-icon
|
||||
padding 0
|
||||
width 55px
|
||||
height 24px
|
||||
font-size 24px
|
||||
line-height 24px
|
||||
text-align center
|
||||
margin-right 22px
|
||||
filter grayscale(100%)
|
||||
&:hover .title:after
|
||||
border-right-color $che-simple-selector-color
|
||||
|
||||
&:before
|
||||
color $menu-bg-color
|
||||
.selector-icon
|
||||
padding 0
|
||||
width 55px
|
||||
height 24px
|
||||
font-size 24px
|
||||
line-height 24px
|
||||
text-align center
|
||||
margin-right 22px
|
||||
filter grayscale(100%)
|
||||
|
||||
.che-simple-selector .selector-icon img
|
||||
height 24px
|
||||
padding-bottom 1px
|
||||
&:before
|
||||
color $menu-bg-color
|
||||
|
||||
.che-simple-selector .cheico-type-blank > img
|
||||
img
|
||||
display inline
|
||||
height 24px
|
||||
max-width 36px
|
||||
position relative
|
||||
bottom 4px
|
||||
|
||||
.cheico-type-blank img
|
||||
display none
|
||||
|
||||
.che-simple-selector .title
|
||||
font-size 12px
|
||||
line-height 22px
|
||||
text-align center
|
||||
text-transform uppercase
|
||||
.title
|
||||
font-size 12px
|
||||
line-height 22px
|
||||
text-align center
|
||||
text-transform uppercase
|
||||
|
||||
.che-simple-selector .description, .che-simple-selector-active .description
|
||||
font-size 12px
|
||||
padding 5px 10px
|
||||
color $label-primary-color
|
||||
.description
|
||||
font-size 12px
|
||||
padding 5px 10px
|
||||
color $label-primary-color
|
||||
|
||||
.che-simple-selector-active
|
||||
border-color $primary-color
|
||||
|
|
@ -97,20 +101,21 @@ $che-simple-selector-color = $label-info-color
|
|||
&:hover
|
||||
background-color $background-color
|
||||
|
||||
.che-simple-selector-active .title, .che-simple-selector-active:hover .title
|
||||
background-color $primary-color
|
||||
color $background-color
|
||||
border-color $primary-color
|
||||
font-weight bold
|
||||
.title,
|
||||
&:hover .title
|
||||
background-color $primary-color
|
||||
color $background-color
|
||||
border-color $primary-color
|
||||
font-weight bold
|
||||
|
||||
.che-simple-selector-active .title:before, .che-simple-selector-active:hover .title:before
|
||||
border-right-color $primary-color
|
||||
.title:before,
|
||||
&:hover .title:before
|
||||
border-right-color $primary-color
|
||||
|
||||
.che-simple-selector-active .title:after, .che-simple-selector-active:hover .title:after
|
||||
border-right-color $primary-color
|
||||
.title:after,
|
||||
&:hover .title:after
|
||||
border-right-color $primary-color
|
||||
|
||||
.che-simple-selector-active:hover .selector-icon
|
||||
filter none
|
||||
|
||||
.che-simple-selector-active .selector-icon
|
||||
filter none
|
||||
.selector-icon,
|
||||
&:hover .selector-icon
|
||||
filter none
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
*/
|
||||
'use strict';
|
||||
import {DockerfileParser} from '../../../../../components/api/environment/docker-file-parser';
|
||||
import {CheBranding} from '../../../../../components/branding/che-branding.factory';
|
||||
|
||||
/**
|
||||
* @ngdoc controller
|
||||
|
|
@ -30,6 +31,7 @@ export class WorkspaceRecipeAuthoringController {
|
|||
recipeScript: string;
|
||||
recipeFormatCopy: string;
|
||||
recipeScriptCopy: string;
|
||||
stackDocsUrl: string;
|
||||
recipeChange: Function;
|
||||
|
||||
editorOptions: {
|
||||
|
|
@ -44,10 +46,10 @@ export class WorkspaceRecipeAuthoringController {
|
|||
* Default constructor that is using resource
|
||||
* @ngInject for Dependency injection
|
||||
*/
|
||||
constructor($scope: ng.IScope, $timeout: ng.ITimeoutService) {
|
||||
constructor($scope: ng.IScope, $timeout: ng.ITimeoutService, cheBranding: CheBranding) {
|
||||
this.$timeout = $timeout;
|
||||
|
||||
this.dockerfileParser = new DockerfileParser();
|
||||
this.stackDocsUrl = cheBranding.getDocs().stack;
|
||||
|
||||
this.editorOptions = {
|
||||
lineWrapping: true,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
{{workspaceRecipeAuthoringController.recipeValidationError}}
|
||||
</div>
|
||||
<div class="recipe-docs-link">
|
||||
<a href="https://www.eclipse.org/che/docs/workspace/stacks/index.html#stack-administration" target="_blank">Custom stack documentation</a>
|
||||
<a ng-href="{{workspaceRecipeAuthoringController.stackDocsUrl}}" target="_blank">Custom stack documentation</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2015-2017 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Defines a filter that match if given value is containing stack ID
|
||||
* @author Oleksii Kurinnyi
|
||||
*/
|
||||
|
||||
export class CreateProjectStackLibrarySelectedStackFilter {
|
||||
|
||||
constructor(register) {
|
||||
register.app.filter('stackSelectedStackFilter', () => {
|
||||
return function (templates, idFilter) {
|
||||
if (!templates) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!idFilter || !idFilter.length) {
|
||||
return templates;
|
||||
}
|
||||
|
||||
var filtered = [];
|
||||
templates.forEach((template) => {
|
||||
if (idFilter.indexOf(template.id) > -1) {
|
||||
filtered.push(template);
|
||||
}
|
||||
});
|
||||
return filtered;
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
* Codenvy, S.A. - initial API and implementation
|
||||
*/
|
||||
'use strict';
|
||||
import {CheStack} from '../../../../../components/api/che-stack.factory';
|
||||
|
||||
/**
|
||||
* This class is handling the controller for the creating stack library projects
|
||||
|
|
@ -17,72 +18,62 @@
|
|||
*/
|
||||
export class CreateProjectStackLibraryController {
|
||||
|
||||
private $scope: ng.IScope;
|
||||
private lodash: _.LoDashStatic;
|
||||
private tabName: string;
|
||||
private selectedStackId: string;
|
||||
private allStackTags: Array<string> = [];
|
||||
private filteredStackIds: Array<string> = [];
|
||||
private stacks: Array<che.IStack> = [];
|
||||
|
||||
/**
|
||||
* Default constructor that is using resource
|
||||
* @ngInject for Dependency injection
|
||||
*/
|
||||
constructor($scope, cheStack, cheWorkspace, lodash) {
|
||||
constructor($scope: ng.IScope, cheStack: CheStack, lodash: _.LoDashStatic) {
|
||||
this.$scope = $scope;
|
||||
this.cheStack = cheStack;
|
||||
this.cheWorkspace = cheWorkspace;
|
||||
this.lodash = lodash;
|
||||
|
||||
this.workspaces = [];
|
||||
|
||||
this.allStackTags = [];
|
||||
this.filteredStackIds = [];
|
||||
|
||||
this.stacks = cheStack.getStacks();
|
||||
if (this.stacks.length) {
|
||||
this.updateData();
|
||||
let stacks = cheStack.getStacks();
|
||||
if (stacks.length) {
|
||||
this.updateData(stacks);
|
||||
} else {
|
||||
cheStack.fetchStacks().then(() => {
|
||||
this.updateData();
|
||||
this.updateData(stacks);
|
||||
});
|
||||
}
|
||||
|
||||
$scope.$on('event:library:selectStackId', (event, data) => {
|
||||
this.setStackSelectionById(data)
|
||||
});
|
||||
|
||||
// create array of id of stacks which contain selected tags
|
||||
// to make filtration faster
|
||||
$scope.$on('event:updateFilter', (event, tags) => {
|
||||
this.allStackTags = [];
|
||||
this.filteredStackIds = [];
|
||||
|
||||
if (!tags) {
|
||||
tags = [];
|
||||
}
|
||||
this.stacks.forEach((stack) => {
|
||||
let matches = 0,
|
||||
stackTags = stack.tags.map(tag => tag.toLowerCase());
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
if (stackTags.indexOf(tags[i].toLowerCase()) > -1) {
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
if (matches === tags.length) {
|
||||
this.filteredStackIds.push(stack.id);
|
||||
this.allStackTags = this.allStackTags.concat(stack.tags);
|
||||
}
|
||||
});
|
||||
this.allStackTags = this.lodash.uniq(this.allStackTags);
|
||||
});
|
||||
|
||||
// set first stack as selected after filtration finished
|
||||
$scope.$watch('filteredStacks && filteredStacks.length', (length) => {
|
||||
if (length) {
|
||||
this.setStackSelectionById($scope.filteredStacks[0].id);
|
||||
}
|
||||
this.setStackSelectionById(data);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Select stack by Id
|
||||
* @param stackId
|
||||
* Update filtered stack keys depends on tags.
|
||||
* @param tags {Array<string>}
|
||||
*/
|
||||
setStackSelectionById(stackId) {
|
||||
onTagsChanges(tags?: Array<string>): void {
|
||||
if (!angular.isArray(tags) || !tags.length) {
|
||||
this.filteredStackIds = this.stacks.map((stack: che.IStack) => stack.id);
|
||||
this.setStackSelectionById(this.filteredStackIds[0]);
|
||||
return;
|
||||
}
|
||||
this.filteredStackIds = this.stacks.filter((stack: che.IStack) => {
|
||||
let stackTags = stack.tags.map((tag: string) => tag.toLowerCase());
|
||||
return tags.every((tag: string) => {
|
||||
return stackTags.indexOf(tag.toLowerCase()) !== -1;
|
||||
});
|
||||
}).map((stack: che.IStack) => stack.id);
|
||||
if (this.filteredStackIds.length) {
|
||||
this.setStackSelectionById(this.filteredStackIds[0]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Select stack by Id
|
||||
* @param stackId {string}
|
||||
*/
|
||||
setStackSelectionById(stackId: string): void {
|
||||
this.selectedStackId = stackId;
|
||||
if (this.selectedStackId) {
|
||||
this.$scope.$emit('event:selectStackId', {tabName: this.tabName, stackId: this.selectedStackId});
|
||||
|
|
@ -91,28 +82,42 @@ export class CreateProjectStackLibraryController {
|
|||
|
||||
/**
|
||||
* Update stacks' data
|
||||
* @param stacks {Array<che.IStack>}
|
||||
*/
|
||||
updateData() {
|
||||
this.stacks.forEach((stack) => {
|
||||
updateData(stacks: Array<che.IStack>): void {
|
||||
stacks.forEach((stack: che.IStack) => {
|
||||
this.filteredStackIds.push(stack.id);
|
||||
this.allStackTags = this.allStackTags.concat(stack.tags);
|
||||
});
|
||||
this.allStackTags = this.lodash.uniq(this.allStackTags);
|
||||
stacks.sort((stackA: che.IStack, stackB: che.IStack) => {
|
||||
const nameA = stackA.name.toLowerCase();
|
||||
const nameB = stackB.name.toLowerCase();
|
||||
if (nameA < nameB) {
|
||||
return -1;
|
||||
}
|
||||
if (nameA > nameB) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
this.stacks = angular.copy(stacks);
|
||||
this.onTagsChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides tooltip data from a stack
|
||||
* @param stack - the data to analyze
|
||||
* @returns String
|
||||
* @param stack {che.IStack} - the data to analyze
|
||||
* @returns {string}
|
||||
*/
|
||||
getTooltip(stack) {
|
||||
getTooltip(stack: che.IStack): string {
|
||||
// get components and add data from the components
|
||||
let text = '';
|
||||
if (!stack || !stack.components) {
|
||||
return text;
|
||||
}
|
||||
|
||||
stack.components.forEach((component) => {
|
||||
stack.components.forEach((component: any) => {
|
||||
text += component.name + ':' + component.version + ' ';
|
||||
});
|
||||
return text;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
<div class="stack-label-info">Select from our library of stacks.</div>
|
||||
<div layout="row" flex="100">
|
||||
<che-stack-library-filter layout="row" flex
|
||||
ng-model="createProjectStackLibraryCtrl.allStackTags">
|
||||
stack-tags="createProjectStackLibraryCtrl.allStackTags"
|
||||
on-tags-changes="createProjectStackLibraryCtrl.onTagsChanges(tags)">
|
||||
</che-stack-library-filter>
|
||||
</div>
|
||||
<div layout="row" flex layout-align="start start">
|
||||
|
|
@ -11,14 +12,15 @@
|
|||
|
||||
<div layout="row" layout-wrap>
|
||||
<che-stack-library-selecter
|
||||
ng-repeat="stack in filteredStacks = (createProjectStackLibraryCtrl.stacks | stackSelectedStackFilter:createProjectStackLibraryCtrl.filteredStackIds) | orderBy:'name'"
|
||||
ng-init="$first && createProjectStackLibraryCtrl.setStackSelectionById(stack.id)"
|
||||
che-is-select="stack.id === createProjectStackLibraryCtrl.selectedStackId"
|
||||
che-is-active="true"
|
||||
che-title="{{stack.name}}"
|
||||
che-text="{{stack.description}}"
|
||||
che-extra-text="{{createProjectStackLibraryCtrl.getTooltip(stack)}}"
|
||||
che-stack-id="{{stack.id}}"/>
|
||||
ng-repeat="stack in createProjectStackLibraryCtrl.stacks"
|
||||
ng-init="$first && createProjectStackLibraryCtrl.setStackSelectionById(stack.id)"
|
||||
ng-hide="createProjectStackLibraryCtrl.filteredStackIds.indexOf(stack.id) === -1"
|
||||
che-is-select="stack.id === createProjectStackLibraryCtrl.selectedStackId"
|
||||
che-is-active="true"
|
||||
che-title="{{stack.name}}"
|
||||
che-text="{{stack.description}}"
|
||||
che-extra-text="{{createProjectStackLibraryCtrl.getTooltip(stack)}}"
|
||||
che-stack-id="{{stack.id}}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -16,11 +16,21 @@
|
|||
*/
|
||||
export class CheStackLibraryFilterController {
|
||||
|
||||
private $scope: ng.IScope;
|
||||
private $timeout: ng.ITimeoutService;
|
||||
private selectedIndex: number;
|
||||
private chip: string;
|
||||
private keys: Array<string>;
|
||||
private stackTags: Array<string>;
|
||||
private suggestions: Array<string>;
|
||||
private selectedTags: Array<string>;
|
||||
private onTagsChanges: Function;
|
||||
private selectSuggestion: Function;
|
||||
/**
|
||||
* Default constructor that is using resource
|
||||
* @ngInject for Dependency injection
|
||||
*/
|
||||
constructor($scope, $mdConstant, $timeout) {
|
||||
constructor($scope: ng.IScope, $mdConstant: any, $timeout: ng.ITimeoutService) {
|
||||
this.$scope = $scope;
|
||||
this.$timeout = $timeout;
|
||||
this.chip = '';
|
||||
|
|
@ -33,59 +43,44 @@ export class CheStackLibraryFilterController {
|
|||
|
||||
/**
|
||||
* Transform chip into tag
|
||||
* @param chip the string to make a tag
|
||||
* @returns {*}
|
||||
*/
|
||||
transformChip(chip) {
|
||||
* @param chip {string} the string to make a tag
|
||||
* @returns {string}
|
||||
*/
|
||||
transformChip(chip: string): string {
|
||||
chip = chip.toLowerCase();
|
||||
|
||||
// if partial input
|
||||
if (this.selectedIndex > -1) {
|
||||
chip = this.suggestions[this.selectedIndex].toLowerCase();
|
||||
}
|
||||
|
||||
// if already selected
|
||||
let selected = this.selectedTags.some(tag => tag.toLowerCase() === chip);
|
||||
if (selected) {
|
||||
if (this.selectedTags.some((tag: string) => tag.toLowerCase() === chip)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// if match some tag
|
||||
let tag;
|
||||
for (var i=0; i<this.suggestions.length; i++) {
|
||||
if (this.suggestions[i].toLowerCase() === chip) {
|
||||
tag = this.suggestions[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (tag) {
|
||||
return tag;
|
||||
}
|
||||
let tag = this.suggestions.find((tag: string) => tag.toLowerCase() === chip);
|
||||
|
||||
// query string isn't matched any tag
|
||||
// don't add new tag
|
||||
return null;
|
||||
return tag ? tag : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback called when tag added
|
||||
*/
|
||||
onAdd() {
|
||||
this.$scope.$emit('event:updateFilter', this.selectedTags);
|
||||
onAdd(): void {
|
||||
this.onTagsChanges({tags: this.selectedTags});
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback called when tag removed
|
||||
*/
|
||||
onRemove() {
|
||||
this.$scope.$emit('event:updateFilter', this.selectedTags);
|
||||
onRemove(): void {
|
||||
this.onTagsChanges({tags: this.selectedTags});
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback called when search query changed
|
||||
* @param query the string to compare with tags
|
||||
* @param query {string} the string to compare with tags
|
||||
*/
|
||||
querySearch(query) {
|
||||
querySearch(query: string): void {
|
||||
query = query.trim().toLowerCase();
|
||||
|
||||
let result = [];
|
||||
|
|
@ -97,7 +92,7 @@ export class CheStackLibraryFilterController {
|
|||
}
|
||||
|
||||
// exclude already selected tags and filter by substring
|
||||
result = this.ngModel.filter((tag) => this.selectedTags.indexOf(tag) === -1 && tag.toLowerCase().indexOf(query) === 0);
|
||||
result = this.stackTags.filter((tag: string) => this.selectedTags.indexOf(tag) === -1 && tag.toLowerCase().indexOf(query) === 0);
|
||||
|
||||
this.suggestions = result;
|
||||
|
||||
|
|
@ -108,19 +103,19 @@ export class CheStackLibraryFilterController {
|
|||
|
||||
// set first suggestion as selected
|
||||
this.$timeout(() => {
|
||||
this.$scope.$broadcast('selectSuggestion');
|
||||
this.selectSuggestion(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when user clicked on suggestion to select it
|
||||
* @param tag
|
||||
* @param tag {string}
|
||||
*/
|
||||
onSelectSuggestion(tag) {
|
||||
onSelectSuggestion(tag: string): void {
|
||||
// add tag to selected
|
||||
if (this.transformChip(tag)){
|
||||
if (this.transformChip(tag)) {
|
||||
this.selectedTags.push(tag);
|
||||
this.onAdd(tag);
|
||||
this.onAdd();
|
||||
}
|
||||
|
||||
// clear suggestions and previous input
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name projects.create.directive:cheStackLibraryFilterCtrl
|
||||
* @name projects.create.directive:cheStackLibraryFilter
|
||||
* @restrict E
|
||||
* @element
|
||||
*
|
||||
|
|
@ -21,33 +21,21 @@
|
|||
*
|
||||
* @author Oleksii Kurinnyi
|
||||
*/
|
||||
export class CheStackLibraryFilter {
|
||||
|
||||
/**
|
||||
* Default constructor that is using resource
|
||||
* @ngInject for Dependency injection
|
||||
*/
|
||||
constructor () {
|
||||
this.restrict = 'E';
|
||||
this.templateUrl = 'app/workspaces/workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.html';
|
||||
|
||||
this.controller = 'CheStackLibraryFilterController';
|
||||
this.controllerAs = 'cheStackLibraryFilterCtrl';
|
||||
|
||||
// we require ngModel as we want to use it inside our directive
|
||||
this.require = 'ngModel';
|
||||
|
||||
this.bindToController = true;
|
||||
|
||||
this.scope = {
|
||||
ngModel: '='
|
||||
};
|
||||
}
|
||||
export class CheStackLibraryFilter implements ng.IDirective {
|
||||
restrict = 'E';
|
||||
templateUrl = 'app/workspaces/workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.html';
|
||||
controller = 'CheStackLibraryFilterController';
|
||||
controllerAs = 'cheStackLibraryFilterCtrl';
|
||||
bindToController = true;
|
||||
scope = {
|
||||
stackTags: '=',
|
||||
onTagsChanges: '&'
|
||||
};
|
||||
|
||||
|
||||
link($scope, element) {
|
||||
let ctrl = $scope.cheStackLibraryFilterCtrl;
|
||||
let selectSuggestion = (element, index) => {
|
||||
link($scope: ng.IScope, element: any) {
|
||||
let ctrl = (<any>$scope).cheStackLibraryFilterCtrl;
|
||||
ctrl.selectSuggestion = (index: number) => {
|
||||
let selectionClass = 'stack-library-filter-suggestion-selected',
|
||||
suggestionElements = element.find('.stack-library-filter-suggestions md-chip');
|
||||
|
||||
|
|
@ -59,7 +47,7 @@ export class CheStackLibraryFilter {
|
|||
};
|
||||
|
||||
// select suggestion by keys
|
||||
element.bind('keypress keydown', (event) => {
|
||||
element.bind('keypress keydown', (event: any) => {
|
||||
if (event.which === 38) {
|
||||
// on press 'up'
|
||||
// select prev suggestion
|
||||
|
|
@ -67,26 +55,20 @@ export class CheStackLibraryFilter {
|
|||
|
||||
ctrl.selectedIndex--;
|
||||
if (ctrl.selectedIndex < 0) {
|
||||
ctrl.selectedIndex = ctrl.suggestions.length-1;
|
||||
ctrl.selectedIndex = ctrl.suggestions.length - 1;
|
||||
}
|
||||
selectSuggestion(element, ctrl.selectedIndex);
|
||||
}
|
||||
else if (event.which === 9 || event.which === 40) {
|
||||
ctrl.selectSuggestion(ctrl.selectedIndex);
|
||||
} else if (event.which === 9 || event.which === 40) {
|
||||
// on press 'tab' or 'down'
|
||||
// select next suggestion
|
||||
event.preventDefault();
|
||||
|
||||
ctrl.selectedIndex++;
|
||||
if (ctrl.selectedIndex > ctrl.suggestions.length-1) {
|
||||
if (ctrl.selectedIndex > ctrl.suggestions.length - 1) {
|
||||
ctrl.selectedIndex = 0;
|
||||
}
|
||||
selectSuggestion(element, ctrl.selectedIndex);
|
||||
ctrl.selectSuggestion(ctrl.selectedIndex);
|
||||
}
|
||||
});
|
||||
|
||||
// set first suggestion selected
|
||||
$scope.$on('selectSuggestion', () => {
|
||||
selectSuggestion(element, 0);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,21 +10,28 @@
|
|||
*/
|
||||
'use strict';
|
||||
|
||||
interface ISelecterScope extends ng.IScope {
|
||||
stackId: string;
|
||||
select: Function;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a directive for the stack library selecter.
|
||||
* @author Florent Benoit
|
||||
*/
|
||||
export class CheStackLibrarySelecter {
|
||||
export class CheStackLibrarySelecter implements ng.IDirective {
|
||||
restrict: string = 'E';
|
||||
templateUrl: string = 'app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.html';
|
||||
|
||||
scope: {
|
||||
[propName: string]: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Default constructor that is using resource
|
||||
* @ngInject for Dependency injection
|
||||
*/
|
||||
constructor () {
|
||||
this.restrict='E';
|
||||
this.templateUrl = 'app/workspaces/workspace-details/select-stack/stack-library/stack-library-selecter/che-stack-library-selecter.html';
|
||||
|
||||
// scope values
|
||||
this.scope = {
|
||||
title: '@cheTitle',
|
||||
|
|
@ -36,11 +43,26 @@ export class CheStackLibrarySelecter {
|
|||
};
|
||||
}
|
||||
|
||||
link($scope) {
|
||||
//select item
|
||||
link($scope: ISelecterScope, element: ng.IAugmentedJQuery) {
|
||||
// select item
|
||||
$scope.select = () => {
|
||||
$scope.$emit('event:library:selectStackId', $scope.stackId);
|
||||
};
|
||||
|
||||
const jqTextWrapper = element.find('.che-stack-library-selecter-descr'),
|
||||
jqText = angular.element(jqTextWrapper.find('.che-stack-library-selecter-descr-text')),
|
||||
jqTextEllipsis = angular.element(jqTextWrapper.find('.che-stack-library-selecter-descr-ellipsis'));
|
||||
|
||||
// show ellipsis
|
||||
$scope.$watch(() => {
|
||||
return jqText.get(0).clientHeight;
|
||||
}, (textHeight: number) => {
|
||||
if (textHeight > jqTextWrapper.get(0).clientHeight) {
|
||||
jqTextEllipsis.show();
|
||||
} else {
|
||||
jqTextEllipsis.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,11 @@
|
|||
<div class="body">
|
||||
<div class="title">{{title}}</div>
|
||||
</div>
|
||||
<div class="che-stack-library-selecter-text">{{text}}</div>
|
||||
<div layout="row" layout-align="end end" flex>
|
||||
<div class="che-stack-library-selecter-descr" flex>
|
||||
<div class="che-stack-library-selecter-descr-text">{{text}}</div>
|
||||
<div class="che-stack-library-selecter-descr-ellipsis">…</div>
|
||||
</div>
|
||||
<div layout="row" layout-align="end end">
|
||||
<div class="che-stack-library-selecter-extra-text" tooltip="{{extraText}}">...</div>
|
||||
</div>
|
||||
</md-card-content>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
$che-stack-library-selecter-color = $label-info-color
|
||||
$che-stack-library-selecter-bg-color = #EEE
|
||||
|
||||
.che-stack-library-selecter
|
||||
height 110px
|
||||
|
|
@ -16,7 +17,7 @@ $che-stack-library-selecter-color = $label-info-color
|
|||
color $che-stack-library-selecter-color
|
||||
|
||||
&:hover
|
||||
background-color #EEE
|
||||
background-color $che-stack-library-selecter-bg-color
|
||||
|
||||
|
||||
.che-stack-library-selecter md-card-content
|
||||
|
|
@ -42,8 +43,8 @@ $che-stack-library-selecter-color = $label-info-color
|
|||
margin-left auto
|
||||
margin-right auto
|
||||
margin-top 16px
|
||||
margin-bottom 0px
|
||||
padding 0px
|
||||
margin-bottom 0
|
||||
padding 0
|
||||
height 74px
|
||||
width 74px
|
||||
|
||||
|
|
@ -54,7 +55,7 @@ $che-stack-library-selecter-color = $label-info-color
|
|||
|
||||
&:hover
|
||||
color $primary-color
|
||||
background-color #EEE
|
||||
background-color $che-stack-library-selecter-bg-color
|
||||
|
||||
.che-stack-library-selecter-active:hover .title
|
||||
background-color $primary-color
|
||||
|
|
@ -90,8 +91,36 @@ che-stack-library-selecter
|
|||
.che-stack-library-selecter-extra-text
|
||||
cursor pointer
|
||||
margin-right 7px
|
||||
margin-bottom 2px
|
||||
margin-bottom 7px
|
||||
line-height 5px
|
||||
|
||||
.che-stack-library-selecter-text
|
||||
.che-stack-library-selecter-descr
|
||||
font-size 12px
|
||||
padding-left 10px
|
||||
padding-right 20px
|
||||
text-align justify
|
||||
position relative
|
||||
|
||||
$line-height = 16px
|
||||
$text-height = 3 * $line-height
|
||||
|
||||
overflow hidden
|
||||
height $text-height !important
|
||||
min-height $text-height !important
|
||||
max-height $text-height !important
|
||||
line-height $line-height
|
||||
box-sizing content-box
|
||||
|
||||
.che-stack-library-selecter-descr-ellipsis
|
||||
position absolute
|
||||
bottom 0
|
||||
right 20px
|
||||
width 25px
|
||||
display none
|
||||
text-align right
|
||||
|
||||
background-size 100% 100%
|
||||
background linear-gradient(to right, rgba(255, 255, 255, 0), $background-color 50%, $background-color)
|
||||
|
||||
.che-stack-library-selecter:hover .che-stack-library-selecter-descr-ellipsis
|
||||
background linear-gradient(to right, rgba(255, 255, 255, 0), $che-stack-library-selecter-bg-color 50%, $che-stack-library-selecter-bg-color)
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@
|
|||
layout="row" layout-align="start center">
|
||||
<che-filter-selector che-values="workspaceDetailsController.namespaceLabels"
|
||||
ng-model="workspaceDetailsController.namespaceLabel"
|
||||
che-width="200px"
|
||||
che-on-change="workspaceDetailsController.onNamespaceChanged"></che-filter-selector>
|
||||
<span class="namespace-additional-info" ng-if="workspaceDetailsController.namespaceInfo">
|
||||
{{workspaceDetailsController.namespaceInfo}}
|
||||
|
|
|
|||
|
|
@ -48,8 +48,6 @@ import {WorkspaceStatusIndicator} from './workspace-status/workspace-status-indi
|
|||
|
||||
import {CheStackLibraryFilterController} from './workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.controller';
|
||||
import {CheStackLibraryFilter} from './workspace-details/select-stack/stack-library/stack-library-filter/che-stack-library-filter.directive';
|
||||
import {CreateProjectStackLibrarySelectedStackFilter} from './workspace-details/select-stack/stack-library/create-project-stack-library-selected-stack.filter';
|
||||
|
||||
import {WorkspaceEnvironmentsController} from './workspace-details/environments/environments.controller';
|
||||
import {WorkspaceEnvironments} from './workspace-details/environments/environments.directive';
|
||||
import {WorkspaceMachineConfigController} from './workspace-details/environments/machine-config/machine-config.controller';
|
||||
|
|
@ -83,10 +81,7 @@ import {ListAgents} from './workspace-details/environments/list-agents/list-age
|
|||
*/
|
||||
export class WorkspacesConfig {
|
||||
|
||||
constructor(register) {
|
||||
|
||||
new CreateProjectStackLibrarySelectedStackFilter(register);
|
||||
|
||||
constructor(register: che.IRegisterService) {
|
||||
register.controller('WorkspaceDetailsSshCtrl', WorkspaceDetailsSshCtrl);
|
||||
register.directive('workspaceDetailsSsh', WorkspaceDetailsSsh);
|
||||
|
||||
|
|
@ -165,7 +160,7 @@ export class WorkspacesConfig {
|
|||
register.directive('listAgents', ListAgents);
|
||||
|
||||
// config routes
|
||||
register.app.config(function ($routeProvider) {
|
||||
register.app.config(($routeProvider: any) => {
|
||||
$routeProvider.accessWhen('/workspaces', {
|
||||
title: 'Workspaces',
|
||||
templateUrl: 'app/workspaces/list-workspaces/list-workspaces.html',
|
||||
|
|
|
|||
|
|
@ -13,5 +13,9 @@
|
|||
"cli" : {
|
||||
"configName" : "che.env",
|
||||
"name" : "CHE"
|
||||
},
|
||||
"docs" : {
|
||||
"stack" : "/docs/devops/runtime-stacks/index.html",
|
||||
"workspace" : "/docs/devops/intro/index.html"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ export class CheBranding {
|
|||
$http: ng.IHttpService;
|
||||
cheService: CheService;
|
||||
|
||||
private docs: { stack: string; workspace: string};
|
||||
/**
|
||||
* Default constructor that is using resource
|
||||
* @ngInject for Dependency injection
|
||||
|
|
@ -47,7 +48,7 @@ export class CheBranding {
|
|||
let assetPrefix = 'assets/branding/';
|
||||
|
||||
// load data
|
||||
this.$http.get(assetPrefix + 'product.json').then((data) => {
|
||||
this.$http.get(assetPrefix + 'product.json').then((data: any) => {
|
||||
|
||||
let brandingData = data.data;
|
||||
|
||||
|
|
@ -62,7 +63,8 @@ export class CheBranding {
|
|||
helpPath : brandingData.helpPath,
|
||||
helpTitle : brandingData.helpTitle,
|
||||
supportEmail: brandingData.supportEmail,
|
||||
oauthDocs: brandingData.oauthDocs
|
||||
oauthDocs: brandingData.oauthDocs,
|
||||
docs: brandingData.docs
|
||||
};
|
||||
|
||||
this.productName = this.$rootScope.branding.title;
|
||||
|
|
@ -83,6 +85,7 @@ export class CheBranding {
|
|||
} else {
|
||||
this.cli = this.$rootScope.branding.cli;
|
||||
}
|
||||
this.docs = this.$rootScope.branding.docs;
|
||||
this.deferred.resolve(this.$rootScope.branding);
|
||||
});
|
||||
|
||||
|
|
@ -124,5 +127,13 @@ export class CheBranding {
|
|||
return this.cli;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns object with docs URLs.
|
||||
* @returns {{stack: string, workspace: string}}
|
||||
*/
|
||||
getDocs(): { stack: string; workspace: string } {
|
||||
return this.docs;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ declare namespace _che {
|
|||
creator?: string;
|
||||
scope?: string;
|
||||
components?: Array<any>;
|
||||
links?: Array<any>;
|
||||
source?: any;
|
||||
workspaceConfig: IWorkspaceConfig;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
export class CheFilterSelectorController {
|
||||
|
||||
private valueModel: string;
|
||||
private width: string;
|
||||
private onChange: Function;
|
||||
|
||||
/**
|
||||
|
|
@ -25,8 +26,10 @@ export class CheFilterSelectorController {
|
|||
* @ngInject for Dependency injection
|
||||
*/
|
||||
constructor() {
|
||||
this.width = this.width || '150px';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Performs value selection and calls value changed handler.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ export class CheFilterSelector {
|
|||
valueModel: '=ngModel',
|
||||
values: '=cheValues',
|
||||
isDisabled: '=cheDisabled',
|
||||
onChange: '=cheOnChange'
|
||||
onChange: '=cheOnChange',
|
||||
width: '@?cheWidth'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<md-menu md-offset="1 35" class="che-filter-selector">
|
||||
<div ng-click="$mdOpenMenu($event)" class="che-filter-selector-button">
|
||||
<div ng-click="$mdOpenMenu($event)" class="che-filter-selector-button" ng-style="{width: cheFilterSelectorController.width}">
|
||||
<div ng-init="cheFilterSelectorController.valueModel = cheFilterSelectorController.valueModel || cheFilterSelectorController.values[0]"
|
||||
layout="row" layout-align="start center">
|
||||
<span>{{cheFilterSelectorController.valueModel}}</span>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
<i class="fa fa-angle-down"></i>
|
||||
</div>
|
||||
</div>
|
||||
<md-menu-content class="che-filter-selector-items">
|
||||
<md-menu-content class="che-filter-selector-items" ng-style="{width: cheFilterSelectorController.width}">
|
||||
<md-menu-item layout="column" class="che-filter-item"
|
||||
ng-repeat="value in cheFilterSelectorController.values"
|
||||
ng-click="cheFilterSelectorController.selectValue(value)">
|
||||
|
|
|
|||
|
|
@ -1,15 +1,20 @@
|
|||
.che-filter-selector
|
||||
outline none
|
||||
min-width 150px
|
||||
|
||||
md-open-menu-container
|
||||
min-width 150px
|
||||
|
||||
md-menu-item
|
||||
overflow-x hidden
|
||||
text-overflow ellipsis
|
||||
display inline !important
|
||||
|
||||
.che-filter-selector-button
|
||||
min-height 35px
|
||||
height 100%
|
||||
color $primary-color
|
||||
border 1px solid $primary-color
|
||||
max-width 200px
|
||||
border-radius 2px
|
||||
padding 0px 10px
|
||||
outline none
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ get_display_url() {
|
|||
CHE_HOST_LOCAL=$(get_value_of_var_from_env_file ${CHE_PRODUCT_NAME}_HOST)
|
||||
fi
|
||||
|
||||
if ! is_docker_for_mac; then
|
||||
if ! is_docker_for_mac && ! is_docker_for_windows; then
|
||||
echo "http://${CHE_HOST_LOCAL}:${CHE_PORT}"
|
||||
else
|
||||
echo "http://localhost:${CHE_PORT}"
|
||||
|
|
@ -55,7 +55,7 @@ get_debug_display_url() {
|
|||
fi
|
||||
fi
|
||||
|
||||
if ! is_docker_for_mac; then
|
||||
if ! is_docker_for_mac && ! is_docker_for_windows; then
|
||||
echo "http://${CHE_HOST}:${CHE_DEBUG_PORT_LOCAL}"
|
||||
else
|
||||
echo "http://localhost:${CHE_DEBUG_PORT_LOCAL}"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
IMAGE_INIT=eclipse/che-init:5.11.0
|
||||
IMAGE_CHE=eclipse/che-server:5.11.0
|
||||
IMAGE_COMPOSE=docker/compose:1.8.1
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
eclipse/alpine_jdk8
|
||||
eclipse/aspnet
|
||||
eclipse/centos_jdk8
|
||||
eclipse/cpp_gcc
|
||||
eclipse/debian_jdk8
|
||||
eclipse/debian_jdk8_node
|
||||
eclipse/debian_jre
|
||||
eclipse/dotnet_core
|
||||
eclipse/hadoop-dev
|
||||
eclipse/meteor
|
||||
eclipse/node
|
||||
eclipse/php
|
||||
eclipse/platformio
|
||||
eclipse/ruby_rails
|
||||
eclipse/selenium
|
||||
eclipse/ubuntu_android
|
||||
eclipse/ubuntu_go
|
||||
eclipse/ubuntu_gradle
|
||||
eclipse/ubuntu_jdk8
|
||||
eclipse/ubuntu_jre
|
||||
eclipse/ubuntu_python
|
||||
eclipse/ubuntu_wildfly8
|
||||
registry.centos.org/che-stacks/vertx
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
IMAGE_INIT=eclipse/che-init:5.9.1
|
||||
IMAGE_CHE=eclipse/che-server:5.9.1
|
||||
IMAGE_COMPOSE=docker/compose:1.8.1
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
eclipse/alpine_jdk8
|
||||
eclipse/aspnet
|
||||
eclipse/centos_jdk8
|
||||
eclipse/cpp_gcc
|
||||
eclipse/debian_jdk8
|
||||
eclipse/debian_jdk8_node
|
||||
eclipse/debian_jre
|
||||
eclipse/dotnet_core
|
||||
eclipse/hadoop-dev
|
||||
eclipse/meteor
|
||||
eclipse/node
|
||||
eclipse/php
|
||||
eclipse/platformio
|
||||
eclipse/ruby_rails
|
||||
eclipse/selenium
|
||||
eclipse/ubuntu_android
|
||||
eclipse/ubuntu_go
|
||||
eclipse/ubuntu_gradle
|
||||
eclipse/ubuntu_jdk8
|
||||
eclipse/ubuntu_jre
|
||||
eclipse/ubuntu_python
|
||||
eclipse/ubuntu_wildfly8
|
||||
registry.centos.org/che-stacks/vertx
|
||||
|
||||
|
|
@ -1 +1 @@
|
|||
5.9.0
|
||||
5.10.0
|
||||
|
|
@ -17,13 +17,13 @@
|
|||
<parent>
|
||||
<artifactId>maven-depmgt-pom</artifactId>
|
||||
<groupId>org.eclipse.che.depmgt</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>dto-typescript</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Che TypeScript DTO</name>
|
||||
<properties>
|
||||
<che.version>5.10.0-SNAPSHOT</che.version>
|
||||
<che.version>5.11.0-SNAPSHOT</che.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-ide-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-dyna-provider-generator-maven-plugin</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-ide-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-ide-api</artifactId>
|
||||
|
|
|
|||
|
|
@ -13,13 +13,13 @@ package org.eclipse.che.ide.api.command;
|
|||
import org.eclipse.che.api.core.model.workspace.config.Command;
|
||||
import org.eclipse.che.commons.annotation.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import static java.util.Collections.unmodifiableList;
|
||||
import static java.util.Collections.unmodifiableSet;
|
||||
import static org.eclipse.che.api.workspace.shared.Constants.COMMAND_GOAL_ATTRIBUTE_NAME;
|
||||
import static org.eclipse.che.api.workspace.shared.Constants.COMMAND_PREVIEW_URL_ATTRIBUTE_NAME;
|
||||
|
||||
|
|
@ -192,30 +192,30 @@ public class CommandImpl implements Command {
|
|||
/** Defines the context in which command is applicable. */
|
||||
public static class ApplicableContext {
|
||||
|
||||
private boolean workspaceApplicable;
|
||||
private List<String> projects;
|
||||
private boolean workspaceApplicable;
|
||||
private Set<String> projects;
|
||||
|
||||
/** Creates new {@link ApplicableContext} which is workspace applicable. */
|
||||
public ApplicableContext() {
|
||||
workspaceApplicable = true;
|
||||
projects = new ArrayList<>();
|
||||
projects = new HashSet<>();
|
||||
}
|
||||
|
||||
/** Creates new {@link ApplicableContext} which is applicable to the single project only. */
|
||||
public ApplicableContext(String projectPath) {
|
||||
projects = new ArrayList<>();
|
||||
projects = new HashSet<>();
|
||||
projects.add(projectPath);
|
||||
}
|
||||
|
||||
/** Creates new {@link ApplicableContext} based on the provided data. */
|
||||
public ApplicableContext(boolean workspaceApplicable, List<String> projects) {
|
||||
public ApplicableContext(boolean workspaceApplicable, Set<String> projects) {
|
||||
this.workspaceApplicable = workspaceApplicable;
|
||||
this.projects = projects;
|
||||
}
|
||||
|
||||
/** Creates copy of the given {@code context}. */
|
||||
public ApplicableContext(ApplicableContext context) {
|
||||
this(context.isWorkspaceApplicable(), new ArrayList<>(context.getApplicableProjects()));
|
||||
this(context.isWorkspaceApplicable(), new HashSet<>(context.getApplicableProjects()));
|
||||
}
|
||||
|
||||
/** Returns {@code true} if command is applicable to the workspace and {@code false} otherwise. */
|
||||
|
|
@ -229,8 +229,8 @@ public class CommandImpl implements Command {
|
|||
}
|
||||
|
||||
/** Returns <b>immutable</b> list of the paths of the applicable projects. */
|
||||
public List<String> getApplicableProjects() {
|
||||
return unmodifiableList(projects);
|
||||
public Set<String> getApplicableProjects() {
|
||||
return unmodifiableSet(projects);
|
||||
}
|
||||
|
||||
/** Adds applicable project's path. */
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-ide-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-ide-app</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@ import org.eclipse.che.ide.command.editor.EditorMessages;
|
|||
import org.eclipse.che.ide.command.editor.page.AbstractCommandEditorPage;
|
||||
import org.eclipse.che.ide.command.editor.page.CommandEditorPage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/** Presenter for {@link CommandEditorPage} which allows to edit command's applicable projects. */
|
||||
public class ProjectsPage extends AbstractCommandEditorPage implements ProjectsPageView.ActionDelegate,
|
||||
|
|
@ -39,7 +39,7 @@ public class ProjectsPage extends AbstractCommandEditorPage implements ProjectsP
|
|||
private final AppContext appContext;
|
||||
|
||||
/** Initial value of the applicable projects list. */
|
||||
private List<String> applicableProjectsInitial;
|
||||
private Set<String> applicableProjectsInitial;
|
||||
|
||||
@Inject
|
||||
public ProjectsPage(ProjectsPageView view,
|
||||
|
|
@ -65,7 +65,7 @@ public class ProjectsPage extends AbstractCommandEditorPage implements ProjectsP
|
|||
protected void initialize() {
|
||||
final ApplicableContext context = editedCommand.getApplicableContext();
|
||||
|
||||
applicableProjectsInitial = new ArrayList<>(context.getApplicableProjects());
|
||||
applicableProjectsInitial = new HashSet<>(context.getApplicableProjects());
|
||||
|
||||
refreshProjects();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
import static org.eclipse.che.api.core.model.workspace.WorkspaceStatus.RUNNING;
|
||||
|
|
@ -166,7 +167,7 @@ public class CommandManagerImpl implements CommandManager {
|
|||
|
||||
/** Checks whether the given command is applicable to the current project. */
|
||||
private boolean isCommandApplicableToCurrentProject(CommandImpl command) {
|
||||
final List<String> applicableProjects = command.getApplicableContext().getApplicableProjects();
|
||||
final Set<String> applicableProjects = command.getApplicableContext().getApplicableProjects();
|
||||
|
||||
if (applicableProjects.isEmpty()) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -925,7 +925,12 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP
|
|||
|
||||
@Nullable
|
||||
private MachineEntity getMachine(@NotNull String machineId) {
|
||||
List<MachineEntity> wsMachines = getMachines(appContext.getWorkspace());
|
||||
Workspace workspace = appContext.getWorkspace();
|
||||
if (workspace == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<MachineEntity> wsMachines = getMachines(workspace);
|
||||
for (MachineEntity machine : wsMachines) {
|
||||
if (machineId.equals(machine.getId())) {
|
||||
return machine;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2017 Codenvy, S.A.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.ide.terminal;
|
||||
|
||||
import com.google.gwt.core.client.JavaScriptObject;
|
||||
|
||||
/**
|
||||
* Custom keyDown handler for {@link TerminalJso}
|
||||
*
|
||||
* @author Alexander Andrienko
|
||||
*/
|
||||
public class CustomKeyDownTerminalHandler extends JavaScriptObject {
|
||||
protected CustomKeyDownTerminalHandler() {
|
||||
}
|
||||
|
||||
public static native CustomKeyDownTerminalHandler create() /*-{
|
||||
return function(ev) {
|
||||
var C = 67;
|
||||
var V = 86;
|
||||
if (ev.ctrlKey && !(ev.shiftKey || ev.metaKey || ev.altKey)) {
|
||||
|
||||
//handle Ctrl + V
|
||||
if (ev.keyCode === V) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var selection = this.document.getSelection(),
|
||||
collapsed = selection.isCollapsed,
|
||||
isRange = typeof collapsed === 'boolean' ? !collapsed : selection.type === 'Range';
|
||||
|
||||
//handle Ctrl + C
|
||||
if (ev.keyCode === C && isRange) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}-*/;
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@ import org.eclipse.che.api.promises.client.Operation;
|
|||
* GWT binding to term.js script
|
||||
*
|
||||
* @author Evgen Vidolob
|
||||
* @author Alexander Andrienko
|
||||
*/
|
||||
class TerminalJso extends JavaScriptObject {
|
||||
protected TerminalJso() {
|
||||
|
|
@ -32,6 +33,10 @@ class TerminalJso extends JavaScriptObject {
|
|||
this.open(element);
|
||||
}-*/;
|
||||
|
||||
public final native void attachCustomKeyDownHandler(JavaScriptObject customKeyDownHandler) /*-{
|
||||
this.attachCustomKeydownHandler(customKeyDownHandler);
|
||||
}-*/;
|
||||
|
||||
public final native Element getElement() /*-{
|
||||
return this.element;
|
||||
}-*/;
|
||||
|
|
|
|||
|
|
@ -16,9 +16,8 @@ import com.google.gwt.uibinder.client.UiBinder;
|
|||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Timer;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.RequiresResize;
|
||||
import com.google.gwt.user.client.ui.ResizeLayoutPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
|
@ -28,7 +27,7 @@ import javax.validation.constraints.NotNull;
|
|||
*
|
||||
* @author Dmitry Shnurenko
|
||||
*/
|
||||
final class TerminalViewImpl extends Composite implements TerminalView, RequiresResize {
|
||||
final class TerminalViewImpl extends Composite implements TerminalView {
|
||||
|
||||
interface TerminalViewImplUiBinder extends UiBinder<Widget, TerminalViewImpl> {
|
||||
}
|
||||
|
|
@ -36,15 +35,15 @@ final class TerminalViewImpl extends Composite implements TerminalView, Requires
|
|||
private final static TerminalViewImplUiBinder UI_BINDER = GWT.create(TerminalViewImplUiBinder.class);
|
||||
|
||||
@UiField
|
||||
FlowPanel terminalPanel;
|
||||
ResizeLayoutPanel terminalPanel;
|
||||
|
||||
@UiField
|
||||
Label unavailableLabel;
|
||||
Label unavailableLabel;
|
||||
|
||||
private ActionDelegate delegate;
|
||||
|
||||
private TerminalJso terminal;
|
||||
private Element terminalElement;
|
||||
private Element terminalElement;
|
||||
|
||||
public TerminalViewImpl() {
|
||||
initWidget(UI_BINDER.createAndBindUi(this));
|
||||
|
|
@ -66,10 +65,18 @@ final class TerminalViewImpl extends Composite implements TerminalView, Requires
|
|||
terminalElement.getStyle().setProperty("opacity", "0");
|
||||
|
||||
terminal.open(terminalPanel.getElement());
|
||||
terminal.attachCustomKeyDownHandler(CustomKeyDownTerminalHandler.create());
|
||||
resizeTerminal();
|
||||
|
||||
terminalElement.getFirstChildElement().getStyle().clearProperty("backgroundColor");
|
||||
terminalElement.getFirstChildElement().getStyle().clearProperty("color");
|
||||
terminalElement.getStyle().clearProperty("opacity");
|
||||
|
||||
terminalPanel.addResizeHandler(resizeEvent -> {
|
||||
if (terminalElement != null && isVisible()) {
|
||||
resizeTimer.schedule(200);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
|
@ -81,20 +88,6 @@ final class TerminalViewImpl extends Composite implements TerminalView, Requires
|
|||
terminalPanel.setVisible(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resize {@link TerminalJso} to current widget size.
|
||||
* To improve performance we should resize only visible terminals,
|
||||
* because "resize terminal" is quite expensive operation. When you
|
||||
* click on the tab to activate hidden terminal this method will be
|
||||
* executed too, so terminal will be resized anyway.
|
||||
*/
|
||||
@Override
|
||||
public void onResize() {
|
||||
if (terminalElement != null && isVisible()) {
|
||||
resizeTimer.schedule(200);
|
||||
}
|
||||
}
|
||||
|
||||
private Timer resizeTimer = new Timer() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
|
|
|||
|
|
@ -50,6 +50,6 @@
|
|||
|
||||
<g:FlowPanel styleName="{style.terminalView}">
|
||||
<g:Label ui:field="unavailableLabel" visible="false" text="{locale.terminalTryRestarting}" addStyleNames="{style.unavailable}"/>
|
||||
<g:FlowPanel ui:field="terminalPanel" styleName="{style.termPanel}"/>
|
||||
<g:ResizeLayoutPanel ui:field="terminalPanel" styleName="{style.termPanel}"/>
|
||||
</g:FlowPanel>
|
||||
</ui:UiBinder>
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@ import org.mockito.Captor;
|
|||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
|
@ -148,7 +148,7 @@ public class ProjectsPageTest {
|
|||
}
|
||||
|
||||
private void setUpApplicableProjectToContext() {
|
||||
List<String> applicableProjects = new ArrayList<>();
|
||||
Set<String> applicableProjects = new HashSet<>();
|
||||
applicableProjects.add(PROJECT_PATH);
|
||||
when(applicableContext.getApplicableProjects()).thenReturn(applicableProjects);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-ide-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-ide-generators</artifactId>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-ide-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-ide-stacks</artifactId>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-ide-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-ide-templates</artifactId>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-ide-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<artifactId>che-core-ide-ui</artifactId>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<svg viewBox="0 0 225 57" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg viewBox="0 0 225 57" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g>
|
||||
<path d="M0.0322265625,30.8803711 L0,13.7929688 L23.8525391,0 L47.6494141,13.7841797 L32.9580078,22.2944336 L23.8955078,17.1850586 L0.0322265625,30.8803711 Z" fill="#4990E2"></path>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-ide-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-orion-editor</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<parent>
|
||||
<artifactId>che-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>5.10.0-SNAPSHOT</version>
|
||||
<version>5.11.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue