增加获取集群文件列表界面

Web_Manager_Develope
wu ming 9 years ago
commit 562b55eb79

@ -1,139 +0,0 @@
function Recursion(node){
var count=0;
for (var key in node) {
count++;
var value = node[key];
delete node[key];
//如果node为叶子节点
if (key.toString() == '$') {
for (var attr in value)
node[attr] = value[attr];
} else {
if (value instanceof Array) {
if (value.length > 0) {
node["children"] = value;
for (var obj in value)
Recursion(value[obj]);
}
}
}
}
if(count==1)
node["children"]=[];
}
function randomString(len) {
len = len || 32;
var $chars = 'abcdefhijkmnprstwxyz'; // 默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1
var maxPos = $chars.length;
var pwd = '';
for (i = 0; i < len; i++) {
pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
}
return pwd;
}
function compArray(array1,array2){
if((array1&&typeof array1 ==="object"&&array1.constructor===Array)&&(array2&&typeof array2 ==="object"&&array2.constructor===Array)){
if(array1.length==array2.length){
for(var i=0;i<array1.length;i++){
var ggg=compObj(array1[i],array2[i]);
if(!ggg)
return false;
}
}else{
return false;
}
}else{
throw new Error("argunment is error ;");
}
return true;
};
function compObj(obj1,obj2){//比较两个对象是否相等,不包含原形上的属性计较
if((obj1&&typeof obj1==="object")&&((obj2&&typeof obj2==="object"))){
var count1=propertyLength(obj1);
var count2=propertyLength(obj2);
if(count1==count2){
for(var ob in obj1){
if(obj1.hasOwnProperty(ob)&&obj2.hasOwnProperty(ob)){
if(obj1[ob].constructor==Array&&obj2[ob].constructor==Array){//如果属性是数组
if(!compArray(obj1[ob],obj2[ob])){
return false;
};
}else if(typeof obj1[ob]==="string"&&typeof obj2[ob]==="string"){//纯属性
if(obj1[ob]!==obj2[ob]){
return false;
}
}else if(typeof obj1[ob]==="object"&&typeof obj2[ob]==="object"){//属性是对象
if(!compObj(obj1[ob],obj2[ob])){
return false;
};
}else{
return false;
}
}else{
return false;
}
}
}else{
return false;
}
}
return true;
};
function propertyLength(obj){//获得对象上的属性个数,不包含对象原形上的属性
var count=0;
if(obj&&typeof obj==="object") {
for(var ooo in obj) {
if(obj.hasOwnProperty(ooo)) {
count++;
}
}
return count;
}else {
throw new Error("argunment can not be null;");
}
};
function selectorMatches(selector,labels){
if(typeof(selector) === 'object'){
var answer = true;
var count = 0;
for(var key in selector){
count++;
if(answer && labels[key] !== selector[key])
answer = false;
}
return answer && count > 0;
}else{
return false;
}
}
Date.prototype.Format = function(fmt)
{ //author: meizz
var o = {
"M+" : this.getMonth()+1, //月份
"d+" : this.getDate(), //日
"h+" : this.getHours(), //小时
"m+" : this.getMinutes(), //分
"s+" : this.getSeconds(), //秒
"q+" : Math.floor((this.getMonth()+3)/3), //季度
"S" : this.getMilliseconds() //毫秒
};
if(/(y+)/.test(fmt))
fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
for(var k in o)
if(new RegExp("("+ k +")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
return fmt;
}
exports.randomString = randomString;
exports.Recursion = Recursion;
exports.compObj = compObj;
exports.selectorMatches = selectorMatches;

File diff suppressed because one or more lines are too long

@ -1,213 +0,0 @@
var fs = require('fs'), path = require('path'), util = require('util'), Stream = require('stream').Stream;
module.exports = resumable = function(temporaryFolder){
var $ = this;
$.temporaryFolder = temporaryFolder;
$.maxFileSize = null;
$.fileParameterName = 'file';
try {
fs.mkdirSync($.temporaryFolder);
}catch(e){}
var cleanIdentifier = function(identifier){
return identifier.replace(/^0-9A-Za-z_-/img, '');
}
var getChunkFilename = function(chunkNumber, identifier){
// Clean up the identifier
identifier = cleanIdentifier(identifier);
// What would the file name be?
return path.join($.temporaryFolder, './resumable-'+identifier+'.'+chunkNumber);
}
var validateRequest = function(chunkNumber, chunkSize, totalSize, identifier, filename, fileSize){
// Clean up the identifier
identifier = cleanIdentifier(identifier);
// Check if the request is sane
if (chunkNumber==0 || chunkSize==0 || totalSize==0 || identifier.length==0 || filename.length==0) {
return 'non_resumable_request';
}
var numberOfChunks = Math.max(Math.floor(totalSize/(chunkSize*1.0)), 1);
if (chunkNumber>numberOfChunks) {
return 'invalid_resumable_request1';
}
// Is the file too big?
if($.maxFileSize && totalSize>$.maxFileSize) {
return 'invalid_resumable_request2';
}
if(typeof(fileSize)!='undefined') {
if(chunkNumber<numberOfChunks && fileSize!=chunkSize) {
// The chunk in the POST request isn't the correct size
return 'invalid_resumable_request3';
}
if(numberOfChunks>1 && chunkNumber==numberOfChunks && fileSize!=((totalSize%chunkSize)+chunkSize)) {
// The chunks in the POST is the last one, and the fil is not the correct size
return 'invalid_resumable_request4';
}
if(numberOfChunks==1 && fileSize!=totalSize) {
// The file is only a single chunk, and the data size does not fit
return 'invalid_resumable_request5';
}
}
return 'valid';
}
//'found', filename, original_filename, identifier
//'not_found', null, null, null
$.get = function(req, callback){
var chunkNumber = req.param('resumableChunkNumber', 0);
var chunkSize = req.param('resumableChunkSize', 0);
var totalSize = req.param('resumableTotalSize', 0);
var identifier = req.param('resumableIdentifier', "");
var filename = req.param('resumableFilename', "");
if(validateRequest(chunkNumber, chunkSize, totalSize, identifier, filename)=='valid') {
var chunkFilename = getChunkFilename(chunkNumber, identifier);
fs.exists(chunkFilename, function(exists){
if(exists){
callback('found', chunkFilename, filename, identifier);
} else {
callback('not_found', chunkFilename, filename, identifier);
}
});
} else {
callback('not_found2', chunkFilename, filename, identifier);
}
}
//'partly_done', filename, original_filename, identifier
//'done', filename, original_filename, identifier
//'invalid_resumable_request', null, null, null
//'non_resumable_request', null, null, null
$.post = function(req, callback){
var fields = req.body;
var files = req.files;
var chunkNumber = fields['resumableChunkNumber'];
var chunkSize = fields['resumableChunkSize'];
var totalSize = fields['resumableTotalSize'];
var identifier = cleanIdentifier(fields['resumableIdentifier']);
var filename = fields['resumableFilename'];
var original_filename = fields['resumableIdentifier'];
if(!files[$.fileParameterName] || !files[$.fileParameterName].size) {
callback('invalid_resumable_request', null, null, null);
return;
}
var validation = validateRequest(chunkNumber, chunkSize, totalSize, identifier, files[$.fileParameterName].size);
if(validation=='valid') {
var chunkFilename = getChunkFilename(chunkNumber, identifier);
// Save the chunk (TODO: OVERWRITE)
fs.rename(files[$.fileParameterName].path, chunkFilename, function(){
// Do we have all the chunks?
var currentTestChunk = 1;
var numberOfChunks = Math.max(Math.floor(totalSize/(chunkSize*1.0)), 1);
var testChunkExists = function(){
fs.exists(getChunkFilename(currentTestChunk, identifier), function(exists){
if(exists){
currentTestChunk++;
if(currentTestChunk>numberOfChunks) {
callback('done', filename, original_filename, identifier);
} else {
// Recursion
testChunkExists();
}
} else {
callback('partly_done', filename, original_filename, identifier);
}
});
}
testChunkExists();
});
} else {
callback(validation, filename, original_filename, identifier);
}
}
// Pipe chunks directly in to an existsing WritableStream
// r.write(identifier, response);
// r.write(identifier, response, {end:false});
//
// var stream = fs.createWriteStream(filename);
// r.write(identifier, stream);
// stream.on('data', function(data){...});
// stream.on('end', function(){...});
$.write = function(identifier, writableStream, options) {
options = options || {};
options.end = (typeof options['end'] == 'undefined' ? true : options['end']);
// Iterate over each chunk
var pipeChunk = function(number) {
var chunkFilename = getChunkFilename(number, identifier);
fs.exists(chunkFilename, function(exists) {
if (exists) {
// If the chunk with the current number exists,
// then create a ReadStream from the file
// and pipe it to the specified writableStream.
var sourceStream = fs.createReadStream(chunkFilename);
sourceStream.pipe(writableStream, {
end: false
});
sourceStream.on('end', function() {
// When the chunk is fully streamed,
// jump to the next one
pipeChunk(number + 1);
});
} else {
// When all the chunks have been piped, end the stream
if (options.end) writableStream.end();
if (options.onDone) options.onDone();
}
});
}
pipeChunk(1);
}
$.clean = function(identifier, options) {
options = options || {};
// Iterate over each chunk
var pipeChunkRm = function(number) {
var chunkFilename = getChunkFilename(number, identifier);
//console.log('removing pipeChunkRm ', number, 'chunkFilename', chunkFilename);
fs.exists(chunkFilename, function(exists) {
if (exists) {
console.log('exist removing ', chunkFilename);
fs.unlink(chunkFilename, function(err) {
if (err && options.onError) options.onError(err);
});
pipeChunkRm(number + 1);
} else {
if (options.onDone) options.onDone();
}
});
}
pipeChunkRm(1);
}
return $;
}

File diff suppressed because it is too large Load Diff

@ -1,216 +0,0 @@
/* 样式重置 */
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#fff;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{color:#7f7f7f;text-decoration:none;}
a:hover,a:active{color:#000;}
.fl{ float:left;}
.fr{ float:right;}
.cl{ clear:both; overflow:hidden;}
/* 数据页面 */
.data_container{
width:100%;
margin:0 auto;
}
.data_heaer{
height:66px;
width:100%;
background-color:#3499db;
text-align:center;
}
.data_heaer h2{
font-size:30px;
font-weight:300;
color:#fff;
line-height:66px;
}
.data_content{
width:1280px;
height:838px;
margin:0 auto;
background-color:#fff;
border:1px solid #e0dede;
border-top:none;
}
.data_leftside{
width:612px;
border-right:1px solid #e0dede;
}
.data_h3{
width:100%;
text-align:center;
height:50px;
font-size:18px;
color:#444;
line-height:50px;
}
.data_leftside_files{
border-right:1px solid #e0dede;
border-bottom:1px solid #e0dede;
height:710px;
overflow :auto;
}
.data_leftside_files input{
margin-top:15px;
width:15px;
height:15px;
}
.data_leftside_files li{
height:40px;
line-height:40px;
border-bottom:1px solid #e0dede;
padding:0 10px;
}
.data_leftside_files li.data_title{
width:210px; height:36px;
line-height:36px;
text-align:center;
background-color:#e9f3fb;
border:none;
overflow:hidden;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
white-space:nowrap;
}
.date_label{
display:block;
width:168px;
overflow:hidden;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
white-space:nowrap;
}
.data_leftside_shu{
border-right:none;
}
.data_leftside_shu li{
border-bottom:none;
}
.data_conbar{ width:149px;
height:834px;
border-right:1px solid #e0dede;
border-left:1px solid #e0dede;
}
.date_btns{
width:260px;
margin:20px auto;
}
.date_btns_w{
width:390px;
}
.date_btns button{
margin:10px 20px;
}
.data_btn{
border:none;
width:108px;
height:35px;
line-height:35px;
text-align:center;
background-color:#3499db;
color:#fff;
font-size:14px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
-o-border-radius:5px;
border-radius:5px;
}
.data_btn:hover{
background-color:#2989da;
}
.data_rightside{
width:667px;
}
.data_rightside_w{
width:407px;
}
.data_leftside_files li.data_title_w{
width:183px;
}
.date_label_w{
width:150px;
}
.data_leftside_shu li{
border-bottom:none;
}
a.data_file_btn{ display:block; position:relative; width:108px; height:35px; margin:15px auto; line-height:35px; font-size:14px; color: #fff; text-align:center;
background-color: #79b4e7;
background-image: -webkit-linear-gradient(#79b4e7, #1377cf);
background-image: linear-gradient(#79b4e7, #1377cf);
border-color: #076bc2;
-webkit-border-radius:5px;
-moz-border-radius:5px;
-o-border-radius:5px;
border-radius:5px;
vertical-align: middle;
cursor: pointer;
margin:0 10px;
}
a:hover.data_file_btn{
background-color: #076bc2;
background-image: -webkit-linear-gradient(#79b4e7, #076bc2);
background-image: linear-gradient(#79b4e7, #076bc2);
border-color: #076bc2;}
.data_file_btn input{ position:absolute; left:0px;opacity:0; filter:alpha(opacity=0); width:108px; height:35px;}
.data_conbox{
width:407px;
height:709px;
border-top:1px solid #e0dede;
border-bottom:1px solid #e0dede;
overflow: auto;
}
.data_con_title{
width:49.8%;
height:36px;
line-height:36px;
text-align:center;
background-color:#e9f3fb;
overflow:hidden;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
white-space:nowrap;
}
.data_con_line{
border-right:1px solid #e0dede;
}
.data_con_li{
width:49.8%;
height:36px;
line-height:36px;
overflow:hidden;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
white-space:nowrap;
border-bottom:1px solid #e0dede;
}
.mt15{ margin-top:15px;}
/* 树形结构 */
.data_rightside_tree{
width:259px;
height:709px;
border-right:1px solid #e0dede;
border-top:1px solid #e0dede;
border-bottom:1px solid #e0dede;
overflow: auto;
}
.tree { min-height:20px;padding:15px;padding-left:30px;border-bottom:1px dashed #ccc;}
.tree li {list-style-type:none;margin:0; padding:10px 5px 0 20px; position:relative}
.tree li::before, .tree li::after { content:'';left:-30px;position:absolute; right:auto}
.tree li::before { border-left:1px solid #999; bottom:50px;height:100%; top:0; width:0px}
.tree li::after {border-top:1px solid #999;height:20px; top:25px; width:35px}
.tree li p {display:inline-block;padding:3px 10px;border:1px solid #fff; margin-left:-15px; width:150px; }
.tree li.parent_li>p {cursor:pointer}
.tree>ul>li::before, .tree>ul>li::after {border:0}
.tree li:last-child::before { height:30px}
.tree li.parent_li>p:hover, .tree li.parent_li>p:hover+ul li p { }
.icon-plus-sign{ margin-left:-15px; background:url(../img/icons1.gif) -5px 10px no-repeat; }
.icon-minus-sign{ margin-left:-15px; background:url(../img/icons2.gif) -6px 9px no-repeat;}

@ -1,607 +0,0 @@
var fs = require('fs');
var dom = require("xmldom").DOMParser;
var select = require('xpath.js');
//var dataDetailPath = "/home/server_data/data-detail.xml"
//var dataPath = "/home/server_data/data.xml"
//var versionPath = "/home/server_data/version.txt"
var allDataPath = process.env.ALL_DATA || '/home/all_data';
var dataDetailPath = allDataPath + "/collecting_data/data-detail.xml"
var dataPath = allDataPath + "/collecting_data/data.xml"
var versionPath = allDataPath+ "/collecting_data/version.txt"
//<2F><><EFBFBD><EFBFBD>fileId<49><64><EFBFBD><EFBFBD>ȡ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>ŵ<EFBFBD>λ<EFBFBD><CEBB>
function getVersionPath(fileId){
fileId = fileId.replace(/\"/g, "");
var item = "<item";
// fs<66><73>ȡ<EFBFBD><C8A1> xmldomת<6D><D7AA><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
var filedata = fs.readFileSync(dataDetailPath, "utf-8");
var itemArray = filedata.split(item);
var itemsize = itemArray.length;
var version = {value:0};
// ͬһ<CDAC><D2BB>id,<2C><>Ӧ<EFBFBD><D3A6>item<65>ж<EFBFBD><D0B6>ٸ<EFBFBD><D9B8><EFBFBD>
for(var i = 1; i < itemsize; i++){
if(itemArray[i].indexOf(fileId)!= -1){
var oldBigVersion = itemArray[i].split("<version>")[1].split("</version>")[0];
if(version.value < oldBigVersion){
version.value = oldBigVersion;
}
}
}
version.value ++;
return version.value;
}
function mkdataForPage(collecttime, realtype, realpath, realbatch, realid, realname, version){
// var resultXmlData = "";
// var realpath = "/uplaods/";
// var realtype = "01";
// var realbatch = "01_A";
// var realid = "32550_111";
// var realname = "<22>Ͼ<EFBFBD><CFBE><EFBFBD>_<EFBFBD><5F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><5F>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>ϵͳ";
//json<6F><6E><EFBFBD>Եĸ<D4B5>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>@
var type ="id=\""+realtype+"\"";
var batch = "id=\""+realtype+"_"+realbatch+"\"";
var id = realtype+"_"+realbatch+"_"+realid+"\"";
var versionid = realtype+"_"+realbatch + "_"+realid + "_" + version +"\"";
var name = "name=\""+realname+"\"";
var path = "path=\""+realpath+"\"";
var versionstrutf = fs.readFileSync(versionPath, "utf-8");
console.log(typeof versionstrutf);
console.log("------------- mkdataForPage --------------");
fs.readFile(dataPath, "utf-8", function(err, data){
if(err){
console.log("<22><>ȡ<EFBFBD>ļ<EFBFBD> "+dataDetailPath+" fail " + err);
}
else{
var dataNodes = data.split("<node");
var istype ="0";
var isbatch ="0";
var isexist ="0";
var sizel = dataNodes.length;
for(var i=0; i < sizel; i++){
if(dataNodes[i].indexOf(type) != -1)
{
istype ="1";
}
if((istype == "1") && (dataNodes[i].indexOf(batch) != -1))
{
isbatch ="1";
}
//id<69><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ψһ<CEA8>ģ<EFBFBD> <node id="32550_113"
if(isbatch == "1")
{//<2F><><EFBFBD><EFBFBD><EFBFBD>ӵİ汾
var nodestr = "";
if(dataNodes[i].indexOf(id) != -1){
nodestr = nodestr + "<node id=\""+ versionid + " name=\"" + realname+"\("+ versionstrutf + version + ")\"";
nodestr = nodestr + " path=\""+ realpath +"\"" + " time=\""+collecttime+ "\"></node>\n";
isexist = "1";
dataNodes[i] = dataNodes[i] + nodestr;
}
}
}
if(isexist.indexOf("1") == -1){
var nodestr = "";
for(var i=0; i < sizel; i++){
if(dataNodes[i].indexOf(batch) != -1){
var items = dataNodes[i].split("</");
if(items.length == 1){
//<2F><><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD>ϵͳ<CFB5><CDB3>---<2D><EFBFBD><E6B1BE>Ϣ<EFBFBD><CFA2>
nodestr = nodestr + "<node id=\"" + id +" "+ name + ">\n";
nodestr = nodestr + "<node id=\""+ versionid + " name=\"" + realname +"\(" + versionstrutf + version + ")\"";
nodestr = nodestr + " path=\""+ realpath +"\"" + " time=\""+collecttime+ "\"></node>\n</node>\n";
isexist = "1";
dataNodes[i] = dataNodes[i] + nodestr;
break;
}
else{
var items = dataNodes[i].split("</node");
nodestr = nodestr + "<node id=\"" + id +" "+ name + ">\n";
nodestr = nodestr + "<node id=\""+ versionid + " name=\"" + realname+"\(" + versionstrutf + version + ")\"";
nodestr = nodestr + " path=\""+ realpath +"\"" + " time=\""+collecttime+ "\"></node>\n</node>\n";
isexist = "1";
nodestr = items[0] +"\n" + nodestr +"\n</node>\n";
dataNodes[i] = nodestr;
break;
}
}
}
}
var resultdatastr = "";
for(var j=0; j < sizel-1; j++){
resultdatastr = resultdatastr + dataNodes[j] + "<node";
}
resultdatastr = resultdatastr + dataNodes[sizel-1]+"";
console.log("--------22222222-----------------");
console.log(resultdatastr);
console.log(typeof resultdatastr);
fs.writeFile(dataPath, resultdatastr, function(err){
if(err)
console.log(err);
else
console.log('has finished');
});
}
});
}
//saveByIdToXml("01", "B", "321200_0", "̩<><CCA9><EFBFBD><EFBFBD>_<EFBFBD><5F>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>ϵͳ2","<22><><EFBFBD><EFBFBD>" , "̩<><CCA9>2", "<22>б<EFBFBD><D0B1><EFBFBD>", "<22><>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>ϵͳ", "321200_0", "0000", "lim", "13323225656",5);
function saveByIdToXml(collecttime, type, dataTimes, id, name, province, city, county, system, areacode, systemcode, contacts, phone, version, realpath){
var dataTimetemstr = "batch=\""+ type +"_" + dataTimes + "\"";
typestr = "type=\""+type+"\"";
var datatype = "<datatype";
var dataTimestr = "<dataTimes";
var dataTimeEndstr = "</dataTimes>";
var item = "<item";
var itemEnd = "</item>";
var dataEnd = "</data>";
id = type +"_" + dataTimes + "_" + id;
// <20><>ȡ
// var data = fs.readFileSync(dataDetailPath, "utf-8");
// <20><>ȡ
fs.readFile(dataDetailPath, "utf-8", function(err, data){
//fs.readFile("data.txt", function(err, data){
if(err){
console.log("<22><>ȡ<EFBFBD>ļ<EFBFBD> "+dataDetailPath+" fail " + err);
}
else{
console.log(data);
var resultStr = "";
// gbk <20><><EFBFBD><EFBFBD> linux<75><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//var str = iconv.decode(data,'gbk');
//data = str;
var typeArray = data.split(datatype);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E7B1A3>{typeArray[0]:ͷ<><CDB7> typeArray[1]:<3A><EFBFBD><E7B1A3> typeArray[2]:<3A><><EFBFBD><EFBFBD>}
if(typeArray[1].indexOf(typestr)== -1){
resultStr += typeArray[0];
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E7B1A3>
resultStr += datatype;
resultStr += typeArray[1];
//<2F><><EFBFBD><EFBFBD> <20><>typeArray[2]
var timesArray = typeArray[2].split(dataTimestr);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><><EFBFBD>ǵ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD>εģ<CEB5><C4A3>ǵ<EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD>; {timesArray[0]:ͷ<><CDB7> timesArray[1]:1<><31><EFBFBD>Σ<EFBFBD> timesArray[2]:2<><32><EFBFBD><EFBFBD>}
if(timesArray[1].indexOf(dataTimetemstr)== -1){
resultStr += datatype;
resultStr += timesArray[0];
// <20><><EFBFBD>ϵ<EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>
resultStr += dataTimestr;
resultStr += timesArray[1];
var itemArray = timesArray[2].split(item);
var itemsize = itemArray.length;
var nowDate = new Date();
// itemԪ<6D><D4AA>
var itemStr = "<item id=\""+id+"_"+version+"\">\n";
itemStr += "\t\t\t\t<name>"+name+"</name>\n";
itemStr += "\t\t\t\t<collecttime>"+collecttime+"</collecttime>\n";
itemStr += "\t\t\t\t<time>"+nowDate.getFullYear()+"-"+(nowDate.getMonth()+1)+"-"+nowDate.getDate()+" "+nowDate.getHours()+":"+nowDate.getMinutes()+"</time>\n";
itemStr += "\t\t\t\t<province>"+province+"</province>\n";
itemStr += "\t\t\t\t<city>"+city+"</city>\n";
itemStr += "\t\t\t\t<county>"+county+"</county>\n";
itemStr += "\t\t\t\t<system>"+system+"</system>\n";
itemStr += "\t\t\t\t<version>"+version+"</version>\n";
itemStr += "\t\t\t\t<path>"+realpath+"</path>\n";
itemStr += "\t\t\t\t<areacode>"+areacode+"</areacode>\n";
itemStr += "\t\t\t\t<systemcode>"+systemcode+"</systemcode>\n";
itemStr += "\t\t\t\t<contacts>"+contacts+"</contacts>\n";
itemStr += "\t\t\t\t<phone>"+phone+"</phone>\n";
itemStr += "\t\t\t\t<type>"+type+"</type>\n\t\t\t"+itemEnd+"\n\t\t";
// <20><><EFBFBD> <20><> resultStr
// û<><C3BB> item<65><6D> itemsize ==1
if(itemsize ==1){
var dataTimebeginstr = itemArray[0].split(dataTimeEndstr);
resultStr += dataTimestr;
resultStr += dataTimebeginstr[0];
resultStr += "\t" + itemStr;
resultStr += dataTimeEndstr;
for(var i = 1; i < dataTimebeginstr.length;i++){
resultStr += dataTimebeginstr[i];
}
}
// <20><> item<65><6D>
else{
resultStr += dataTimestr;
resultStr += itemArray[0];
if(version == 1){
for(var i=1; i < itemsize-1; i++){
resultStr += item;
resultStr += itemArray[i];
}
resultStr += itemStr + "\t";
resultStr += item;
// itemArray[itemsize-1]: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></dataTimes>
resultStr += itemArray[itemsize-1];
}
else{
var addtimes = 0;
var isadd = 0;
for(var i=1; i < itemsize-1; i++){
isadd++;
if(addtimes == 0){
if(itemArray[i].indexOf(id)!= -1){
resultStr += itemStr + "\t";
addtimes = 1;
}
}
resultStr += item;
resultStr += itemArray[i];
}
if(isadd == 0){
if(addtimes == 0){
if(itemArray[i].indexOf(id)!= -1){
resultStr += itemStr + "\t";
addtimes = 1;
}
}
}
// itemArray[itemsize-1]: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></dataTimes>
resultStr += item;
resultStr += itemArray[itemsize-1];
}
}
}
// <20><>1<EFBFBD><31><EFBFBD><EFBFBD>ʱ
else{
resultStr += datatype;
resultStr += timesArray[0];
resultStr += dataTimestr;
// item Ԫ<><D4AA>
var itemArray = timesArray[1].split(item);
var itemsize = itemArray.length;
var nowDate = new Date();
// itemԪ<6D><D4AA>
var itemStr = "<item id=\""+id+"_"+version+"\">\n";
itemStr += "\t\t\t\t<name>"+name+"</name>\n";
itemStr += "\t\t\t\t<collecttime>"+collecttime+"</collecttime>\n";
itemStr += "\t\t\t\t<time>"+nowDate.getFullYear()+"-"+(nowDate.getMonth()+1)+"-"+nowDate.getDate()+" "+nowDate.getHours()+":"+nowDate.getMinutes()+"</time>\n";
itemStr += "\t\t\t\t<province>"+province+"</province>\n";
itemStr += "\t\t\t\t<city>"+city+"</city>\n";
itemStr += "\t\t\t\t<county>"+county+"</county>\n";
itemStr += "\t\t\t\t<system>"+system+"</system>\n";
itemStr += "\t\t\t\t<version>"+version+"</version>\n";
itemStr += "\t\t\t\t<path>"+realpath+"</path>\n";
itemStr += "\t\t\t\t<areacode>"+areacode+"</areacode>\n";
itemStr += "\t\t\t\t<systemcode>"+systemcode+"</systemcode>\n";
itemStr += "\t\t\t\t<contacts>"+contacts+"</contacts>\n";
itemStr += "\t\t\t\t<phone>"+phone+"</phone>\n";
itemStr += "\t\t\t\t<type>"+type+"</type>\n\t\t\t"+itemEnd+"\n\t\t";
// <20><><EFBFBD> <20><> resultStr
// û<><C3BB> item<65><6D> itemsize ==1
if(itemsize ==1){
var dataTimebeginstr = itemArray[0].split(dataTimeEndstr);
resultStr += dataTimebeginstr[0];
resultStr += "\t" + itemStr;
resultStr += dataTimeEndstr;
for(var i = 1; i < dataTimebeginstr.length;i++){
resultStr += dataTimebeginstr[i];
}
}
// <20><> item<65><6D>
else{
resultStr += itemArray[0];
if(version == 1){
for(var i=1; i < itemsize-1; i++){
resultStr += item;
resultStr += itemArray[i];
}
resultStr += itemStr + "\t";
resultStr += item;
// itemArray[itemsize-1]: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></dataTimes>
resultStr += itemArray[itemsize-1];
}
else{
var addtimes = 0;
var isadd = 0;
for(var i=1; i < itemsize-1; i++){
isadd++;
if(addtimes == 0){
if(itemArray[i].indexOf(id)!= -1){
resultStr += itemStr + "\t";
addtimes = 1;
}
}
resultStr += item;
resultStr += itemArray[i];
}
if(isadd == 0){
if(addtimes == 0){
if(itemArray[i].indexOf(id)!= -1){
resultStr += itemStr + "\t";
addtimes = 1;
}
}
}
// itemArray[itemsize-1]: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></dataTimes>
resultStr += item;
resultStr += itemArray[itemsize-1];
}
}
//Ȼ<><C8BB><EFBFBD><EFBFBD>ϵ<EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD>
resultStr += dataTimestr;
resultStr += timesArray[2];
}
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
else{
resultStr += typeArray[0];
//<2F><20><>typeArray[1]
var timesArray = typeArray[1].split(dataTimestr);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><><EFBFBD>ǵ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD>εģ<CEB5><C4A3>ǵ<EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD>; {timesArray[0]:ͷ<><CDB7> timesArray[1]:1<><31><EFBFBD>Σ<EFBFBD> timesArray[2]:2<><32><EFBFBD><EFBFBD>}
if(timesArray[1].indexOf(dataTimetemstr)== -1){
resultStr += datatype;
resultStr += timesArray[0];
// <20><><EFBFBD>ϵ<EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>
resultStr += dataTimestr;
resultStr += timesArray[1];
var itemArray = timesArray[2].split(item);
var itemsize = itemArray.length;
var nowDate = new Date();
// itemԪ<6D><D4AA>
var itemStr = "<item id=\""+id+"_"+version+"\">\n";
itemStr += "\t\t\t\t<name>"+name+"</name>\n";
itemStr += "\t\t\t\t<collecttime>"+collecttime+"</collecttime>\n";
itemStr += "\t\t\t\t<time>"+nowDate.getFullYear()+"-"+(nowDate.getMonth()+1)+"-"+nowDate.getDate()+" "+nowDate.getHours()+":"+nowDate.getMinutes()+"</time>\n";
itemStr += "\t\t\t\t<province>"+province+"</province>\n";
itemStr += "\t\t\t\t<city>"+city+"</city>\n";
itemStr += "\t\t\t\t<county>"+county+"</county>\n";
itemStr += "\t\t\t\t<system>"+system+"</system>\n";
itemStr += "\t\t\t\t<version>"+version+"</version>\n";
itemStr += "\t\t\t\t<path>"+realpath+"</path>\n";
itemStr += "\t\t\t\t<areacode>"+areacode+"</areacode>\n";
itemStr += "\t\t\t\t<systemcode>"+systemcode+"</systemcode>\n";
itemStr += "\t\t\t\t<contacts>"+contacts+"</contacts>\n";
itemStr += "\t\t\t\t<phone>"+phone+"</phone>\n";
itemStr += "\t\t\t\t<type>"+type+"</type>\n\t\t\t"+itemEnd+"\n\t\t";
// <20><><EFBFBD> <20><> resultStr
// û<><C3BB> item<65><6D> itemsize ==1
if(itemsize ==1){
var dataTimebeginstr = itemArray[0].split(dataTimeEndstr);
resultStr += dataTimestr;
resultStr += dataTimebeginstr[0];
resultStr = resultStr + "\t" + itemStr;
resultStr += dataTimeEndstr;
for(var i = 1; i < dataTimebeginstr.length;i++){
resultStr += dataTimebeginstr[i];
}
}
// <20><> item<65><6D>
else{
resultStr += dataTimestr;
resultStr += itemArray[0];
if(version == 1){
for(var i=1; i < itemsize-1; i++){
resultStr += item;
resultStr += itemArray[i];
}
resultStr += itemStr + "\t";
resultStr += item;
// itemArray[itemsize-1]: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></dataTimes>
resultStr += itemArray[itemsize-1];
}
else{
var addtimes = 0;
var isadd = 0;
for(var i=1; i < itemsize-1; i++){
isadd++;
if(addtimes == 0){
if(itemArray[i].indexOf(id)!= -1){
resultStr += itemStr + "\t";
addtimes = 1;
}
}
resultStr += item;
resultStr += itemArray[i];
}
if(isadd == 0){
if(addtimes == 0){
if(itemArray[i].indexOf(id)!= -1){
resultStr += itemStr + "\t";
addtimes = 1;
}
}
}
// itemArray[itemsize-1]: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></dataTimes>
resultStr += item;
resultStr += itemArray[itemsize-1];
}
}
}
// <20><>1<EFBFBD><31><EFBFBD><EFBFBD>ʱ
else{
resultStr += datatype;
resultStr += timesArray[0];
resultStr += dataTimestr;
// item Ԫ<><D4AA>
var itemArray = timesArray[1].split(item);
var itemsize = itemArray.length;
var nowDate = new Date();
// itemԪ<6D><D4AA>
var itemStr = "<item id=\""+id+"_"+version+"\">\n";
itemStr += "\t\t\t\t<name>"+name+"</name>\n";
itemStr += "\t\t\t\t<collecttime>"+collecttime+"</collecttime>\n";
itemStr += "\t\t\t\t<time>"+nowDate.getFullYear()+"-"+(nowDate.getMonth()+1)+"-"+nowDate.getDate()+" "+nowDate.getHours()+":"+nowDate.getMinutes()+"</time>\n";
itemStr += "\t\t\t\t<province>"+province+"</province>\n";
itemStr += "\t\t\t\t<city>"+city+"</city>\n";
itemStr += "\t\t\t\t<county>"+county+"</county>\n";
itemStr += "\t\t\t\t<system>"+system+"</system>\n";
itemStr += "\t\t\t\t<version>"+version+"</version>\n";
itemStr += "\t\t\t\t<path>"+realpath+"</path>\n";
itemStr += "\t\t\t\t<areacode>"+areacode+"</areacode>\n";
itemStr += "\t\t\t\t<systemcode>"+systemcode+"</systemcode>\n";
itemStr += "\t\t\t\t<contacts>"+contacts+"</contacts>\n";
itemStr += "\t\t\t\t<phone>"+phone+"</phone>\n";
itemStr += "\t\t\t\t<type>"+type+"</type>\n\t\t\t"+itemEnd+"\n\t\t";
// <20><><EFBFBD> <20><> resultStr
// û<><C3BB> item<65><6D> itemsize ==1
if(itemsize ==1){
var dataTimebeginstr = itemArray[0].split(dataTimeEndstr);
resultStr += dataTimebeginstr[0];
resultStr = resultStr + "\t" + itemStr;
resultStr += dataTimeEndstr;
for(var i = 1; i < dataTimebeginstr.length;i++){
resultStr += dataTimebeginstr[i];
}
}
// <20><> item<65><6D>
else{
resultStr += itemArray[0];
if(version == 1){
for(var i=1; i < itemsize-1; i++){
resultStr += item;
resultStr += itemArray[i];
}
resultStr += itemStr+"\t";
resultStr += item;
// itemArray[itemsize-1]: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></dataTimes>
resultStr += itemArray[itemsize-1];
}
else{
var addtimes = 0;
var isadd = 0;
for(var i=1; i < itemsize-1; i++){
isadd++;
if(addtimes == 0){
if(itemArray[i].indexOf(id)!= -1){
resultStr += itemStr + "\t";
addtimes = 1;
}
}
resultStr += item;
resultStr += itemArray[i];
}
if(isadd == 0){
if(addtimes == 0){
if(itemArray[i].indexOf(id)!= -1){
resultStr += itemStr + "\t";
addtimes = 1;
}
}
}
// itemArray[itemsize-1]: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></dataTimes>
resultStr += item;
resultStr += itemArray[itemsize-1];
}
}
//Ȼ<><C8BB><EFBFBD><EFBFBD>ϵ<EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD>
resultStr += dataTimestr;
resultStr += timesArray[2];
}
//<2F><><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD>
resultStr += datatype;
resultStr += typeArray[2];
}
console.log("-----------------------------------------------");
console.log(resultStr);
console.log(typeof resultStr);
// д<><D0B4><EFBFBD>ļ<EFBFBD>
fs.writeFile(dataDetailPath, resultStr, function(err){
if(err)
console.log(err);
else
console.log('has finished');
});
}
});
}
function savehuizong(collecttime, type, id, name, realpath, fakename){
var typestr = "id=\""+type+"\"";
var data = fs.readFileSync(dataPath, "utf-8");
data = data.toString();
var node_arr = data.split("<node");
var node_arr_size = node_arr.length;
//遍历每个节点
for (var i = 1; i < node_arr_size; i++) {
if(node_arr[i] == undefined ){
continue;
}
if(node_arr[i].indexOf(typestr) != -1){
var tem_arr = node_arr[i].split("</node");
var nodeData = "\t<node id=\""+type+"_"+id+"\" name=\""+name+"\" fakename=\""+fakename+"\" path=\""+realpath+"\" time=\""+collecttime+"\"></node>\n\t";
var temhuizonglastSize = tem_arr.length ;
//判断有多少</node>
if (temhuizonglastSize <= 2) {
if(temhuizonglastSize == 2 && tem_arr[1].indexOf(">") != -1){
node_arr[i] = tem_arr[0]+nodeData + "</node>";
}
else{
node_arr[i] = tem_arr[0]+nodeData;
}
}
else{
node_arr[i] = tem_arr[0]+nodeData;
var nodestrtem = "";
for (var k = 1; k < temhuizonglastSize; k++) {
nodestrtem = nodestrtem + "\n</node>";
}
node_arr[i] = node_arr[i] + nodestrtem;
}
break;
}
}
var result_str = node_arr[0];
for (var j = 1; j < node_arr_size; j++) {
result_str = result_str +"<node"+ node_arr[j];
}
fs.writeFileSync(dataPath, result_str);
}
exports.getVersionPath = getVersionPath;
exports.mkdataForPage = mkdataForPage;
exports.saveByIdToXml = saveByIdToXml;
exports.savehuizong = savehuizong;

@ -0,0 +1,10 @@
/// <reference path="../../includes.d.ts" />
/// <reference path="developerHelpers.d.ts" />
declare module Developer {
var _module: ng.IModule;
var controller: (name: string, inlineAnnotatedConstructor: any[]) => ng.IModule;
var route: (templateName: string, reloadOnSearch?: boolean) => {
templateUrl: string;
reloadOnSearch: boolean;
};
}

@ -0,0 +1,10 @@
/// <reference path="../../includes.d.ts" />
/// <reference path="developerHelpers.d.ts" />
declare module Developer {
var _module: ng.IModule;
var controller: (name: string, inlineAnnotatedConstructor: any[]) => ng.IModule;
var route: (templateName: string, reloadOnSearch?: boolean) => {
templateUrl: string;
reloadOnSearch: boolean;
};
}

@ -0,0 +1,10 @@
/// <reference path="../../includes.d.ts" />
/// <reference path="developerHelpers.d.ts" />
declare module Developer {
var _module: ng.IModule;
var controller: (name: string, inlineAnnotatedConstructor: any[]) => ng.IModule;
var route: (templateName: string, reloadOnSearch?: boolean) => {
templateUrl: string;
reloadOnSearch: boolean;
};
}

5
defs.d.ts vendored

@ -8,6 +8,9 @@
/// <reference path="d.ts/developer/ts/dataManagerHelper.d.ts"/>
/// <reference path="d.ts/developer/ts/developerPlugin.d.ts"/>
/// <reference path="d.ts/developer/ts/dataManagerModel.d.ts"/>
/// <reference path="d.ts/developer/ts/developerPlugin.ts.BASE.d.ts"/>
/// <reference path="d.ts/developer/ts/developerPlugin.ts.LOCAL.d.ts"/>
/// <reference path="d.ts/developer/ts/developerPlugin.ts.REMOTE.d.ts"/>
/// <reference path="d.ts/developer/ts/environmentPanel.d.ts"/>
/// <reference path="d.ts/developer/ts/home.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsJob.d.ts"/>
@ -25,7 +28,6 @@
/// <reference path="d.ts/developer/ts/projects.d.ts"/>
/// <reference path="d.ts/developer/ts/workspace.d.ts"/>
/// <reference path="d.ts/developer/ts/workspaces.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/apps.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/breadcrumbs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/build.d.ts"/>
@ -70,3 +72,4 @@
/// <reference path="d.ts/kubernetes/ts/sharedControllers.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/tabs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/templates.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>

File diff suppressed because one or more lines are too long

@ -25,6 +25,13 @@
<!-- endbower -->
<link rel="stylesheet" type="text/css" href="libs/angular-tree-control/css/tree-control-attribute.css">
<link rel="stylesheet" href="dist/hawtio-kubernetes.css" />
<<<<<<< .mine
=======
<link rel="stylesheet" type="text/css" href="new/sj_style.css">
>>>>>>> .theirs
<!-- bower:js -->
<script src="libs/jquery/dist/jquery.js"></script>
<script src="libs/angular/angular.js"></script>
@ -128,14 +135,30 @@
</style>
</head>
<<<<<<< .mine
<body style="padding-top: 75px;">
<nav class="navbar navbar-fixed-top navbar-pf" role="navigation">
<a href="/" class="log fl"><img src="/" class="log-img"></a>
<ul class="nav navbar-nav navbar-primary" hawtio-main-nav></ul>
=======
</head>
<body >
<nav class="navbar navbar-fixed-top navbar-pf sj_header " role="navigation" >
<a href="/" class="log fl sj_logo" ><img src="new/images/logo.png" class="log-img" ></a>
<ul class="nav navbar-nav navbar-primary sj_topnav" hawtio-main-nav></ul>
>>>>>>> .theirs
</nav>
<platform-sub-tabs-outlet></platform-sub-tabs-outlet>
<<<<<<< .mine
<div id="main" class="container-fluid container-pf-nav-pf-vertical container-pf-nav-pf-vertical-with-secondary content-margin" ng-controller="HawtioNav.ViewController" hawtio-main-outlet>
<div class="row">
=======
<div id="main" class="container-fluid container-pf-nav-pf-vertical container-pf-nav-pf-vertical-with-secondary content-margin" ng-controller="HawtioNav.ViewController" hawtio-main-outlet >
<div class="row" ng-class="getClass()" >
>>>>>>> .theirs
<hawtio-breadcrumbs-outlet></hawtio-breadcrumbs-outlet>
</div>
<div class="row" ng-class="getClass()">

24
my.js

@ -1,24 +0,0 @@
function Recursion(node){
var count=0;
for (var key in node) {
count++;
var value = node[key];
delete node[key];
//如果node为叶子节点
if (key.toString() == '$') {
for (var attr in value)
node[attr] = value[attr];
} else {
if (value instanceof Array) {
if (value.length > 0) {
node["children"] = value;
for (var obj in value)
Recursion(value[obj]);
}
}
}
}
if(count==1)
node["children"]=[];
}
exports.Recursion=Recursion;

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

@ -0,0 +1,85 @@
/* 样式重置 */
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#fff;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{color:#7a7a7a;text-decoration:none;}
a:hover,a:active{color:#333;}
/* 清除 */
.clear{ zoom:1;}
.clear:after {content:".";height:0;visibility:hidden;display:block;clear:both;}
.fl{ float:left;}
.fr{ float:right;}
.cl{ clear:both; overflow:hidden;}
/* public*/
.ml5{ margin-top: 5px;}.ml10{ margin-top: 10px;}
.ml5{ margin-left:5px;}.ml10{ margin-left:10px;}
.mr5{ margin-right:5px;}.mr10{ margin-right:10px;}
a.sj_btn_grey{ display:inline-block; padding:0px 15px; height:30px; line-height:30px; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; background-image:-webkit-linear-gradient(top, #fdfdfd,#e8e8e8);background-image:linear-gradient(top,#fdfdfd,#e8e8e8); border:1px solid #cecece; color:#505050;}
a:hover.sj_btn_grey{ background-image:-webkit-linear-gradient(top, #eeeeee,#d3d3d3);background-image:linear-gradient(top,#eeeeee,#d3d3d3);}
.sj_btn_grey{ display:inline-block; padding:0px 15px; height:30px; line-height:30px; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; background-image:-webkit-linear-gradient(top, #fdfdfd,#e8e8e8);background-image:linear-gradient(top,#fdfdfd,#e8e8e8); border:1px solid #cecece; color:#505050;}
.sj_btn_grey:hover{ background-image:-webkit-linear-gradient(top, #eeeeee,#d3d3d3);background-image:linear-gradient(top,#eeeeee,#d3d3d3);}
/* sj_header */
.sj_header{ height:70px; width:100%; background:#1d1d1d;}
.sj_header a.sj_logo{ display:block; height:41px; width:146px; padding:14px 20px 0 12px;}
.sj_topnav{ height:70px; width:100%; padding-left: 180px; }
.sj_topnav li a{ height:70px; line-height:70px; font-size:14px; color:#fff; padding:0 20px;}
.sj_topnav li a:hover,.sj_topnav li a.sj_topnav_active{ background-image:-webkit-linear-gradient(top, #424242,#323232);background-image:linear-gradient(top,#424242,#323232); }
/* sj_content */
.sj_content{ width:100%; position:relative; color:#505050;}
.sj_leftnav{ width:170px; min-height:800px; max-height:985px; background:#1d1d1d; position:absolute; left:0; top:0px;}
.sj_leftnav_i{ background:#717171; padding:0 5px;;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; margin-left:80px; }
.sj_menu {margin-top:12px;background:#1d1d1d; }
.sj_menu_nav { background-image:-webkit-linear-gradient(top, #404040,#353535);background-image:linear-gradient(top,#404040,#353535); color: #fff; height:40px; line-height:38px; padding-left:15px; border: none; border-top: 2px solid #4d4d4d; border-bottom: 2px solid #1d1d1d;}
.sj_menu_nav:hover{ background-image:-webkit-linear-gradient(top, #535353,#353535);background-image:linear-gradient(top,#535353,#353535);}
.sj_menu_nav i{ font-style: normal;}
.sj_menu_nav a{ color: #fff;}
.sj_menu .sj_menu_nav ul{background: #1d1d1d; color: #fff;padding-left: 20px; border:none;}
.sj_menu_ul{ }
.sj_menu_ul li a{ display: block; background: #1d1d1d; color: #fff;padding-left: 30px; height: 40px; line-height: 40px; }
.sj_menu_ul li a:hover{background: #fff; color:#1d1d1d;}
#menu li a:hover { background-image:-webkit-linear-gradient(top, #535353,#353535);background-image:linear-gradient(top,#535353,#353535);}
#menu li ul li a { background: #1d1d1d; color: #fff;padding-left: 20px; border:none;}
#menu li ul li a:hover,.sj_leftnav ul#menu li ul li .leftnavact { background: #fff; color:#1d1d1d;}
.sj_menu_01{ background:url(../new/images/sj_icons.png) 0 0px no-repeat; padding-left:20px;}
.sj_menu_02{ background:url(../new/images/sj_icons.png) 0 -29px no-repeat; padding-left:20px;}
.sj_menu_03{ background:url(../new/images/sj_icons.png) 0 -112px no-repeat; padding-left:20px;}
.sj_menu_04{ background:url(../new/images/sj_icons.png) 0 -133px no-repeat; padding-left:20px;}
.sj_contentbox{ width:100%; background:#fff; min-height:800px; }
.sj_icons_home{ background:url(../new/images/sj_icons.png) 0 -60px no-repeat; width:15px; height:15px; margin-top:10px; margin-right:3px;}
.sj_content_position{ background:#eee; height:35px; line-height:35px; color:#7a7a7a; margin:2px 0 0 170px; padding-left:20px;}
.sj_content_position ul li{ float:left;}
.sj_filter li{ float:left;}
.sj_filter li a{ display: inline-block; border:1px solid #cecece;background-image:-webkit-linear-gradient(top, #fcfcfc,#e9e9e9);background-image:linear-gradient(top, #fcfcfc,#e9e9e9); padding:5px 15px; color:#505050; margin-right:5px;}
.sj_filter li a:hover,.sj_filter li a.active{ background:#cdcdcd; border:1px solid #9e9e9e;}
.sj_content_top{ margin:20px 20px 0 190px;}
.sj_searchbox{position:relative;}
.sj_search_input{-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; border:1px solid #d3d3d3; background:#fff; padding-left:5px; color:#888; height:28px; width:210px;box-shadow: inset 0px 0px 5px #dcdcdc; }
.sj_searchbox a.sj_search_btn{ position:absolute; top:5px; right:5px; background:url(../new/images/sj_icons.png) 0 -82px no-repeat; display:block; width:20px; height:20px; }
/* table */
.sj_content_table{ }
.sj_content_table > tbody > tr > td{ height:36px; line-height:36px;}
.sj_content_table tr td.tl{ text-align:left;}
.sj_content_table .table-header{background-image:-webkit-linear-gradient(top, #f7f7f7,#dfdfdf);background-image:linear-gradient(top, #f7f7f7,#dfdfdf); border-bottom:1px solid #a6a6a6;}
.sj_content_table > thead > tr > th{ height:36px; line-height:36px;}
.sj_content_table .sj_tr_grey{ background:#f3f3f3;}
.sj_table_td01{ width:2%;}
.sj_table_td02{ width:9%;}
.sj_table_td03{ width:22%;}
.sj_table_td04{ width:14%;}
.sj_table_td05{ width:13%;}
.sj_table_td06{ width:10%;}
.sj_table_td07{ width:30%;}
.sj_table_td08{ width:60%;}
.sj_table_td09{ width:70%;}
.sj_over_hid{ display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.sj_content_table table tr td input{ margin-top:15px;}
.sj_content_table .sj_table_top td{ border-bottom:1px solid #a6a6a6; font-weight:bold; border-right:1px solid #ccc;}
.sj_table_bottom{ height:30px; line-height:30px; }
.sj_table_bottom li{ float:left;}
.sj_table_select{ background:#fff; border:1px solid #b1b1b1; height:25px; margin:0 5px;}

@ -1,4 +1,4 @@
<div ng-controller="Developer.WorkspacesController" hawtio-card-bg>
<div ng-controller="Developer.WorkspacesController" hawtio-card-bg style="margin-top:100px;">
<div hawtio-breadcrumbs></div>
<div hawtio-tabs></div>
<div class="container-content">
@ -12,6 +12,7 @@
<p class="alert alert-info">当前没有可以查看的数据.</p>
</div>
<div ng-show="model.data.length">
<<<<<<< .mine
<table class="table table-striped table-bordered" hawtio-simple-table="tableConfig"></table>
<div class="row">
<div class="col-xs-6 col-sm-2">
@ -39,6 +40,35 @@
</div>
</div>
</div>
=======
<table class="table table-striped table-bordered sj_content_table" hawtio-simple-table="tableConfig"></table>
<div class="row clear">
<div class=" fl">
<input type="checkbox" class="fl mr5 " style="margin-top: 8px;" />
<label class="fl mr5 " style="margin-top: 5px; font-style:nomal;">全选</label>
<a class="sj_btn_grey pull-left mr5" title="启动oracle服务" href="/kubernetes/replicationControllers" ng-disabled="!id && tableConfig.selectedItems.length == 0" ng-click="createOracleService(id || tableConfig.selectedItems)">启动oracle服务</a>
<a class="sj_btn_grey pull-left mr5" title="迁移数据" href="/kubernetes/replicationControllers" ng-disabled="!id && tableConfig.selectedItems.length == 0" ng-click="createOracleService(id || tableConfig.selectedItems)">迁移数据</a>
<a class="sj_btn_grey pull-left mr5" title="删除数据" href="/kubernetes/replicationControllers" ng-disabled="!id && tableConfig.selectedItems.length == 0" ng-click="createOracleService(id || tableConfig.selectedItems)">删除数据</a>
</div>
<ul class="fr sj_table_bottom">
<li class="mr5">当前显示1~7行共7行。</li>
<li class="mr5">每页显示
<select ng-options="value for value in pageSizeChoses" ng-change="selectAction()" ng-model="options.currentTableSize"></select>
</li>
<li class="mr5">当前页码</li>
<li>
<div class="hawtio-pager clearfix">
<label>{{options.currentPageNum}} / {{options.getPageSizeNum()}}</label>
<div class=btn-group>
<button class="btn sj_btn_grey" ng-disabled="isEmptyOrFirst()" ng-click="first()"><i class="fa fa-fast-backward"></i></button>
<button class="btn sj_btn_grey" ng-disabled="isEmptyOrFirst()" ng-click="previous()"><i class="fa fa-step-backward"></i></button>
<button class="btn sj_btn_grey " ng-disabled="isEmptyOrLast()" ng-click="next()"><i class="fa fa-step-forward"></i></button>
<button class="btn sj_btn_grey" ng-disabled="isEmptyOrLast()" ng-click="last()"><i class="fa fa-fast-forward"></i></button>
</div>
</div>
</li>
</ul>
>>>>>>> .theirs
</div>
</div>
</div>

@ -12,12 +12,10 @@ module Developer {
.when("/data-manager", route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/all'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/financial'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/social-security'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/social-security'), route('workspaces.html', false)
.when(UrlHelpers.join(context, 'task'), route('apps.html', false))
.otherwise(context);
}]);
}]);
_module.run(['viewRegistry', 'ServiceRegistry', 'HawtioNav', 'KubernetesModel', '$templateCache', (viewRegistry, ServiceRegistry, HawtioNav, KubernetesModel, $templateCache) => {
log.debug("Running");

@ -194,21 +194,21 @@ module Navigation {
restrict: 'AE',
replace: true,
template: `
<div class="nav-pf-vertical nav-pf-vertical-with-secondary-nav" ng-controller="Developer.NavBarController" ng-class="getClass()">
<ul class="navbar-lf-menu">
<li ng-repeat="subTab in subTabConfig">
<div class="expandable closed" ng-show="subTab.items.length">
<div title="The title" class="title">
<i class="expandable-indicator"><span style="font-size:12px;color:red">{{subTab.label}}</i>
<div class="nav-pf-vertical nav-pf-vertical-with-secondary-nav sj_menu" ng-controller="Developer.NavBarController" ng-class="getClass()">
<ul class="navbar-lf-menu " >
<li ng-repeat="subTab in subTabConfig " >
<div class="expandable closed " ng-show="subTab.items.length" style=" padding:0;">
<div title="The title" class="title sj_menu_nav" >
<i class=" sj_menu_01" >{{subTab.label}}</i>
</div>
<ul class="expandable-body well">
<li ng-repeat="item in subTab.items">
<a href="{{item.href}}">{{item.label}}</a>
<ul class="expandable-body sj_menu_ul" >
<li ng-repeat="item in subTab.items" >
<a href="{{item.href}}" >{{item.label}}</a>
</li>
</ul>
</div>
<div ng-hide="subTab.items.length">
<a href="{{subTab.href}}">{{subTab.label}}</a>
<div ng-hide="subTab.items.length" class="sj_menu_nav" >
<i class=" sj_menu_02" ></i><a href="{{subTab.href}}">{{subTab.label}}</a>
</div>
</li>
</ul>

@ -1,213 +0,0 @@
var fs = require('fs'), path = require('path'), util = require('util'), Stream = require('stream').Stream;
module.exports = resumable = function(temporaryFolder){
var $ = this;
$.temporaryFolder = temporaryFolder;
$.maxFileSize = null;
$.fileParameterName = 'file';
try {
fs.mkdirSync($.temporaryFolder);
}catch(e){}
var cleanIdentifier = function(identifier){
return identifier.replace(/^0-9A-Za-z_-/img, '');
}
var getChunkFilename = function(chunkNumber, identifier){
// Clean up the identifier
identifier = cleanIdentifier(identifier);
// What would the file name be?
return path.join($.temporaryFolder, './resumable-'+identifier+'.'+chunkNumber);
}
var validateRequest = function(chunkNumber, chunkSize, totalSize, identifier, filename, fileSize){
// Clean up the identifier
identifier = cleanIdentifier(identifier);
// Check if the request is sane
if (chunkNumber==0 || chunkSize==0 || totalSize==0 || identifier.length==0 || filename.length==0) {
return 'non_resumable_request';
}
var numberOfChunks = Math.max(Math.floor(totalSize/(chunkSize*1.0)), 1);
if (chunkNumber>numberOfChunks) {
return 'invalid_resumable_request1';
}
// Is the file too big?
if($.maxFileSize && totalSize>$.maxFileSize) {
return 'invalid_resumable_request2';
}
if(typeof(fileSize)!='undefined') {
if(chunkNumber<numberOfChunks && fileSize!=chunkSize) {
// The chunk in the POST request isn't the correct size
return 'invalid_resumable_request3';
}
if(numberOfChunks>1 && chunkNumber==numberOfChunks && fileSize!=((totalSize%chunkSize)+chunkSize)) {
// The chunks in the POST is the last one, and the fil is not the correct size
return 'invalid_resumable_request4';
}
if(numberOfChunks==1 && fileSize!=totalSize) {
// The file is only a single chunk, and the data size does not fit
return 'invalid_resumable_request5';
}
}
return 'valid';
}
//'found', filename, original_filename, identifier
//'not_found', null, null, null
$.get = function(req, callback){
var chunkNumber = req.param('resumableChunkNumber', 0);
var chunkSize = req.param('resumableChunkSize', 0);
var totalSize = req.param('resumableTotalSize', 0);
var identifier = req.param('resumableIdentifier', "");
var filename = req.param('resumableFilename', "");
if(validateRequest(chunkNumber, chunkSize, totalSize, identifier, filename)=='valid') {
var chunkFilename = getChunkFilename(chunkNumber, identifier);
fs.exists(chunkFilename, function(exists){
if(exists){
callback('found', chunkFilename, filename, identifier);
} else {
callback('not_found', chunkFilename, filename, identifier);
}
});
} else {
callback('not_found2', chunkFilename, filename, identifier);
}
}
//'partly_done', filename, original_filename, identifier
//'done', filename, original_filename, identifier
//'invalid_resumable_request', null, null, null
//'non_resumable_request', null, null, null
$.post = function(req, callback){
var fields = req.body;
var files = req.files;
var chunkNumber = fields['resumableChunkNumber'];
var chunkSize = fields['resumableChunkSize'];
var totalSize = fields['resumableTotalSize'];
var identifier = cleanIdentifier(fields['resumableIdentifier']);
var filename = fields['resumableFilename'];
var original_filename = fields['resumableIdentifier'];
if(!files[$.fileParameterName] || !files[$.fileParameterName].size) {
callback('invalid_resumable_request', null, null, null);
return;
}
var validation = validateRequest(chunkNumber, chunkSize, totalSize, identifier, files[$.fileParameterName].size);
if(validation=='valid') {
var chunkFilename = getChunkFilename(chunkNumber, identifier);
// Save the chunk (TODO: OVERWRITE)
fs.rename(files[$.fileParameterName].path, chunkFilename, function(){
// Do we have all the chunks?
var currentTestChunk = 1;
var numberOfChunks = Math.max(Math.floor(totalSize/(chunkSize*1.0)), 1);
var testChunkExists = function(){
fs.exists(getChunkFilename(currentTestChunk, identifier), function(exists){
if(exists){
currentTestChunk++;
if(currentTestChunk>numberOfChunks) {
callback('done', filename, original_filename, identifier);
} else {
// Recursion
testChunkExists();
}
} else {
callback('partly_done', filename, original_filename, identifier);
}
});
}
testChunkExists();
});
} else {
callback(validation, filename, original_filename, identifier);
}
}
// Pipe chunks directly in to an existsing WritableStream
// r.write(identifier, response);
// r.write(identifier, response, {end:false});
//
// var stream = fs.createWriteStream(filename);
// r.write(identifier, stream);
// stream.on('data', function(data){...});
// stream.on('end', function(){...});
$.write = function(identifier, writableStream, options) {
options = options || {};
options.end = (typeof options['end'] == 'undefined' ? true : options['end']);
// Iterate over each chunk
var pipeChunk = function(number) {
var chunkFilename = getChunkFilename(number, identifier);
fs.exists(chunkFilename, function(exists) {
if (exists) {
// If the chunk with the current number exists,
// then create a ReadStream from the file
// and pipe it to the specified writableStream.
var sourceStream = fs.createReadStream(chunkFilename);
sourceStream.pipe(writableStream, {
end: false
});
sourceStream.on('end', function() {
// When the chunk is fully streamed,
// jump to the next one
pipeChunk(number + 1);
});
} else {
// When all the chunks have been piped, end the stream
if (options.end) writableStream.end();
if (options.onDone) options.onDone();
}
});
}
pipeChunk(1);
}
$.clean = function(identifier, options) {
options = options || {};
// Iterate over each chunk
var pipeChunkRm = function(number) {
var chunkFilename = getChunkFilename(number, identifier);
//console.log('removing pipeChunkRm ', number, 'chunkFilename', chunkFilename);
fs.exists(chunkFilename, function(exists) {
if (exists) {
console.log('exist removing ', chunkFilename);
fs.unlink(chunkFilename, function(err) {
if (err && options.onError) options.onError(err);
});
pipeChunkRm(number + 1);
} else {
if (options.onDone) options.onDone();
}
});
}
pipeChunkRm(1);
}
return $;
}
Loading…
Cancel
Save