UNPKG

@xuda.io/xuda-dbs-plugin-mysql

Version:

Xuda Database Socket for MySql

59 lines (54 loc) 1.73 kB
export function tabs(doc) { return { accounts: { svg_icon: '<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-palette" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M12 21a9 9 0 1 1 0 -18a9 8 0 0 1 9 8a4.5 4 0 0 1 -4.5 4h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25" /> <circle cx="7.5" cy="10.5" r=".5" fill="currentColor" /> <circle cx="12" cy="7.5" r=".5" fill="currentColor" /> <circle cx="16.5" cy="10.5" r=".5" fill="currentColor" /> </svg>', text: "Connections", type: "multi", fields: { con_host: { type: "string", placeholder: "example.org", mandatory: true, label: "Host", size: 12, }, con_user: { type: "string", placeholder: "bob", mandatory: true, label: "User", size: 12, }, con_password: { type: "string", placeholder: "secret", mandatory: true, label: "Password", size: 12, }, con_database: { type: "string", placeholder: "my_db", mandatory: true, label: "Database Name", size: 12, }, con_port: { type: "string", placeholder: "445 (optional)", mandatory: false, label: "Port", size: 12, }, }, }, }; } export function public_filter(doc) { var ret = {}; for (const [key, val] of Object.entries(doc.accounts)) { ret[key] = {}; } return ret; }