提交 85887e83 编写于 作者: O o2null

Merge branch 'release' into 'master'

Release

See merge request o2oa/o2oa!2450
echo ready to stop server $(cd "$(dirname "$0")"; pwd)
$(cd "$(dirname "$0")"; pwd)/jvm/linux/bin/java -javaagent:$(cd "$(dirname "$0")"; pwd)/console.jar -cp $(cd "$(dirname "$0")"; pwd)/console.jar com.x.server.console.swapcommand.Exit
echo 'check server stoped wait 2s-10s'
sleep 2
PID=`ps -ef | grep "$(cd "$(dirname "$0")"; pwd)" | grep -v grep | awk '{print $2}'`
if [ "X$PID" != "X" ]
then
sleep 8
if [ "X$PID" != "X" ]
then
echo ready to kill server $PID
kill -9 $PID
fi
fi
echo 'server stoped ready to start'
$(cd "$(dirname "$0")"; pwd)/start_linux.sh
...@@ -18,10 +18,10 @@ public class CommandFactory { ...@@ -18,10 +18,10 @@ public class CommandFactory {
public static final Pattern test_pattern = Pattern.compile("^ {0,}test {0,}$", Pattern.CASE_INSENSITIVE); public static final Pattern test_pattern = Pattern.compile("^ {0,}test {0,}$", Pattern.CASE_INSENSITIVE);
//public static final Pattern create_encrypt_key_pattern = Pattern.compile("^ {0,}create encrypt key{0,}$",Pattern.CASE_INSENSITIVE); //public static final Pattern create_encrypt_key_pattern = Pattern.compile("^ {0,}create encrypt key{0,}$",Pattern.CASE_INSENSITIVE);
public static final Pattern create_encrypt_key_pattern = Pattern.compile("^ {0,}create encrypt key {0,}$", public static final Pattern create_encrypt_key_pattern = Pattern.compile("^ {0,}create encrypt key {0,}$",
Pattern.CASE_INSENSITIVE); Pattern.CASE_INSENSITIVE);
public static final Pattern start_pattern = Pattern public static final Pattern start_pattern = Pattern
.compile("^ {0,}start {0,}(data|storage|center|application|web|all|) {0,}$", Pattern.CASE_INSENSITIVE); .compile("^ {0,}start {0,}(data|storage|center|application|web|all|) {0,}$", Pattern.CASE_INSENSITIVE);
...@@ -50,6 +50,8 @@ public class CommandFactory { ...@@ -50,6 +50,8 @@ public class CommandFactory {
public static final Pattern exit_pattern = Pattern.compile("^ {0,}exit {0,}$", Pattern.CASE_INSENSITIVE); public static final Pattern exit_pattern = Pattern.compile("^ {0,}exit {0,}$", Pattern.CASE_INSENSITIVE);
public static final Pattern restart_pattern = Pattern.compile("^ {0,}restart {0,}$", Pattern.CASE_INSENSITIVE);
// public static final Pattern updateFile_pattern = Pattern.compile("^ {0,}update file (.+) (true|false) {0,}$", // public static final Pattern updateFile_pattern = Pattern.compile("^ {0,}update file (.+) (true|false) {0,}$",
// Pattern.CASE_INSENSITIVE); // Pattern.CASE_INSENSITIVE);
......
package com.x.server.console; package com.x.server.console;
import java.io.BufferedReader; import java.io.*;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.RandomAccessFile;
import java.lang.management.ManagementFactory; import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean; import java.lang.management.RuntimeMXBean;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.net.Socket;
import java.net.URL; import java.net.URL;
import java.net.URLClassLoader; import java.net.URLClassLoader;
import java.nio.MappedByteBuffer; import java.nio.MappedByteBuffer;
...@@ -19,12 +15,12 @@ import java.nio.file.Files; ...@@ -19,12 +15,12 @@ import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.nio.file.StandardOpenOption; import java.nio.file.StandardOpenOption;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import com.x.base.core.project.gson.XGsonBuilder;
import com.x.base.core.project.tools.Crypto;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.BooleanUtils;
...@@ -52,6 +48,7 @@ public class Main { ...@@ -52,6 +48,7 @@ public class Main {
private static final String MANIFEST_FILENAME = "manifest.cfg"; private static final String MANIFEST_FILENAME = "manifest.cfg";
private static final String GITIGNORE_FILENAME = ".gitignore"; private static final String GITIGNORE_FILENAME = ".gitignore";
private static final LinkedBlockingQueue<String> commandQueue = new LinkedBlockingQueue<>(); private static final LinkedBlockingQueue<String> commandQueue = new LinkedBlockingQueue<>();
private static NodeAgent nodeAgent;
private static final Thread swapCommandThread = new Thread(() -> { private static final Thread swapCommandThread = new Thread(() -> {
// 文件中的命令输出到解析器 // 文件中的命令输出到解析器
...@@ -122,7 +119,7 @@ public class Main { ...@@ -122,7 +119,7 @@ public class Main {
swapCommandThread.start(); swapCommandThread.start();
consoleCommandThread.start(); consoleCommandThread.start();
if (BooleanUtils.isTrue(Config.currentNode().nodeAgentEnable())) { if (BooleanUtils.isTrue(Config.currentNode().nodeAgentEnable())) {
NodeAgent nodeAgent = new NodeAgent(); nodeAgent = new NodeAgent();
nodeAgent.setCommandQueue(commandQueue); nodeAgent.setCommandQueue(commandQueue);
nodeAgent.setDaemon(true); nodeAgent.setDaemon(true);
nodeAgent.start(); nodeAgent.start();
...@@ -234,6 +231,12 @@ public class Main { ...@@ -234,6 +231,12 @@ public class Main {
if (matcher.find()) { if (matcher.find()) {
exit(); exit();
} }
matcher = CommandFactory.restart_pattern.matcher(cmd);
if (matcher.find()) {
restart();
continue;
}
System.out.println("unknown command:" + cmd); System.out.println("unknown command:" + cmd);
} }
// 关闭定时器 // 关闭定时器
...@@ -421,6 +424,94 @@ public class Main { ...@@ -421,6 +424,94 @@ public class Main {
System.exit(0); System.exit(0);
} }
private static void restart() {
try {
System.out.println("ready to restart...");
stopAll();
stopAllThreads();
String osName = System.getProperty("os.name");
//System.out.println("当前操作系统是:"+osName);
File file = new File(Config.base(), "start_linux.sh");
if (osName.toLowerCase().startsWith("mac")){
file = new File(Config.base(), "start_macos.sh");
}else if (osName.toLowerCase().startsWith("windows")) {
file = new File(Config.base(), "start_windows.bat");
}else if(!file.exists()) {
file = new File("start_aix.sh");
if(!file.exists()) {
file = new File("start_arm.sh");
if(!file.exists()) {
file = new File("start_mips.sh");
if(!file.exists()) {
file = new File("start_raspi.sh");
}
}
}
}
if(file.exists()) {
System.out.println("server will start in new process!");
Process ps = Runtime.getRuntime().exec(file.getAbsolutePath());
Thread.sleep(2000);
if(!Config.currentNode().autoStart()) {
for (int i = 0; i < 5; i++) {
try (Socket socket = new Socket(Config.node(), Config.currentNode().nodeAgentPort())) {
socket.setKeepAlive(true);
socket.setSoTimeout(2000);
try (DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
DataInputStream dis = new DataInputStream(socket.getInputStream())) {
Map<String, Object> commandObject = new HashMap<>();
commandObject.put("command", "command:start");
commandObject.put("credential", Crypto.rsaEncrypt("o2@", Config.publicKey()));
dos.writeUTF(XGsonBuilder.toJson(commandObject));
dos.flush();
break;
}
} catch (Exception ex) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
}
}
}
}else{
System.out.println("not support restart in current operating system!start server failure!");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
System.exit(0);
}
}
private static void stopAllThreads(){
if(swapCommandThread!=null){
try {
swapCommandThread.interrupt();
} catch (Exception e) {
}
}
if(consoleCommandThread!=null){
try {
consoleCommandThread.interrupt();
} catch (Exception e) {
}
}
if(nodeAgent!=null){
try {
nodeAgent.stopAgent();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
nodeAgent.interrupt();
nodeAgent = null;
} catch (Exception e) {
}
}
}
private static void stopAll() { private static void stopAll() {
try { try {
WebServer webServer = Config.currentNode().getWeb(); WebServer webServer = Config.currentNode().getWeb();
...@@ -466,7 +557,7 @@ public class Main { ...@@ -466,7 +557,7 @@ public class Main {
/** /**
* 检查store目录下的war文件是否全部在manifest.cfg中 * 检查store目录下的war文件是否全部在manifest.cfg中
* *
* @param base o2server的根目录 * @param base o2server的根目录
*/ */
private static void scanWar(String base) throws Exception { private static void scanWar(String base) throws Exception {
...@@ -621,4 +712,4 @@ public class Main { ...@@ -621,4 +712,4 @@ public class Main {
Files.write(path, Long.toString(pid).getBytes(), StandardOpenOption.CREATE, Files.write(path, Long.toString(pid).getBytes(), StandardOpenOption.CREATE,
StandardOpenOption.TRUNCATE_EXISTING); StandardOpenOption.TRUNCATE_EXISTING);
} }
} }
\ No newline at end of file
...@@ -92,11 +92,16 @@ public class NodeAgent extends Thread { ...@@ -92,11 +92,16 @@ public class NodeAgent extends Thread {
this.commandQueue = commandQueue; this.commandQueue = commandQueue;
} }
private volatile boolean runFlag = true;
private ServerSocket serverSocket = null;
@Override @Override
public void run() { public void run() {
try (ServerSocket serverSocket = new ServerSocket(Config.currentNode().nodeAgentPort())) { try{
serverSocket = new ServerSocket(Config.currentNode().nodeAgentPort());
Matcher matcher; Matcher matcher;
while (true) { while (runFlag) {
try (Socket socket = serverSocket.accept()) { try (Socket socket = serverSocket.accept()) {
try (DataOutputStream dos = new DataOutputStream(socket.getOutputStream()); try (DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
DataInputStream dis = new DataInputStream(socket.getInputStream())) { DataInputStream dis = new DataInputStream(socket.getInputStream())) {
...@@ -261,6 +266,24 @@ public class NodeAgent extends Thread { ...@@ -261,6 +266,24 @@ public class NodeAgent extends Thread {
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally {
if(serverSocket!=null){
try {
serverSocket.close();
} catch (IOException e) {
}
}
}
}
public void stopAgent(){
try {
this.runFlag = false;
if(serverSocket!=null) {
this.serverSocket.close();
this.serverSocket = null;
}
} catch (Exception e) {
} }
} }
......
...@@ -61,7 +61,7 @@ public class Custom extends SliceJpaObject { ...@@ -61,7 +61,7 @@ public class Custom extends SliceJpaObject {
public static final String person_FIELDNAME = "person"; public static final String person_FIELDNAME = "person";
@FieldDescribe("属性所属个人,不可为空.") @FieldDescribe("属性所属个人,不可为空.")
@Column(length = JpaObject.length_id, name = ColumnNamePrefix + person_FIELDNAME) @Column(length = length_255B, name = ColumnNamePrefix + person_FIELDNAME)
@Index(name = TABLE + IndexNameMiddle + person_FIELDNAME) @Index(name = TABLE + IndexNameMiddle + person_FIELDNAME)
@CheckPersist(allowEmpty = false) @CheckPersist(allowEmpty = false)
private String person; private String person;
...@@ -103,4 +103,4 @@ public class Custom extends SliceJpaObject { ...@@ -103,4 +103,4 @@ public class Custom extends SliceJpaObject {
this.name = name; this.name = name;
} }
} }
\ No newline at end of file
...@@ -13,8 +13,6 @@ import com.x.base.core.project.http.EffectivePerson; ...@@ -13,8 +13,6 @@ import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.tools.ListTools; import com.x.base.core.project.tools.ListTools;
import com.x.processplatform.assemble.surface.Business; import com.x.processplatform.assemble.surface.Business;
import com.x.processplatform.core.entity.content.Attachment; import com.x.processplatform.core.entity.content.Attachment;
import com.x.processplatform.core.entity.content.Work;
import com.x.processplatform.core.entity.content.WorkCompleted;
import java.util.List; import java.util.List;
...@@ -23,20 +21,13 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction { ...@@ -23,20 +21,13 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
ActionResult<Wo> result = new ActionResult<>(); ActionResult<Wo> result = new ActionResult<>();
Business business = new Business(emc); Business business = new Business(emc);
Work work = emc.find(workId, Work.class);
if(work == null){
WorkCompleted workCompleted = emc.find(workId, WorkCompleted.class);
if (null == workCompleted) {
throw new ExceptionEntityNotExist(workId, Work.class);
}
}
Attachment attachment = emc.find(id, Attachment.class); Attachment attachment = emc.find(id, Attachment.class);
if (null == attachment) { if (null == attachment) {
throw new ExceptionEntityNotExist(id, Attachment.class); throw new ExceptionEntityNotExist(id, Attachment.class);
} }
if (!business.readableWithWorkOrWorkCompleted(effectivePerson, work.getId(), if (!business.readableWithWorkOrWorkCompleted(effectivePerson, workId,
new ExceptionEntityNotExist(work.getId()))) { new ExceptionEntityNotExist(workId))) {
throw new ExceptionAccessDenied(effectivePerson); throw new ExceptionAccessDenied(effectivePerson);
} }
...@@ -157,4 +148,4 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction { ...@@ -157,4 +148,4 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
} }
return value; return value;
} }
} }
\ No newline at end of file
package com.x.program.center.jaxrs.command; package com.x.program.center.jaxrs.command;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream; import java.io.DataInputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.File; import java.io.File;
...@@ -11,8 +10,6 @@ import java.text.SimpleDateFormat; ...@@ -11,8 +10,6 @@ import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -30,32 +27,24 @@ import com.x.base.core.project.tools.Crypto; ...@@ -30,32 +27,24 @@ import com.x.base.core.project.tools.Crypto;
/*执行服务器命令*/ /*执行服务器命令*/
public class ActionCommand extends BaseAction { public class ActionCommand extends BaseAction {
private static Logger logger = LoggerFactory.getLogger(ActionCommand.class); private static Logger logger = LoggerFactory.getLogger(ActionCommand.class);
ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception { ActionResult<Wo> execute(HttpServletRequest request, EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {
ActionResult<Wo> result = new ActionResult<>(); ActionResult<Wo> result = new ActionResult<>();
Wi wi = this.convertToWrapIn(jsonElement, Wi.class); Wi wi = this.convertToWrapIn(jsonElement, Wi.class);
String ctl = wi.getCtl(); String ctl = wi.getCtl();
String nodeName = wi.getNodeName() ; String nodeName = wi.getNodeName() ;
String curServer = request.getLocalAddr();
Wo wo = null; Wo wo = null;
if(nodeName.equalsIgnoreCase("*")) { if(nodeName.equalsIgnoreCase("*")) {
Nodes nodes = Config.nodes(); Nodes nodes = Config.nodes();
if (ctl.indexOf("create encrypt")>-1) { if (ctl.indexOf("create encrypt")>-1) {
//生成key文件 //生成key文件
for (String node : nodes.keySet()){ wo = executeCommand(ctl, Config.node(), nodes.get(Config.node()).nodeAgentPort());
//当前服务器
if(node.equalsIgnoreCase(curServer)) {
if(nodes.get(curServer).getApplication().getEnable() || nodes.get(curServer).getCenter().getEnable()){
wo = executeCommand(ctl, node, nodes.get(node).nodeAgentPort());
}
}
}
//同步key文件 //同步key文件
for (String node : nodes.keySet()){ for (String node : nodes.keySet()){
//其他服务器 //其他服务器
if(!node.equalsIgnoreCase(curServer)) { if(!node.equalsIgnoreCase(Config.node())) {
if(nodes.get(node).getApplication().getEnable() || nodes.get(node).getCenter().getEnable()){ if(nodes.get(node).getApplication().getEnable() || nodes.get(node).getCenter().getEnable()){
boolean Syncflag = executeSyncFile("config/public.key" , node ,nodes.get(node).nodeAgentPort()); boolean Syncflag = executeSyncFile("config/public.key" , node ,nodes.get(node).nodeAgentPort());
Syncflag = executeSyncFile("config/private.key" , node ,nodes.get(node).nodeAgentPort()); Syncflag = executeSyncFile("config/private.key" , node ,nodes.get(node).nodeAgentPort());
...@@ -63,35 +52,26 @@ public class ActionCommand extends BaseAction { ...@@ -63,35 +52,26 @@ public class ActionCommand extends BaseAction {
} }
} }
} }
}else { }else {
//先其他服务器再当前服务器
for (String node : nodes.keySet()){
//先其他服务器
if(!node.equalsIgnoreCase(curServer)) {
if(nodes.get(node).getApplication().getEnable() || nodes.get(node).getCenter().getEnable()){
wo = executeCommand(ctl, node, nodes.get(node).nodeAgentPort());
}
}
}
for (String node : nodes.keySet()){ for (String node : nodes.keySet()){
//后当前服务器 if(!node.equalsIgnoreCase(Config.node())) {
if(node.equalsIgnoreCase(curServer)) { logger.print("{} executeCommand {} on node {}",effectivePerson.getDistinguishedName(), ctl, node);
if(nodes.get(curServer).getApplication().getEnable() || nodes.get(curServer).getCenter().getEnable()){ wo = executeCommand(ctl, node, nodes.get(node).nodeAgentPort());
wo = executeCommand(ctl, node, nodes.get(node).nodeAgentPort());
}
} }
} }
logger.print("{} executeCommand {} on node {}",effectivePerson.getDistinguishedName(), ctl, Config.node());
wo = executeCommand(ctl, Config.node(), nodes.get(Config.node()).nodeAgentPort());
} }
}else { }else {
wo = executeCommand(ctl, nodeName, Integer.parseInt(wi.getNodePort())); logger.print("{} executeCommand {} on node {}",effectivePerson.getDistinguishedName(), ctl, nodeName);
wo = executeCommand(ctl, nodeName, Integer.parseInt(wi.getNodePort()));
} }
result.setData(wo); result.setData(wo);
return result; return result;
} }
synchronized private Wo executeCommand(String ctl , String nodeName ,int nodePort) throws Exception{ synchronized private Wo executeCommand(String ctl , String nodeName ,int nodePort) throws Exception{
Wo wo = new Wo(); Wo wo = new Wo();
wo.setNode(nodeName); wo.setNode(nodeName);
...@@ -106,7 +86,7 @@ public class ActionCommand extends BaseAction { ...@@ -106,7 +86,7 @@ public class ActionCommand extends BaseAction {
commandObject.put("credential", Crypto.rsaEncrypt("o2@", Config.publicKey())); commandObject.put("credential", Crypto.rsaEncrypt("o2@", Config.publicKey()));
dos.writeUTF(XGsonBuilder.toJson(commandObject)); dos.writeUTF(XGsonBuilder.toJson(commandObject));
dos.flush(); dos.flush();
if (ctl.indexOf("create encrypt")>-1) { if (ctl.indexOf("create encrypt")>-1) {
String createEncrypt = dis.readUTF(); String createEncrypt = dis.readUTF();
logger.info(createEncrypt); logger.info(createEncrypt);
...@@ -120,18 +100,18 @@ public class ActionCommand extends BaseAction { ...@@ -120,18 +100,18 @@ public class ActionCommand extends BaseAction {
wo.setTime(df.format(new Date())); wo.setTime(df.format(new Date()));
return wo; return wo;
} }
private boolean executeSyncFile(String syncFilePath , String nodeName ,int nodePort){ private boolean executeSyncFile(String syncFilePath , String nodeName ,int nodePort){
boolean syncFileFlag = false; boolean syncFileFlag = false;
File syncFile; File syncFile;
InputStream fileInputStream = null; InputStream fileInputStream = null;
try (Socket socket = new Socket(nodeName, nodePort)) { try (Socket socket = new Socket(nodeName, nodePort)) {
syncFile = new File(Config.base(), syncFilePath); syncFile = new File(Config.base(), syncFilePath);
fileInputStream= new FileInputStream(syncFile); fileInputStream= new FileInputStream(syncFile);
socket.setKeepAlive(true); socket.setKeepAlive(true);
socket.setSoTimeout(5000); socket.setSoTimeout(5000);
DataOutputStream dos = null; DataOutputStream dos = null;
...@@ -139,17 +119,17 @@ public class ActionCommand extends BaseAction { ...@@ -139,17 +119,17 @@ public class ActionCommand extends BaseAction {
try { try {
dos = new DataOutputStream(socket.getOutputStream()); dos = new DataOutputStream(socket.getOutputStream());
dis = new DataInputStream(socket.getInputStream()); dis = new DataInputStream(socket.getInputStream());
Map<String, Object> commandObject = new HashMap<>(); Map<String, Object> commandObject = new HashMap<>();
commandObject.put("command", "syncFile:"+ syncFilePath); commandObject.put("command", "syncFile:"+ syncFilePath);
commandObject.put("credential", Crypto.rsaEncrypt("o2@", Config.publicKey())); commandObject.put("credential", Crypto.rsaEncrypt("o2@", Config.publicKey()));
dos.writeUTF(XGsonBuilder.toJson(commandObject)); dos.writeUTF(XGsonBuilder.toJson(commandObject));
dos.flush(); dos.flush();
dos.writeUTF(syncFilePath); dos.writeUTF(syncFilePath);
dos.flush(); dos.flush();
logger.info("同步文件starting......."); logger.info("同步文件starting.......");
byte[] bytes = new byte[1024]; byte[] bytes = new byte[1024];
int length =0; int length =0;
...@@ -158,14 +138,14 @@ public class ActionCommand extends BaseAction { ...@@ -158,14 +138,14 @@ public class ActionCommand extends BaseAction {
dos.flush(); dos.flush();
} }
logger.info("同步文件end......."); logger.info("同步文件end.......");
}finally { }finally {
dos.close(); dos.close();
dis.close(); dis.close();
socket.close(); socket.close();
fileInputStream.close(); fileInputStream.close();
} }
syncFileFlag = true; syncFileFlag = true;
} catch (Exception ex) { } catch (Exception ex) {
logger.error(ex); logger.error(ex);
...@@ -173,7 +153,7 @@ public class ActionCommand extends BaseAction { ...@@ -173,7 +153,7 @@ public class ActionCommand extends BaseAction {
} }
return syncFileFlag; return syncFileFlag;
} }
public static class Wi extends GsonPropertyObject{ public static class Wi extends GsonPropertyObject{
@FieldDescribe("命令名称") @FieldDescribe("命令名称")
private String ctl; private String ctl;
...@@ -181,7 +161,7 @@ public class ActionCommand extends BaseAction { ...@@ -181,7 +161,7 @@ public class ActionCommand extends BaseAction {
private String nodeName; private String nodeName;
@FieldDescribe("服务端口") @FieldDescribe("服务端口")
private String nodePort; private String nodePort;
public String getCtl() { public String getCtl() {
return ctl; return ctl;
} }
...@@ -201,9 +181,9 @@ public class ActionCommand extends BaseAction { ...@@ -201,9 +181,9 @@ public class ActionCommand extends BaseAction {
this.nodePort = nodePort; this.nodePort = nodePort;
} }
} }
public static class Wo extends GsonPropertyObject { public static class Wo extends GsonPropertyObject {
@FieldDescribe("执行时间") @FieldDescribe("执行时间")
private String time; private String time;
@FieldDescribe("执行结束") @FieldDescribe("执行结束")
...@@ -214,11 +194,11 @@ public class ActionCommand extends BaseAction { ...@@ -214,11 +194,11 @@ public class ActionCommand extends BaseAction {
public String getTime() { public String getTime() {
return time; return time;
} }
public void setTime(String time) { public void setTime(String time) {
this.time = time; this.time = time;
} }
public String getNode() { public String getNode() {
return node; return node;
} }
...@@ -235,7 +215,7 @@ public class ActionCommand extends BaseAction { ...@@ -235,7 +215,7 @@ public class ActionCommand extends BaseAction {
this.status = status; this.status = status;
} }
} }
} }
...@@ -268,9 +268,12 @@ MWF.xApplication.Common.Main = new Class({ ...@@ -268,9 +268,12 @@ MWF.xApplication.Common.Main = new Class({
window.addEventListener("beforeunload", function (e) { window.addEventListener("beforeunload", function (e) {
this.fireAppEvent("queryClose"); this.fireAppEvent("queryClose");
}.bind(this)); }.bind(this));
// window.addEventListener("pagehide", function (e) {
// this.fireAppEvent("queryClose"); if(layout.mobile){
// }.bind(this)); window.addEventListener("pagehide", function (e) {
this.fireAppEvent("queryClose");
}.bind(this));
}
// window.onbeforeunload = function(e){ // window.onbeforeunload = function(e){
// this.fireAppEvent("queryClose"); // this.fireAppEvent("queryClose");
......
...@@ -25,6 +25,10 @@ ...@@ -25,6 +25,10 @@
} }
var redirect = uri.getData("redirect"); var redirect = uri.getData("redirect");
redirect = redirect + "&uniqueId=" + uniqueId + "&flushPortalUrl="+flushPortalUrl; redirect = redirect + "&uniqueId=" + uniqueId + "&flushPortalUrl="+flushPortalUrl;
var nav = uri.getData("nav");
if(nav)redirect = redirect + "&nav=" + nav;
if (xtoken){ if (xtoken){
var res = new Request.JSON({ var res = new Request.JSON({
url: o2.filterUrl(address+"?SMAP_SESSION_DATA="+encodeURIComponent(xtoken)+"&appID="+appID+"&date="+(new Date()).getTime()), url: o2.filterUrl(address+"?SMAP_SESSION_DATA="+encodeURIComponent(xtoken)+"&appID="+appID+"&date="+(new Date()).getTime()),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册