mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
fix: use snapshot version for dev
This commit is contained in:
@@ -36,7 +36,7 @@ public class VersionController {
|
|||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public VersionInfo version() {
|
public VersionInfo version() {
|
||||||
if ("dev".equals(version)) {
|
if (version.endsWith("-SNAPSHOT")) {
|
||||||
return VersionInfo.builder()
|
return VersionInfo.builder()
|
||||||
.currentVersion(version)
|
.currentVersion(version)
|
||||||
.latestVersion(version).build();
|
.latestVersion(version).build();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Button, type ButtonProps } from "@/components/ui/button";
|
import { Button, buttonVariants } from "@/components/ui/button";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
import { VariantProps } from "class-variance-authority";
|
||||||
import { Check, Copy } from "lucide-react";
|
import { Check, Copy } from "lucide-react";
|
||||||
import { type HTMLProps, type ReactNode, useCallback, useEffect, useState } from "react";
|
import { type HTMLProps, type ReactNode, useCallback, useEffect, useState } from "react";
|
||||||
import { CopyToClipboard } from "react-copy-to-clipboard";
|
import { CopyToClipboard } from "react-copy-to-clipboard";
|
||||||
@@ -8,12 +9,12 @@ import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
|
|||||||
import { materialDark } from "react-syntax-highlighter/dist/esm/styles/prism";
|
import { materialDark } from "react-syntax-highlighter/dist/esm/styles/prism";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|
||||||
interface CopyButtonProps extends ButtonProps {
|
interface CopyButtonProps extends React.ComponentProps<"button"> {
|
||||||
value: string;
|
value: string;
|
||||||
src?: string;
|
src?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function CopyButton({ value }: Readonly<CopyButtonProps>) {
|
export function CopyButton({ value }: Readonly<CopyButtonProps & VariantProps<typeof buttonVariants>>) {
|
||||||
const [hasCopied, setHasCopied] = useState(false);
|
const [hasCopied, setHasCopied] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ const VersionBadge: React.FC = () => {
|
|||||||
});
|
});
|
||||||
const inProduction = env.MODE === "production";
|
const inProduction = env.MODE === "production";
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const version = data?.currentVersion === "dev" ? data?.currentVersion : `v${data?.currentVersion}`;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
@@ -77,11 +76,11 @@ const VersionBadge: React.FC = () => {
|
|||||||
)}
|
)}
|
||||||
{data && (!data.hasUpdate || !inProduction) && (
|
{data && (!data.hasUpdate || !inProduction) && (
|
||||||
<Button
|
<Button
|
||||||
className="rounded-full bg-green-500 text-white hover:bg-green-600 hover:text-white"
|
className="rounded-full text-xs bg-green-500 text-white hover:bg-green-600 hover:text-white"
|
||||||
size="sm"
|
size="sm"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
>
|
>
|
||||||
<span>{version}</span>
|
<span>v{data?.currentVersion}</span>
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user