diff options
author | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2019-04-16 11:20:38 +0900 |
---|---|---|
committer | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2019-05-13 17:50:04 +0900 |
commit | 3b55d06b89bf64873e685c3d78fce5affbba3d17 (patch) | |
tree | 2adcff0087f4757107d2bf1e50c85ea649f04f94 /warehouse/src/main/webapp/WEB-INF/pages/appDev |
Add warehouse server source code.icefish_8.99.5icefish_8.99.4icefish_8.99.3icefish_8.99.2icefish_8.99.1icefish/8.99.5icefish/8.99.4icefish/8.99.3icefish/8.99.2icefish/8.99.1halibut_8.0.6halibut_8.0.5halibut_8.0.4halibut_8.0.3halibut_8.0.2halibut_8.0.1halibut_8.0.0halibut_7.99.3halibut_7.99.2halibut_7.99.1halibut/8.0.6halibut/8.0.5halibut/8.0.4halibut/8.0.3halibut/8.0.2halibut/8.0.1halibut/8.0.0halibut/7.99.3halibut/7.99.2halibut/7.99.18.99.58.99.48.99.38.99.28.99.18.0.68.0.58.0.48.0.38.0.28.0.18.0.07.99.37.99.27.99.1halibut
[Patch Set 2] Add ReadMe.md
Change-Id: I6ade52d2490f5ca4ba107c1a27ed6d5b39048725
Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
Diffstat (limited to 'warehouse/src/main/webapp/WEB-INF/pages/appDev')
4 files changed, 502 insertions, 0 deletions
diff --git a/warehouse/src/main/webapp/WEB-INF/pages/appDev/detailDev.jsp b/warehouse/src/main/webapp/WEB-INF/pages/appDev/detailDev.jsp new file mode 100644 index 0000000..3f7928d --- /dev/null +++ b/warehouse/src/main/webapp/WEB-INF/pages/appDev/detailDev.jsp @@ -0,0 +1,87 @@ +<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<% +String path = request.getContextPath(); +String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path; +%> +<!-- navigationDialog dialog --> +<%-- <jsp:include page="../navigationDialog.jsp" flush="true"></jsp:include> --%> +<c:choose> + <c:when test="${not empty modelErrors}"> + <div class="alert alert-danger" id="modalErrorArea" role="alert"> + ${modelErrors} + </div> + </c:when> + <c:otherwise> + <div id="page-content" class="index-page container" style="BACKGROUND-COLOR: transparent;color:white"> + <div class="row" id="appHeight"> + <div class="col-md-12 col-md-offset-12"> + <div id="main-content"> + <article> + <div class="art-content" style="min-height:480px;height:100%;width:auto;margin-left:45px;margin-right:45px;word-break: break-all; word-wrap:break-word;"> + <input id="t_typeId" type="hidden" value="${appInfo.typeId}"> + <input id="t_appId" type="hidden" value="${appInfo.appId}"> + <input id="t_filePath" type="hidden" value="${appInfo.verFilePath}"> + <input id="iconPath" type="hidden" value="${appInfo.imagePath}"> + <div style="display:none"> + <input id="t_developer" type="text" value="${appInfo.developer}"> + </div> + + <h2 style="color:white;">${appInfo.appName}</h2> + <table> + <tr> + <td rowspan="3" valign="top" style="width:130px"><img id="imagePath" src="${appInfo.imagePath}" style="width:120px;height:120px"/></td> + <td>By ${appInfo.developerName} ${date}<br>${appInfo.versionName}<br>${appInfo.typeName}<br>${appInfo.appDeviceTypeName}<br></td> + </tr> + <tr><td></td></tr> + <tr><td></td></tr> + </table> + <div id="appAbstract" class="col-md-12" style="margin-left:-15px">${appInfo.appAbstract}</div><br> + <div style="color:#ADADAD; margin: 0px 0px 10px 0px;">MD5:<a>${appInfo.hashcode}</a></div> + <c:choose> + <c:when test="${appStatus == 0}"> + <button class="btn btn-skin size" type="button" style="width:190px;padding-left:0px;padding-right:0px;" onclick="doDownload(this, '${appInfo.appId}','${appInfo.typeId}','${appInfo.verFilePath}')">install</button> + </c:when> + <c:when test="${appStatus == 1}"> + <button class="btn btn-skin size" type="button" style="width:190px;padding-left:0px;padding-right:0px;" onclick="launchApp('${localApp.id}')">launch</button> + </c:when> + <c:when test="${appStatus == 2}"> + <button class="btn btn-skin size" type="button" style="width:190px;padding-left:0px;padding-right:0px;" onclick="onclick=updateApp(this,'${appInfo.appId}','${appInfo.typeId}','${appInfo.verFilePath}','${localApp.id}')">update</button> + </c:when> + </c:choose> + <a href="javascript:void(0);" onclick="backToPrePage('${isListDev}')"><button type="button" class="btn btn-skin size" style="width:190px;">Back</button></a> + </div> + + </div> + </article> + </div> + </div> + <div style="height:28px"></div> + </div> + </c:otherwise> +</c:choose> +<script src="<%=basePath%>/js/constant.js"></script> +<script> +$(function() { + $("#appHeight").height($(document).height()-250); + $("#page-content").css("background-image","url(<%=basePath%>/image/AGL_HMI_Blue_Background_Car-01.png)"); + if($('#iconPath').val() == ''){ + $('#imagePath').attr("src",'<%=basePath%>/image/defaultAppIcon.png'); + } + // TODO DJ 暂时放置,等上传功能好用之后再对应,猜想textarea上传后,数据库会把回车空格之类的给替换掉。 + var abstractSubStr = document.getElementById("appAbstract").innerHTML; + var reg=new RegExp("\r\n","g"); + var reg1=new RegExp("\n","g"); + var abstractSubStr= abstractSubStr.replace(reg,"<br>"); + abstractSubStr= abstractSubStr.replace(reg1,"<br>"); + document.getElementById("appAbstract").innerHTML = abstractSubStr; +}); + +function backToPrePage(isListDev){ + if("true" == isListDev){ + Commons.showContent('<%=basePath%>/appDev'); + }else if("false" == isListDev){ + Commons.showContent('<%=basePath%>/appDev/SearchDev'); + } +} +</script>
\ No newline at end of file diff --git a/warehouse/src/main/webapp/WEB-INF/pages/appDev/listDev.jsp b/warehouse/src/main/webapp/WEB-INF/pages/appDev/listDev.jsp new file mode 100644 index 0000000..b815dbf --- /dev/null +++ b/warehouse/src/main/webapp/WEB-INF/pages/appDev/listDev.jsp @@ -0,0 +1,85 @@ +<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<% +String path = request.getContextPath(); +String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path; +%> +<style type="text/css"> +div.dataTables_wrapper div.dataTables_info { + padding-top: 0.3em; + white-space: nowrap; + margin-left: 120px; +} + +a.page-link { + height: calc(1.8125rem + 4px); + margin-left: -5px; +} + +</style> +<c:choose> + <c:when test="${not empty modelErrors}"> + <div class="alert alert-danger" id="modalErrorArea" role="alert"> + ${modelErrors} + </div> + </c:when> + <c:otherwise> + <div class="card mb-3" style="BACKGROUND-COLOR: transparent;color:white"> + <div class="container" role="alert" style="display:none"> + <div class="row" > + <div class="input-group"> + <input type="text" class="form-control size" id="t_keyWord" name="t_keyWord" value="" placeholder="please input keywords" style="height:50px;BACKGROUND-COLOR: transparent;color:white"> + <button class="input-group-addon fa fa-search" id="btn-save-edit" style="font-size:30px;color:green;height:50px;BACKGROUND-COLOR: transparent;" onclick="$table.DataTable().ajax.reload();"></button> + </div> + </div> + </div> + <div class="card-header" style="display:none"> + <input type="text" class="form-control" id="t_filePath" size="16" name="t_filePath" style="display:none;"> + <div style="overflow-x:scroll;white-space:nowrap;height:70px;"> + <c:forEach var="list" items="${appDeviceTypeList}"> + <label class="btn btn-skin col-md-4 button-size" style="overflow:hidden;color:white" onclick="deviceTypeButton(${list.value})"><input style="display:none;" type="radio" name="deviceType" >${list.label}</label> + </c:forEach> + </div><br> + <div id="appType" style="color:gray;overflow-x:scroll;white-space:nowrap;height:70px;display:none;"> + <c:forEach var="list" items="${appTypeList}"> + <label class="btn btn-skin col-md-4 button-size" style="overflow:hidden;color:white" onclick="TypeButton(${list.value})"><input style="display:none;" type="radio" name="appType" >${list.label}</label> + </c:forEach> + </div> + </div> + <div class="card-body"> + <div id="appHeight" style="overflow-x:hidden;" class="test1"> + <table id="example" cellspacing="0" style="width:100%;"> + <thead style="display:none"> + <tr><hr> + <th>No.</th> + <th>App Name</th> + <th>Developer</th> + <th>TypeId</th> + <th id="textarea">App Abstract</th> + <th>Manipulation</th> + </tr> + </thead> + </table> + </div> + </div> + </div> + </c:otherwise> +</c:choose> +<script src="<%=basePath%>/js/common.js"></script> +<script> +$(function() { + $("#appHeight").height($(document).height()-250); + $("#page-content").css("background-image","url(<%=basePath%>/image/AGL_HMI_Blue_Background_Car-01.png)"); + Commons.bindDateControl(); + Commons.appendRedAsterisk(); + + initData(true); +}); + +var deviceTypeId = ""; +var TypeId = ""; +var $table = $('#example'); +var $errorArea = $('#modalErrorArea'); + +</script>
\ No newline at end of file diff --git a/warehouse/src/main/webapp/WEB-INF/pages/appDev/localListDev.jsp b/warehouse/src/main/webapp/WEB-INF/pages/appDev/localListDev.jsp new file mode 100644 index 0000000..bafa8f8 --- /dev/null +++ b/warehouse/src/main/webapp/WEB-INF/pages/appDev/localListDev.jsp @@ -0,0 +1,175 @@ +<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<% +String path = request.getContextPath(); +String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path; +%> +<style type="text/css"> + a.page-link{height:calc(1.8125rem + 4px);margin-left:-5px;} + .div{font-size:18px; color:#000;line-height:24px;white-space:nowrap;text-overflow:ellipsis;word-break:break-all;overflow:hidden;} + .item,.carousel-caption{ + width: 100%; + height: 300px; + } + .carousel-caption{ + left: 0; + top: 0; + padding: 0; + } +</style> +<c:choose> + <c:when test="${not empty modelErrors}"> + <div class="alert alert-danger" id="modalErrorArea" role="alert"> + ${modelErrors}</div> + </c:when> + <c:otherwise> + <div class="card mb-3" + style="BACKGROUND-COLOR: transparent; color: white"> + <div class="card-body"> + <div id="appHeight" style="overflow-x: hidden;" class="test1"> + <div> + <hr> + <div id="localList" style="padding-left: 15px; padding-right: 15px;"></div> + </div> + </div> + </div> + </div> + </c:otherwise> +</c:choose> +<script> +$(function() { + $("#appHeight").height($(document).height()-250); + $("#page-content").css("background-image","url(<%=basePath%>/image/AGL_HMI_Blue_Background_Car-01.png)"); + Commons.bindDateControl(); + Commons.appendRedAsterisk(); + + initLocalData(); +}); + +var $errorArea = $('#modalErrorArea'); + +function initLocalData(){ + debugger; + console.log("localapp" + "initLocalData"); + this.listReplyok = this.listReplyok.bind(this); + aglSocket.listInstalledApps(initLocalDataReplyok, initLocalDatareplyerr); +}; + +function initLocalDataReplyok(obj){ + debugger; + console.log("localapp" + "listReplyok\n"); + var appListStr = obj["response"]; + checkLocalUpdate(appListStr); + console.log(appListStr); +}; + +function initLocalDatareplyerr(obj){ + debugger; + alert("get local app failed"); +}; + +function checkLocalUpdate(appListStr){ + debugger; + $.ajax({ + url:"<%=basePath%>/appDev/CheckUpdateInfoDev", + type: "POST", + dataType: "json", + contentType:"application/json;charset=utf-8", + data: JSON.stringify(appListStr), + success:function(data){ + debugger; + initTable(data,appListStr); + } + }) +}; + +/* +author:"↵ Loïc Collignon <loic.collignon@iot.bzh>↵ Matt Porter <mporter@konsulko.com>↵ " +author-email:"info@automotivelinux.org" +description:"AGL Default Mixer" +height:"" +http-port:1024 +icon:"/var/local/lib/afm/applications/mixer/6.90/icon.svg" +id:"mixer@6.90" +name:"mixer" +shortname:"" +version:"6.90.0-04990a8" +width:"" +*/ +/*** + * applist: local list + * appListStr:local app package(afm-util list) + */ +function initTable(applist,appListStr){ + console.log(TAG_LOG + "applist.length" + applist.length); + for (var i = 0; i < applist.length; i++) { + var data = applist[i]; + var localdata = appListStr[i]; + var appStatusButton = ""; + +/* if(data.updateFlag){ + var appStatusButton = '<button class="btn btn-skin button-size" type="button" style="margin-right:auto;padding-left:0px;padding-right:0px;width:150px;color:white"' + +'onclick=updateApp(this,"'+data.appId+'","'+data.typeId+'","'+data.verFilePath+'","'+localdata.id+'")>update</button>' + } + else */{ + var appStatusButton = '<a href="javascript:void(0);" onclick=launchApp("'+localdata.id+'")><button class="btn btn-skin button-size" type="button" style="margin-right:auto;width:150px;color:white" >launch</button></a>'; + } + + if(data.systemApp){ + var uninstall = '<a href="javascript:void(0);"><button class="btn btn-skin button-size" type="button" style="display:none;" >uninstall</button></a>'; + } + else{ + var uninstall = '<a href="javascript:void(0);" onclick=uninstallApp("'+localdata.id+'")><button class="btn btn-skin button-size" type="button" style="margin-right:auto;width:150px;color:white" >uninstall</button></a>'; + } + + var date = null; + if(data.createDate == null){ + date = "----/--/--"; + } + else{ + date = new Date(data.createDate).format("yyyy-MM-dd"); + } + + if(data.imagePath == null){ + data.imagePath = '<%=basePath%>/image/defaultAppIcon.png'; + } + + if(data.typeName == null){ + data.typeName = "--"; + } + + var context = + '<div class="row">' + +'<div class="col-md-2" style="text-align:center;">' + +'<img style="height:auto;width:100%;" src = "'+data.imagePath+'">' + +'</div>' + + +'<div class="col-md-7">' + +'<h4 style="color:#00AEAE;">' + localdata.name + '</h3>' + +'<div class="font-size"> <strong>Version</strong>: '+ localdata.version + '</div>' + +'<p class="font-size ellipsis" style="color:white;"> <strong>Description</strong>: ' + data.appAbstract + '</p>' + +'</div>' + + +'<div class="col-md-3">' + +'<div style="float:right">'+ appStatusButton + '</div>' + +'<div style="float:right;margin-top:10px;">' + uninstall + '</div>' + +'</div>' + +'</div>' + + '<hr>'; +/* var context = '<div style="height:120px width:100%; margin-right:210px;""><div><img style="height:120px;width:120px" src = "'+data.imagePath+'"></div>' + +'<div class="margin-left"style="margin-top:-120px;"><div style="color:#00AEAE;font-size:30px;">'+localdata.name+'</div></div><div style="height:20px;"></div>' + +'<div class="font-size margin-left">'+ 'Version: ' + localdata.version +'</div>' + +'<div class="font-size margin-left" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; max-width:400px; height:50px;">'+ 'Description: ' + data.appAbstract+'</div></div>' + +'<div style="float:right; width:200px;"><div style="margin-top:-105px;">'+appStatusButton+'</div>' + +'<div style="padding-top:10px;">'+uninstall+'</div></div><hr>'; */ + $("#localList").append(context); + } +} + +function uninstallApp(appId) { + debugger; + aglSocket.uninstallApp(appId); + Commons.showContent('<%=basePath%>/appDev/localApp'); +} +</script>
\ No newline at end of file diff --git a/warehouse/src/main/webapp/WEB-INF/pages/appDev/searchDev.jsp b/warehouse/src/main/webapp/WEB-INF/pages/appDev/searchDev.jsp new file mode 100644 index 0000000..33ac523 --- /dev/null +++ b/warehouse/src/main/webapp/WEB-INF/pages/appDev/searchDev.jsp @@ -0,0 +1,155 @@ +<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<% +String path = request.getContextPath(); +String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path; +%> +<style type="text/css"> + div.dataTables_wrapper div.dataTables_info {padding-top: 0.3em;white-space: nowrap;margin-left:120px;} + a.page-link{height:calc(1.8125rem + 4px);margin-left:-5px;} + .div{font-size:18px; color:#000;line-height:24px;white-space:nowrap;text-overflow:ellipsis;word-break:break-all;overflow:hidden;} + .item,.carousel-caption{ + width: 100%; + height: 300px; + } + .carousel-caption{ + left: 0; + top: 0; + padding: 0; + } + .mask { + position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #777; + z-index: 1002; left: 0px; + opacity:0.5; -moz-opacity:0.5; + } + + </style> +<c:choose> + <c:when test="${not empty modelErrors}"> + <div class="alert alert-danger" id="modalErrorArea" role="alert"> + ${modelErrors} + </div> + </c:when> + <c:otherwise> + <div class="card mb-3" style="BACKGROUND-COLOR: transparent;color:white"> + <div class="alert alert-danger" id="modalErrorArea" role="alert" + <c:choose> + <c:when test="${not empty modelErrors}">style="display: block"</c:when> + <c:otherwise>style="display: none"</c:otherwise> + </c:choose>> + <c:if test="${not empty modelErrors}"> + ${modelErrors} + </c:if> + </div> + <div class="card-header" style="height:250px;"> + <div style="color:#00CACA;font-size:30px;">KeyWord</div><br> + <div class="row" > + <div class="input-group col-md-10"> + <input type="text" class="form-control size" id="t_keyWord" name="t_keyWord" value="" placeholder="please input keywords" style="height:50px;BACKGROUND-COLOR: transparent;color:white"> + <button id="btn-save-edit" style="color:white;height:50px;width:50px;font-size:30px;border-color:white;background:none;" onclick="clean()">X</button> + </div> + <div class="col-md-2"> + <button class="btn btn-skin button-size" id="btn-search" style="color:white;height:50px;float:right" onclick="searchApp(this);">search</button> + </div> + </div><br> + <div style="color:#00CACA;font-size:30px;">AppType</div> + <input type="text" class="form-control" id="t_filePath" size="16" name="t_filePath" style="display:none;"> + <div style="overflow-x:scroll;white-space:nowrap;height:70px;display:none"> + <c:forEach var="list" items="${appDeviceTypeList}"> + <label class="btn btn-skin col-md-4 button-size" style="overflow:hidden;color:white" onclick="deviceTypeButton(${list.value})"><input style="display:none;" type="radio" name="deviceType" >${list.label}</label> + </c:forEach> + </div><br> + <div id="appType" style="color:gray;overflow-x:scroll;white-space:nowrap;height:70px;" class="test1"> + <button id="type-btn-all" class="btn btn-skin col-md-4 button-size" style="overflow:hidden;color:white"" onclick="TypeButton(this,'');">Show All Types</button> + <c:forEach var="list" items="${appTypeList}"> + <button id="type-btn-signal" class="btn btn-skin col-md-4 button-size" style="overflow:hidden;color:white" onclick="TypeButton(this,${list.value});">${list.label}</button> + </c:forEach> + </div> + </div> + <div class="card-body"> + <div id="appHeight" style="overflow-x:hidden;" class="test1"> + <table id="example" cellspacing="0" style="width:100%;"> + <thead style="display:none"> + <tr><hr> + <th>No.</th> + <th>App Name</th> + <th>Developer</th> + <th>TypeId</th> + <th id="textarea">App Abstract</th> + <th>Manipulation</th> + </tr> + </thead> + </table> + </div> + <div style="height:20px"></div> + </div> + </div> + </c:otherwise> +</c:choose> + +<script> +$(function() { + $("#appHeight").height($(document).height()-520); + $("#page-content").css("background-image","url(<%=basePath%>/image/AGL_HMI_Blue_Background_Car-01.png)"); + Commons.bindDateControl(); + Commons.appendRedAsterisk(); +}); + +var appTypeFlag = false; +function searchApp(obj){ + debugger; + if(appTypeFlag == false){ + $("#type-btn-all").css("background-color", "#00D096"); + } + if(isInitTable == false){ + initData(false); + isInitTable = true; + }else if(isInitTable == true){ + $table.DataTable().ajax.reload(); + } +} + +//appDeviceType +var deviceTypeButton = function(deviceTypeValue){ + $("input[name='deviceType']").parent().css('background-color',''); + $('#appType')[0].style.display="block"; + $table.DataTable().ajax.reload(); + $('input:radio[name="deviceType"]:checked').parent().css('background-color','#00D096'); + deviceTypeId = deviceTypeValue; +}; + +//appType +var TypeButton = function(obj, typeValue){ + TypeId = typeValue; + debugger; + $('button[id^="type-btn-"]').css("background-color", ""); + $(obj).css("background-color", "#00D096"); + appTypeFlag = true; + searchApp(obj); +}; + +//Judge whether is the first time searched +var isInitTable = false; +var deviceTypeId = ""; +var TypeId = ""; +var $table = $('#example'); +var $errorArea = $('#modalErrorArea'); + + var strSub = function(str, subLen){ + if(str == null){ + return ""; + } + if(str.length > subLen){ + str = str.substring(0, subLen); + appAbstract = str + "..."; + return appAbstract; + } + return str; +}; + +function clean(){ + $("#t_keyWord").val(""); +} + +</script>
\ No newline at end of file |