This commit is contained in:
2019-04-10 18:08:50 +08:00
parent 9623b70875
commit 6e7388ddf4
9 changed files with 71 additions and 81 deletions

12
root/api/db.js Normal file
View File

@@ -0,0 +1,12 @@
const db = {
catalogList({dbAccount, dbPlatId}) { // database列表
console.log(dbAccount)
return red.postX('/_db/catalog_list', {dbAccount: JSON.stringify(dbAccount), dbPlatId})
},
tableList({dbPlatId, catalog}) { // 数据库表列表
return red.postX('/_db/table_list', {dbPlatId, catalog})
},
tableInfo({dbPlatId, catalog, tableName}) {
return red.postX('/_db/table_info', {dbPlatId, catalog, tableName})
}
}

View File

@@ -1,50 +1,5 @@
/*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));
},
@@ -82,10 +37,9 @@ const meta = {
callback(json);
});
},
getCfg({name}, callback) {
red.getJSON("/meta/cfg",{name}, json => {
json = red.replacePoint(json)
callback(json);
getCfg({name}) {
return red.postX("/meta/cfg",{name}, res => {
return red.replacePoint(res)
});
},
getDataList({name, filters, orders, limit}, callback) {
@@ -94,14 +48,4 @@ const meta = {
callback(json)
})
}
}
/*
export {
getTableList,
getPlats,
getServiceDetail,
getServiceInfo,
getServiceList,
getTableDetail
}*/
}

View File

@@ -15,8 +15,5 @@ const plat = {
dbSave({plat}) {
return red.postX('/plat/db_save', {plat})
},
catalogList({dbAccount, dbPlatId}) { // database列表
console.log(dbAccount)
return red.postX('/_db/catalog_list', {dbAccount: JSON.stringify(dbAccount), dbPlatId})
}
}

View File

@@ -6,7 +6,7 @@ const login = ({username, pwd}) => {
const logout = () => {
red.getJSON("/user/logout",{}, function () {
red.showMsg({msg:"退出成功"});
red.showOk('退出成功')
setTimeout(() => {
location.href = "/user/login.html";
}, 2000)