| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- <%@ page import="java.io.File" %>
- <%@ page import="java.io.BufferedReader" %>
- <%@ page import="java.io.InputStreamReader" %>
- <%@ page import="java.io.FileInputStream" %><%-- 去掉,去掉 basePath(String),直接用 /page/ = AppC.PAGE_path。Lin
- <%@ page language="java" import="java.util.*" pageEncoding="UTF-8" isELIgnored="false"%>
- <jsp:directive.page import="java.io.*"/>
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
- %>
- --%>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <%-- 去掉,去掉 basePath(String),直接用 /page/ = AppC.PAGE_path。Lin
- <base href="<%=basePath%>">
- --%>
- <title>My JSP 'index.jsp' starting page</title>
- <meta http-equiv="pragma" content="no-cache">
- <meta http-equiv="cache-control" content="no-cache">
- <meta http-equiv="expires" content="0">
- <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
- <meta http-equiv="description" content="This is my page">
- <link href="/skin/ssdev/style.css" rel="stylesheet" type="text/css">
- <js.ss file="/ss/common.js"/> <%-- ="wd/js/common.js"。Lin --%>
- <js.ss file="/ss/jquery/jquery-1.7.2.min.js"/> <%-- ="/wd/js/jquery-1.6.2.min.js"。Lin --%>
- <js.ss file="/ss/json2.js"/> <%-- ="wd/js/json2.js"。Lin --%>
- <script type="text/javascript">
- <%-- 先去掉,用到再加 -- 去掉 "wd/apps/apps"。Lin
- <%
- wd.dev.DevConstVars.devHttpPort = request.getServerPort();
- /// 先去掉 apps 文件,用到再弄 -- 考虑改为服务。Lin
- // 输出了 request."method" 的处理程序,包括 createApp("创建应用")、saveApps("保存应用")、createDebug("创建调试")、getDebugInfo("获得调试信息")
- String appsPath = session.getServletContext().getRealPath("wd/apps/apps");
- ///
- File file = new File(appsPath);
- if(!file.exists()){
- out.write("var appInfo = [];");
- }else{
- BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8"));
- String s = "";
- String buf = "";
- while(null!=(buf=br.readLine())){
- s += buf;
- }
- if("".equals(s)){
- out.write("var appInfo = [];");
- }else{
- out.write("var appInfo = "+s+";");
- }
- }
- %>
- --%>
- /* 去掉,没用到。Lin
- function initAppSel() {
- appInfo = appInfo || [];
- var appSel = g('app');
- appSel.options.length = 0;
- for(var i = 0; i < appInfo.length; i++) {
- var item = appInfo[i];
- var name = item['name'];
- addOption(appSel, name, name);
- }
- }
- function cascadeJndiName() {
- var appName = g('app').value;
- if('' == appName) return;
- for(var i = 0; i < appInfo.length; i++) {
- var item = appInfo[i];
- var name = item['name'];
- if(name == appName) {
- var jndi = item['jndi'];
- g('defaultJndiName').value = jndi;
- break;
- }
- }
- }
- function createApp() {
- var newAppName = g('newAppName').value.trim();
- var tip = checkNull('newAppName', '应用名');
- //tip += 'WD'== newAppName.toUpperCase() ? '应用名不能为wd!\n' : '';
- tip += appNameExist(newAppName) ? '应用名:' + newAppName + '已经存在\n' : '';
- if('' != tip) {
- alert(tip);
- return;
- }
- $.ajax({
- url: "<@%=path%>/wd/apps / apps.jsp ? method = createApp ",
- type: "POST",
- dataType: "text",
- data: {
- "newAppName": newAppName
- },
- success: function(msg) {
- if('success' == msg.trim()) {
- var item = {};
- item['name'] = newAppName;
- item['jndi'] = '';
- appInfo.push(item);
- initAppSel();
- g('app').value = newAppName;
- g('app').onchange();
- alert('创建应用 ' + newAppName + ' 成功!');
- }
- }
- });
- }
- function appNameExist(appName) {
- var result = false;
- for(var i = 0; i < appInfo.length; i++) {
- var name = appInfo[i]['name'];
- if(name == appName) {
- result = true;
- break;
- }
- }
- return result;
- }
- */
- function mySubmit() {
- document.forms[0].submit();
- }
- //打开调试服务程序的窗口
- /* 去掉,没用到了 -- 没有 id="toServer"、id="toServerIP" 了。Lin
- function bindOpenDebugWindowEvent() {
- g('toServer').onclick = function() {
- var url = 'http://' + g('toServerIP').value + '/initDevParams.jsp?wd.dev.host=<@%=wd.core.common.CoreConstVars.listenIP %>& wd.dev.port =<@%=wd.dev.DevConstVars.debugPort %>';
- window.open(url);
- };
- }
- */
- function addEvent() {
- // g('createApp').onclick = createApp;
- // g('app').onchange = cascadeJndiName;
- g('loginBtn').onclick = mySubmit;
- }
- onload = function() {
- // initAppSel();
- addEvent();
- // g('app').onchange();
- /* 去掉,没用到了 -- 没有 id="toServer"、id="toServerIP" 了。Lin
- bindOpenDebugWindowEvent();
- */
- }
- </script>
- </head>
- <body leftmargin="0" topmargin="0">
- <form action="<serv.ss name='ssdevClient_login' dest='ssdev_home'/>" method="post"> <%-- ="/pmsAction.do?action=login"。Lin --%>
- <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="center" height="120">
- <table width="100%" >
- <tr>
- <td align="center" width="100%" height="20"><h1>欢迎使用 SS 开发平台</h1></td>
- </tr>
- <tr>
- <td align="center" width="100%" height="20"><div class="login">
- <table>
- <!--<tr>
- <th>应用名:</th>
- <td>
- <select id="app" name="<@%=ServiceConst.APP_NAME %>" class="login-select"></select>
- </td>
- </tr
- <tr>
- <th>默认数据库JNDI名:</th>
- <td><input id="defaultJndiName" name="<@%=ServiceConst.DEFAULT_JNDI_NAME %>" type="text" class=" login-text" id="textfield" ></td>
- </tr>-->
- <tr>
- <th>用户名</th>
- <td><input type="text" name="yhm" /></td>
- </tr>
- <tr>
- <th>密码</th>
- <td><input type="password" name="mm" /></td>
- </tr>
- <tr>
- <td colspan="2"><p>
- <input type="button" name="loginBtn" id="loginBtn" value="登录" class="edit-button">
- </p></td>
- </tr>
- </table>
- <%-- 去掉,没有 <div>。Lin
- </div>
- --%>
- </td>
- </tr>
- <!--<tr><td> </td></tr>
- <tr>
- <td align="center" width="100%" height="20">
- <div class="login">
- <table >
- <tr>
- <th>应用名:</th>
- <td><input name="newAppName" type="text" class=" login-text" id="textfield2" >
- <input type="button" name="button2" id="createApp" value="创 建" class="edit-button"></td>
- </tr>
- </table>
- </div></td>
- </tr>-->
- <tr><td> </td></tr>
- <tr>
- <!--<td align="center" width="100%" height="20">
- <div class="login">
- <table >
- <tr>
- <th>服务器地址:</th>
- <td><input name="toServerIP" type="text" class=" login-text" id="toServerIP" value="localhost:8081" >
- <input type="button" name="toServer" id="toServer" value="跳 转" class="edit-button"></td>
- </tr>
- </table>
- </div></td>-->
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <%-- 去掉,改为 <serv@ss。Lin
- <input type="hidden" name="<@%=ServiceConst.SUCCESS_PATH %>" value="/wd/base/index.jsp" />
- --%>
- </form>
- </body>
- </html>
|