Skip to content

Commit

Permalink
feat: display test result
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Mar 24, 2024
1 parent f7263f4 commit b2e1026
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .vitepress/theme/components/Route.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<template>
<div :id="namespace + JSON.stringify(data.path)" class="routeBlock">
<p class="badges">
<Badge v-if="!test" type="warning">🟑 Missing Test</Badge>
<Badge v-if="test?.code" type="danger" :title="test?.message">πŸ”΄ Failed Test</Badge>
<Badge v-if="test && !test?.code" type="tip">🟒 Passed Test</Badge>
<a v-if="data.features?.antiCrawler" href="/faq" target="_blank">
<Badge type="danger">🚨 Strict anti-crawling</Badge>
<Badge type="danger">🚨 Strict Anti-crawling</Badge>
</a>
<Badge v-if="data.features?.supportBT" type="tip">πŸ”„ Support BT</Badge>
<Badge v-if="data.features?.supportPodcast" type="tip">πŸŽ™οΈ Support Podcast</Badge>
<Badge v-if="data.features?.supportScihub" type="tip">πŸ§ͺ Support Sci-Hub</Badge>
<Badge v-if="data.features?.requirePuppeteer" type="warning">🎭 Rely on Puppeteer</Badge>
<a v-if="data.features?.requireConfig" href="/install/config#route-specific-configurations" target="_blank">
<Badge type="warning">βš™οΈ Config required</Badge>
<Badge type="warning">βš™οΈ Config Required</Badge>
</a>
<a v-if="data.radar" href="/usage#radar" target="_blank">
<Badge type="tip">πŸ” Support Radar</Badge>
Expand Down Expand Up @@ -70,6 +73,10 @@ import type { Route } from '../types';
const props = defineProps<{
namespace: string,
data: Route,
test?: {
code: number,
message?: string,
}
}>();
const demoUrl = props.data.example ? ('https://rsshub.app' + props.data.example) : null;
Expand Down

0 comments on commit b2e1026

Please sign in to comment.