Skip to content

Commit

Permalink
fixed backup wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Nov 3, 2023
1 parent 66fd3db commit b776180
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions src/views/cipp/CIPPSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,23 +337,7 @@ const GeneralSettings = () => {
/>,
],
}
const downloadTxtFile = (data) => {
const txtdata = [JSON.stringify(RunBackupResult.data.backup)]
const file = new Blob(txtdata, { type: 'text/plain' })
const element = document.createElement('a')
element.href = URL.createObjectURL(file)
element.download = 'CIPP-Backup' + Date.now() + '.json'
document.body.appendChild(element)
element.click()
}
const inputRef = useRef(null)
const handleChange = (e) => {
const fileReader = new FileReader()
fileReader.readAsText(e.target.files[0], 'UTF-8')
fileReader.onload = (e) => {
restoreBackup({ path: '/api/ExecRestoreBackup', values: e.target.result })
}
}

return (
<div>
<CRow className="mb-3">
Expand Down Expand Up @@ -1339,7 +1323,22 @@ const DNSSettings = () => {
const { data: versions, isSuccess: isSuccessVersion } = useLoadVersionsQuery()

const [alertVisible, setAlertVisible] = useState(false)

const downloadTxtFile = (data) => {
const txtdata = [JSON.stringify(RunBackupResult.data.backup)]
const file = new Blob(txtdata, { type: 'text/plain' })
const element = document.createElement('a')
element.href = URL.createObjectURL(file)
element.download = 'CIPP-Backup' + Date.now() + '.json'
document.body.appendChild(element)
element.click()
}
const handleChange = (e) => {
const fileReader = new FileReader()
fileReader.readAsText(e.target.files[0], 'UTF-8')
fileReader.onload = (e) => {
restoreBackup({ path: '/api/ExecRestoreBackup', values: e.target.result })
}
}
const switchResolver = (resolver) => {
editDnsConfig({ resolver })
getDnsConfig()
Expand Down

0 comments on commit b776180

Please sign in to comment.