From: Naga Sugguna Date: Thu, 10 Oct 2019 03:37:08 +0000 (+0000) Subject: Merge "New container for logging" X-Git-Tag: 2.0.0~17 X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=validation.git;a=commitdiff_plain;h=49217bce754b187bf41208e6dc52112d3f2ba962;hp=ffd70629b641249429734a6831c9fefe9e73e2ae Merge "New container for logging" --- diff --git a/.coafile b/.coafile index 8ade5f5..50e636c 100644 --- a/.coafile +++ b/.coafile @@ -96,4 +96,7 @@ ignore = ui/src/main/webapp/app/fusion/**, ui/src/main/webapp/app/BluvalUI/GetLabs/GetLabs.js, ui/src/main/webapp/app/BluvalUI/GetLayers/GetLayers.js, ui/src/main/webapp/app/BluvalUI/GetTimeslots/GetTimeslots.js, - ui/src/main/webapp/app/BluvalUI/CreateUser/CreateUser.js + ui/src/main/webapp/app/BluvalUI/CreateUser/CreateUser.js, + ui/src/main/webapp/app/BluvalUI/GetUser/GetUser.js, + ui/src/main/webapp/app/BluvalUI/ResetUser/ResetUser.js, + ui/src/main/webapp/app/BluvalUI/UpdatePassword/UpdatePassword.js diff --git a/docker/README.rst b/docker/README.rst index 74f362d..6e0cc7d 100644 --- a/docker/README.rst +++ b/docker/README.rst @@ -100,12 +100,12 @@ In order for the container to be easily created, the deploy.sh script has been d CONTAINER_NAME, name of the container, default value is akraino-validation-mysql MYSQL_ROOT_PASSWORD, the desired mysql root user password, this variable is required -MYSQL_AKRAINO_PASSWORD, the desired mysql akraino user password, this variable is required +MYSQL_USER, the desired mysql user, the default value is 'akraino' +MYSQL_PASSWORD, the desired mysql user password, this variable is required REGISTRY, registry of the mysql image, default value is akraino NAME, name of the mysql image, default value is validation TAG_PRE, first part of the image version, default value is mysql TAG_VER, last part of the image version, default value is latest -MYSQL_HOST_PORT, port on which mysql is exposed on host, default value is 3307 In order to deploy the container, this script can be executed with the appropriate parameters. @@ -114,7 +114,7 @@ Example (assuming the default variables have been utilized for building the imag .. code-block:: console cd validation/docker/mysql - ./deploy.sh MYSQL_ROOT_PASSWORD=root_password MYSQL_AKRAINO_PASSWORD=akraino_password + ./deploy.sh --MYSQL_ROOT_PASSWORD root_password --MYSQL_PASSWORD akraino_password Also, in order to re-deploy the database (it is assumed that the corresponding mysql container has been stopped and deleted) while the persistent storage already exists (currently, the 'akraino-validation-mysql' docker volume is used), a different approach should be used after the image building process. @@ -125,7 +125,6 @@ REGISTRY, the registry of the mysql image, default value is akraino NAME, the name of the mysql image, default value is validation TAG_PRE, the first part of the image version, default value is mysql TAG_VER, the last part of the image version, default value is latest -MYSQL_HOST_PORT, the port on which mysql is exposed on host, default value is 3307 In order to deploy the container, this script can be executed with the appropriate parameters. @@ -162,7 +161,8 @@ In order for the container to be easily created, the deploy.sh script has been d CONTAINER_NAME, the name of the contaner, default value is akraino-validation-ui DB_IP_PORT, the IP and port of the mysql instance, this variable is required -MYSQL_AKRAINO_PASSWORD, the mysql akraino user password, this variable is required +MYSQL_USER, the mysql user, the default value is 'akraino' +MYSQL_PASSWORD, the mysql user password, this variable is required REGISTRY, the registry of the mysql image, default value is akraino NAME, the name of the mysql image, default value is validation TAG_PRE, the first part of the image version, default value is ui @@ -176,7 +176,8 @@ JENKINS_PROXY, the needed proxy in order for the Jenkins server to be reachable, CERTDIR, the directory where the SSL certificates can be found, default value is the working directory where self signed certificates exist only for demo purposes ENCRYPTION_KEY, the key that should be used by the AES algorithm for encrypting passwords stored in database, this variable is required UI_ADMIN_PASSWORD, the desired Blueprint Validation UI password for the admin user, this variable is required -UI_AKRAINO_PASSWORD, the desired Blueprint Validation UI password for the akraino user, this variable is required +TRUST_ALL, the variable that defines whether the UI should trust all certificates or not, default value is false +USE_NETWORK_HOST, the variable that defines whether the UI container should run in 'network host' mode or not, default value is "false" Note that, for a functional UI, the following prerequisites are needed: @@ -193,7 +194,7 @@ Example (assuming the default variables have been utilized for building the imag .. code-block:: console cd validation/docker/ui - ./deploy.sh DB_IP_PORT=172.17.0.3:3306 MYSQL_AKRAINO_PASSWORD=akraino_password ENCRYPTION_KEY=AGADdG4D04BKm2IxIWEr8o== UI_ADMIN_PASSWORD=admin UI_AKRAINO_PASSWORD=akraino + ./deploy.sh --DB_IP_PORT 172.17.0.3:3306 --MYSQL_PASSWORD akraino_password --ENCRYPTION_KEY AGADdG4D04BKm2IxIWEr8o== --UI_ADMIN_PASSWORD admin The kube-conformance container ============================== @@ -230,7 +231,7 @@ Example: .. code-block:: console - docker run -ti akraino/validation:kube-conformance-v1.16 + docker run -ti akraino/validation:kube-conformance-v1.15 By default, the container will run the `run_e2e.sh` script. If you want to enter the container, add */bin/sh* at the end of the command above diff --git a/docker/k8s/Dockerfile b/docker/k8s/Dockerfile index 43c6d80..925ac3d 100644 --- a/docker/k8s/Dockerfile +++ b/docker/k8s/Dockerfile @@ -19,9 +19,9 @@ FROM golang:alpine3.9 as build # Sonobuoy supports 3 Kubernetes minor versions: the current release and 2 # minor versions before. -ARG SB_TAG=v0.16.1 +ARG SB_TAG=v0.15.1 # Determine the latest stable git tag at build time based on stable major version -ARG K8S_VER=1.16 +ARG K8S_VER=1.15 # Install dependencies COPY pip-requirements.txt /wheels/requirements/pip-requirements.txt diff --git a/docker/kube-conformance/Makefile b/docker/kube-conformance/Makefile index ee7b40f..8e76e14 100644 --- a/docker/kube-conformance/Makefile +++ b/docker/kube-conformance/Makefile @@ -15,7 +15,7 @@ ############################################################################## export WORK_DIR?=$(TAG_PRE) -export KUBE_VERSION=1.16 +export KUBE_VERSION=1.15 export TAG_VER?=v$(KUBE_VERSION) .PHONY: .build diff --git a/docker/mysql/deploy.sh b/docker/mysql/deploy.sh index 4184912..ef79b13 100755 --- a/docker/mysql/deploy.sh +++ b/docker/mysql/deploy.sh @@ -23,29 +23,20 @@ DOCKER_VOLUME_NAME="akraino-validation-mysql" CONTAINER_NAME="akraino-validation-mysql" # Container input variables MYSQL_ROOT_PASSWORD="" -MYSQL_AKRAINO_PASSWORD="" +MYSQL_USER="akraino" +MYSQL_PASSWORD="" # Image data REGISTRY=akraino NAME=validation TAG_PRE=mysql TAG_VER=latest -MYSQL_HOST_PORT=3307 -for ARGUMENT in "$@" -do - KEY=$(echo $ARGUMENT | cut -f1 -d=) - VALUE=$(echo $ARGUMENT | cut -f2 -d=) - case "$KEY" in - REGISTRY) REGISTRY=${VALUE} ;; - NAME) NAME=${VALUE} ;; - TAG_VER) TAG_VER=${VALUE} ;; - TAG_PRE) TAG_PRE=${VALUE} ;; - MYSQL_ROOT_PASSWORD) MYSQL_ROOT_PASSWORD=${VALUE} ;; - MYSQL_AKRAINO_PASSWORD) MYSQL_AKRAINO_PASSWORD=${VALUE} ;; - CONTAINER_NAME) CONTAINER_NAME=${VALUE} ;; - MYSQL_HOST_PORT) MYSQL_HOST_PORT=${VALUE} ;; - *) - esac +while [ $# -gt 0 ]; do + if [[ $1 == *"--"* ]]; then + v="${1/--/}" + declare $v="$2" + fi + shift done if [ -z "$MYSQL_ROOT_PASSWORD" ] @@ -54,13 +45,13 @@ if [ -z "$MYSQL_ROOT_PASSWORD" ] exit 1 fi -if [ -z "$MYSQL_AKRAINO_PASSWORD" ] +if [ -z "$MYSQL_PASSWORD" ] then - echo "ERROR: You must specify the mysql database akraino user password" + echo "ERROR: You must specify the mysql database user password" exit 1 fi IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER" chmod 0444 "/$(pwd)/mysql.conf" -docker run --detach --name $CONTAINER_NAME --publish $MYSQL_HOST_PORT:3306 -v $DOCKER_VOLUME_NAME:/var/lib/mysql -v "/$(pwd)/mysql.conf:/etc/mysql/conf.d/my.cnf" -e MYSQL_ROOT_PASSWORD="$MYSQL_ROOT_PASSWORD" -e MYSQL_DATABASE="akraino" -e MYSQL_USER="akraino" -e MYSQL_PASSWORD="$MYSQL_AKRAINO_PASSWORD" $IMAGE +docker run --detach --name $CONTAINER_NAME -v $DOCKER_VOLUME_NAME:/var/lib/mysql -v "$(pwd)/mysql.conf:/etc/mysql/conf.d/my.cnf" -e MYSQL_ROOT_PASSWORD="$MYSQL_ROOT_PASSWORD" -e MYSQL_DATABASE="akraino_bluvalui" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" $IMAGE sleep 10 diff --git a/docker/mysql/deploy_with_existing_persistent_storage.sh b/docker/mysql/deploy_with_existing_persistent_storage.sh index bd449ec..7a52f5c 100755 --- a/docker/mysql/deploy_with_existing_persistent_storage.sh +++ b/docker/mysql/deploy_with_existing_persistent_storage.sh @@ -26,23 +26,15 @@ REGISTRY=akraino NAME=validation TAG_PRE=mysql TAG_VER=latest -MYSQL_HOST_PORT=3307 -for ARGUMENT in "$@" -do - KEY=$(echo $ARGUMENT | cut -f1 -d=) - VALUE=$(echo $ARGUMENT | cut -f2 -d=) - case "$KEY" in - REGISTRY) REGISTRY=${VALUE} ;; - NAME) NAME=${VALUE} ;; - TAG_VER) TAG_VER=${VALUE} ;; - TAG_PRE) TAG_PRE=${VALUE} ;; - CONTAINER_NAME) CONTAINER_NAME=${VALUE} ;; - MYSQL_HOST_PORT) MYSQL_HOST_PORT=${VALUE} ;; - *) - esac +while [ $# -gt 0 ]; do + if [[ $1 == *"--"* ]]; then + v="${1/--/}" + declare $v="$2" + fi + shift done IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER" -docker run --detach --name $CONTAINER_NAME --publish $MYSQL_HOST_PORT:3306 -v $DOCKER_VOLUME_NAME:/var/lib/mysql -v "/$(pwd)/mysql.conf:/etc/mysql/conf.d/my.cnf" $IMAGE +docker run --detach --name $CONTAINER_NAME -v $DOCKER_VOLUME_NAME:/var/lib/mysql -v "$(pwd)/mysql.conf:/etc/mysql/conf.d/my.cnf" $IMAGE sleep 10 diff --git a/docker/ui/deploy.sh b/docker/ui/deploy.sh index faab064..6a0d58f 100755 --- a/docker/ui/deploy.sh +++ b/docker/ui/deploy.sh @@ -24,7 +24,8 @@ NAME=validation TAG_PRE=ui TAG_VER=latest # Container input parameters -MYSQL_AKRAINO_PASSWORD="" +MYSQL_USER="akraino" +MYSQL_PASSWORD="" JENKINS_URL="https://jenkins.akraino.org/" JENKINS_USERNAME="demo" JENKINS_USER_PASSWORD="demo" @@ -35,32 +36,15 @@ JENKINS_PROXY="" CERTDIR=$(pwd) ENCRYPTION_KEY="" UI_ADMIN_PASSWORD="" -UI_AKRAINO_PASSWORD="" +TRUST_ALL="false" +USE_NETWORK_HOST="false" -for ARGUMENT in "$@" -do - KEY=$(echo $ARGUMENT | cut -f1 -d=) - VALUE=$(echo $ARGUMENT | cut -f2 -d=) - case "$KEY" in - REGISTRY) REGISTRY=${VALUE} ;; - NAME) NAME=${VALUE} ;; - TAG_PRE) TAG_PRE=${VALUE} ;; - TAG_VER) TAG_VER=${VALUE} ;; - MYSQL_AKRAINO_PASSWORD) MYSQL_AKRAINO_PASSWORD=${VALUE} ;; - JENKINS_URL) JENKINS_URL=${VALUE} ;; - JENKINS_USERNAME) JENKINS_USERNAME=${VALUE} ;; - JENKINS_USER_PASSWORD) JENKINS_USER_PASSWORD=${VALUE} ;; - JENKINS_JOB_NAME) JENKINS_JOB_NAME=${VALUE} ;; - DB_IP_PORT) DB_IP_PORT=${VALUE} ;; - CONTAINER_NAME) CONTAINER_NAME=${VALUE} ;; - NEXUS_PROXY) NEXUS_PROXY=${VALUE} ;; - JENKINS_PROXY) JENKINS_PROXY=${VALUE} ;; - CERTDIR) CERTDIR=${VALUE} ;; - ENCRYPTION_KEY) ENCRYPTION_KEY=${VALUE} ;; - UI_ADMIN_PASSWORD) UI_ADMIN_PASSWORD=${VALUE} ;; - UI_AKRAINO_PASSWORD) UI_AKRAINO_PASSWORD=${VALUE} ;; - *) - esac +while [ $# -gt 0 ]; do + if [[ $1 == *"--"* ]]; then + v="${1/--/}" + declare $v="$2" + fi + shift done if [ -z "$DB_IP_PORT" ] @@ -69,9 +53,9 @@ if [ -z "$DB_IP_PORT" ] exit 1 fi -if [ -z "$MYSQL_AKRAINO_PASSWORD" ] +if [ -z "$MYSQL_PASSWORD" ] then - echo "ERROR: You must specify the mysql akraino user password" + echo "ERROR: You must specify the mysql user password" exit 1 fi @@ -87,12 +71,13 @@ if [ -z "$UI_ADMIN_PASSWORD" ] exit 1 fi -if [ -z "$UI_AKRAINO_PASSWORD" ] - then - echo "ERROR: You must specify the UI akraino password" - exit 1 -fi +echo "Note: If there is a password already stored in database, the supplied UI_ADMIN_PASSWORD will be ignored." IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER" -docker run --detach --name $CONTAINER_NAME --network="host" -v "$(pwd)/server.xml:/usr/local/tomcat/conf/server.xml" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -v "$(pwd)/root_index.jsp:/usr/local/tomcat/webapps/ROOT/index.jsp" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_AKRAINO_PASSWORD="$MYSQL_AKRAINO_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e UI_AKRAINO_PASSWORD="$UI_AKRAINO_PASSWORD" $IMAGE +if [[ $USE_NETWORK_HOST = "true" ]] + then + docker run --detach --name $CONTAINER_NAME --network="host" -v "$(pwd)/server.xml:/usr/local/tomcat/conf/server.xml" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -v "$(pwd)/root_index.jsp:/usr/local/tomcat/webapps/ROOT/index.jsp" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE + else + docker run --detach --name $CONTAINER_NAME -v "$(pwd)/server.xml:/usr/local/tomcat/conf/server.xml" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -v "$(pwd)/root_index.jsp:/usr/local/tomcat/webapps/ROOT/index.jsp" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE +fi sleep 10 diff --git a/docker/ui/server.xml b/docker/ui/server.xml index 969d62b..801b98f 100644 --- a/docker/ui/server.xml +++ b/docker/ui/server.xml @@ -50,9 +50,14 @@ - + Define an SSL/TLS Connector on port 8443 for backwards compatibility--> + @@ -69,7 +74,7 @@ clientAuth="false" sslProtocol="TLS" />--> + redirectPort="443" /> + + + + + + + + + +Get User + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + \ No newline at end of file diff --git a/ui/src/main/webapp/app/BluvalUI/GetUser/GetUser.js b/ui/src/main/webapp/app/BluvalUI/GetUser/GetUser.js new file mode 100644 index 0000000..7cf5eb7 --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/GetUser/GetUser.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var appDS2 = angular.module("GetUser", [ 'ngRoute', 'ngMessages', + 'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap', + 'ui.bootstrap.modal', 'App.Services' ]); \ No newline at end of file diff --git a/ui/src/main/webapp/app/BluvalUI/GetUser/GetUserController.js b/ui/src/main/webapp/app/BluvalUI/GetUser/GetUserController.js new file mode 100644 index 0000000..fafcd66 --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/GetUser/GetUserController.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var app = angular.module('GetUser'); +app.controller('GetUserController', function($scope, restAPISvc) { + + initialize(); + + function initialize() { + $scope.loadingUsers = true; + $scope.userInfos = []; + restAPISvc.getRestAPI("/api/v1/user/", function(data) { + if (data) { + $scope.userInfos = data; + } else { + confirm("No users found"); + } + $scope.loadingUsers = false; + }); + } + +}); diff --git a/ui/src/main/webapp/app/BluvalUI/GetUser/GetUserTemplate.html b/ui/src/main/webapp/app/BluvalUI/GetUser/GetUserTemplate.html new file mode 100644 index 0000000..7b8176d --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/GetUser/GetUserTemplate.html @@ -0,0 +1,74 @@ + + +
+ +
+

Get User

+ +
+ +
+ +

+ + + + + + + + + + + + + + + + + +
Id Login Id First name Role(s): 
+ {{ userInfo.id }} + {{ userInfo.loginId }}{{ + userInfo.firstName }} +
    +
  • {{role.name}}
  • +
+
+
+
diff --git a/ui/src/main/webapp/app/BluvalUI/GetUser/Route.js b/ui/src/main/webapp/app/BluvalUI/GetUser/Route.js new file mode 100644 index 0000000..ff82745 --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/GetUser/Route.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +appDS2.config(function($routeProvider) { + $routeProvider.otherwise({ + templateUrl : 'app/BluvalUI/GetUser/GetUserTemplate.html', + controller : "GetUserController" + }); +}); \ No newline at end of file diff --git a/ui/src/main/webapp/app/BluvalUI/ResetUser/ResetUser.html b/ui/src/main/webapp/app/BluvalUI/ResetUser/ResetUser.html new file mode 100644 index 0000000..34573d5 --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/ResetUser/ResetUser.html @@ -0,0 +1,179 @@ + + + + + + + + + + +Reset User + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + \ No newline at end of file diff --git a/ui/src/main/webapp/app/BluvalUI/ResetUser/ResetUser.js b/ui/src/main/webapp/app/BluvalUI/ResetUser/ResetUser.js new file mode 100644 index 0000000..a716a82 --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/ResetUser/ResetUser.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var appDS2 = angular.module("ResetUser", [ 'ngRoute', 'ngMessages', + 'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap', + 'ui.bootstrap.modal', 'App.Services' ]); \ No newline at end of file diff --git a/ui/src/main/webapp/app/BluvalUI/ResetUser/ResetUserController.js b/ui/src/main/webapp/app/BluvalUI/ResetUser/ResetUserController.js new file mode 100644 index 0000000..99bbd1e --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/ResetUser/ResetUserController.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var app = angular.module('ResetUser'); +app.controller('ResetUserController', function($scope, restAPISvc) { + + initialize(); + + function initialize() { + $scope.definedLoginId = ''; + $scope.definedNewLoginPwd = ''; + } + + $scope.register = function() { + if (!$scope.definedLoginId || !$scope.definedNewLoginPwd) { + confirm("You must specify all data fields"); + return; + } + var userInfo = { + "loginId" : $scope.definedLoginId, + "loginPwd" : $scope.definedNewLoginPwd + }; + restAPISvc.postRestAPI("/api/v1/user/", userInfo, function(data) { + if (data) { + var confirmText = "The user has been reset successfully."; + confirm(confirmText); + } else { + confirm("Error when resetting the user"); + } + initialize(); + }); + } +}); diff --git a/ui/src/main/webapp/app/BluvalUI/ResetUser/ResetUserTemplate.html b/ui/src/main/webapp/app/BluvalUI/ResetUser/ResetUserTemplate.html new file mode 100644 index 0000000..a9c7dd1 --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/ResetUser/ResetUserTemplate.html @@ -0,0 +1,45 @@ + + +
+
+

Reset User

+ +
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+ +
+
+
diff --git a/ui/src/main/webapp/app/BluvalUI/ResetUser/Route.js b/ui/src/main/webapp/app/BluvalUI/ResetUser/Route.js new file mode 100644 index 0000000..fad2de0 --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/ResetUser/Route.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +appDS2.config(function($routeProvider) { + $routeProvider.otherwise({ + templateUrl : 'app/BluvalUI/ResetUser/ResetUserTemplate.html', + controller : "ResetUserController" + }); +}); \ No newline at end of file diff --git a/ui/src/main/webapp/app/BluvalUI/UpdatePassword/Route.js b/ui/src/main/webapp/app/BluvalUI/UpdatePassword/Route.js new file mode 100644 index 0000000..41fe928 --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/UpdatePassword/Route.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +appDS2 + .config(function($routeProvider) { + $routeProvider + .otherwise({ + templateUrl : 'app/BluvalUI/UpdatePassword/UpdatePasswordTemplate.html', + controller : "UpdatePasswordController" + }); + }); \ No newline at end of file diff --git a/ui/src/main/webapp/app/BluvalUI/UpdatePassword/UpdatePassword.html b/ui/src/main/webapp/app/BluvalUI/UpdatePassword/UpdatePassword.html new file mode 100644 index 0000000..a6b56e6 --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/UpdatePassword/UpdatePassword.html @@ -0,0 +1,179 @@ + + + + + + + + + + +Update Password + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + \ No newline at end of file diff --git a/ui/src/main/webapp/app/BluvalUI/UpdatePassword/UpdatePassword.js b/ui/src/main/webapp/app/BluvalUI/UpdatePassword/UpdatePassword.js new file mode 100644 index 0000000..f0d0e6b --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/UpdatePassword/UpdatePassword.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var appDS2 = angular.module("UpdatePassword", [ 'ngRoute', 'ngMessages', + 'modalServices', 'ngCookies', 'b2b.att', 'gridster', 'ui.bootstrap', + 'ui.bootstrap.modal', 'App.Services' ]); \ No newline at end of file diff --git a/ui/src/main/webapp/app/BluvalUI/UpdatePassword/UpdatePasswordController.js b/ui/src/main/webapp/app/BluvalUI/UpdatePassword/UpdatePasswordController.js new file mode 100644 index 0000000..8493b2d --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/UpdatePassword/UpdatePasswordController.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var app = angular.module('UpdatePassword'); +app + .controller( + 'UpdatePasswordController', + function($scope, restAPISvc) { + + initialize(); + + function initialize() { + $scope.definedLoginId = ''; + $scope.definedOldLoginPwd = ''; + $scope.definedNewLoginPwd = ''; + } + + $scope.register = function() { + if (!$scope.definedLoginId + || !$scope.definedOldLoginPwd + || !$scope.definedNewLoginPwd) { + confirm("You must specify all data fields"); + return; + } + var userInfo = { + "loginId" : $scope.definedLoginId, + "loginPwd" : $scope.definedOldLoginPwd + }; + var userData = { + "user" : userInfo, + "newPwd" : $scope.definedNewLoginPwd + }; + + restAPISvc + .postRestAPI( + "/api/v1/user/updatepassword", + userData, + function(data) { + if (data) { + var confirmText = "The password has been updated successfully."; + confirm(confirmText); + } else { + confirm("Error when updating the password"); + } + initialize(); + }); + } + }); diff --git a/ui/src/main/webapp/app/BluvalUI/UpdatePassword/UpdatePasswordTemplate.html b/ui/src/main/webapp/app/BluvalUI/UpdatePassword/UpdatePasswordTemplate.html new file mode 100644 index 0000000..312b3fa --- /dev/null +++ b/ui/src/main/webapp/app/BluvalUI/UpdatePassword/UpdatePasswordTemplate.html @@ -0,0 +1,53 @@ + + +
+
+

Update password

+ +
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+ +
+
+