Commit da3757b6 authored by 智勇's avatar 智勇

update

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