@xuda.io/xuda-dbs-plugin-xuda
Version:
Xuda Database Socket for Xuda's proprietary structure powered by CouchDB
32 lines (27 loc) • 1.36 kB
JavaScript
export function tabs(doc) {
return {
accounts: {
svg_icon:
'<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-cloud-data-connection" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M5 9.897c0 -1.714 1.46 -3.104 3.26 -3.104c.275 -1.22 1.255 -2.215 2.572 -2.611c1.317 -.397 2.77 -.134 3.811 .69c1.042 .822 1.514 2.08 1.239 3.3h.693a2.42 2.42 0 0 1 2.425 2.414a2.42 2.42 0 0 1 -2.425 2.414h-8.315c-1.8 0 -3.26 -1.39 -3.26 -3.103z"></path> <path d="M12 13v3"></path> <circle cx="12" cy="18" r="2"></circle> <path d="M14 18h7"></path> <path d="M3 18h7"></path> </svg>',
text: "Connections",
type: "multi",
fields: {
db_connection_string: {
type: "string",
placeholder: "https://john:12345678@db.xuda.io:6984/employees",
mandatory: true,
label: "Db Connection String",
size: 12,
value: `https://${doc.app_db_admin_username}:${doc.app_db_admin_password}@xuda.io/db/${doc.app_db_name}`,
},
},
},
};
}
export function public_filter(doc) {
var ret = {};
for (const [key, val] of Object.entries(doc.accounts)) {
ret[key] = {};
}
return ret;
}