mirror of
https://github.com/zoriya/flood.git
synced 2026-06-02 02:56:05 +00:00
client: AboutTab: display Flood version badges
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
# Flood
|
||||
# Flood <FloodVersion />
|
||||
|
||||
[](https://www.npmjs.com/flood) <CommitBadge />
|
||||
|
||||
[](https://github.com/jesec/flood/actions) [](https://crowdin.com/project/flood) [](https://discord.gg/Z7yR5Uf)
|
||||
|
||||
Flood is a monitoring service for [rTorrent](https://github.com/rakshasa/rtorrent). It's a Node.js service that communicates with rTorrent instances and serves a decent web UI for administration. It's a work-in-progress.
|
||||
Flood is a monitoring service for [rTorrent](https://github.com/rakshasa/rtorrent). It's a Node.js service that communicates with rTorrent instances and serves a decent web UI for administration.
|
||||
|
||||
#### Feedback
|
||||
|
||||
|
||||
@@ -1,13 +1,35 @@
|
||||
import React from 'react';
|
||||
|
||||
import {version} from '../../../../../../package.json';
|
||||
|
||||
const AboutMarkdown = React.lazy(() =>
|
||||
import('../../../../../../ABOUT.md').then((module) => ({default: module.react})),
|
||||
);
|
||||
|
||||
const FLOOD_PROJECT_URL = 'https://github.com/jesec/flood';
|
||||
|
||||
const AboutTab = () => {
|
||||
return (
|
||||
<React.Suspense fallback={null}>
|
||||
<AboutMarkdown />
|
||||
<AboutMarkdown
|
||||
FloodVersion={() => version}
|
||||
CommitBadge={() =>
|
||||
version.length > 8 ? (
|
||||
// If user is on a rolling build, display latest version of rolling build.
|
||||
<a href={FLOOD_PROJECT_URL}>
|
||||
<img alt="Latest version of rolling build" src="https://img.shields.io/npm/v/@jesec/flood?label=HEAD" />
|
||||
</a>
|
||||
) : (
|
||||
// If user is on a released build, display commits to project made since user's version.
|
||||
<a href={FLOOD_PROJECT_URL}>
|
||||
<img
|
||||
alt="Commits since user's version"
|
||||
src={`https://img.shields.io/github/commits-since/jesec/flood/v${version}`}
|
||||
/>
|
||||
</a>
|
||||
)
|
||||
}
|
||||
/>
|
||||
</React.Suspense>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user