Skip to content

Commit 78ef9ca

Browse files
committed
cosmetics and update for latest nugets
1 parent 44a27e0 commit 78ef9ca

8 files changed

Lines changed: 106 additions & 79 deletions

File tree

community-app/frontend/src/components/overview/LatestNugets.vue

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,27 @@
22
33
import { ref, onMounted } from 'vue'
44
import { useRouter } from 'vue-router'
5-
import { NEllipsis, NSkeleton } from 'naive-ui'
5+
import { NEllipsis, NSkeleton, NAvatar, NTag } from 'naive-ui'
66
import { useLatestNugetsStore } from './LatestNugetsStore.js'
77
import Constants from '../../constants.js'
88
import SectionTitle from './SectionTitle.vue'
9+
import defaultLogo from '../../assets/defaultLogo.png'
910
1011
const store = useLatestNugetsStore();
1112
const loading = ref(false);
1213
const router = useRouter();
1314
14-
onMounted(()=>{
15-
sync();
15+
onMounted(async ()=>{
16+
await sync();
1617
})
1718
1819
async function sync(force)
1920
{
2021
try {
2122
loading.value = true;
22-
await store.fetch(force);
23+
await store.fetch(force);
24+
25+
console.log (store.nugets);
2326
}
2427
catch(error) {
2528
console.log (error);
@@ -36,18 +39,21 @@ function showAll()
3639
</script>
3740

3841
<template>
39-
<div class="section pl-4">
40-
<SectionTitle :showRefresh="true" :loading="loading" title="Latest NuGets tagged with VL" @sync="sync(true)" :link="Constants.NUGET_ORG" :isExternal="true"/>
41-
<div class="row pt-2">
42+
<div class="section pl-4 nugets">
43+
<SectionTitle :showRefresh="true" :loading="loading" title="Latest #VL NuGets" @sync="sync(true)" :link="Constants.NUGET_ORG" :isExternal="true"/>
44+
<div class="row pt-1">
4245
<template v-if="loading">
4346
<NSkeleton text :repeat="5" class="mb-4 mx-3"></NSkeleton>
4447
</template>
4548
<template v-else>
4649
<ul v-if="store.nugets.length > 0" class="list-group list-group-flush list">
4750
<li v-for="(nuget, index) in store.nugets" :key="index" class="list-group-item d-flex flex-nowrap link">
51+
<NAvatar v-if="nuget.icon" objectFit="contain" :src="nuget.icon" :size="25" class="mr-3" :class="{ 'noImageBack': nuget.icon !== null }"/>
4852
<NEllipsis :line-clamp="1" :tooltip=false>
49-
<a :href="nuget.link" target="_blank">{{ nuget.title }}</a>
53+
<a :href="nuget.link" target="_blank">{{ nuget.id }}</a>
5054
</NEllipsis>
55+
<span class="by">{{ nuget.by }}</span>
56+
<NTag v-if="nuget.status" size="small" round :bordered="false" class="px-2 ml-3 text-muted text-right" :class="{'new': nuget.status == 'new'}">{{ nuget.status }}</NTag>
5157
</li>
5258
</ul>
5359
<div v-else class="m-3">Okay, Houston... we've had a problem here.<br/>Try again later.</div>

community-app/frontend/src/components/overview/LatestNugetsStore.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import Constants from "../../constants.js"
22
import { defineStore } from 'pinia'
33

4+
const twoWeeks = 14 * 24 * 60 * 60 * 1000;
5+
46
export const useLatestNugetsStore = defineStore ('latestNugets',{
57
state: ()=>{
68
return {
@@ -23,21 +25,27 @@ export const useLatestNugetsStore = defineStore ('latestNugets',{
2325

2426
}
2527
}
26-
})
28+
})
2729

2830
async function fetchLatestNugets(){
2931

30-
const count = 5;
32+
const count = 7;
3133
const response = await fetch(Constants.NUGETS_LATEST+`?count=${count}`);
3234

3335
if (response.ok)
3436
{
3537
const json = await response.json();
3638

3739
const nugets = json.map((n)=>{
40+
41+
// const by=[... new Set([ ...n.owners, ...n.authors])];
42+
3843
return {
39-
title: n,
40-
link: `${Constants.NUGET_PACK_LINK}${n}#readme-body-tab`
44+
id: n.id,
45+
icon: n.icon || "",
46+
by: n.owners.join(', '),
47+
link: `${Constants.NUGET_PACK_LINK}${n.id}#readme-body-tab`,
48+
status: n.status
4149
}
4250
})
4351

community-app/frontend/src/components/overview/LatestTopics.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function sync(force)
3535
<template>
3636
<div class="section pl-4">
3737
<SectionTitle :showRefresh="true" :loading="loading" title="Latest Forum Topics" @sync="sync(true)" :link="Constants.FORUM" :isExternal="true"/>
38-
<div class="row pt-2">
38+
<div class="row">
3939
<template v-if="loading">
4040
<NSkeleton text :repeat="5" class="mb-4 mx-3"></NSkeleton>
4141
</template>

community-app/frontend/src/components/overview/Opportunities.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async function sync(force)
3131
<template>
3232
<div class="section pl-4">
3333
<SectionTitle showRefresh="true" :loading="loading" title="Opportunities" @sync="sync(true)"/>
34-
<div class="row pt-2">
34+
<div class="row pt-1">
3535
<template v-if="loading">
3636
<NSkeleton text :repeat="5" class="mb-4 mx-3"></NSkeleton>
3737
</template>

community-app/frontend/src/routes/Overview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const columnClass='col-12 col-md-6 mb-3 mb-lg-0';
6363
<Businesses class="mt-4"/>
6464
</div>
6565
<div class="col mb-4 mb-md-0 order-1 order-md-2">
66-
<LatestNugets/>
66+
<LatestNugets class="mb-2"/>
6767
<Opportunities/>
6868
</div>
6969
</div>

community-app/frontend/src/styles/style.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ $orange-hover: #ee4b28;
99
.overview
1010
{
1111

12+
.nugets{
13+
.by{
14+
font-size: 0.8rem;
15+
color: #888;
16+
padding: 0.1rem 1rem;
17+
}
18+
19+
.new{
20+
background-color: #aaa;
21+
color: #fff !important;
22+
}
23+
}
24+
1225
a.all {
1326
text-transform: uppercase;
1427
text-decoration: underline;

static/js/vue/app.js

Lines changed: 63 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/vue/main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)