mirror of
https://github.com/apache/superset.git
synced 2024-09-18 19:49:37 -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);
|
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 && (
|
db?.engine && (
|
||||||
<StyledAlertMargin>
|
<StyledAlertMargin>
|
||||||
<Alert
|
<Alert
|
||||||
@ -862,11 +871,13 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
|||||||
}
|
}
|
||||||
description={
|
description={
|
||||||
engineSpecificAlertMapping[db.engine]?.description ||
|
engineSpecificAlertMapping[db.engine]?.description ||
|
||||||
connectionAlert?.DEFAULT?.description
|
connectionAlert?.DEFAULT?.description + ipAlert
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</StyledAlertMargin>
|
</StyledAlertMargin>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const errorAlert = () => {
|
const errorAlert = () => {
|
||||||
if (
|
if (
|
||||||
|
Loading…
Reference in New Issue
Block a user