chore(admin): temporarily disable upload feature
This commit is contained in:
@@ -16,13 +16,14 @@ import {
|
||||
TabsList,
|
||||
TabsTrigger,
|
||||
} from "@/components/ui/tabs";
|
||||
import { KeyRound } from "lucide-react";
|
||||
import { ExternalLink, KeyRound } from "lucide-react";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
type LoginMethodProps = {
|
||||
name: string;
|
||||
description: string;
|
||||
href: string;
|
||||
configured: boolean;
|
||||
setupVariables: string[];
|
||||
resultVariables: string[];
|
||||
@@ -39,6 +40,7 @@ function EnvironmentBlock({ variables }: { variables: string[] }) {
|
||||
function LoginMethod({
|
||||
name,
|
||||
description,
|
||||
href,
|
||||
configured,
|
||||
setupVariables,
|
||||
resultVariables,
|
||||
@@ -71,10 +73,20 @@ function LoginMethod({
|
||||
</div>
|
||||
</CardContent>
|
||||
<CardFooter className="border-t">
|
||||
{configured ? (
|
||||
<Button asChild>
|
||||
<a href={href}>
|
||||
<KeyRound data-icon="inline-start" />
|
||||
Login with {name}
|
||||
<ExternalLink data-icon="inline-end" />
|
||||
</a>
|
||||
</Button>
|
||||
) : (
|
||||
<Button disabled>
|
||||
<KeyRound data-icon="inline-start" />
|
||||
Login with {name} temporarily disabled
|
||||
Login with {name}
|
||||
</Button>
|
||||
)}
|
||||
</CardFooter>
|
||||
</Card>
|
||||
);
|
||||
@@ -111,6 +123,7 @@ export default function AdminLoginPage() {
|
||||
<LoginMethod
|
||||
name="YouTube"
|
||||
description="Authorize the channel used for video uploads."
|
||||
href="/api/auth/youtube"
|
||||
configured={youtubeConfigured}
|
||||
setupVariables={[
|
||||
"BASE_URL",
|
||||
@@ -127,6 +140,7 @@ export default function AdminLoginPage() {
|
||||
<LoginMethod
|
||||
name="TikTok"
|
||||
description="Authorize the account used for profile data and video publishing."
|
||||
href="/api/auth/tiktok"
|
||||
configured={tiktokConfigured}
|
||||
setupVariables={[
|
||||
"BASE_URL",
|
||||
|
||||
@@ -80,11 +80,13 @@ function QuickAction({
|
||||
title,
|
||||
description,
|
||||
icon: Icon,
|
||||
disabled = false,
|
||||
}: {
|
||||
href: string;
|
||||
title: string;
|
||||
description: string;
|
||||
icon: typeof ClipboardList;
|
||||
disabled?: boolean;
|
||||
}) {
|
||||
return (
|
||||
<Card size="sm">
|
||||
@@ -95,11 +97,17 @@ function QuickAction({
|
||||
</CardTitle>
|
||||
<CardDescription>{description}</CardDescription>
|
||||
<CardAction>
|
||||
{disabled ? (
|
||||
<Button variant="ghost" size="icon-sm" disabled aria-label={`${title} disabled`}>
|
||||
<ArrowUpRight />
|
||||
</Button>
|
||||
) : (
|
||||
<Button variant="ghost" size="icon-sm" asChild>
|
||||
<Link href={href} aria-label={`Open ${title}`}>
|
||||
<ArrowUpRight />
|
||||
</Link>
|
||||
</Button>
|
||||
)}
|
||||
</CardAction>
|
||||
</CardHeader>
|
||||
</Card>
|
||||
@@ -348,6 +356,7 @@ export default async function AdminPage() {
|
||||
title="Video uploads"
|
||||
description="Publish and monitor platform jobs."
|
||||
icon={Upload}
|
||||
disabled
|
||||
/>
|
||||
<QuickAction
|
||||
href="/admin/backend"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useRef, useState, useTransition } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { CalendarClock, Upload } from "lucide-react";
|
||||
import { Upload } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Card,
|
||||
@@ -508,18 +508,10 @@ export function UploadForm() {
|
||||
<Button
|
||||
type="submit"
|
||||
size="lg"
|
||||
disabled={pending || uploadStatus !== "completed"}
|
||||
disabled
|
||||
>
|
||||
{pending ? (
|
||||
<CalendarClock data-icon="inline-start" />
|
||||
) : (
|
||||
<Upload data-icon="inline-start" />
|
||||
)}
|
||||
{pending
|
||||
? "Sending…"
|
||||
: scheduledAt
|
||||
? "Schedule both uploads"
|
||||
: "Upload to both platforms"}
|
||||
Upload feature temporarily disabled
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Clapperboard, History, UploadCloud } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
|
||||
const items = [
|
||||
@@ -37,13 +36,11 @@ export function UploadNavigation() {
|
||||
return (
|
||||
<Button
|
||||
key={href}
|
||||
asChild
|
||||
disabled
|
||||
variant={active ? "default" : "outline"}
|
||||
>
|
||||
<Link href={href} aria-current={active ? "page" : undefined}>
|
||||
<Icon data-icon="inline-start" />
|
||||
{label}
|
||||
</Link>
|
||||
</Button>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -24,6 +24,7 @@ interface NavItem {
|
||||
label: string;
|
||||
icon: LucideIcon;
|
||||
isActive: (pathname: string) => boolean;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
const NAV_ITEMS: NavItem[] = [
|
||||
@@ -50,6 +51,7 @@ const NAV_ITEMS: NavItem[] = [
|
||||
label: "Upload",
|
||||
icon: Upload,
|
||||
isActive: (pathname) => pathname.startsWith("/admin/upload"),
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
href: "/admin/login",
|
||||
@@ -99,14 +101,21 @@ export function AdminShell({
|
||||
<SidebarGroup>
|
||||
<SidebarGroupContent>
|
||||
<SidebarMenu>
|
||||
{NAV_ITEMS.map(({ href, label, icon: Icon, isActive }) => (
|
||||
{NAV_ITEMS.map(({ href, label, icon: Icon, isActive, disabled }) => (
|
||||
<SidebarMenuItem key={href}>
|
||||
{disabled ? (
|
||||
<SidebarMenuButton disabled tooltip={`${label} temporarily disabled`}>
|
||||
<Icon className="w-4 h-4" />
|
||||
<span>{label}</span>
|
||||
</SidebarMenuButton>
|
||||
) : (
|
||||
<SidebarMenuButton asChild isActive={isActive(pathname)}>
|
||||
<Link href={href}>
|
||||
<Icon className="w-4 h-4" />
|
||||
<span>{label}</span>
|
||||
</Link>
|
||||
</SidebarMenuButton>
|
||||
)}
|
||||
</SidebarMenuItem>
|
||||
))}
|
||||
</SidebarMenu>
|
||||
|
||||
Reference in New Issue
Block a user