nexus site path corrected
[portal.git] / ecomp-portal-BE / war / WEB-INF / jsp / login.jsp
1 <%--
2   ================================================================================
3   eCOMP Portal
4   ================================================================================
5   Copyright (C) 2017 AT&T Intellectual Property
6   ================================================================================
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10   
11        http://www.apache.org/licenses/LICENSE-2.0
12   
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18   ================================================================================
19   --%>
20 <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
21 <%@ taglib prefix="c"      uri="http://java.sun.com/jsp/jstl/core" %>
22 <%@ taglib prefix="fmt"    uri="http://java.sun.com/jsp/jstl/fmt" %>
23 <%@ page import="org.openecomp.portalsdk.core.util.SystemProperties" %>
24 <%@ page import="org.openecomp.portalapp.portal.utils.EPSystemProperties" %>
25 <c:set var="title" value="Login" />
26 <c:set var="isMobileEnabled"
27         value="<%=(SystemProperties.getProperty(SystemProperties.MOBILE_ENABLE)!= null && SystemProperties.getProperty(SystemProperties.MOBILE_ENABLE).trim().equals(\"true\"))%>" />
28
29 <!DOCTYPE html>
30 <html ng-app="abs">
31         <head>
32                 <link rel="shortcut icon" href="assets/images/1cc621d2.ecomp_logo.png">
33             <title>
34               Login
35         </title>
36                 <meta charset="utf-8">
37                 <meta http-equiv="X-UA-Compatible" content="IE=edge">
38                 <meta name="viewport" content="width=device-width, initial-scale=1"> 
39         <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
40                 <link rel="stylesheet" type="text/css" href="static/ebz/fn-ebz.css" >
41         <link rel="stylesheet" type="text/css" href="static/fusion/css/jquery-ui.css">
42                 <script src="static/js/jquery-1.10.2.js" type="text/javascript"></script>
43                 <script src= "static/ebz/angular_js/angular.js"></script> 
44                 <script src= "static/ebz/angular_js/angular-sanitize.js"></script>
45                 <script src= "static/ebz/angular_js/att_abs_tpls.js"></script>
46                 <script src= "static/ebz/angular_js/app.js"></script>
47                 <script src= "static/ebz/angular_js/gestures.js"></script>
48                 <script src="static/js/modalService.js"></script>
49                 <style>
50                         .terms {
51                                 font-family: Verdana,Arial,Helvetica, sans-serif;
52                                 font-size: 9px;
53                         }
54                 </style>
55         </head>
56         <body style="padding-top: 15px;">
57         <% 
58        String frontUrl = SystemProperties.getProperty(EPSystemProperties.FE_URL);
59     %>
60         <div ng-controller="externalLoginController">
61                 <div class="centered style="-webkit-transform: translateZ(0);background:white, z-index:0;">
62                         <div align="center" id="errorInfo" style="display:none;float:left;font-size:12px;margin-left:5px"><span style="color:red">Invaild username or password, Please try again</span></div>
63                         <br/>
64                         <div align="center" style="margin-left:auto;margin-right:auto;width:40%;padding:6px;opacity:0.7;background-color:white">
65                         <img src="static/fusion/images/ecomp-login.jpg" height="250"/>
66                                 <br>
67                                 <label>
68                                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label class="form-field__label">Login ID:</label>
69                                 </label>
70                                 <input  type="text" class="fn-ebz-text" ng-model="loginId" style="width: 140px;height:25px;border-radius:7px;font-size:18px;padding-left:5px;"
71                                         maxlength="30" />
72                                 <br/>
73                                 <br/>
74                                 <label >&nbsp;Password:</label>
75                                 <input type="password" class="span3" ng-model="password" style="width: 140px;height:25px;border-radius:7px;font-size:18px;padding-left:5px;"
76                                         maxlength="30" onkeydown="if (event.keyCode == 13) document.getElementById('loginBtn').click()"/> 
77                                 <br />
78                                 <br />
79                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
80                                 <a class="login-btn" id="loginBtn" ng-click="loginExternal();">LOGIN</a>
81                                 <br>
82                         </div>
83                 </div>
84                 <br/><br/><br/><br/><br/><br/><br/>
85     </div>
86     </body>
87 <script>
88 app.controller("externalLoginController", function ($scope) { 
89         // Table Data
90         
91         $scope.viewPerPage = 200;
92         $scope.currentPage = 2;
93         $scope.totalPage;
94         $scope.searchCategory = "";
95         $scope.searchString = "";
96         $scope.loginId="";
97         $scope.password="";
98         $scope.loginError=true;
99         $scope.viewPerPage = 200;
100         $scope.currentPage = 2;
101         $scope.totalPage;
102         $scope.searchCategory = "";
103         $scope.searchString = "";
104         $scope.loginId="";
105         $scope.password="";
106         $scope.loginUrl = "";
107         
108         $scope.loginExternal = function() {
109                 var postData={loginId:$scope.loginId,password:$scope.password};
110                 $.ajax({
111                     url: "open_source/login?",
112                 type : "POST",
113                                  dataType: 'json',
114                                  contentType: 'application/json',
115                                  data: JSON.stringify(postData),                
116                 success:function (response){
117                   if(response.success=="success"){
118                     //window.location.href = 'applicationsHome';
119                     window.location.href= "<%=frontUrl%>"
120                   }else{
121                         $("#errorInfo span").text(response);
122                         //$("#errorInfo").text = response;
123                         $("#errorInfo").show();
124                   }
125                 },
126                 error:function( jqXHR, status,error ){
127                         $("#errorInfo").show();
128                 }
129                 
130         });
131
132     };
133         /**
134         $scope.loginExternal = function() {
135
136         
137                   var redirectUrl = "login_external/login";
138           var form = $('<form action="' + redirectUrl + '" method="post">' +
139                   '<input type="hidden" name="loginId" value='+$scope.loginId+' />' +
140                   '<input type="hidden" name="password" value='+$scope.password+' />' +
141                   '</form>');
142                   
143                   $('body').append(form);
144                   $(form).submit();
145          
146
147     };
148     */  
149 });
150 </script>
151         
152 </html>