mirror of
https://github.com/apache/superset.git
synced 2024-09-06 22:07:34 -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,25 +848,36 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
setTabKey(key);
|
||||
};
|
||||
|
||||
const renderStepTwoAlert = () =>
|
||||
db?.engine && (
|
||||
<StyledAlertMargin>
|
||||
<Alert
|
||||
closable={false}
|
||||
css={(theme: SupersetTheme) => antDAlertStyles(theme)}
|
||||
type="info"
|
||||
showIcon
|
||||
message={
|
||||
engineSpecificAlertMapping[db.engine]?.message ||
|
||||
connectionAlert?.DEFAULT?.message
|
||||
}
|
||||
description={
|
||||
engineSpecificAlertMapping[db.engine]?.description ||
|
||||
connectionAlert?.DEFAULT?.description
|
||||
}
|
||||
/>
|
||||
</StyledAlertMargin>
|
||||
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
|
||||
closable={false}
|
||||
css={(theme: SupersetTheme) => antDAlertStyles(theme)}
|
||||
type="info"
|
||||
showIcon
|
||||
message={
|
||||
engineSpecificAlertMapping[db.engine]?.message ||
|
||||
connectionAlert?.DEFAULT?.message
|
||||
}
|
||||
description={
|
||||
engineSpecificAlertMapping[db.engine]?.description ||
|
||||
connectionAlert?.DEFAULT?.description + ipAlert
|
||||
}
|
||||
/>
|
||||
</StyledAlertMargin>
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
const errorAlert = () => {
|
||||
if (
|
||||
|
Loading…
Reference in New Issue
Block a user