mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-10 04:58:03 -05:00
Added capability to deploy PostgreSQL servers on Microsoft Azure. Fixes #7178
This commit is contained in:
committed by
Akshay Joshi
parent
99c7a50fd6
commit
7e1e068370
@@ -12,7 +12,7 @@ import _ from 'lodash';
|
||||
import {
|
||||
FormInputText, FormInputSelect, FormInputSwitch, FormInputCheckbox, FormInputColor,
|
||||
FormInputFileSelect, FormInputToggle, InputSwitch, FormInputSQL, InputSQL, FormNote, FormInputDateTimePicker, PlainString,
|
||||
InputSelect, InputText, InputCheckbox, InputDateTimePicker, InputFileSelect, FormInputKeyboardShortcut, FormInputQueryThreshold, FormInputSelectThemes, InputRadio
|
||||
InputSelect, InputText, InputCheckbox, InputDateTimePicker, InputFileSelect, FormInputKeyboardShortcut, FormInputQueryThreshold, FormInputSelectThemes, InputRadio, FormButton
|
||||
} from '../components/FormComponents';
|
||||
import Privilege from '../components/Privilege';
|
||||
import { evalFunc } from 'sources/utils';
|
||||
@@ -21,7 +21,7 @@ import CustomPropTypes from '../custom_prop_types';
|
||||
import { SelectRefresh } from '../components/SelectRefresh';
|
||||
|
||||
/* Control mapping for form view */
|
||||
function MappedFormControlBase({ type, value, id, onChange, className, visible, inputRef, noLabel, ...props }) {
|
||||
function MappedFormControlBase({ type, value, id, onChange, className, visible, inputRef, noLabel, onClick, ...props }) {
|
||||
const name = id;
|
||||
const onTextChange = useCallback((e) => {
|
||||
let val = e;
|
||||
@@ -86,6 +86,8 @@ function MappedFormControlBase({ type, value, id, onChange, className, visible,
|
||||
return <FormInputQueryThreshold name={name} value={value} onChange={onTextChange} {...props}/>;
|
||||
case 'theme':
|
||||
return <FormInputSelectThemes name={name} value={value} onChange={onTextChange} {...props}/>;
|
||||
case 'button':
|
||||
return <FormButton name={name} value={value} className={className} onClick={onClick} {...props} />;
|
||||
default:
|
||||
return <PlainString value={value} {...props} />;
|
||||
}
|
||||
@@ -103,7 +105,8 @@ MappedFormControlBase.propTypes = {
|
||||
]),
|
||||
visible: PropTypes.bool,
|
||||
inputRef: CustomPropTypes.ref,
|
||||
noLabel: PropTypes.bool
|
||||
noLabel: PropTypes.bool,
|
||||
onClick: PropTypes.func
|
||||
};
|
||||
|
||||
/* Control mapping for grid cell view */
|
||||
@@ -197,11 +200,11 @@ const ALLOWED_PROPS_FIELD_COMMON = [
|
||||
'mode', 'value', 'readonly', 'disabled', 'hasError', 'id',
|
||||
'label', 'options', 'optionsLoaded', 'controlProps', 'schema', 'inputRef',
|
||||
'visible', 'autoFocus', 'helpMessage', 'className', 'optionsReloadBasis',
|
||||
'orientation', 'isvalidate', 'fields', 'radioType', 'hideBrowseButton'
|
||||
'orientation', 'isvalidate', 'fields', 'radioType', 'hideBrowseButton', 'btnName'
|
||||
];
|
||||
|
||||
const ALLOWED_PROPS_FIELD_FORM = [
|
||||
'type', 'onChange', 'state', 'noLabel', 'text',
|
||||
'type', 'onChange', 'state', 'noLabel', 'text','onClick'
|
||||
];
|
||||
|
||||
const ALLOWED_PROPS_FIELD_CELL = [
|
||||
|
||||
@@ -16,6 +16,7 @@ import Expand from '../../img/fonticon/open_in_full.svg?svgr';
|
||||
import Collapse from '../../img/fonticon/close_fullscreen.svg?svgr';
|
||||
import AWS from '../../img/aws.svg?svgr';
|
||||
import BigAnimal from '../../img/biganimal.svg?svgr';
|
||||
import Azure from '../../img/azure.svg?svgr';
|
||||
|
||||
export default function ExternalIcon({Icon, ...props}) {
|
||||
return <Icon className={'MuiSvgIcon-root'} {...props} />;
|
||||
@@ -72,3 +73,6 @@ AWSIcon.propTypes = {style: PropTypes.object};
|
||||
|
||||
export const BigAnimalIcon = ({style})=><ExternalIcon Icon={BigAnimal} style={{height: '1.4rem', ...style}} data-label="BigAnimalIcon" />;
|
||||
BigAnimalIcon.propTypes = {style: PropTypes.object};
|
||||
|
||||
export const AzureIcon = ({style})=><ExternalIcon Icon={Azure} style={{height: '1.4rem', ...style}} data-label="AzureIcon" />;
|
||||
AzureIcon.propTypes = {style: PropTypes.object};
|
||||
@@ -1289,3 +1289,22 @@ NotifierMessage.propTypes = {
|
||||
closable: PropTypes.bool,
|
||||
onClose: PropTypes.func,
|
||||
};
|
||||
|
||||
|
||||
export function FormButton({required, label,
|
||||
className, helpMessage, onClick, disabled, ...props }) {
|
||||
return (
|
||||
<FormInput required={required} label={label} className={className} helpMessage={helpMessage}>
|
||||
<PrimaryButton onClick={onClick} disabled={disabled} >{gettext(props.btnName)}</PrimaryButton>
|
||||
</FormInput>
|
||||
);
|
||||
}
|
||||
FormButton.propTypes = {
|
||||
required: PropTypes.bool,
|
||||
label: PropTypes.string,
|
||||
className: CustomPropTypes.className,
|
||||
helpMessage: PropTypes.string,
|
||||
onClick: PropTypes.func,
|
||||
disabled: PropTypes.bool,
|
||||
btnName: PropTypes.string
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user