Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-deploy-utils
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qa-deploy-utils
Commits
6ea73c6e
Commit
6ea73c6e
authored
Jan 22, 2018
by
tywldx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
faf42d58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
31 deletions
+35
-31
get_project_config_server.js
qa_shell_script/config_server/get_project_config_server.js
+35
-31
No files found.
qa_shell_script/config_server/get_project_config_server.js
View file @
6ea73c6e
...
@@ -7,6 +7,8 @@ var options = {
...
@@ -7,6 +7,8 @@ var options = {
limit
:
'
100kb
'
,
limit
:
'
100kb
'
,
type
:
'
application/octet-stream
'
type
:
'
application/octet-stream
'
};
};
// const mongoose = require('mongoose');
// mongoose.connect('mongodb://localhost/my_database');
var
app
=
express
();
var
app
=
express
();
var
admin
=
express
();
// the sub app
var
admin
=
express
();
// the sub app
...
@@ -30,6 +32,38 @@ var attrComsArr = [];
...
@@ -30,6 +32,38 @@ var attrComsArr = [];
for
(
let
i
of
attrComs
){
for
(
let
i
of
attrComs
){
attrComsArr
.
push
(
attrs
[
i
]);
attrComsArr
.
push
(
attrs
[
i
]);
}
}
// ------------UTILS----------
function
parseStr2Json
(
str
){
var
a
=
{};
var
strs
=
str
.
split
(
"
"
);
for
(
let
i
of
strs
){
if
(
i
){
let
os
=
i
.
split
(
"
|
"
);
a
[
os
[
0
]]
=
{
name
:
os
[
0
],
ip
:
os
[
1
],
http
:
os
[
2
],
https
:
os
[
3
]
}
}
}
return
a
}
function
parseJson2Str
(
json
){
var
a
=
[];
let
keys
=
Object
.
keys
(
json
);
for
(
let
k
of
keys
){
a
.
push
([
json
[
k
].
name
,
json
[
k
].
ip
,
json
[
k
].
http
,
json
[
k
].
https
].
join
(
"
|
"
))
}
return
a
.
join
(
"
"
)
}
// ------------UTILS----------
// 获取节点命令
// 获取节点命令
admin
.
get
(
'
/get_node_command/:name
'
,
function
(
req
,
res
)
{
admin
.
get
(
'
/get_node_command/:name
'
,
function
(
req
,
res
)
{
...
@@ -74,37 +108,6 @@ admin.get('/get_hosts', function (req, res) {
...
@@ -74,37 +108,6 @@ admin.get('/get_hosts', function (req, res) {
res
.
send
(
items
);
res
.
send
(
items
);
});
});
function
parseStr2Json
(
str
){
var
a
=
{};
var
strs
=
str
.
split
(
"
"
);
for
(
let
i
of
strs
){
if
(
i
){
let
os
=
i
.
split
(
"
|
"
);
a
[
os
[
0
]]
=
{
name
:
os
[
0
],
ip
:
os
[
1
],
http
:
os
[
2
],
https
:
os
[
3
]
}
}
}
return
a
}
function
parseJson2Str
(
json
){
var
a
=
[];
let
keys
=
Object
.
keys
(
json
);
for
(
let
k
of
keys
){
a
.
push
([
json
[
k
].
name
,
json
[
k
].
ip
,
json
[
k
].
http
,
json
[
k
].
https
].
join
(
"
|
"
))
}
return
a
.
join
(
"
"
)
}
// 增加一个新的nginx映射
// 增加一个新的nginx映射
admin
.
post
(
'
/add_new_proxy
'
,
function
(
req
,
res
)
{
admin
.
post
(
'
/add_new_proxy
'
,
function
(
req
,
res
)
{
...
@@ -130,6 +133,7 @@ admin.post('/add_new_proxy', function (req, res) {
...
@@ -130,6 +133,7 @@ admin.post('/add_new_proxy', function (req, res) {
// 删除一个namespace映射
// 删除一个namespace映射
admin
.
post
(
'
/remove_proxy
'
,
function
(
req
,
res
)
{
admin
.
post
(
'
/remove_proxy
'
,
function
(
req
,
res
)
{
let
request
=
req
.
body
;
let
request
=
req
.
body
;
console
.
log
(
request
);
let
new_namespace
=
request
[
"
namespace
"
];
let
new_namespace
=
request
[
"
namespace
"
];
var
str
=
String
(
execSync
(
`cat ../ngrok/docker_env_name.sh`
)).
replace
(
/
\n
/
,
""
);
var
str
=
String
(
execSync
(
`cat ../ngrok/docker_env_name.sh`
)).
replace
(
/
\n
/
,
""
);
let
data
=
parseStr2Json
(
str
);
let
data
=
parseStr2Json
(
str
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment