Commit 0105d1b7 authored by tywldx's avatar tywldx

fix

parent 15b73732
......@@ -277,9 +277,9 @@ process.argv.forEach(function(val, index, array) {
function getListAttr(projects, attr) {
var list = [];
for (var i = 0; i < projects.length; i++) {
if (projects[i].is_active) {
// if (projects[i].is_active) {
list.push(projects[i][attr])
}
// }
}
return list.join(" ");
}
......@@ -326,13 +326,13 @@ configFunction.prototype = {
}
}else{
for (var i = 0; i < projects.length; i++) {
if (projects[i].is_active){
// if (projects[i].is_active){
var li = [projects[i]["name"]];
for (var j = 0; j < attrs.length; j++) {
li.push(projects[i][attrs[j]]);
}
list.push(li.join("|"));
}
// }
}
}
return list.join(" ");
......
......@@ -102,7 +102,6 @@ admin.get('/get_project_attr/:name', function (req, res) {
// 获取所有域名
admin.get('/get_hosts', function (req, res) {
res.setHeader("Content-Type","application/json");
var comstr = attrComsArr.join("/");
var str = execSync(`node ./get_project_config.js -type hosts`)
var items = String(str);
res.send(items);
......@@ -111,16 +110,15 @@ admin.get('/get_hosts', function (req, res) {
// 根据类型获取系统名称
admin.get('/get_systems_by_type', function (req, res) {
res.setHeader("Content-Type","application/json");
var comstr = attrComsArr.join("/");
var ui_str = execSync(`node ./get_project_config.js -type ui -attr name`)
ui_str = String(ui_str)
.replace(/xyqb-ui/g,"").replace(/xjd-ui/,"xyqb-ui--xjd-ui")
.replace(/paycenter-ui/g,"").replace(/new-paycenter-ui/,"paycenter-ui--new-paycenter-ui")
.replace(/new-paycenter-ui/g,"").replace(/paycenter-ui/,"paycenter-ui--new-paycenter-ui")
.replace(/\s+/g,",").replace(/\n/g,"").slice(0, -1);
var java_str = execSync(`node ./get_project_config.js -type java -attr name`)
var node_str = execSync(`node ./get_project_config.js -type node -attr name`)
var python_str = execSync(`node ./get_project_config.js -type python -attr name`)
var server_str = `${String(java_str)}${String(node_str)}${String(python_str)}`
var server_str = `${String(java_str)} ${String(node_str)} ${String(python_str)}`
server_str = server_str.replace(/\s+/g,",").replace(/\n/g,"").slice(0, -1);;
res.send({
frontend:ui_str,
......@@ -128,19 +126,21 @@ admin.get('/get_systems_by_type', function (req, res) {
});
});
// 给jenkins使用根据类型获取系统名称
admin.get('/get_systems_by_type_for_jenkins', function (req, res) {
res.setHeader("Content-Type","application/json");
var comstr = attrComsArr.join("/");
var ui_str = execSync(`node ./get_project_config.js -type ui -attr name`)
ui_str = String(ui_str)
.replace(/xyqb-ui/g,"").replace(/xjd-ui/,"xyqb-ui--xjd-ui")
.replace(/paycenter-ui/g,"").replace(/new-paycenter-ui/,"paycenter-ui--new-paycenter-ui");
var java_str = execSync(`node ./get_project_config.js -type java -attr name`)
var node_str = execSync(`node ./get_project_config.js -type node -attr name`)
var python_str = execSync(`node ./get_project_config.js -type python -attr name`)
var server_str = `${ui_str} ${String(java_str)}${String(node_str)}${String(python_str)}`
server_str = server_str.replace(/\n/g,"").slice(0, -1).replace(/\s+/g,"\n");
res.send(server_str);
admin.get('/get_systems_by_type_for_jenkins/:_type', function (req, res) {
let str = ""
if(req.params._type === "frontend"){
var ui_str = execSync(`node ./get_project_config.js -type ui -attr name`)
str = String(ui_str)
.replace(/xyqb-ui/g,"").replace(/xjd-ui/,"xyqb-ui--xjd-ui")
.replace(/new-paycenter-ui/g,"").replace(/paycenter-ui/,"paycenter-ui--new-paycenter-ui");
}else{
var java_str = execSync(`node ./get_project_config.js -type java -attr name`)
var node_str = execSync(`node ./get_project_config.js -type node -attr name`)
var python_str = execSync(`node ./get_project_config.js -type python -attr name`)
str = `${String(java_str)} ${String(node_str)} ${String(python_str)}`
}
str = str.replace(/\n/g,"").replace(/\s+/g,"\n");
res.send(str);
});
// 增加一个新的nginx映射
admin.post('/add_new_proxy', function (req, res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment