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
|
||||
public VersionInfo version() {
|
||||
if ("dev".equals(version)) {
|
||||
if (version.endsWith("-SNAPSHOT")) {
|
||||
return VersionInfo.builder()
|
||||
.currentVersion(version)
|
||||
.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 { VariantProps } from "class-variance-authority";
|
||||
import { Check, Copy } from "lucide-react";
|
||||
import { type HTMLProps, type ReactNode, useCallback, useEffect, useState } from "react";
|
||||
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 { toast } from "sonner";
|
||||
|
||||
interface CopyButtonProps extends ButtonProps {
|
||||
interface CopyButtonProps extends React.ComponentProps<"button"> {
|
||||
value: string;
|
||||
src?: string;
|
||||
}
|
||||
|
||||
export function CopyButton({ value }: Readonly<CopyButtonProps>) {
|
||||
export function CopyButton({ value }: Readonly<CopyButtonProps & VariantProps<typeof buttonVariants>>) {
|
||||
const [hasCopied, setHasCopied] = useState(false);
|
||||
const { t } = useTranslation();
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ const VersionBadge: React.FC = () => {
|
||||
});
|
||||
const inProduction = env.MODE === "production";
|
||||
const { t } = useTranslation();
|
||||
const version = data?.currentVersion === "dev" ? data?.currentVersion : `v${data?.currentVersion}`;
|
||||
|
||||
return (
|
||||
<div className="flex items-center space-x-2">
|
||||
@@ -77,11 +76,11 @@ const VersionBadge: React.FC = () => {
|
||||
)}
|
||||
{data && (!data.hasUpdate || !inProduction) && (
|
||||
<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"
|
||||
variant="ghost"
|
||||
>
|
||||
<span>{version}</span>
|
||||
<span>v{data?.currentVersion}</span>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user