Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Update & Delete in ZooKeeper Browser and added SQL Functi…
…ons in SQL Editor autocomplete list (#5981) * Adding api to edit ZK path * Adding delete api * Support for Update & Delete in ZooKeeper Browser and added SQL Functions in SQL Editor autocomplete list * showing notification on operation completion, display last refresh time, fixed refresh action Co-authored-by: kishoreg <g.kishore@gmail.com>
- Loading branch information
1 parent
054faf7
commit 5da3433
Showing
11 changed files
with
394 additions
and
57 deletions.
There are no files selected for viewing
106 changes: 106 additions & 0 deletions
106
pinot-controller/src/main/resources/app/components/Confirm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/* eslint-disable no-nested-ternary */ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import React, { useEffect } from 'react'; | ||
import { Button, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, makeStyles } from '@material-ui/core'; | ||
import { green, red } from '@material-ui/core/colors'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
dialogContent: { | ||
minWidth: 900 | ||
}, | ||
dialogTextContent: { | ||
fontWeight: 600 | ||
}, | ||
dialogActions: { | ||
justifyContent: 'center' | ||
}, | ||
green: { | ||
fontWeight: 600, | ||
color: green[500], | ||
borderColor: green[500], | ||
'&:hover': { | ||
backgroundColor: green[50], | ||
borderColor: green[500] | ||
} | ||
}, | ||
red: { | ||
fontWeight: 600, | ||
color: red[500], | ||
borderColor: red[500], | ||
'&:hover': { | ||
backgroundColor: red[50], | ||
borderColor: red[500] | ||
} | ||
} | ||
})); | ||
|
||
|
||
type Props = { | ||
openDialog: boolean, | ||
dialogTitle?: string, | ||
dialogContent: string, | ||
successCallback: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void; | ||
closeDialog: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void; | ||
dialogYesLabel?: string, | ||
dialogNoLabel?: string | ||
}; | ||
|
||
const Confirm = ({openDialog, dialogTitle, dialogContent, successCallback, closeDialog, dialogYesLabel, dialogNoLabel}: Props) => { | ||
const classes = useStyles(); | ||
const [open, setOpen] = React.useState(openDialog); | ||
|
||
useEffect(()=>{ | ||
setOpen(openDialog); | ||
}, [openDialog]) | ||
|
||
const isStringDialog = typeof dialogContent === 'string'; | ||
|
||
return ( | ||
<div> | ||
<Dialog | ||
open={open} | ||
onClose={closeDialog} | ||
aria-labelledby="alert-dialog-title" | ||
aria-describedby="alert-dialog-description" | ||
maxWidth={false} | ||
> | ||
{dialogTitle && <DialogTitle id="alert-dialog-title">{dialogTitle}</DialogTitle>} | ||
<DialogContent className={`${!isStringDialog ? classes.dialogContent : ""}`}> | ||
{isStringDialog ? | ||
<DialogContentText id="alert-dialog-description" className={classes.dialogTextContent}> | ||
{dialogContent} | ||
</DialogContentText> | ||
: dialogContent} | ||
</DialogContent> | ||
<DialogActions style={{paddingBottom: 20}} className={`${isStringDialog ? classes.dialogActions : ""}`}> | ||
<Button variant="outlined" onClick={closeDialog} color="secondary" className={classes.red}> | ||
{dialogNoLabel || "No"} | ||
</Button> | ||
<Button variant="outlined" onClick={successCallback} color="primary" autoFocus className={classes.green}> | ||
{dialogYesLabel || "Yes"} | ||
</Button> | ||
</DialogActions> | ||
</Dialog> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Confirm; |
66 changes: 66 additions & 0 deletions
66
pinot-controller/src/main/resources/app/components/CustomCodemirror.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* eslint-disable no-nested-ternary */ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import React, { } from 'react'; | ||
import { UnControlled as CodeMirror } from 'react-codemirror2'; | ||
import 'codemirror/lib/codemirror.css'; | ||
import 'codemirror/theme/material.css'; | ||
import 'codemirror/mode/javascript/javascript' | ||
import { makeStyles } from '@material-ui/core'; | ||
|
||
type Props = { | ||
data: Object, | ||
isEditable?: Object, | ||
returnCodemirrorValue?: Function | ||
}; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
codeMirror: { | ||
'& .CodeMirror': { height: 600, border: '1px solid #BDCCD9', fontSize: '13px' }, | ||
} | ||
})); | ||
|
||
const CustomCodemirror = ({data, isEditable, returnCodemirrorValue}: Props) => { | ||
const classes = useStyles(); | ||
|
||
const jsonoptions = { | ||
lineNumbers: true, | ||
mode: 'application/json', | ||
styleActiveLine: true, | ||
gutters: ['CodeMirror-lint-markers'], | ||
lint: true, | ||
theme: 'default', | ||
readOnly: !isEditable | ||
}; | ||
|
||
return ( | ||
<CodeMirror | ||
options={jsonoptions} | ||
value={JSON.stringify(data, null , 2)} | ||
className={classes.codeMirror} | ||
autoCursor={false} | ||
onChange={(editor, data, value) => { | ||
returnCodemirrorValue && returnCodemirrorValue(value); | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export default CustomCodemirror; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.