Initial OpenECOMP policy/engine commit
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / WEB-INF / jsp / login_external.jsp
1 <%--
2   ================================================================================
3   eCOMP Portal SDK
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 <c:set var="title" value="Login" />
25 <c:set var="isMobileEnabled"
26         value="<%=(SystemProperties.getProperty(SystemProperties.MOBILE_ENABLE)!= null && SystemProperties.getProperty(SystemProperties.MOBILE_ENABLE).trim().equals(\"true\"))%>" />
27
28 <!DOCTYPE html>
29 <html ng-app="abs">
30         <head>
31
32             <title>
33               Login
34         </title>
35                 <meta charset="utf-8">
36                 <meta http-equiv="X-UA-Compatible" content="IE=edge">
37                 <meta name="viewport" content="width=device-width, initial-scale=1"> 
38         <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
39                 <link rel="stylesheet" type="text/css" href="app/fusion/external/ebz/fn-ebz.css" >
40         <link rel="stylesheet" type="text/css" href="static/fusion/css/jquery-ui.css">
41                 <script src="static/js/jquery-1.10.2.js" type="text/javascript"></script>
42                 <script src= "app/fusion/external/ebz/angular_js/angular.js"></script> 
43                 <script src="app/fusion/external/ebz/angular_js/angular-route.min.js"></script>
44                 <script src= "app/fusion/external/ebz/angular_js/angular-sanitize.js"></script>
45                 <script src= "app/fusion/external/ebz/angular_js/angular-cookies.js"></script>
46                 <script src= "app/fusion/external/ebz/sandbox/att-abs-tpls.js" type="text/javascript"></script>
47                 <script src="static/fusion/js/att_angular_gridster/ui-gridster-tpls.js"></script>
48                 <script src="static/fusion/js/att_angular_gridster/angular-gridster.js"></script>       
49                 <script src= "app/fusion/external/ebz/angular_js/checklist-model.js"></script>
50                 <script src= "app/fusion/external/ebz/angular_js/app.js"></script>
51                 <script src= "app/fusion/external/ebz/angular_js/gestures.js"></script>
52                 <script src="static/js/modalService.js"></script>
53                 <script src="app/fusion/external/angular-ui/ui-bootstrap-tpls-1.1.2.min.js"></script>
54         
55                 <style>
56                 .terms {
57                         font-family: Verdana,Arial,Helvetica, sans-serif;
58                         font-size: 9px;
59                 }
60                 
61                 </style>
62         </head>
63         <body style="padding-top: 15px;">
64         <div ng-controller="externalLoginController">
65                 <div class="centered style="-webkit-transform: translateZ(0);background:white, z-index:0;">
66                         <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>
67                         <br/>
68                         <div align="center" style="margin-left:auto;margin-right:auto;width:40%;padding:6px;opacity:0.7;background-color:white">
69                         <img src="static/fusion/images/ecomp_trans.png"/>
70                                 <h2> ECOMP Portal </h2>
71                                 <label>
72                                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label class="form-field__label">Login ID:</label>
73                                 </label>
74                                 <input  type="text" class="fn-ebz-text" ng-model="loginId" style="width: 140px;height:25px;border-radius:7px;font-size:18px;padding-left:5px;"
75                                         maxlength="30" />
76                                 <br/>
77                                 <br/>
78                                 <label >&nbsp;Password:</label>
79                                 <input type="password" class="span3" ng-model="password" style="width: 140px;height:25px;border-radius:7px;font-size:18px;padding-left:5px;"
80                                         maxlength="30" onkeydown="if (event.keyCode == 13) document.getElementById('loginBtn').click()"/> 
81                                 <br />
82                                 <br />
83                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
84                                 <input id="loginBtn" type="image" ng-click="loginExternal();" src="static/fusion/images/login_button.gif" alt="Login" />
85                                 <br>
86                         </div>
87                 </div>
88                 <br/><br/><br/><br/><br/><br/><br/>
89                 <div id="footer">
90                 </div>
91     </div>
92     </body>
93 <script>
94 app.controller("externalLoginController", function ($scope) { 
95         // Table Data
96         
97         $scope.viewPerPage = 200;
98         $scope.currentPage = 2;
99         $scope.totalPage;
100         $scope.searchCategory = "";
101         $scope.searchString = "";
102         $scope.loginId="";
103         $scope.password="";
104         $scope.loginError=true;
105         $scope.viewPerPage = 200;
106         $scope.currentPage = 2;
107         $scope.totalPage;
108         $scope.searchCategory = "";
109         $scope.searchString = "";
110         $scope.loginId="";
111         $scope.password="";
112         
113         
114         $scope.loginExternal = function() {
115                 
116                 $.ajax({
117                     url: "login_external/login?"+"loginId="+$scope.loginId+"&password="+$scope.password,
118                 type : "POST",
119                 success:function (response){
120                   if(response=="success"){
121                     window.location.href = 'welcome.htm';
122                   }else{
123                         $("#errorInfo").show();
124                   }
125                 },
126                 error:function( jqXHR, status,error ){
127                         $("#errorInfo").show();
128                 }
129                 
130         });
131
132     };
133         
134         
135         /**
136         $scope.loginExternal = function() {
137
138         
139                   var redirectUrl = "login_external/login";
140           var form = $('<form action="' + redirectUrl + '" method="post">' +
141                   '<input type="hidden" name="loginId" value='+$scope.loginId+' />' +
142                   '<input type="hidden" name="password" value='+$scope.password+' />' +
143                   '</form>');
144                   
145                   $('body').append(form);
146                   $(form).submit();
147          
148
149     };
150     */
151         
152 });
153 </script>
154 </html>