mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-26 18:36:14 -04:00
Disable cleanup by default and show errors in admin area
This commit is contained in:
parent
593d1021b6
commit
3330ed8d1b
6 changed files with 53 additions and 1 deletions
|
@ -23,6 +23,7 @@ export const PadPage = ()=>{
|
|||
const pads = useStore(state=>state.pads)
|
||||
const [currentPage, setCurrentPage] = useState<number>(0)
|
||||
const [deleteDialog, setDeleteDialog] = useState<boolean>(false)
|
||||
const [errorText, setErrorText] = useState<string|null>(null)
|
||||
const [padToDelete, setPadToDelete] = useState<string>('')
|
||||
const pages = useMemo(()=>{
|
||||
if(!pads){
|
||||
|
@ -72,6 +73,11 @@ export const PadPage = ()=>{
|
|||
settingsSocket.on('results:cleanupPadRevisions', (data)=>{
|
||||
let newPads = useStore.getState().pads?.results ?? []
|
||||
|
||||
if (data.error) {
|
||||
setErrorText(data.error)
|
||||
return
|
||||
}
|
||||
|
||||
newPads.forEach((pad)=>{
|
||||
if (pad.padName === data.padId) {
|
||||
pad.revisionNumber = data.keepRevisions
|
||||
|
@ -118,6 +124,21 @@ export const PadPage = ()=>{
|
|||
</Dialog.Content>
|
||||
</Dialog.Portal>
|
||||
</Dialog.Root>
|
||||
<Dialog.Root open={errorText !== null}>
|
||||
<Dialog.Portal>
|
||||
<Dialog.Overlay className="dialog-confirm-overlay"/>
|
||||
<Dialog.Content className="dialog-confirm-content">
|
||||
<div>
|
||||
<div>Error occured: {errorText}</div>
|
||||
<div className="settings-button-bar">
|
||||
<button onClick={() => {
|
||||
setErrorText(null)
|
||||
}}>OK</button>
|
||||
</div>
|
||||
</div>
|
||||
</Dialog.Content>
|
||||
</Dialog.Portal>
|
||||
</Dialog.Root>
|
||||
<h1><Trans i18nKey="ep_admin_pads:ep_adminpads2_manage-pads"/></h1>
|
||||
<SearchField value={searchTerm} onChange={v=>setSearchTerm(v.target.value)} placeholder={t('ep_admin_pads:ep_adminpads2_search-heading')}/>
|
||||
<table>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue