Strings are wrapped into gettext in the Dashboard and Cloud modules.
parent
e455114441
commit
8bcd1e4e60
|
@ -124,7 +124,7 @@ export default function Dashboard({
|
|||
...props
|
||||
}) {
|
||||
const classes = useStyles();
|
||||
let tabs = ['Sessions', 'Locks', 'Prepared Transactions'];
|
||||
let tabs = [gettext('Sessions'), gettext('Locks'), gettext('Prepared Transactions')];
|
||||
const [dashData, setdashData] = useState([]);
|
||||
const [msg, setMsg] = useState('');
|
||||
const [tabVal, setTabVal] = useState(0);
|
||||
|
@ -132,7 +132,7 @@ export default function Dashboard({
|
|||
const [schemaDict, setSchemaDict] = React.useState({});
|
||||
|
||||
if (!did) {
|
||||
tabs.push('Configuration');
|
||||
tabs.push(gettext('Configuration'));
|
||||
}
|
||||
tabVal == 3 && did && setTabVal(0);
|
||||
const tabChanged = (e, tabVal) => {
|
||||
|
@ -242,7 +242,7 @@ export default function Dashboard({
|
|||
.catch(function (error) {
|
||||
Notify.alert(
|
||||
gettext('Failed to retrieve data from the server.'),
|
||||
gettext(error.message)
|
||||
error.message
|
||||
);
|
||||
});
|
||||
},
|
||||
|
@ -311,7 +311,7 @@ export default function Dashboard({
|
|||
.catch(function (error) {
|
||||
Notify.alert(
|
||||
gettext('Failed to retrieve data from the server.'),
|
||||
gettext(error.message)
|
||||
error.message
|
||||
);
|
||||
});
|
||||
},
|
||||
|
@ -857,7 +857,7 @@ export default function Dashboard({
|
|||
) : sid && !props.serverConnected ? (
|
||||
<Box className={classes.dashboardPanel}>
|
||||
<div className={classes.emptyPanel}>
|
||||
<EmptyPanelMessage text={gettext(msg)}/>
|
||||
<EmptyPanelMessage text={msg}/>
|
||||
</div>
|
||||
</Box>
|
||||
) : (
|
||||
|
|
|
@ -226,7 +226,7 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose}) {
|
|||
const onBeforeNext = (activeStep) => {
|
||||
return new Promise((resolve, reject)=>{
|
||||
if(activeStep == 1 && cloudProvider == 'rds') {
|
||||
setErrMsg([MESSAGE_TYPE.INFO, 'Validating credentials...']);
|
||||
setErrMsg([MESSAGE_TYPE.INFO, gettext('Validating credentials...')]);
|
||||
var _url = url_for('rds.verify_credentials');
|
||||
const post_data = {
|
||||
cloud: selectionVal,
|
||||
|
@ -243,12 +243,12 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose}) {
|
|||
}
|
||||
})
|
||||
.catch(() => {
|
||||
setErrMsg([MESSAGE_TYPE.ERROR, 'Error while checking cloud credentials']);
|
||||
setErrMsg([MESSAGE_TYPE.ERROR, gettext('Error while checking cloud credentials')]);
|
||||
reject();
|
||||
});
|
||||
} else if(activeStep == 0 && cloudProvider == 'biganimal') {
|
||||
if (!isEmptyString(verificationURI)) { resolve(); return; }
|
||||
setErrMsg([MESSAGE_TYPE.INFO, 'Getting EDB BigAnimal verification URL...']);
|
||||
setErrMsg([MESSAGE_TYPE.INFO, gettext('Getting EDB BigAnimal verification URL...')]);
|
||||
validateBigAnimal()
|
||||
.then((res) => {
|
||||
setVerificationURI(res);
|
||||
|
@ -261,7 +261,7 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose}) {
|
|||
reject();
|
||||
});
|
||||
} else if(activeStep == 2 && cloudProvider == 'azure'){
|
||||
setErrMsg([MESSAGE_TYPE.INFO, 'Checking cluster name availability...']);
|
||||
setErrMsg([MESSAGE_TYPE.INFO, gettext('Checking cluster name availability...')]);
|
||||
checkClusternameAvailbility(azureInstanceData.name)
|
||||
.then((res)=>{
|
||||
if (res.data && res.data.success == 0 ) {
|
||||
|
@ -287,7 +287,7 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose}) {
|
|||
'static', { 'filename': 'img/loading.gif'}
|
||||
);
|
||||
|
||||
setErrMsg([MESSAGE_TYPE.INFO, 'EDB BigAnimal authentication process is in progress...<img src="' + loading_icon_url + '" alt="' + gettext('Loading...') + '">']);
|
||||
setErrMsg([MESSAGE_TYPE.INFO, gettext('EDB BigAnimal authentication process is in progress...') + '<img src="' + loading_icon_url + '" alt="' + gettext('Loading...') + '">']);
|
||||
window.open(verificationURI, 'edb_biganimal_authentication');
|
||||
let _url = url_for('biganimal.verification_ack') ;
|
||||
const myInterval = setInterval(() => {
|
||||
|
@ -325,9 +325,9 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose}) {
|
|||
setErrMsg([]);
|
||||
});
|
||||
|
||||
let cloud_providers = [{label: 'Amazon RDS', value: 'rds', icon: <AWSIcon className={classes.icon} />},
|
||||
{label: 'EDB BigAnimal', value: 'biganimal', icon: <BigAnimalIcon className={classes.icon} />},
|
||||
{'label': 'Azure PostgreSQL', value: 'azure', icon: <AzureIcon className={classes.icon} /> }];
|
||||
let cloud_providers = [{label: gettext('Amazon RDS'), value: 'rds', icon: <AWSIcon className={classes.icon} />},
|
||||
{label: gettext('EDB BigAnimal'), value: 'biganimal', icon: <BigAnimalIcon className={classes.icon} />},
|
||||
{'label': gettext('Azure PostgreSQL'), value: 'azure', icon: <AzureIcon className={classes.icon} /> }];
|
||||
|
||||
return (
|
||||
<CloudWizardEventsContext.Provider value={eventBus.current}>
|
||||
|
|
|
@ -17,6 +17,7 @@ import getApiInstance from '../../../../static/js/api_instance';
|
|||
import { isEmptyString } from 'sources/validators';
|
||||
import PropTypes from 'prop-types';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import gettext from 'sources/gettext';
|
||||
|
||||
const useStyles = makeStyles(() =>
|
||||
({
|
||||
|
@ -209,31 +210,31 @@ function createData(name, value) {
|
|||
|
||||
export function getAWSSummary(cloud, cloudInstanceDetails, cloudDBDetails) {
|
||||
const rows1 = [
|
||||
createData('Cloud', cloud),
|
||||
createData('Instance name', cloudInstanceDetails.name),
|
||||
createData('Public IP', cloudInstanceDetails.public_ip),
|
||||
createData(gettext('Cloud'), cloud),
|
||||
createData(gettext('Instance name'), cloudInstanceDetails.name),
|
||||
createData(gettext('Public IP'), cloudInstanceDetails.public_ip),
|
||||
];
|
||||
|
||||
const rows2 = [
|
||||
createData('PostgreSQL version', cloudInstanceDetails.db_version),
|
||||
createData('Instance type', cloudInstanceDetails.instance_type),
|
||||
createData(gettext('PostgreSQL version'), cloudInstanceDetails.db_version),
|
||||
createData(gettext('Instance type'), cloudInstanceDetails.instance_type),
|
||||
];
|
||||
|
||||
let _storage_type = getStorageType(cloudInstanceDetails);
|
||||
|
||||
const rows3 = [
|
||||
createData('Storage type', _storage_type[1]),
|
||||
createData('Allocated storage', cloudInstanceDetails.storage_size + ' GiB'),
|
||||
createData(gettext('Storage type'), _storage_type[1]),
|
||||
createData(gettext('Allocated storage'), cloudInstanceDetails.storage_size + ' GiB'),
|
||||
];
|
||||
if (_storage_type[0] !== undefined) {
|
||||
rows3.push(createData('Provisioned IOPS', _storage_type[0]));
|
||||
rows3.push(createData(gettext('Provisioned IOPS'), _storage_type[0]));
|
||||
}
|
||||
|
||||
const rows4 = [
|
||||
createData('Database name', cloudDBDetails.db_name),
|
||||
createData('Username', cloudDBDetails.db_username),
|
||||
createData('Password', 'xxxxxxx'),
|
||||
createData('Port', cloudDBDetails.db_port),
|
||||
createData(gettext('Database name'), cloudDBDetails.db_name),
|
||||
createData(gettext('Username'), cloudDBDetails.db_username),
|
||||
createData(gettext('Password'), 'xxxxxxx'),
|
||||
createData(gettext('Port'), cloudDBDetails.db_port),
|
||||
];
|
||||
|
||||
return [rows1, rows2, rows3, rows4];
|
||||
|
|
|
@ -299,33 +299,33 @@ function createData(name, value) {
|
|||
// Summary section
|
||||
export function getAzureSummary(cloud, cloudInstanceDetails, cloudDBDetails) {
|
||||
const rows1 = [
|
||||
createData('Cloud', cloud),
|
||||
createData('Subscription', cloudInstanceDetails.subscription),
|
||||
createData('Resource group', cloudInstanceDetails.resource_group),
|
||||
createData('Region', cloudInstanceDetails.region),
|
||||
createData('Availability zone', cloudInstanceDetails.availability_zone),
|
||||
createData(gettext('Cloud'), cloud),
|
||||
createData(gettext('Subscription'), cloudInstanceDetails.subscription),
|
||||
createData(gettext('Resource group'), cloudInstanceDetails.resource_group),
|
||||
createData(gettext('Region'), cloudInstanceDetails.region),
|
||||
createData(gettext('Availability zone'), cloudInstanceDetails.availability_zone),
|
||||
];
|
||||
|
||||
const rows2 = [
|
||||
createData('PostgreSQL version', cloudInstanceDetails.db_version),
|
||||
createData('Instance type', cloudInstanceDetails.instance_type),
|
||||
createData(gettext('PostgreSQL version'), cloudInstanceDetails.db_version),
|
||||
createData(gettext('Instance type'), cloudInstanceDetails.instance_type),
|
||||
];
|
||||
|
||||
const rows3 = [
|
||||
createData('Allocated storage', cloudInstanceDetails.storage_size + ' GiB'),
|
||||
createData(gettext('Allocated storage'), cloudInstanceDetails.storage_size + ' GiB'),
|
||||
];
|
||||
|
||||
const rows4 = [
|
||||
createData('Username', cloudDBDetails.db_username),
|
||||
createData('Password', 'xxxxxxx'),
|
||||
createData(gettext('Username'), cloudDBDetails.db_username),
|
||||
createData(gettext('Password'), 'xxxxxxx'),
|
||||
];
|
||||
|
||||
const rows5 = [
|
||||
createData('Public IP', cloudInstanceDetails.public_ips),
|
||||
createData(gettext('Public IP'), cloudInstanceDetails.public_ips),
|
||||
];
|
||||
|
||||
const rows6 = [
|
||||
createData('High availability', cloudInstanceDetails.high_availability),
|
||||
createData(gettext('High availability'), cloudInstanceDetails.high_availability),
|
||||
];
|
||||
|
||||
return [rows1, rows2, rows3, rows4, rows5, rows6];
|
||||
|
|
|
@ -16,6 +16,7 @@ import url_for from 'sources/url_for';
|
|||
import getApiInstance from '../../../../static/js/api_instance';
|
||||
import { isEmptyString } from 'sources/validators';
|
||||
import PropTypes from 'prop-types';
|
||||
import gettext from 'sources/gettext';
|
||||
|
||||
const axiosApi = getApiInstance();
|
||||
|
||||
|
@ -163,32 +164,32 @@ function createData(name, value) {
|
|||
|
||||
export function getBigAnimalSummary(cloud, bigAnimalInstanceData, bigAnimalDatabaseData) {
|
||||
const rows1 = [
|
||||
createData('Cloud', cloud),
|
||||
createData('Instance name', bigAnimalInstanceData.name),
|
||||
createData('Region', bigAnimalInstanceData.region),
|
||||
createData('Cluster type', bigAnimalInstanceData.cloud_type),
|
||||
createData('Public IPs', bigAnimalInstanceData.biganimal_public_ip),
|
||||
createData(gettext('Cloud'), cloud),
|
||||
createData(gettext('Instance name'), bigAnimalInstanceData.name),
|
||||
createData(gettext('Region'), bigAnimalInstanceData.region),
|
||||
createData(gettext('Cluster type'), bigAnimalInstanceData.cloud_type),
|
||||
createData(gettext('Public IPs'), bigAnimalInstanceData.biganimal_public_ip),
|
||||
];
|
||||
|
||||
let instance_size = bigAnimalInstanceData.instance_size.split('||');
|
||||
|
||||
const rows2 = [
|
||||
createData('Instance type', bigAnimalInstanceData.instance_type),
|
||||
createData('Instance series', bigAnimalInstanceData.instance_series),
|
||||
createData('Instance size', instance_size[0]),
|
||||
createData(gettext('Instance type'), bigAnimalInstanceData.instance_type),
|
||||
createData(gettext('Instance series'), bigAnimalInstanceData.instance_series),
|
||||
createData(gettext('Instance size'), instance_size[0]),
|
||||
];
|
||||
|
||||
const rows3 = [
|
||||
createData('Volume type', bigAnimalInstanceData.volume_type),
|
||||
createData('Volume properties', bigAnimalInstanceData.volume_properties),
|
||||
createData(gettext('Volume type'), bigAnimalInstanceData.volume_type),
|
||||
createData(gettext('Volume properties'), bigAnimalInstanceData.volume_properties),
|
||||
];
|
||||
|
||||
const rows4 = [
|
||||
createData('Password', 'xxxxxxx'),
|
||||
createData('Database Type', bigAnimalDatabaseData.database_type),
|
||||
createData('Database Version', bigAnimalDatabaseData.postgres_version),
|
||||
createData('High Availability', bigAnimalDatabaseData.high_availability),
|
||||
createData('No. of Standby Replicas', bigAnimalDatabaseData.replicas),
|
||||
createData(gettext('Password'), 'xxxxxxx'),
|
||||
createData(gettext('Database Type'), bigAnimalDatabaseData.database_type),
|
||||
createData(gettext('Database Version'), bigAnimalDatabaseData.postgres_version),
|
||||
createData(gettext('High Availability'), bigAnimalDatabaseData.high_availability),
|
||||
createData(gettext('No. of Standby Replicas'), bigAnimalDatabaseData.replicas),
|
||||
];
|
||||
|
||||
return [rows1, rows2, rows3, rows4];
|
||||
|
|
Loading…
Reference in New Issue