Add variable to API endpoint
Allow API to retrun max_connections for frontend database page
This commit is contained in:
parent
f0e4764a11
commit
0ecfb40f5e
3 changed files with 4 additions and 1 deletions
|
@ -58,6 +58,7 @@ class DatabaseTransformer extends BaseClientTransformer
|
||||||
'name' => $model->database,
|
'name' => $model->database,
|
||||||
'username' => $model->username,
|
'username' => $model->username,
|
||||||
'connections_from' => $model->remote,
|
'connections_from' => $model->remote,
|
||||||
|
'max_connections' => $model->max_connections,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ export interface ServerDatabase {
|
||||||
username: string;
|
username: string;
|
||||||
connectionString: string;
|
connectionString: string;
|
||||||
allowConnectionsFrom: string;
|
allowConnectionsFrom: string;
|
||||||
|
maxConnections: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +16,7 @@ export const rawDataToServerDatabase = (data: any): ServerDatabase => ({
|
||||||
username: data.username,
|
username: data.username,
|
||||||
connectionString: `${data.host.address}:${data.host.port}`,
|
connectionString: `${data.host.address}:${data.host.port}`,
|
||||||
allowConnectionsFrom: data.connections_from,
|
allowConnectionsFrom: data.connections_from,
|
||||||
|
maxConnections: data.max_connections,
|
||||||
password: data.relationships && data.relationships.password ? data.relationships.password.attributes.password : undefined,
|
password: data.relationships && data.relationships.password ? data.relationships.password.attributes.password : undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ export default ({ database, className }: Props) => {
|
||||||
<p className={'mt-1 text-2xs text-neutral-500 uppercase select-none'}>Username</p>
|
<p className={'mt-1 text-2xs text-neutral-500 uppercase select-none'}>Username</p>
|
||||||
</div>
|
</div>
|
||||||
<div className={'ml-8 text-center'}>
|
<div className={'ml-8 text-center'}>
|
||||||
<p className={'text-sm'}>{database.max_connections}</p>
|
<p className={'text-sm'}>{database.maxConnections}</p>
|
||||||
<p className={'mt-1 text-2xs text-neutral-500 uppercase select-none'}>Max Connections</p>
|
<p className={'mt-1 text-2xs text-neutral-500 uppercase select-none'}>Max Connections</p>
|
||||||
</div>
|
</div>
|
||||||
<div className={'ml-8'}>
|
<div className={'ml-8'}>
|
||||||
|
|
Loading…
Reference in a new issue