feat: transloadit
This commit is contained in:
parent
ca671654e5
commit
30396f6a35
|
|
@ -55,6 +55,14 @@ export default async function AppLayout({ children }: { children: ReactNode }) {
|
||||||
isSecured={!process.env.NOT_SECURED}
|
isSecured={!process.env.NOT_SECURED}
|
||||||
disableImageCompression={!!process.env.DISABLE_IMAGE_COMPRESSION}
|
disableImageCompression={!!process.env.DISABLE_IMAGE_COMPRESSION}
|
||||||
language={allHeaders.get(headerName)}
|
language={allHeaders.get(headerName)}
|
||||||
|
transloadit={
|
||||||
|
process.env.TRANSLOADIT_AUTH && process.env.TRANSLOADIT_TEMPLATE
|
||||||
|
? [
|
||||||
|
process.env.TRANSLOADIT_AUTH!,
|
||||||
|
process.env.TRANSLOADIT_TEMPLATE!,
|
||||||
|
]
|
||||||
|
: []
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<ToltScript />
|
<ToltScript />
|
||||||
<FacebookComponent />
|
<FacebookComponent />
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ export function useUppyUploader(props: {
|
||||||
}) {
|
}) {
|
||||||
const setLocked = useLaunchStore(state => state.setLocked);
|
const setLocked = useLaunchStore(state => state.setLocked);
|
||||||
const toast = useToaster();
|
const toast = useToaster();
|
||||||
const { storageProvider, backendUrl, disableImageCompression } =
|
const { storageProvider, backendUrl, disableImageCompression, transloadit } =
|
||||||
useVariables();
|
useVariables();
|
||||||
const { onUploadSuccess, allowedFileTypes } = props;
|
const { onUploadSuccess, allowedFileTypes } = props;
|
||||||
const fetch = useFetch();
|
const fetch = useFetch();
|
||||||
|
|
@ -124,7 +124,8 @@ export function useUppyUploader(props: {
|
||||||
const { plugin, options } = getUppyUploadPlugin(
|
const { plugin, options } = getUppyUploadPlugin(
|
||||||
storageProvider,
|
storageProvider,
|
||||||
fetch,
|
fetch,
|
||||||
backendUrl
|
backendUrl,
|
||||||
|
transloadit
|
||||||
);
|
);
|
||||||
uppy2.use(plugin, options);
|
uppy2.use(plugin, options);
|
||||||
if (!disableImageCompression) {
|
if (!disableImageCompression) {
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,8 @@ model Media {
|
||||||
path String
|
path String
|
||||||
organization Organization @relation(fields: [organizationId], references: [id])
|
organization Organization @relation(fields: [organizationId], references: [id])
|
||||||
organizationId String
|
organizationId String
|
||||||
|
fileSize Int @default(0)
|
||||||
|
type String @default("image")
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
userPicture User[]
|
userPicture User[]
|
||||||
|
|
@ -209,6 +211,7 @@ model Media {
|
||||||
deletedAt DateTime?
|
deletedAt DateTime?
|
||||||
|
|
||||||
@@index([organizationId])
|
@@index([organizationId])
|
||||||
|
@@index([type])
|
||||||
}
|
}
|
||||||
|
|
||||||
model SocialMediaAgency {
|
model SocialMediaAgency {
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,9 @@ const fetchUploadApiEndpoint = async (
|
||||||
export const getUppyUploadPlugin = (
|
export const getUppyUploadPlugin = (
|
||||||
provider: string,
|
provider: string,
|
||||||
fetch: any,
|
fetch: any,
|
||||||
backendUrl: string
|
backendUrl: string,
|
||||||
|
transloadit: string[] = [],
|
||||||
|
isVideo: boolean = false,
|
||||||
) => {
|
) => {
|
||||||
switch (provider) {
|
switch (provider) {
|
||||||
case 'cloudflare':
|
case 'cloudflare':
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ interface VariableContextInterface {
|
||||||
disableImageCompression: boolean;
|
disableImageCompression: boolean;
|
||||||
language: string;
|
language: string;
|
||||||
tolt: string;
|
tolt: string;
|
||||||
|
transloadit: string[];
|
||||||
}
|
}
|
||||||
const VariableContext = createContext({
|
const VariableContext = createContext({
|
||||||
billingEnabled: false,
|
billingEnabled: false,
|
||||||
|
|
@ -40,6 +41,7 @@ const VariableContext = createContext({
|
||||||
disableImageCompression: false,
|
disableImageCompression: false,
|
||||||
language: '',
|
language: '',
|
||||||
tolt: '',
|
tolt: '',
|
||||||
|
transloadit: [],
|
||||||
} as VariableContextInterface);
|
} as VariableContextInterface);
|
||||||
export const VariableContextComponent: FC<
|
export const VariableContextComponent: FC<
|
||||||
VariableContextInterface & {
|
VariableContextInterface & {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue