Merge branch 'main' of http://113.45.157.195:3003/insiinc/re-mooc
This commit is contained in:
commit
55fa908391
|
@ -14,7 +14,7 @@ export class ImageProcessor extends BaseProcessor {
|
||||||
const { url } = resource;
|
const { url } = resource;
|
||||||
const filepath = getUploadFilePath(url);
|
const filepath = getUploadFilePath(url);
|
||||||
const originMeta = resource.meta as unknown as FileMetadata;
|
const originMeta = resource.meta as unknown as FileMetadata;
|
||||||
if (!originMeta.mimeType?.startsWith('image/')) {
|
if (!originMeta.filetype?.startsWith('image/')) {
|
||||||
this.logger.log(`Skipping non-image resource: ${resource.id}`);
|
this.logger.log(`Skipping non-image resource: ${resource.id}`);
|
||||||
return resource;
|
return resource;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ export class VideoProcessor extends BaseProcessor {
|
||||||
);
|
);
|
||||||
|
|
||||||
const originMeta = resource.meta as unknown as FileMetadata;
|
const originMeta = resource.meta as unknown as FileMetadata;
|
||||||
if (!originMeta.mimeType?.startsWith('video/')) {
|
if (!originMeta.filetype?.startsWith('video/')) {
|
||||||
this.logger.log(`Skipping non-video resource: ${resource.id}`);
|
this.logger.log(`Skipping non-video resource: ${resource.id}`);
|
||||||
return resource;
|
return resource;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ export interface ProcessResult {
|
||||||
|
|
||||||
export interface BaseMetadata {
|
export interface BaseMetadata {
|
||||||
size: number
|
size: number
|
||||||
mimeType: string
|
filetype: string
|
||||||
filename: string
|
filename: string
|
||||||
extension: string
|
extension: string
|
||||||
modifiedAt: Date
|
modifiedAt: Date
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
export function coursePreviewAllmsg() {
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen">
|
||||||
|
helloword
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
export function CoursePreview(){
|
||||||
|
return(
|
||||||
|
<div className="min-h-screen">
|
||||||
|
helloword
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
|
@ -1,7 +1,8 @@
|
||||||
import { Checkbox, Divider, Radio, Space } from "antd";
|
import { Checkbox, Divider, Radio, Space , Spin} from 'antd';
|
||||||
import { categories, levels } from "../mockData";
|
import { categories, levels } from '../mockData';
|
||||||
import { api } from "@nice/client";
|
import { TaxonomySlug, TermDto } from '@nice/common';
|
||||||
import { TaxonomySlug } from "@nice/common";
|
import { GetTaxonomyProps, useGetTaxonomy } from '@web/src/hooks/useGetTaxonomy';
|
||||||
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
interface FilterSectionProps {
|
interface FilterSectionProps {
|
||||||
selectedCategory: string;
|
selectedCategory: string;
|
||||||
|
@ -16,14 +17,12 @@ export default function FilterSection({
|
||||||
onCategoryChange,
|
onCategoryChange,
|
||||||
onLevelChange,
|
onLevelChange,
|
||||||
}: FilterSectionProps) {
|
}: FilterSectionProps) {
|
||||||
const { data: levels, isLoading } = api.term.findMany.useQuery({
|
const gateGory : GetTaxonomyProps = useGetTaxonomy({
|
||||||
where: {
|
type: TaxonomySlug.CATEGORY,
|
||||||
taxonomy: {
|
})
|
||||||
slug: TaxonomySlug.LEVEL,
|
const levels : GetTaxonomyProps = useGetTaxonomy({
|
||||||
},
|
type: TaxonomySlug.LEVEL,
|
||||||
},
|
})
|
||||||
});
|
|
||||||
// const { data } = api.term;
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-white p-6 rounded-lg shadow-sm space-y-6">
|
<div className="bg-white p-6 rounded-lg shadow-sm space-y-6">
|
||||||
<div>
|
<div>
|
||||||
|
@ -31,13 +30,23 @@ export default function FilterSection({
|
||||||
<Radio.Group
|
<Radio.Group
|
||||||
value={selectedCategory}
|
value={selectedCategory}
|
||||||
onChange={(e) => onCategoryChange(e.target.value)}
|
onChange={(e) => onCategoryChange(e.target.value)}
|
||||||
className="flex flex-col space-y-3">
|
className="flex flex-col space-y-3"
|
||||||
|
>
|
||||||
|
{
|
||||||
|
gateGory.isLoading?
|
||||||
|
(<Spin/>)
|
||||||
|
:
|
||||||
|
(
|
||||||
|
<>
|
||||||
<Radio value="">全部课程</Radio>
|
<Radio value="">全部课程</Radio>
|
||||||
{categories.map((category) => (
|
{gateGory.categories.map(category => (
|
||||||
<Radio key={category} value={category}>
|
<Radio key={category} value={category}>
|
||||||
{category}
|
{category}
|
||||||
</Radio>
|
</Radio>
|
||||||
))}
|
))}
|
||||||
|
</>)
|
||||||
|
}
|
||||||
|
|
||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -48,13 +57,23 @@ export default function FilterSection({
|
||||||
<Radio.Group
|
<Radio.Group
|
||||||
value={selectedLevel}
|
value={selectedLevel}
|
||||||
onChange={(e) => onLevelChange(e.target.value)}
|
onChange={(e) => onLevelChange(e.target.value)}
|
||||||
className="flex flex-col space-y-3">
|
className="flex flex-col space-y-3"
|
||||||
|
>
|
||||||
|
{
|
||||||
|
levels.isLoading ?
|
||||||
|
(<Spin/>)
|
||||||
|
:
|
||||||
|
(
|
||||||
|
<>
|
||||||
<Radio value="">全部难度</Radio>
|
<Radio value="">全部难度</Radio>
|
||||||
{levels?.map((level) => (
|
{levels.categories.map(level => (
|
||||||
<Radio key={level.id} value={level.id}>
|
<Radio key={level} value={level}>
|
||||||
{level.name}
|
{level}
|
||||||
</Radio>
|
</Radio>
|
||||||
))}
|
))}
|
||||||
|
</>)
|
||||||
|
}
|
||||||
|
|
||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue