🐛 Fixes CVE description not showing (#609)

This commit is contained in:
Alicia Sykes 2022-04-26 19:57:28 +01:00 committed by GitHub
parent 8acb8cd6b2
commit 45fa35a384
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 15 deletions

View File

@ -12,7 +12,7 @@
</span>
</div>
</a>
<p class="description">
<p class="cve-description">
{{ cve.description | formatDescription }}
<a v-if="cve.description.length > 350" class="read-more" :href="cve.url" target="_blank">
{{ $t('widgets.general.open-link') }}
@ -23,7 +23,6 @@
</template>
<script>
import axios from 'axios';
import WidgetMixin from '@/mixins/WidgetMixin';
import { timestampToDate, truncateStr } from '@/utils/MiscHelpers';
import { widgetApiEndpoints, serviceEndpoints } from '@/utils/defaults';
@ -103,18 +102,8 @@ export default {
methods: {
/* Make GET request to CoinGecko API endpoint */
fetchData() {
axios.request({
method: 'GET',
url: this.proxyReqEndpoint,
headers: { 'Target-URL': this.endpoint },
})
.then((response) => {
this.processData(response.data);
}).catch((error) => {
this.error('Unable to fetch CVE data', error);
}).finally(() => {
this.finishLoading();
});
this.defaultTimeout = 12000;
this.makeRequest(this.endpoint).then(this.processData);
},
/* Assign data variables to the returned data */
processData(data) {
@ -214,7 +203,8 @@ export default {
margin: 0;
opacity: var(--dimming-factor);
}
.description {
.cve-description {
font-size: 0.9rem;
margin: 0 0.25rem 0.5rem 0.25rem;
}
a.read-more {