mirror of
https://github.com/BioArchLinux/Rosa.git
synced 2025-03-10 12:02:43 +00:00
fix dependencies expression value
This commit is contained in:
parent
72db019f5a
commit
4b70939a1d
3 changed files with 8 additions and 2 deletions
|
@ -1,4 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { getTrueName } from '@/utils/dependexpr'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
name: String,
|
name: String,
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -18,5 +20,5 @@ function generatePackageLinkUrl(name, dist) {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<p><a :href="generatePackageLinkUrl(name, dist)">{{ name }}</a><span v-if="type !== 'dep'"> ({{ type }})</span></p>
|
<p><a :href="generatePackageLinkUrl(getTrueName(name), dist)">{{ getTrueName(name) }}</a>{{ name.substring(getTrueName(name).length) }}<span v-if="type !== 'dep'"> ({{ type }})</span></p>
|
||||||
</template>
|
</template>
|
||||||
|
|
3
frontend/src/utils/dependexpr.js
Normal file
3
frontend/src/utils/dependexpr.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export function getTrueName(nameexpr) {
|
||||||
|
return /^[\w\d\-]+/.exec(nameexpr)[0]
|
||||||
|
}
|
|
@ -11,6 +11,7 @@ import moment from 'moment'
|
||||||
import { requestPackageInfo, requestPackageList } from '@/api'
|
import { requestPackageInfo, requestPackageList } from '@/api'
|
||||||
import { calculateSize } from '@/utils/sizing'
|
import { calculateSize } from '@/utils/sizing'
|
||||||
import { formatPackager } from '@/utils/packager'
|
import { formatPackager } from '@/utils/packager'
|
||||||
|
import { getTrueName } from '@/utils/dependexpr'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ requestPackageInfo(route.params.packageName)
|
||||||
requestPackageList()
|
requestPackageList()
|
||||||
.then((list) => {
|
.then((list) => {
|
||||||
function mapPackageDistribution(pkg) {
|
function mapPackageDistribution(pkg) {
|
||||||
if (list.find(dep => dep === pkg)) {
|
if (list.find(dep => dep === getTrueName(pkg))) {
|
||||||
return { name: pkg, dist: 'bioarch' }
|
return { name: pkg, dist: 'bioarch' }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue