-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
153 additions
and
38 deletions.
There are no files selected for viewing
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
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,78 @@ | ||
<template> | ||
<div class="p-relative"> | ||
<BaseLoader v-if="isLoading" /> | ||
<div | ||
id="changelog" | ||
class="container" | ||
v-html="changelog" | ||
/> | ||
<div v-if="isError" class="empty"> | ||
<div class="empty-icon"> | ||
<i class="mdi mdi-48px mdi-alert-outline" /> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import marked from 'marked'; | ||
import BaseLoader from '@/components/BaseLoader'; | ||
export default { | ||
name: 'ModalSettingsChangelog', | ||
components: { | ||
BaseLoader | ||
}, | ||
data () { | ||
return { | ||
changelog: '', | ||
isLoading: true, | ||
error: '', | ||
isError: false | ||
}; | ||
}, | ||
created () { | ||
this.getChangelog(); | ||
}, | ||
methods: { | ||
async getChangelog () { | ||
try { | ||
const apiRes = await fetch('https://api.github.com/repos/Fabio286/antares/releases/latest', { | ||
method: 'GET' | ||
}); | ||
const { body } = await apiRes.json(); | ||
const markdown = body.substr(0, body.indexOf('### Download')); | ||
const renderer = { | ||
link (href, title, text) { | ||
return text; | ||
}, | ||
listitem (text) { | ||
return `<li>${text.replace(/ *\([^)]*\) */g, '')}</li>`; | ||
} | ||
}; | ||
marked.use({ renderer }); | ||
this.changelog = marked(markdown); | ||
} | ||
catch (err) { | ||
this.error = err.message; | ||
this.isError = true; | ||
} | ||
this.isLoading = false; | ||
} | ||
} | ||
}; | ||
</script> | ||
<style lang="scss"> | ||
#changelog { | ||
h3 { | ||
font-size: 1rem; | ||
} | ||
li { | ||
margin-top: 0; | ||
} | ||
} | ||
</style> |
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