Commit da3757b6 authored by 智勇's avatar 智勇

update

parent c2682e8f
......@@ -321,12 +321,16 @@ exports.get_name_space = async function () {
let db = this.mongo("NameSpaceGroup");
try {
await formatListData(res, db);
this.body = res.details.instances;
this.body = {
code: "0000",
data: res.details.instances
};
} catch (error) {
console.log(error)
this.body = {
code: "0001",
msg: "EOS获取数据问题",
msg: "EOS获取数据出错",
data: JSON.stringify(res),
detail: error.toString()
}
}
......@@ -425,10 +429,20 @@ exports.get_device = async function () {
await this.bindDefault();
let self = this;
let opt = new list_microservice(this.request.query.namespace);
// let opth = new hosts_option()
let dev = await requestPromise(opt);
// let hosts = await requestPromise(opth);
dev = JSON.parse(dev);
try {
dev = JSON.parse(dev);
} catch (error) {
console.log(error)
console.log(dev)
this.body = {
code: "0001",
msg: "EOS获取数据出错",
data: JSON.stringify(dev),
detail: error.toString()
}
return
}
// hosts = JSON.parse(hosts);
let buss = [], base = [], ui = [];
let items = dev.details.instances;
......@@ -446,9 +460,12 @@ exports.get_device = async function () {
}
this.body = {
common: base,
backend: buss,
frontend: ui
code: "0000",
data: {
common: base,
backend: buss,
frontend: ui
}
}
return
}
......
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