|
49 | 49 | <Column frozen sortable field="pkg" header="Package" style="min-width: 200px;" />
|
50 | 50 |
|
51 | 51 | <Column v-if="C.display('last_commit_time')" sortable field="last_commit_time"
|
52 |
| - :header="C.name('last_commit_time')" style="text-align: center;" /> |
| 52 | + :header="C.name('last_commit_time')" :pt="ptColumnCenter" /> |
53 | 53 |
|
54 |
| - <Column v-if="C.display('version')" sortable field="version" :header="C.name('version')" |
55 |
| - style="text-align: center;" /> |
| 54 | + <Column v-if="C.display('version')" sortable field="version" :header="C.name('version')" :pt="ptColumnCenter" /> |
56 | 55 |
|
57 | 56 | <Column v-if="C.display('release_count')" sortable field="release_count" :header="C.name('release_count')"
|
58 |
| - style="text-align: center;"> |
| 57 | + :pt="ptColumnCenter"> |
59 | 58 | <template #body="{ data }">
|
60 | 59 | <NuxtLink :to="`https://crates.io/crates/${data.pkg}`" target="_blank" class="nav-link">
|
61 | 60 | {{ data.release_count }}
|
|
64 | 63 | </Column>
|
65 | 64 |
|
66 | 65 | <Column v-if="C.display('last_release_time')" sortable field="last_release_time"
|
67 |
| - :header="C.name('last_release_time')" style="text-align: center; min-width: 120px;" /> |
| 66 | + :header="C.name('last_release_time')" style="min-width: 120px;" :pt="ptColumnCenter" /> |
68 | 67 |
|
69 | 68 | <Column v-if="C.display('last_release_size')" sortable field="last_release_size"
|
70 |
| - :header="C.name('last_release_size')" style="text-align: center" /> |
| 69 | + :header="C.name('last_release_size')" :pt="ptColumnRight" /> |
71 | 70 |
|
72 | 71 | <Column v-if="C.display('diag_total_count')" sortable field="diag_total_count"
|
73 |
| - :header="C.name('diag_total_count')" style="text-align: center;"> |
| 72 | + :header="C.name('diag_total_count')" :pt="ptColumnRight"> |
74 | 73 | <template #body="{ data }">
|
75 | 74 | <NuxtLink :to="`/${data.user}/${data.repo}`" target="_blank" class="nav-link">
|
76 | 75 | {{ data.diag_total_count }}
|
|
79 | 78 | </Column>
|
80 | 79 |
|
81 | 80 | <Column v-if="C.display('testcases')" sortable field="testcases" :header="C.name('testcases')"
|
82 |
| - style="text-align: center; font-weight: bold"> |
| 81 | + style="font-weight: bold" :pt="ptColumnRight"> |
83 | 82 | <template #body="{ data }">
|
84 | 83 | <span :style="{ color: data.testcases_color }">
|
85 | 84 | {{ data.testcases }}
|
86 | 85 | </span>
|
87 | 86 | </template>
|
88 | 87 | </Column>
|
89 | 88 |
|
90 |
| - <Column v-if="C.display('lib')" sortable field="lib" :header="C.name('lib')" style="text-align: center;" /> |
91 |
| - <Column v-if="C.display('bin')" sortable field="bin" :header="C.name('bin')" style="text-align: center;" /> |
| 89 | + <Column v-if="C.display('lib')" sortable field="lib" :header="C.name('lib')" :pt="ptColumnCenter" /> |
| 90 | + <Column v-if="C.display('bin')" sortable field="bin" :header="C.name('bin')" :pt="ptColumnCenter" /> |
92 | 91 | <Column v-if="C.display('dependencies')" sortable field="dependencies" :header="C.name('dependencies')"
|
93 |
| - style="text-align: center;" /> |
| 92 | + :pt="ptColumnRight" /> |
94 | 93 |
|
95 |
| - <Column v-if="C.display('tests')" sortable field="tests" :header="C.name('tests')" style="text-align: center;" /> |
96 |
| - <Column v-if="C.display('examples')" sortable field="examples" :header="C.name('examples')" |
97 |
| - style="text-align: center;" /> |
98 |
| - <Column v-if="C.display('benches')" sortable field="benches" :header="C.name('benches')" |
99 |
| - style="text-align: center;" /> |
| 94 | + <Column v-if="C.display('tests')" sortable field="tests" :header="C.name('tests')" :pt="ptColumnRight" /> |
| 95 | + <Column v-if="C.display('examples')" sortable field="examples" :header="C.name('examples')" :pt="ptColumnRight" /> |
| 96 | + <Column v-if="C.display('benches')" sortable field="benches" :header="C.name('benches')" :pt="ptColumnRight" /> |
100 | 97 |
|
101 | 98 | <Column v-if="C.display('documentation')" field="documentation" :header="C.name('documentation')"
|
102 |
| - style="text-align: center;"> |
| 99 | + :pt="ptColumnCenter"> |
103 | 100 | <template #body="{ data }">
|
104 | 101 | <NuxtLink v-if="data.documentation" :to="data.documentation" target="_blank" class="nav-link">
|
105 | 102 | link
|
|
108 | 105 | </template>
|
109 | 106 | </Column>
|
110 | 107 |
|
111 |
| - <Column v-if="C.display('latest_doc')" field="latest_doc" :header="C.name('latest_doc')" |
112 |
| - style="text-align: center;"> |
| 108 | + <Column v-if="C.display('latest_doc')" field="latest_doc" :header="C.name('latest_doc')" :pt="ptColumnCenter"> |
113 | 109 | <template #body="{ data }">
|
114 | 110 | <NuxtLink v-if="data.latest_doc" :to="data.latest_doc" target="_blank" class="nav-link">
|
115 | 111 | link
|
|
118 | 114 | </template>
|
119 | 115 | </Column>
|
120 | 116 |
|
121 |
| - <Column v-if="C.display('homepage')" field="homepage" :header="C.name('homepage')" style="text-align: center;"> |
| 117 | + <Column v-if="C.display('homepage')" field="homepage" :header="C.name('homepage')" :pt="ptColumnCenter"> |
122 | 118 | <template #body="{ data }">
|
123 | 119 | <NuxtLink v-if="data.homepage" :to="data.homepage" target="_blank" class="nav-link">
|
124 | 120 | link
|
|
148 | 144 | <Column v-if="C.display('description')" field="description" :header="C.name('description')"
|
149 | 145 | style="min-width: 280px;" />
|
150 | 146 |
|
151 |
| - <Column v-if="C.display('authors')" sortable field="authors" :header="C.name('authors')" |
152 |
| - style="min-width: 300px;"> |
| 147 | + <Column v-if="C.display('authors')" sortable field="authors" :header="C.name('authors')" style="min-width: 300px;" |
| 148 | + :pt="ptColumnCenter"> |
153 | 149 | <template #body="{ data: { authors } }">
|
154 | 150 | <div v-for="tag of authors">
|
155 | 151 | <Tag severity="info" :value="tag" style="margin-bottom: 5px;"></Tag>
|
@@ -245,6 +241,16 @@ import type { DataTableSortMeta } from 'primevue/datatable';
|
245 | 241 | const { color, viewportHeight } = storeToRefs(useStyleStore());
|
246 | 242 | const tableHeight = computed(() => `${Math.round(viewportHeight.value * 0.8)}px`);
|
247 | 243 |
|
| 244 | +// styling |
| 245 | +const ptColumnCenter = ref({ |
| 246 | + columnHeaderContent: { style: { "justify-content": "center" } }, |
| 247 | + bodyCell: { style: { "text-align": "center" } } |
| 248 | +}); |
| 249 | +const ptColumnRight = ref({ |
| 250 | + columnHeaderContent: { style: { "justify-content": "right" } }, |
| 251 | + bodyCell: { style: { "text-align": "right" } } |
| 252 | +}); |
| 253 | +
|
248 | 254 | const summaries = ref<PkgInfo[]>([]);
|
249 | 255 |
|
250 | 256 | githubFetch<PkgInfo[]>({
|
|
0 commit comments