improve database.select performance
This commit is contained in:
parent
b12b6b39b5
commit
1462d8dd55
|
@ -22,14 +22,15 @@ export const getBackendUiStore = () => {
|
|||
reset: () => store.set({ ...INITIAL_BACKEND_UI_STATE }),
|
||||
database: {
|
||||
select: async db => {
|
||||
const tablesResponse = await api.get(`/api/tables`)
|
||||
const tables = await tablesResponse.json()
|
||||
const datasourcesResponse = await api.get(`/api/datasources`)
|
||||
const datasources = await datasourcesResponse.json()
|
||||
const queriesResponse = await api.get(`/api/queries`)
|
||||
const queries = await queriesResponse.json()
|
||||
const integrationsResponse = await api.get("/api/integrations")
|
||||
const integrations = await integrationsResponse.json()
|
||||
const [tables, datasources, queries, integrations] = await Promise.all([
|
||||
api.get(`/api/tables`).then(r => r.json()),
|
||||
api.get(`/api/datasources`).then(r => r.json()),
|
||||
api.get(`/api/queries`).then(r => r.json()),
|
||||
api.get("/api/integrations").then(r => r.json())
|
||||
])
|
||||
|
||||
console.log(tables)
|
||||
|
||||
const permissionLevels = await store.actions.permissions.fetchLevels()
|
||||
|
||||
store.update(state => {
|
||||
|
|
|
@ -1,111 +0,0 @@
|
|||
export const componentsAndScreens = () => ({
|
||||
components: [
|
||||
{
|
||||
_instanceName: "TextBox",
|
||||
tags: ["Text", "input"],
|
||||
children: false,
|
||||
props: {
|
||||
size: { type: "options", options: ["small", "medium", "large"] },
|
||||
isPassword: "bool",
|
||||
placeholder: "string",
|
||||
label: "string",
|
||||
},
|
||||
},
|
||||
{
|
||||
_instanceName: "Button",
|
||||
tags: ["input"],
|
||||
children: true,
|
||||
props: {
|
||||
size: { type: "options", options: ["small", "medium", "large"] },
|
||||
css: "string",
|
||||
contentText: "string",
|
||||
},
|
||||
},
|
||||
{
|
||||
_instanceName: "div",
|
||||
tags: ["input"],
|
||||
props: {
|
||||
width: "number",
|
||||
},
|
||||
},
|
||||
{
|
||||
_instanceName: "Row View",
|
||||
tags: ["row"],
|
||||
props: {
|
||||
data: "state",
|
||||
},
|
||||
},
|
||||
],
|
||||
screens: [
|
||||
{
|
||||
props: {
|
||||
_component: "budibase-components/TextBox",
|
||||
_instanceName: "SmallTextbox",
|
||||
size: "small",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: "common/PasswordBox",
|
||||
tags: ["mask"],
|
||||
props: {
|
||||
_component: "budibase-components/TextBox",
|
||||
_instanceName: "PasswordBox",
|
||||
isPassword: true,
|
||||
size: "small",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
props: {
|
||||
_component: "budibase-components/Button",
|
||||
_instanceName: "PrimaryButton",
|
||||
css: "btn-primary",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
route: "",
|
||||
props: {
|
||||
_component: "budibase-components/div",
|
||||
width: 100,
|
||||
_instanceName: "Screen 1",
|
||||
_children: [
|
||||
{
|
||||
_component: "budibase-components/Button",
|
||||
contentText: "Button 1",
|
||||
_instanceName: "Button 1",
|
||||
},
|
||||
{
|
||||
_component: "budibase-components/Button",
|
||||
contentText: "Button 2",
|
||||
_instanceName: "Button 2",
|
||||
},
|
||||
{
|
||||
_component: "budibase-components/TextBox",
|
||||
_instanceName: "TextBox",
|
||||
isPassword: true,
|
||||
size: "small",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
props: {
|
||||
_component: "budibase-components/div",
|
||||
_instanceName: "Field",
|
||||
_children: [
|
||||
{
|
||||
_component: "common/SmallTextbox",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
export const stripStandardProps = props => {
|
||||
delete props._id
|
||||
delete props._styles
|
||||
}
|
Loading…
Reference in New Issue