Commit 9a459ace authored by tywldx's avatar tywldx

fix

parent 0dfc1a15
...@@ -13,8 +13,22 @@ var admin = express(); // the sub app ...@@ -13,8 +13,22 @@ var admin = express(); // the sub app
app.use(bodyParser.urlencoded({ extended: false })) app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json()) app.use(bodyParser.json())
var attrs = {
configPath:"config_file",
buildCmd:"command",
gitGroup:"gitPathHead",
host:"url",
projectType:"type",
projectAuth:"auth",
projectDesc:"desc",
logName:"log_name",
jarFilePath:"target_path"
}
var attrComs = Object.keys(attrs)
var attrComsArr = [];
for(let i of attrComs){
attrComsArr.push(attrs[i]);
}
admin.get('/get_node_command/:name', function (req, res) { admin.get('/get_node_command/:name', function (req, res) {
res.setHeader("Content-Type","application/json"); res.setHeader("Content-Type","application/json");
var str = execSync(`node ./get_project_config.js -name ${req.params.name} -attr config_file/command/gitPathHead`) var str = execSync(`node ./get_project_config.js -name ${req.params.name} -attr config_file/command/gitPathHead`)
...@@ -25,6 +39,20 @@ admin.get('/get_node_command/:name', function (req, res) { ...@@ -25,6 +39,20 @@ admin.get('/get_node_command/:name', function (req, res) {
res.send({configPath:config_file,buildCmd:command,gitGroup:gitGroup}); res.send({configPath:config_file,buildCmd:command,gitGroup:gitGroup});
}); });
admin.get('/get_project_attr/:name', function (req, res) {
res.setHeader("Content-Type","application/json");
var comstr = attrComsArr.join("/");
var str = execSync(`node ./get_project_config.js -name ${req.params.name} -attr ${comstr}`)
var items = String(str).replace(/\n/g,"").split("|");
let rs = {},index = 0;
for(let i of items){
rs[attrComs[index]] = i.replace(/\^/g," ");
index++
}
res.send(rs);
});
admin.post('/add_new_proxy', function (req, res) { admin.post('/add_new_proxy', function (req, res) {
let request = req.body; let request = req.body;
var str = String(execSync(`cat ../ngrok/docker_env_name.sh`)).replace(/\n/,""); var str = String(execSync(`cat ../ngrok/docker_env_name.sh`)).replace(/\n/,"");
......
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