mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-02-24 22:31:29 +01:00
Update 'release-notes' to use loadScript
This commit is contained in:
parent
9947c3bcfb
commit
1f44a283b3
@ -43,22 +43,22 @@
|
|||||||
</style>
|
</style>
|
||||||
`)
|
`)
|
||||||
|
|
||||||
const markedScript = document.createElement('script')
|
loadScript('/media/js/marked.min.js').then(async function() {
|
||||||
markedScript.src = '/media/js/marked.min.js'
|
|
||||||
|
|
||||||
markedScript.onload = async function() {
|
|
||||||
let appConfig = await fetch('/get/app_config')
|
let appConfig = await fetch('/get/app_config')
|
||||||
|
if (!appConfig.ok) {
|
||||||
|
console.error('[release-notes] Failed to get app_config.')
|
||||||
|
return
|
||||||
|
}
|
||||||
appConfig = await appConfig.json()
|
appConfig = await appConfig.json()
|
||||||
|
|
||||||
let updateBranch = appConfig.update_branch || 'main'
|
const updateBranch = appConfig.update_branch || 'main'
|
||||||
|
|
||||||
let releaseNotes = await fetch(`https://raw.githubusercontent.com/cmdr2/stable-diffusion-ui/${updateBranch}/CHANGES.md`)
|
let releaseNotes = await fetch(`https://raw.githubusercontent.com/cmdr2/stable-diffusion-ui/${updateBranch}/CHANGES.md`)
|
||||||
if (releaseNotes.status != 200) {
|
if (!releaseNotes.ok) {
|
||||||
|
console.error('[release-notes] Failed to get CHANGES.md.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
releaseNotes = await releaseNotes.text()
|
releaseNotes = await releaseNotes.text()
|
||||||
news.innerHTML = marked.parse(releaseNotes)
|
news.innerHTML = marked.parse(releaseNotes)
|
||||||
}
|
})
|
||||||
|
|
||||||
document.querySelector('body').appendChild(markedScript)
|
|
||||||
})()
|
})()
|
Loading…
Reference in New Issue
Block a user