forked from administration/panel
feat: make some values configurable
parent
efafed4931
commit
2c3ee300c5
|
@ -2,6 +2,7 @@
|
|||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { API_URL } from "@/lib/constants";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
|
@ -45,7 +46,7 @@ export default function Inspect() {
|
|||
className="flex-1"
|
||||
variant="outline"
|
||||
onClick={() =>
|
||||
fetch("https://api.revolt.chat/invites/" + id)
|
||||
fetch(API_URL + "/invites/" + id)
|
||||
.then((res) => res.json())
|
||||
.then((invite) =>
|
||||
router.push(`/panel/inspect/server/${invite.server_id}`)
|
||||
|
|
|
@ -2,6 +2,7 @@ import { Channel } from "revolt-api";
|
|||
import { Card, CardDescription, CardHeader, CardTitle } from "../ui/card";
|
||||
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";
|
||||
import Link from "next/link";
|
||||
import { AUTUMN_URL } from "@/lib/constants";
|
||||
|
||||
export function ChannelCard({
|
||||
channel,
|
||||
|
@ -23,7 +24,7 @@ export function ChannelCard({
|
|||
<Avatar>
|
||||
{channel.channel_type !== "DirectMessage" && (
|
||||
<AvatarImage
|
||||
src={`https://autumn.revolt.chat/icons/${channel.icon?._id}`}
|
||||
src={`${AUTUMN_URL}/icons/${channel.icon?._id}`}
|
||||
/>
|
||||
)}
|
||||
<AvatarFallback>
|
||||
|
|
|
@ -19,6 +19,7 @@ import { decodeTime } from "ulid";
|
|||
|
||||
import calendarPlugin from "dayjs/plugin/calendar";
|
||||
import Link from "next/link";
|
||||
import { AUTUMN_URL } from "@/lib/constants";
|
||||
dayjs.extend(calendarPlugin);
|
||||
|
||||
export function CompactMessage({
|
||||
|
@ -56,7 +57,7 @@ export function CompactMessage({
|
|||
{user?.avatar && (
|
||||
<Avatar className="w-4 h-4 inline-block align-middle mr-1">
|
||||
<AvatarImage
|
||||
src={`https://autumn.revolt.chat/avatars/${user.avatar._id}`}
|
||||
src={`${AUTUMN_URL}/avatars/${user.avatar._id}`}
|
||||
/>
|
||||
</Avatar>
|
||||
)}
|
||||
|
@ -80,7 +81,7 @@ export function CompactMessage({
|
|||
{user?.avatar && (
|
||||
<Avatar className="inline-block align-middle mr-1">
|
||||
<AvatarImage
|
||||
src={`https://autumn.revolt.chat/avatars/${user.avatar._id}`}
|
||||
src={`${AUTUMN_URL}/avatars/${user.avatar._id}`}
|
||||
/>
|
||||
</Avatar>
|
||||
)}{" "}
|
||||
|
@ -94,11 +95,11 @@ export function CompactMessage({
|
|||
target="_blank"
|
||||
className="w-fit"
|
||||
key={attachment._id}
|
||||
href={`https://autumn.revolt.chat/attachments/${attachment._id}`}
|
||||
href={`${AUTUMN_URL}/attachments/${attachment._id}`}
|
||||
>
|
||||
<img
|
||||
className="max-h-[240px] object-contain"
|
||||
src={`https://autumn.revolt.chat/attachments/${attachment._id}`}
|
||||
src={`${AUTUMN_URL}/attachments/${attachment._id}`}
|
||||
/>
|
||||
</a>
|
||||
) : (
|
||||
|
|
|
@ -2,6 +2,7 @@ import { Server } from "revolt-api";
|
|||
import { Card, CardDescription, CardHeader, CardTitle } from "../ui/card";
|
||||
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";
|
||||
import Link from "next/link";
|
||||
import { AUTUMN_URL } from "@/lib/constants";
|
||||
|
||||
export function ServerCard({
|
||||
server,
|
||||
|
@ -16,7 +17,7 @@ export function ServerCard({
|
|||
<CardTitle>
|
||||
<Avatar>
|
||||
<AvatarImage
|
||||
src={`https://autumn.revolt.chat/icons/${server.icon?._id}`}
|
||||
src={`${AUTUMN_URL}/icons/${server.icon?._id}`}
|
||||
/>
|
||||
<AvatarFallback>
|
||||
{server.name
|
||||
|
|
|
@ -2,6 +2,7 @@ import { User } from "revolt-api";
|
|||
import { Card, CardDescription, CardHeader, CardTitle } from "../ui/card";
|
||||
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";
|
||||
import { Badge } from "../ui/badge";
|
||||
import { AUTUMN_URL } from "@/lib/constants";
|
||||
|
||||
export function UserCard({ user, subtitle }: { user: User; subtitle: string }) {
|
||||
return (
|
||||
|
@ -9,7 +10,7 @@ export function UserCard({ user, subtitle }: { user: User; subtitle: string }) {
|
|||
className="shadow-none bg-no-repeat bg-right text-left"
|
||||
style={{
|
||||
backgroundImage: user.profile?.background
|
||||
? `linear-gradient(to right, white, rgba(255,0,0,0)), url('https://autumn.revolt.chat/backgrounds/${user.profile.background._id}')`
|
||||
? `linear-gradient(to right, white, rgba(255,0,0,0)), url('${AUTUMN_URL}/backgrounds/${user.profile.background._id}')`
|
||||
: "",
|
||||
backgroundSize: "75%",
|
||||
}}
|
||||
|
@ -18,7 +19,7 @@ export function UserCard({ user, subtitle }: { user: User; subtitle: string }) {
|
|||
<CardTitle className="overflow-hidden overflow-ellipsis whitespace-nowrap">
|
||||
<Avatar>
|
||||
<AvatarImage
|
||||
src={`https://autumn.revolt.chat/avatars/${user.avatar?._id}`}
|
||||
src={`${AUTUMN_URL}/avatars/${user.avatar?._id}`}
|
||||
/>
|
||||
<AvatarFallback className="overflow-hidden overflow-ellipsis whitespace-nowrap">
|
||||
{(user.display_name ?? user.username)
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
export const PLATFORM_MOD_ID = "01FC17E1WTM2BGE4F3ARN3FDAF";
|
||||
export const PLATFORM_MOD_ID = process.env.PLATFORM_MOD_ID || "01FC17E1WTM2BGE4F3ARN3FDAF";
|
||||
export const AUTUMN_URL = process.env.AUTUMN_URL || "https://autumn.revolt.chat";
|
||||
export const API_URL = process.env.API_URL || "https://api.revolt.chat";
|
||||
|
|
Loading…
Reference in New Issue