You've already forked AstralRinth
forked from didirus/AstralRinth
Better error handling, fix some more broken OG links
This commit is contained in:
@@ -1,15 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<h1>{{ error.message }}</h1>
|
<div class="container">
|
||||||
<NuxtLink to="/">
|
<NuxtLink to="/">
|
||||||
|
<h2>{{ error.message }}</h2>
|
||||||
|
<p>
|
||||||
An error occurred! Click this text to go back home, and find your way
|
An error occurred! Click this text to go back home, and find your way
|
||||||
back!
|
back!
|
||||||
|
</p>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
|
<m-footer class="footer" centered />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import MFooter from '@/components/MFooter'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
MFooter,
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
error: {
|
error: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -29,8 +39,12 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.main {
|
.main {
|
||||||
margin: 0 auto;
|
margin: var(--spacing-card-sm) auto;
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
text-align: center;
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
@extend %card;
|
||||||
|
padding: var(--spacing-card-md) var(--spacing-card-lg);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
<div class="right hero-image">
|
<div class="right hero-image">
|
||||||
<video
|
<video
|
||||||
src="~/assets/images/search.mp4"
|
src="~/assets/images/search.mp4"
|
||||||
alt="search"
|
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
loop
|
loop
|
||||||
muted
|
muted
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ export default {
|
|||||||
{
|
{
|
||||||
hid: 'og:url',
|
hid: 'og:url',
|
||||||
name: 'og:url',
|
name: 'og:url',
|
||||||
content: `https://modrinth.com/privacy`,
|
content: `https://modrinth.com/legal/privacy`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ export default {
|
|||||||
{
|
{
|
||||||
hid: 'og:url',
|
hid: 'og:url',
|
||||||
name: 'og:url',
|
name: 'og:url',
|
||||||
content: `https://modrinth.com/tos`,
|
content: `https://modrinth.com/legal/terms`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -282,6 +282,7 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const [
|
const [
|
||||||
mod,
|
mod,
|
||||||
availableCategories,
|
availableCategories,
|
||||||
@@ -332,6 +333,12 @@ export default {
|
|||||||
license_url: mod.license.url,
|
license_url: mod.license.url,
|
||||||
// availableDonationPlatforms,
|
// availableDonationPlatforms,
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
data.error({
|
||||||
|
statusCode: 404,
|
||||||
|
message: 'Mod not found',
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const mod = (
|
const mod = (
|
||||||
await axios.get(
|
await axios.get(
|
||||||
`https://api.modrinth.com/api/v1/mod/${data.params.id}`,
|
`https://api.modrinth.com/api/v1/mod/${data.params.id}`,
|
||||||
@@ -72,6 +73,12 @@ export default {
|
|||||||
members,
|
members,
|
||||||
currentMember,
|
currentMember,
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
data.error({
|
||||||
|
statusCode: 404,
|
||||||
|
message: 'Mod not found',
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -219,6 +219,7 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const mod = (
|
const mod = (
|
||||||
await axios.get(
|
await axios.get(
|
||||||
`https://api.modrinth.com/api/v1/mod/${data.params.id}`,
|
`https://api.modrinth.com/api/v1/mod/${data.params.id}`,
|
||||||
@@ -268,6 +269,12 @@ export default {
|
|||||||
members,
|
members,
|
||||||
currentMember,
|
currentMember,
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
data.error({
|
||||||
|
statusCode: 404,
|
||||||
|
message: 'Mod not found',
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const mod = (
|
const mod = (
|
||||||
await axios.get(
|
await axios.get(
|
||||||
`https://api.modrinth.com/api/v1/mod/${data.params.id}`,
|
`https://api.modrinth.com/api/v1/mod/${data.params.id}`,
|
||||||
@@ -182,6 +183,12 @@ export default {
|
|||||||
primaryFile,
|
primaryFile,
|
||||||
currentMember,
|
currentMember,
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
data.error({
|
||||||
|
statusCode: 404,
|
||||||
|
message: 'Version not found',
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const mod = (
|
const mod = (
|
||||||
await axios.get(
|
await axios.get(
|
||||||
`https://api.modrinth.com/api/v1/mod/${data.params.id}`,
|
`https://api.modrinth.com/api/v1/mod/${data.params.id}`,
|
||||||
@@ -280,6 +281,12 @@ export default {
|
|||||||
selectableVersions,
|
selectableVersions,
|
||||||
currentMember,
|
currentMember,
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
data.error({
|
||||||
|
statusCode: 404,
|
||||||
|
message: 'Mod not found',
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
let res = await axios.get(
|
let res = await axios.get(
|
||||||
`https://api.modrinth.com/api/v1/user/${data.params.id}`,
|
`https://api.modrinth.com/api/v1/user/${data.params.id}`,
|
||||||
config
|
config
|
||||||
@@ -112,7 +113,9 @@ export default {
|
|||||||
)
|
)
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
res = await axios.get(
|
res = await axios.get(
|
||||||
`https://api.modrinth.com/api/v1/mods?ids=${JSON.stringify(res.data)}`,
|
`https://api.modrinth.com/api/v1/mods?ids=${JSON.stringify(
|
||||||
|
res.data
|
||||||
|
)}`,
|
||||||
config
|
config
|
||||||
)
|
)
|
||||||
mods = res.data
|
mods = res.data
|
||||||
@@ -122,6 +125,12 @@ export default {
|
|||||||
mods,
|
mods,
|
||||||
user,
|
user,
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
data.error({
|
||||||
|
statusCode: 404,
|
||||||
|
message: 'User not found',
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formatNumber(x) {
|
formatNumber(x) {
|
||||||
|
|||||||
Reference in New Issue
Block a user