Fix ad warning, add snapshot search
This commit is contained in:
parent
7445f43b1b
commit
8ca09f6384
@ -130,7 +130,9 @@
|
|||||||
<DownloadIcon />
|
<DownloadIcon />
|
||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
</div>
|
</div>
|
||||||
|
<client-only>
|
||||||
<EthicalAd type="image" />
|
<EthicalAd type="image" />
|
||||||
|
</client-only>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -54,7 +54,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<client-only>
|
||||||
<EthicalAd />
|
<EthicalAd />
|
||||||
|
</client-only>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,9 @@
|
|||||||
></pagination>
|
></pagination>
|
||||||
</section>
|
</section>
|
||||||
<div class="results column-grow-4">
|
<div class="results column-grow-4">
|
||||||
|
<client-only>
|
||||||
<EthicalAd type="text" />
|
<EthicalAd type="text" />
|
||||||
|
</client-only>
|
||||||
<SearchResult
|
<SearchResult
|
||||||
v-for="(result, index) in results"
|
v-for="(result, index) in results"
|
||||||
:id="result.mod_id"
|
:id="result.mod_id"
|
||||||
@ -233,6 +235,13 @@
|
|||||||
>
|
>
|
||||||
</SearchFilter>
|
</SearchFilter>
|
||||||
<h3>Versions</h3>
|
<h3>Versions</h3>
|
||||||
|
<SearchFilter
|
||||||
|
:active-filters="showVersions"
|
||||||
|
display-name="Snapshots"
|
||||||
|
facet-name="snapshots"
|
||||||
|
style="margin-bottom: 10px"
|
||||||
|
@toggle="fillInitialVersions"
|
||||||
|
/>
|
||||||
</section>
|
</section>
|
||||||
<multiselect
|
<multiselect
|
||||||
v-model="selectedVersions"
|
v-model="selectedVersions"
|
||||||
@ -327,6 +336,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
query: '',
|
query: '',
|
||||||
|
showVersions: [],
|
||||||
selectedVersions: [],
|
selectedVersions: [],
|
||||||
versions: [],
|
versions: [],
|
||||||
facets: [],
|
facets: [],
|
||||||
@ -344,11 +354,22 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async fillInitialVersions() {
|
async fillInitialVersions(x) {
|
||||||
try {
|
try {
|
||||||
const res = await axios.get(
|
let url =
|
||||||
'https://api.modrinth.com/api/v1/tag/game_version?type=release'
|
'https://api.modrinth.com/api/v1/tag/game_version?type=release'
|
||||||
)
|
|
||||||
|
if (x !== null) {
|
||||||
|
if (!this.showVersions.length > 0) {
|
||||||
|
this.showVersions.push('snapshots')
|
||||||
|
|
||||||
|
url = 'https://api.modrinth.com/api/v1/tag/game_version'
|
||||||
|
} else {
|
||||||
|
this.showVersions = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await axios.get(url)
|
||||||
|
|
||||||
this.versions = res.data
|
this.versions = res.data
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@ -11,7 +11,9 @@
|
|||||||
<p v-if="user.role === 'developer'" class="badge green">Developer</p>
|
<p v-if="user.role === 'developer'" class="badge green">Developer</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<client-only>
|
||||||
<EthicalAd />
|
<EthicalAd />
|
||||||
|
</client-only>
|
||||||
<div class="user-mods">
|
<div class="user-mods">
|
||||||
<SearchResult
|
<SearchResult
|
||||||
v-for="result in mods"
|
v-for="result in mods"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user