mirror of
https://github.com/apache/superset.git
synced 2024-09-16 02:29:39 -04:00
feat: Added multi-regional IPs to Database Connections (#16170)
* added google alert * multi-regional IPs * beto revisions * Update superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * Update superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * Update superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
This commit is contained in:
parent
9f52c103ac
commit
2dc0bdda5d
@ -848,7 +848,16 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
setTabKey(key);
|
||||
};
|
||||
|
||||
const renderStepTwoAlert = () =>
|
||||
const renderStepTwoAlert = () => {
|
||||
const { hostname } = window.location;
|
||||
let ipAlert = connectionAlert?.REGIONAL_IPS?.default || '';
|
||||
const regionalIPs = connectionAlert?.REGIONAL_IPS || {};
|
||||
Object.entries(regionalIPs).forEach(([regex, ipRange]) => {
|
||||
if (regex.match(hostname)) {
|
||||
ipAlert = ipRange;
|
||||
}
|
||||
});
|
||||
return (
|
||||
db?.engine && (
|
||||
<StyledAlertMargin>
|
||||
<Alert
|
||||
@ -862,11 +871,13 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
}
|
||||
description={
|
||||
engineSpecificAlertMapping[db.engine]?.description ||
|
||||
connectionAlert?.DEFAULT?.description
|
||||
connectionAlert?.DEFAULT?.description + ipAlert
|
||||
}
|
||||
/>
|
||||
</StyledAlertMargin>
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
const errorAlert = () => {
|
||||
if (
|
||||
|
Loading…
Reference in New Issue
Block a user