You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by dg...@apache.org on 2020/03/25 11:06:09 UTC
[incubator-dlab] branch develop updated: [Dlab 1661]: Grouped
Compute/Notebook shapes by clouds (#673)
This is an automated email from the ASF dual-hosted git repository.
dgnatyshyn pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/develop by this push:
new 658dfef [Dlab 1661]: Grouped Compute/Notebook shapes by clouds (#673)
658dfef is described below
commit 658dfefab40bf1cf0968c3fe6066e5ed625458b5
Author: Dmytro Gnatyshyn <42...@users.noreply.github.com>
AuthorDate: Wed Mar 25 13:06:02 2020 +0200
[Dlab 1661]: Grouped Compute/Notebook shapes by clouds (#673)
[Dlab 1661]: Grouped Compute/Notebook shapes by clouds
---
.../epam/dlab/backendapi/dao/UserRoleDaoImpl.java | 2 ++
.../dlab/backendapi/resources/dto/UserRoleDto.java | 2 ++
.../src/main/resources/mongo/aws/mongo_roles.json | 28 ++++++++++++++++
.../main/resources/mongo/azure/mongo_roles.json | 23 +++++++++++++
.../src/main/resources/mongo/gcp/mongo_roles.json | 26 +++++++++++++++
.../app/administration/roles/roles.component.ts | 9 ++---
.../services/applicationServiceFacade.service.ts | 6 ----
.../src/app/core/services/project.service.ts | 9 -----
.../multi-level-select-dropdown.component.html | 26 ++++++++++++++-
.../multi-level-select-dropdown.component.scss | 4 ++-
.../multi-level-select-dropdown.component.ts | 39 +++++++++++++++++++++-
11 files changed, 152 insertions(+), 22 deletions(-)
diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/UserRoleDaoImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/UserRoleDaoImpl.java
index f4deb0a..fffc70b 100644
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/UserRoleDaoImpl.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/UserRoleDaoImpl.java
@@ -56,6 +56,7 @@ public class UserRoleDaoImpl extends BaseDAO implements UserRoleDao {
private static final String GROUPS_FIELD = "groups";
private static final String DESCRIPTION = "description";
private static final String TYPE = "type";
+ private static final String CLOUD = "cloud";
private static final String ROLES = "roles";
private static final String GROUPS = "$groups";
private static final String GROUP = "group";
@@ -171,6 +172,7 @@ public class UserRoleDaoImpl extends BaseDAO implements UserRoleDao {
return new Document().append(ID, "$" + ID)
.append(DESCRIPTION, "$" + DESCRIPTION)
.append(TYPE, "$" + TYPE)
+ .append(CLOUD, "$" + CLOUD)
.append(USERS_FIELD, "$" + USERS_FIELD)
.append(EXPLORATORY_SHAPES_FIELD, "$" + EXPLORATORY_SHAPES_FIELD)
.append(PAGES_FIELD, "$" + PAGES_FIELD)
diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/UserRoleDto.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/UserRoleDto.java
index b1d3337..5c90602 100644
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/UserRoleDto.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/UserRoleDto.java
@@ -18,6 +18,7 @@
*/
package com.epam.dlab.backendapi.resources.dto;
+import com.epam.dlab.cloud.CloudProvider;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
@@ -35,6 +36,7 @@ public class UserRoleDto {
private String id;
private String description;
private Type type;
+ private CloudProvider cloud;
private Set<String> pages;
private Set<String> computationals;
private Set<String> exploratories;
diff --git a/services/self-service/src/main/resources/mongo/aws/mongo_roles.json b/services/self-service/src/main/resources/mongo/aws/mongo_roles.json
index 0a566f4..9998d84 100644
--- a/services/self-service/src/main/resources/mongo/aws/mongo_roles.json
+++ b/services/self-service/src/main/resources/mongo/aws/mongo_roles.json
@@ -3,6 +3,7 @@
"_id": "nbShapes_p2.xlarge_fetching",
"description": "Use p2.xlarge instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AWS",
"exploratory_shapes": [
"p2.xlarge"
],
@@ -14,6 +15,7 @@
"_id": "nbShapes_t2.medium_fetching",
"description": "Use t2.medium instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AWS",
"exploratory_shapes": [
"t2.medium"
],
@@ -25,6 +27,7 @@
"_id": "nbShapes_r3.xlarge_fetching",
"description": "Use r3.xlarge instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AWS",
"exploratory_shapes": [
"r3.xlarge"
],
@@ -36,6 +39,7 @@
"_id": "nbShapes_r4.2xlarge_fetching",
"description": "Use r4.2xlarge instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AWS",
"exploratory_shapes": [
"r4.2xlarge"
],
@@ -47,6 +51,7 @@
"_id": "nbShapes_r3.4xlarge_fetching",
"description": "Use r3.4xlarge instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AWS",
"exploratory_shapes": [
"r3.4xlarge"
],
@@ -58,6 +63,7 @@
"_id": "nbShapes_r3.8xlarge_fetching",
"description": "Use r3.8xlarge instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AWS",
"exploratory_shapes": [
"r3.8xlarge"
],
@@ -69,6 +75,7 @@
"_id": "nbShapes_c4.large_fetching",
"description": "Use c4.large instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AWS",
"exploratory_shapes": [
"c4.large"
],
@@ -80,6 +87,7 @@
"_id": "nbShapes_c4.2xlarge_fetching",
"description": "Use c4.2xlarge instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AWS",
"exploratory_shapes": [
"c4.2xlarge"
],
@@ -91,6 +99,7 @@
"_id": "nbShapes_c4.8xlarge_fetching",
"description": "Use c4.8xlarge instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AWS",
"exploratory_shapes": [
"c4.8xlarge"
],
@@ -102,6 +111,7 @@
"_id": "nbCreateDeeplearning",
"description": "Create Notebook Deep Learning",
"type": "NOTEBOOK",
+ "cloud": "AWS",
"exploratories": [
"docker.dlab-deeplearning"
],
@@ -113,6 +123,7 @@
"_id": "nbCreateJupyter",
"description": "Create Notebook Jupyter",
"type": "NOTEBOOK",
+ "cloud": "AWS",
"exploratories": [
"docker.dlab-jupyter"
],
@@ -124,6 +135,7 @@
"_id": "nbCreateJupyterLab",
"description": "Create Notebook JupyterLab",
"type": "NOTEBOOK",
+ "cloud": "AWS",
"exploratories": [
"docker.dlab-jupyterlab"
],
@@ -135,6 +147,7 @@
"_id": "nbCreateRstudio",
"description": "Create Notebook RStudio",
"type": "NOTEBOOK",
+ "cloud": "AWS",
"exploratories": [
"docker.dlab-rstudio"
],
@@ -146,6 +159,7 @@
"_id": "nbCreateTensor",
"description": "Create Notebook Jupyter with TensorFlow",
"type": "NOTEBOOK",
+ "cloud": "AWS",
"exploratories": [
"docker.dlab-tensor"
],
@@ -157,6 +171,7 @@
"_id": "nbCreateZeppelin",
"description": "Create Notebook Apache Zeppelin",
"type": "NOTEBOOK",
+ "cloud": "AWS",
"exploratories": [
"docker.dlab-zeppelin"
],
@@ -168,6 +183,7 @@
"_id": "nbCreateTensorRstudio",
"description": "Create Notebook RStudio with TensorFlow",
"type": "NOTEBOOK",
+ "cloud": "AWS",
"exploratories": [
"docker.dlab-tensor-rstudio"
],
@@ -179,6 +195,7 @@
"_id": "nbCreateDataEngine",
"description": "Create Data Engine",
"type": "COMPUTATIONAL",
+ "cloud": "AWS",
"computationals": [
"docker.dlab-dataengine"
],
@@ -190,6 +207,7 @@
"_id": "nbCreateDataEngineService",
"description": "Create Data Engine Service",
"type": "COMPUTATIONAL",
+ "cloud": "AWS",
"computationals": [
"docker.dlab-dataengine-service"
],
@@ -201,6 +219,7 @@
"_id": "compShapes_c4.xlarge_fetching",
"description": "Use c4.xlarge instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AWS",
"computational_shapes": [
"c4.xlarge"
],
@@ -212,6 +231,7 @@
"_id": "compShapes_r3.xlarge_fetching",
"description": "Use r3.xlarge instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AWS",
"computational_shapes": [
"r3.xlarge"
],
@@ -223,6 +243,7 @@
"_id": "compShapes_r4.2xlarge_fetching",
"description": "Use r4.2xlarge instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AWS",
"computational_shapes": [
"r4.2xlarge"
],
@@ -234,6 +255,7 @@
"_id": "compShapes_r3.4xlarge_fetching",
"description": "Use r3.4xlarge instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AWS",
"computational_shapes": [
"r3.4xlarge"
],
@@ -245,6 +267,7 @@
"_id": "compShapes_r3.8xlarge_fetching",
"description": "Use r3.8xlarge instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AWS",
"computational_shapes": [
"r3.8xlarge"
],
@@ -256,6 +279,7 @@
"_id": "compShapes_c4.2xlarge_fetching",
"description": "Use c4.2xlarge instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AWS",
"computational_shapes": [
"c4.2xlarge"
],
@@ -267,6 +291,7 @@
"_id": "compShapes_c4.8xlarge_fetching",
"description": "Use c4.8xlarge instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AWS",
"computational_shapes": [
"c4.8xlarge"
],
@@ -278,6 +303,7 @@
"_id": "compShapes_p2.xlarge_fetching",
"description": "Use p2.xlarge instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AWS",
"computational_shapes": [
"p2.xlarge"
],
@@ -289,6 +315,7 @@
"_id": "nbBillingReportFull",
"description": "View full billing report for all users",
"type": "BILLING",
+ "cloud": "AWS",
"pages": [
"/api/infrastructure_provision/billing"
],
@@ -300,6 +327,7 @@
"_id": "admin",
"description": "Allow to execute administration operation",
"type": "ADMINISTRATION",
+ "cloud": "AWS",
"pages": [
"environment/*",
"/api/infrastructure/backup",
diff --git a/services/self-service/src/main/resources/mongo/azure/mongo_roles.json b/services/self-service/src/main/resources/mongo/azure/mongo_roles.json
index ca61082..113a705 100644
--- a/services/self-service/src/main/resources/mongo/azure/mongo_roles.json
+++ b/services/self-service/src/main/resources/mongo/azure/mongo_roles.json
@@ -3,6 +3,7 @@
"_id": "nbShapes_Standard_NC6_fetching",
"description": "Use Standard_NC6 instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AZURE",
"exploratory_shapes": [
"Standard_NC6"
],
@@ -14,6 +15,7 @@
"_id": "nbShapes_Standard_E4s_v3_fetching",
"description": "Use Standard_E4s_v3 instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AZURE",
"exploratory_shapes": [
"Standard_E4s_v3"
],
@@ -25,6 +27,7 @@
"_id": "nbShapes_Standard_E16s_v3_fetching",
"description": "Use Standard_E16s_v3 instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AZURE",
"exploratory_shapes": [
"Standard_E16s_v3"
],
@@ -36,6 +39,7 @@
"_id": "nbShapes_Standard_E32s_v3_fetching",
"description": "Use Standard_E32s_v3 instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AZURE",
"exploratory_shapes": [
"Standard_E32s_v3"
],
@@ -47,6 +51,7 @@
"_id": "nbShapes_Standard_F2s_fetching",
"description": "Use Standard_F2s instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AZURE",
"exploratory_shapes": [
"Standard_F2s"
],
@@ -58,6 +63,7 @@
"_id": "nbShapes_Standard_F4s_fetching",
"description": "Use Standard_F4s instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AZURE",
"exploratory_shapes": [
"Standard_F4s"
],
@@ -69,6 +75,7 @@
"_id": "nbShapes_Standard_F8s_fetching",
"description": "Use Standard_F8s instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AZURE",
"exploratory_shapes": [
"Standard_F8s"
],
@@ -80,6 +87,7 @@
"_id": "nbShapes_Standard_F16s_fetching",
"description": "Use Standard_F16s instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "AZURE",
"exploratory_shapes": [
"Standard_F16s"
],
@@ -91,6 +99,7 @@
"_id": "nbCreateDeeplearning",
"description": "Create Notebook Deep Learning",
"type": "NOTEBOOK",
+ "cloud": "AZURE",
"exploratories": [
"docker.dlab-deeplearning"
],
@@ -102,6 +111,7 @@
"_id": "nbCreateJupyter",
"description": "Create Notebook Jupyter",
"type": "NOTEBOOK",
+ "cloud": "AZURE",
"exploratories": [
"docker.dlab-jupyter"
],
@@ -113,6 +123,7 @@
"_id": "nbCreateRstudio",
"description": "Create Notebook RStudio",
"type": "NOTEBOOK",
+ "cloud": "AZURE",
"exploratories": [
"docker.dlab-rstudio"
],
@@ -124,6 +135,7 @@
"_id": "nbCreateTensor",
"description": "Create Notebook Jupyter with TensorFlow",
"type": "NOTEBOOK",
+ "cloud": "AZURE",
"exploratories": [
"docker.dlab-tensor"
],
@@ -135,6 +147,7 @@
"_id": "nbCreateZeppelin",
"description": "Create Notebook Apache Zeppelin",
"type": "NOTEBOOK",
+ "cloud": "AZURE",
"exploratories": [
"docker.dlab-zeppelin"
],
@@ -146,6 +159,7 @@
"_id": "nbCreateDataEngine",
"description": "Create Data Engine",
"type": "COMPUTATIONAL",
+ "cloud": "AZURE",
"computationals": [
"docker.dlab-dataengine"
],
@@ -157,6 +171,7 @@
"_id": "compShapes_Standard_F4s_fetching",
"description": "Use Standard_F4s instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AZURE",
"computational_shapes": [
"Standard_F4s"
],
@@ -168,6 +183,7 @@
"_id": "compShapes_Standard_E4s_v3_fetching",
"description": "Use Standard_E4s_v3 instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AZURE",
"computational_shapes": [
"Standard_E4s_v3"
],
@@ -179,6 +195,7 @@
"_id": "compShapes_Standard_E16s_v3_fetching",
"description": "Use Standard_E16s_v3 instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AZURE",
"computational_shapes": [
"Standard_E16s_v3"
],
@@ -190,6 +207,7 @@
"_id": "compShapes_Standard_E32s_v3_fetching",
"description": "Use Standard_E32s_v3 instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AZURE",
"computational_shapes": [
"Standard_E32s_v3"
],
@@ -201,6 +219,7 @@
"_id": "compShapes_Standard_F8s_fetching",
"description": "Use Standard_F8s instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AZURE",
"computational_shapes": [
"Standard_F8s"
],
@@ -212,6 +231,7 @@
"_id": "compShapes_Standard_F16s_fetching",
"description": "Use Standard_F16s instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AZURE",
"computational_shapes": [
"Standard_F16s"
],
@@ -223,6 +243,7 @@
"_id": "compShapes_Standard_NC6_fetching",
"description": "Use Standard_NC6 instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "AZURE",
"computational_shapes": [
"Standard_NC6"
],
@@ -234,6 +255,7 @@
"_id": "nbBillingReportFull",
"description": "View full billing report for all users",
"type": "BILLING",
+ "cloud": "AZURE",
"pages": [
"/api/infrastructure_provision/billing"
],
@@ -245,6 +267,7 @@
"_id": "admin",
"description": "Allow to execute administration operation",
"type": "ADMINISTRATION",
+ "cloud": "AZURE",
"pages": [
"environment/*",
"/api/infrastructure/backup",
diff --git a/services/self-service/src/main/resources/mongo/gcp/mongo_roles.json b/services/self-service/src/main/resources/mongo/gcp/mongo_roles.json
index d3c22ba..8098628 100644
--- a/services/self-service/src/main/resources/mongo/gcp/mongo_roles.json
+++ b/services/self-service/src/main/resources/mongo/gcp/mongo_roles.json
@@ -3,6 +3,7 @@
"_id": "nbShapes_n1-highcpu-2_fetching",
"description": "Use n1-highcpu-2 instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "GCP",
"exploratory_shapes": [
"n1-highcpu-2"
],
@@ -14,6 +15,7 @@
"_id": "nbShapes_n1-highcpu-8_fetching",
"description": "Use n1-highcpu-8 instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "GCP",
"exploratory_shapes": [
"n1-highcpu-8"
],
@@ -25,6 +27,7 @@
"_id": "nbShapes_n1-highcpu-32_fetching",
"description": "Use n1-highcpu-32 instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "GCP",
"exploratory_shapes": [
"n1-highcpu-32"
],
@@ -36,6 +39,7 @@
"_id": "nbShapes_n1-highmem-4_fetching",
"description": "Use n1-highmem-4 instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "GCP",
"exploratory_shapes": [
"n1-highmem-4"
],
@@ -47,6 +51,7 @@
"_id": "nbShapes_n1-highmem-16_fetching",
"description": "Use n1-highmem-16 instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "GCP",
"exploratory_shapes": [
"n1-highmem-16"
],
@@ -58,6 +63,7 @@
"_id": "nbShapes_n1-highmem-32_fetching",
"description": "Use n1-highmem-32 instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "GCP",
"exploratory_shapes": [
"n1-highmem-32"
],
@@ -69,6 +75,7 @@
"_id": "nbShapes_n1-standard-2_fetching",
"description": "Use n1-standard-2 instance shape for notebook",
"type": "NOTEBOOK_SHAPE",
+ "cloud": "GCP",
"exploratory_shapes": [
"n1-standard-2"
],
@@ -80,6 +87,7 @@
"_id": "nbCreateDeeplearning",
"description": "Create Notebook Deep Learning",
"type": "NOTEBOOK",
+ "cloud": "GCP",
"exploratories": [
"docker.dlab-deeplearning"
],
@@ -91,6 +99,7 @@
"_id": "nbCreateJupyter",
"description": "Create Notebook Jupyter",
"type": "NOTEBOOK",
+ "cloud": "GCP",
"exploratories": [
"docker.dlab-jupyter"
],
@@ -102,6 +111,7 @@
"_id": "nbCreateJupyterLab",
"description": "Create Notebook JupyterLab",
"type": "NOTEBOOK",
+ "cloud": "GCP",
"exploratories": [
"docker.dlab-jupyterlab"
],
@@ -113,6 +123,7 @@
"_id": "nbCreateSuperset",
"description": "Create Notebook Superset",
"type": "NOTEBOOK",
+ "cloud": "GCP",
"exploratories": [
"docker.dlab-superset"
],
@@ -124,6 +135,7 @@
"_id": "nbCreateRstudio",
"description": "Create Notebook RStudio",
"type": "NOTEBOOK",
+ "cloud": "GCP",
"exploratories": [
"docker.dlab-rstudio"
],
@@ -135,6 +147,7 @@
"_id": "nbCreateTensor",
"description": "Create Notebook Jupyter with TensorFlow",
"type": "NOTEBOOK",
+ "cloud": "GCP",
"exploratories": [
"docker.dlab-tensor"
],
@@ -146,6 +159,7 @@
"_id": "nbCreateTensorRstudio",
"description": "Create Notebook RStudio with TensorFlow",
"type": "NOTEBOOK",
+ "cloud": "GCP",
"exploratories": [
"docker.dlab-tensor-rstudio"
],
@@ -157,6 +171,7 @@
"_id": "nbCreateZeppelin",
"description": "Create Notebook Apache Zeppelin",
"type": "NOTEBOOK",
+ "cloud": "GCP",
"exploratories": [
"docker.dlab-zeppelin"
],
@@ -168,6 +183,7 @@
"_id": "nbCreateDataEngine",
"description": "Create Data Engine",
"type": "COMPUTATIONAL",
+ "cloud": "GCP",
"computationals": [
"docker.dlab-dataengine"
],
@@ -179,6 +195,7 @@
"_id": "nbCreateDataEngineService",
"description": "Create Data Engine Service",
"type": "COMPUTATIONAL",
+ "cloud": "GCP",
"computationals": [
"docker.dlab-dataengine-service"
],
@@ -190,6 +207,7 @@
"_id": "compShapes_n1-standard-2_fetching",
"description": "Use n1-standard-2 instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "GCP",
"computational_shapes": [
"n1-standard-2"
],
@@ -201,6 +219,7 @@
"_id": "compShapes_n1-highmem-4_fetching",
"description": "Use n1-highmem-4 instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "GCP",
"computational_shapes": [
"n1-highmem-4"
],
@@ -212,6 +231,7 @@
"_id": "compShapes_n1-highmem-16_fetching",
"description": "Use n1-highmem-16 instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "GCP",
"computational_shapes": [
"n1-highmem-16"
],
@@ -223,6 +243,7 @@
"_id": "compShapes_n1-highmem-32_fetching",
"description": "Use n1-highmem-32 instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "GCP",
"computational_shapes": [
"n1-highmem-32"
],
@@ -234,6 +255,7 @@
"_id": "compShapes_n1-highcpu-8_fetching",
"description": "Use n1-highcpu-8 instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "GCP",
"computational_shapes": [
"n1-highcpu-8"
],
@@ -245,6 +267,7 @@
"_id": "compShapes_n1-highcpu-2_fetching",
"description": "Use n1-highcpu-2 instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "GCP",
"computational_shapes": [
"n1-highcpu-2"
],
@@ -256,6 +279,7 @@
"_id": "compShapes_n1-highcpu-32_fetching",
"description": "Use n1-highcpu-32 instance shape for cluster",
"type": "COMPUTATIONAL_SHAPE",
+ "cloud": "GCP",
"computational_shapes": [
"n1-highcpu-32"
],
@@ -267,6 +291,7 @@
"_id": "nbBillingReportFull",
"description": "View full billing report for all users",
"type": "BILLING",
+ "cloud": "GCP",
"pages": [
"/api/infrastructure_provision/billing"
],
@@ -278,6 +303,7 @@
"_id": "admin",
"description": "Allow to execute administration operation",
"type": "ADMINISTRATION",
+ "cloud": "GCP",
"pages": [
"environment/*",
"/api/infrastructure/backup",
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
index 11cd9ca..19ab0ed 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
@@ -75,10 +75,11 @@ export class RolesComponent implements OnInit {
(roles: any) => {
this.roles = roles;
this.rolesList = roles.map((role, index) => {
- return {role: role.description, type: role.type};
- })
+ return {role: role.description, type: role.type, cloud: role.cloud};
+ });
+ this.rolesList = this.rolesList.sort((a, b) => (a.cloud > b.cloud) ? 1 : ((b.cloud > a.cloud) ? -1 : 0));
this.rolesList = this.rolesList.sort((a, b) => (a.type > b.type) ? 1 : ((b.type > a.type) ? -1 : 0));
- this.updateGroupData(groups);
+ this.updateGroupData(groups);
this.stepperView = false;
},
@@ -209,7 +210,7 @@ export class RolesComponent implements OnInit {
return v;
}).sort((a, b) => (a.group > b.group) ? 1 : ((b.group > a.group) ? -1 : 0));
this.groupsData.forEach(item => {
- item.selected_roles = item.roles.map(role => ({role: role.description, type: role.type}));
+ item.selected_roles = item.roles.map(role => ({role: role.description, type: role.type, cloud: role.cloud}));
});
this.getGroupsListCopy();
}
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
index ac698a7..121188e 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
@@ -566,12 +566,6 @@ export class ApplicationServiceFacade {
null);
}
- public buildDeleteProject(param): Observable<any> {
- return this.buildRequest(HTTPMethod.DELETE,
- this.requestRegistry.Item(ApplicationServiceFacade.PROJECT) + param,
- null);
- }
-
public buildToggleProjectStatus(param, data): Observable<any> {
return this.buildRequest(HTTPMethod.POST,
this.requestRegistry.Item(ApplicationServiceFacade.PROJECT) + param,
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/project.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/project.service.ts
index 805c8e8..0bb54b5 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/project.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/project.service.ts
@@ -70,15 +70,6 @@ export class ProjectService {
catchError(ErrorUtils.handleServiceError));
}
- public deleteProject(data): Observable<{}> {
- const url = `/${data}`;
- return this.applicationServiceFacade
- .buildDeleteProject(url)
- .pipe(
- map(response => response),
- catchError(ErrorUtils.handleServiceError));
- }
-
public toggleProjectStatus(data, action): Observable<{}> {
const url = `/${action}`;
return this.applicationServiceFacade
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.html b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.html
index f6b52da..4e41606 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.html
@@ -49,7 +49,7 @@
</a>
</li>
- <li class="role-item" role="presentation" *ngIf="model && isOpenCategory[item.type]" >
+ <li class="role-item" role="presentation" *ngIf="model && isOpenCategory[item.type] && item.type !== 'COMPUTATIONAL_SHAPE' && item.type !== 'NOTEBOOK_SHAPE'" >
<a href="#" class="list-item" role="menuitem" (click)="toggleSelectedOptions($event, model, item)">
<span class="empty-checkbox" [ngClass]="{'checked': checkInModel(item.role)}">
<span class="checked-checkbox" *ngIf="checkInModel(item.role)"></span>
@@ -57,6 +57,30 @@
{{item.role}}
</a>
</li>
+ <li class="role-item" role="presentation" (click)="toggleItemsForCloud(item.type + item.cloud, $event)"
+ *ngIf="model && isOpenCategory[item.type] && item.type === 'COMPUTATIONAL_SHAPE' && item.cloud !== items[i - 1].cloud
+ || model && isOpenCategory[item.type] && item.type === 'NOTEBOOK_SHAPE' && item.type !== items[i - 1].type
+ || model && isOpenCategory[item.type] && item.type === 'NOTEBOOK_SHAPE' && item.cloud !== items[i - 1].cloud
+ || model && isOpenCategory[item.type] && item.type === 'COMPUTATIONAL_SHAPE' && item.type !== items[i - 1].type"
+ >
+ <a href="#" class="list-item" role="menuitem">
+ <span class="arrow" [ngClass]="{'rotate-arrow': isCloudOpen[item.type + item.cloud], 'arrow-checked': selectedAllInCloud(item.type, item.cloud) || selectedSomeInCloud(item.type, item.cloud)}"></span>
+ <span class="empty-checkbox" [ngClass]="{'checked': selectedAllInCloud(item.type, item.cloud) || selectedSomeInCloud(item.type, item.cloud)}" (click)="toggleSelectedCloud($event, model, item.type, item.cloud);$event.stopPropagation()" >
+ <span class="checked-checkbox" *ngIf="selectedAllInCloud(item.type, item.cloud)"></span>
+ <span class="line-checkbox" *ngIf="selectedSomeInCloud(item.type, item.cloud)"></span>
+ </span>
+ {{item.cloud || 'AWS'}}
+ </a>
+ </li>
+ <li class="role-cloud-item" role="presentation" *ngIf="model && isCloudOpen[item.type + item.cloud] && isOpenCategory[item.type]" >
+ <a href="#" class="list-item" role="menuitem" (click)="toggleSelectedOptions($event, model, item)">
+ <span class="empty-checkbox" [ngClass]="{'checked': checkInModel(item.role)}">
+ <span class="checked-checkbox" *ngIf="checkInModel(item.role)"></span>
+ </span>
+ {{item.role}}
+ </a>
+ </li>
+
</ng-template>
<li *ngIf="items?.length == 0">
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.scss b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.scss
index 00d9a80..5323a24 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.scss
@@ -117,7 +117,9 @@
.role-item{
padding-left: 30px;
}
-
+ .role-cloud-item{
+ padding-left: 60px;
+ }
}
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.ts b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.ts
index 7d160fb..cabf7d9 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.ts
@@ -35,6 +35,10 @@ export class MultiLevelSelectDropdownComponent {
public isOpenCategory = {
};
+ public isCloudOpen = {
+
+ };
+
public labels = {
COMPUTATIONAL_SHAPE: 'Compute shapes',
NOTEBOOK_SHAPE: 'Notebook shapes',
@@ -57,8 +61,21 @@ export class MultiLevelSelectDropdownComponent {
this.onUpdate($event);
}
- selectAllOptions($event) {
+ toggleSelectedCloud($event, model, category, cloud) {
+ $event.preventDefault();
+ const categoryItems = this.items.filter(role => role.type === category && role.cloud === cloud);
+ this.selectedAllInCloud(category, cloud) ? this.model = this.model.filter(role => {
+ if (role.type === category && role.cloud === cloud) {
+ return false;
+ }
+ return true;
+ }) : categoryItems.forEach(role => {
+ if (!model.filter(mod => mod.role === role.role).length) {this.model.push(role); }
+ });
+ this.onUpdate($event);
+ }
+ selectAllOptions($event) {
$event.preventDefault();
this.model = [...this.items];
this.onUpdate($event);
@@ -77,6 +94,14 @@ export class MultiLevelSelectDropdownComponent {
public toggleItemsForLable(label, $event) {
this.isOpenCategory[label] = !this.isOpenCategory[label];
+ this.isCloudOpen[label + 'AWS'] = false;
+ this.isCloudOpen[label + 'GCP'] = false;
+ this.isCloudOpen[label + 'AZURE'] = false;
+ $event.preventDefault();
+ }
+
+ public toggleItemsForCloud(label, $event) {
+ this.isCloudOpen[label] = !this.isCloudOpen[label];
$event.preventDefault();
}
@@ -92,6 +117,18 @@ export class MultiLevelSelectDropdownComponent {
return selected.length && selected.length !== categoryItems.length;
}
+ public selectedAllInCloud(category, cloud) {
+ const selected = this.model.filter(role => role.type === category && role.cloud === cloud);
+ const categoryItems = this.items.filter(role => role.type === category && role.cloud === cloud);
+ return selected.length === categoryItems.length;
+ }
+
+ public selectedSomeInCloud(category, cloud) {
+ const selected = this.model.filter(role => role.type === category && role.cloud === cloud);
+ const categoryItems = this.items.filter(role => role.type === category && role.cloud === cloud);
+ return selected.length && selected.length !== categoryItems.length;
+ }
+
public checkInModel(item) {
return this.model.filter(v => v.role === item).length;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org