108 lines
3.0 KiB
JavaScript
108 lines
3.0 KiB
JavaScript
/*import red from '../res/js/red'*/
|
|
|
|
/*const getPlats = (callback) => {
|
|
red.getJSON("/meta/plat_list", {}, json => callback(json));
|
|
}
|
|
|
|
const getTableList = (callback) => {
|
|
red.getJSON("/meta/tablelist",{}, function (json) {
|
|
callback(json);
|
|
});
|
|
}
|
|
|
|
const getTableDetail = ({name}, callback) => {
|
|
red.getJSON("/meta/tableinfo",{name}, function (json) {
|
|
callback(json);
|
|
});
|
|
}
|
|
|
|
const getServiceList = (callback) => {
|
|
red.getJSON("/meta/service_list",{}, function (json) {
|
|
json = red.replacePoint(json);
|
|
callback(json);
|
|
});
|
|
}
|
|
|
|
const getServiceInfo = ({name}, callback) => {
|
|
red.getJSON("/meta/service_info",{name}, res => {
|
|
let row = red.replacePoint(res);
|
|
row.shows = row.shows || [];
|
|
row.exports = row.exports || [];
|
|
row.imports = row.imports || [];
|
|
row.filters = row.filters || [];
|
|
|
|
callback(row);
|
|
});
|
|
}
|
|
|
|
function getServiceDetail({name}, callback) {
|
|
red.getJSON("/meta/service_detail",{name}, function (json) {
|
|
json = red.replacePoint(json)
|
|
callback(json);
|
|
});
|
|
}*/
|
|
const meta = {
|
|
/*getPlats: (callback) => {
|
|
red.getJSON("/meta/plat_list", {}, json => callback(json));
|
|
},*/
|
|
getTableList(callback) {
|
|
red.getJSON("/meta/tablelist",{}, json => callback(json));
|
|
},
|
|
getTableDetail({name}, callback) {
|
|
red.getJSON("/meta/tableinfo",{name}, json => callback(json));
|
|
},
|
|
|
|
getServiceList(callback) {
|
|
red.getJSON("/meta/service_list",{}, json => {
|
|
json = red.replacePoint(json);
|
|
callback(json);
|
|
});
|
|
},
|
|
getServiceInfo({name}, callback) {
|
|
red.getJSON("/meta/service_info",{name}, res => {
|
|
/*let row = red.replacePoint(res)
|
|
console.log(row)
|
|
|
|
//let [name, comment, table, edits, imports, shows, exports, filters] = red.replacePoint(res);
|
|
|
|
|
|
row.shows = row.shows || [];
|
|
row.exports = row.exports || [];
|
|
row.imports = row.imports || [];
|
|
row.filters = row.filters || [];*/
|
|
|
|
let {name, comment, table, edits, imports, shows, exports, filters} = red.replacePoint(res)
|
|
|
|
callback({name, comment, table, edits, imports, shows, exports, filters});
|
|
});
|
|
},
|
|
getServiceDetail({name}, callback) {
|
|
red.getJSON("/meta/service_detail",{name}, json => {
|
|
json = red.replacePoint(json)
|
|
callback(json);
|
|
});
|
|
},
|
|
getCfg({name}, callback) {
|
|
red.getJSON("/meta/cfg",{name}, json => {
|
|
json = red.replacePoint(json)
|
|
callback(json);
|
|
});
|
|
},
|
|
getDataList({name, filters, orders, limit}, callback) {
|
|
let fbean = red.replace$({name, filters, orders, limit})
|
|
red.getJSON("/data/list",{fBean: JSON.stringify(fbean)}, (json = {rows:[], total:0}) => {
|
|
callback(json)
|
|
})
|
|
}
|
|
}
|
|
|
|
/*
|
|
export {
|
|
getTableList,
|
|
getPlats,
|
|
getServiceDetail,
|
|
getServiceInfo,
|
|
getServiceList,
|
|
getTableDetail
|
|
}*/
|