$(document).ready(function() {

	function trim(str) {
		return str.replace(/^\s+|\s+$/g, "");
	}

	function dealCmd(command, term) {
		if (command.indexOf("ls") > -1) {
			$.ajax({
				type : 'get',
				dataType : 'json',
				url : '/ke/cluster/zk/cmd/ajax?cmd=' + command + '&type=ls',
				success : function(datas) {
					if (datas != null) {
						term.echo(new String(datas.result));
					}
				}
			});
		} else if (command.indexOf("delete") > -1) {
			$.ajax({
				type : 'get',
				dataType : 'json',
				url : '/ke/cluster/zk/cmd/ajax?cmd=' + command + '&type=delete',
				success : function(datas) {
					if (datas != null) {
						term.echo(new String(datas.result));
					}
				}
			});
		} else if (command.indexOf("get") > -1) {
			$.ajax({
				type : 'get',
				dataType : 'json',
				url : '/ke/cluster/zk/cmd/ajax?cmd=' + command + '&type=get',
				success : function(datas) {
					if (datas != null) {
						term.echo(new String(datas.result));
					}
				}
			});
		} else {
			throw new Error("Currently only supports ls, delete, get commands, example: ls / ");
		}
	}

	$.ajax({
		type : 'get',
		dataType : 'json',
		url : '/ke/cluster/zk/islive/ajax',
		success : function(datas) {
			if (datas != null) {
				if (datas.live) {
					$('#zkcli_info').terminal(function(command, term) {
						if (command !== '') {
							try {
								dealCmd(command, term);
							} catch (e) {
								term.error(new String(e));
							}
						} else {
							term.echo('');
						}
					}, {
						greetings : '********************************************************************************\n' + 'Name :  Zookeeper Client Interpreter\n' + 'Server :  [' + datas.list + ']\n' + '********************************************************************************\n',
						height : 400,
						prompt : '[zk: (CONNECTED) ] > '
					});
				} else {
					$('#zkcli_info').terminal(function(command, term) {
					}, {
						greetings : '********************************************************************************\n' + 'Name :  Zookeeper Client Interpreter\n' + 'Server :  [' + datas.list + ']\n' + '********************************************************************************\n',
						height : 400,
						prompt : '[zk: (DISCONNECTED) ] > '
					});
				}
			}
		}
	});
});
@@ -409,297 +409,8 @@
 %09%09%7D 
-else if (command.indexOf(%22delete%22) %3E -1) %7B%0A%09%09%09$.ajax(%7B%0A%09%09%09%09type : 'get',%0A%09%09%09%09dataType : 'json',%0A%09%09%09%09url : '/ke/cluster/zk/cmd/ajax?cmd=' + command + '&type=delete',%0A%09%09%09%09success : function(datas) %7B%0A%09%09%09%09%09if (datas != null) %7B%0A%09%09%09%09%09%09term.echo(new String(datas.result));%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D);%0A%09%09%7D
  els
@@ -748,16 +748,8 @@
  ls,
- delete,
  get

remove js delete operate