Skip to content
Extraits de code Groupes Projets
Valider 17b6c8a8 rédigé par oussama aftys's avatar oussama aftys Validation de oussama aftys
Parcourir les fichiers

added live product mangement

parent 09ac78bf
Branches
1 requête de fusion!143Update 2 files
# HOST
NEXT_PUBLIC_HOST_API=https://api-dev-minimal-v510.vercel.app
NEXT_PUBLIC_HOST_API_URL=http://localhost:8080
NEXT_PUBLIC_WEB_SOCKET_URL="http://localhost:8080/ws"
NEXT_PUBLIC_HOST_API_URL=http://15.237.175.171:8080
NEXT_PUBLIC_WEB_SOCKET_URL=http://15.237.175.171:8080/ws
# ASSETS
NEXT_PUBLIC_ASSETS_API=https://api-dev-minimal-v510.vercel.app
......
......@@ -11,7 +11,7 @@ type LiveCommentsContextType = {
pinnedComments: ILiveComment[];
};
const WEB_SOCKET_URL = process.env.WEB_SOCKET_URL || "http://localhost:8080/ws";
const WEB_SOCKET_URL = process.env.WEB_SOCKET_URL || "http://15.237.175.171:8080/ws";
const useLiveComments = ({ id, status }: ILive): LiveCommentsContextType => {
const [comments, setComments] = useState<ILiveComment[]>([]);
......
......@@ -135,7 +135,7 @@ export async function unpinCommentLive(commentId: string | undefined, liveId: st
//////////////////////////////////////////////////////////////////////////////////
export async function addProductLive(liveId: string, productId: string, startTime: number, endTime: number) {
await axiosInstance.post(`${endpoints.live.products}/${productId}`, { startTime, endTime });
await axiosInstance.post(`${endpoints.live.products}/${productId}/stream/${liveId}`, { startTime, endTime });
mutate(
[`${endpoints.live.stream}/${liveId}/products`],
......@@ -157,7 +157,7 @@ export function useGetProducts() {
}
export async function deleteProductLive(productId: string, liveId: string) {
await axiosInstance.delete(`${endpoints.live.products}/${productId}`);
await axiosInstance.delete(`${endpoints.live.products}/${productId}/stream/${liveId}`);
mutate(
[`${endpoints.live.stream}/${liveId}/products`],
(products: ILiveProduct[] = []) => {
......
......@@ -3,7 +3,7 @@ import { comment } from 'postcss';
import { shippingClassesList } from '../_mock/_shipping';
export const HOST_API = process.env.HOST_API_URL ||'http://localhost:8080';
export const HOST_API = process.env.HOST_API_URL ||'http://15.237.175.171:8080';
export const axiosInstance = axios.create({ baseURL: HOST_API });
......
......@@ -24,14 +24,6 @@ const Logo = forwardRef<HTMLDivElement, LogoProps>(
// OR using local (public folder)
// -------------------------------------------------------
// const logo = (
// <Box
// component="img"
// src="/logo/logo_single.svg" => your path
// sx={{ width: 40, height: 40, cursor: 'pointer', ...sx }}
// />
// );
const logo = (
<Box
component="img"
......
......@@ -80,7 +80,7 @@ export default function AccountPopover() {
}}
>
<Avatar
src={user?.photoURL}
// src={user?.photoURL}
alt={user?.displayName}
sx={{
width: 36,
......@@ -95,7 +95,7 @@ export default function AccountPopover() {
<CustomPopover open={popover.open} onClose={popover.onClose} sx={{ width: 200, p: 0 }}>
<Divider sx={{ borderStyle: 'dashed' }} />
{/* <Divider sx={{ borderStyle: 'dashed' }} /> */}
<MenuItem
onClick={handleLogout}
......
......@@ -61,9 +61,7 @@ export default function Header({ onOpenNav }: Props) {
justifyContent="flex-end"
spacing={{ xs: 0.5, sm: 1 }}
>
<LanguagePopover />
<NotificationsPopover />
<SettingsButton />
......
......@@ -140,18 +140,9 @@ export default function JwtLoginView() {
<>
{renderHead}
<Alert severity="info" sx={{ mb: 3 }}>
<Box component="ul" sx={{ pl: 2, m: 0 }}>
<li>
Admin: <strong>admin@mydressin.com</strong> Mot de passe: <strong>admin1234</strong>
</li>
<li>
Driver: <strong>driver@mydressin.com</strong> Mot de passe: <strong>driver1234</strong>
</li>
</Box>
</Alert>
{/* {renderHead} */}
{/* <Alert severity="info" sx={{ mb: 3 }}>
Use email : <strong>demo@minimals.cc</strong> / password :<strong> demo1234</strong>
</Alert> */}
{!!errorMsg && (
<Alert severity="error" sx={{ mb: 3 }}>
......
......@@ -32,7 +32,7 @@ export default function LiveTableRow({
onEditRow,
onViewStats
}: Props) {
const { title, description, startDate, status ,image} = row;
const { title, description, startDate, status, image } = row;
const popover = usePopover();
const openDetails = useBoolean();
......@@ -91,7 +91,10 @@ export default function LiveTableRow({
'default'
}
>
{status}
{
(status == LiveStatus.REPLAY && 'replay') ||
(status == LiveStatus.ONGOING && 'en cours') ||
(status == LiveStatus.COMING && 'à venir')}
</Label>
</TableCell>
......
......@@ -87,20 +87,20 @@ export default function AllLivesView() {
{ value: 'all', label: 'Tout', color: 'default', count: livesData.length },
{
value: LiveStatus.COMING,
label: LiveStatus.COMING,
label: "à venir",
color: 'error',
count: getLiveLength(LiveStatus.COMING),
},
{
value: LiveStatus.ONGOING,
label: LiveStatus.ONGOING,
label: "en cours",
color: 'warning',
count: getLiveLength(LiveStatus.ONGOING),
},
{
value: LiveStatus.REPLAY,
label: LiveStatus.REPLAY,
label: "replay",
color: 'success',
count: getLiveLength(LiveStatus.REPLAY),
},
......
......@@ -9,18 +9,19 @@ type Props = {
hlsServerAddress: string | undefined;
status: LiveStatus | undefined;
liveId: string;
}
export default function VideoPlayerSection({ keyStream, hlsServerAddress, status, liveId }: Props) {
videoLink?: string;
currentTime?: number;
};
export default function VideoPlayerSection({ keyStream, hlsServerAddress, status, liveId, videoLink }: Props) {
const liveUrl = status === LiveStatus.REPLAY ? videoLink : `${hlsServerAddress}/${keyStream}.m3u8`;
return (
<Grid item lg={4} md={8} xs={12}>
<Card sx={{ position: "relative", height: 600, zIndex: 0, p: 0, bgcolor: 'black', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
{status == LiveStatus.ONGOING && <ReactPlayer playing={true}
controls={true}
width="100%"
height="100%" url={`${hlsServerAddress}/${keyStream}.m3u8`} />
height="100%" url={liveUrl} />
}
{status == LiveStatus.COMING && <Iconify color='white' sx={{ position: "absolute", margin: "auto", width: 100, height: 100, cursor: 'pointer' }} onClick={() => startLive(liveId)} icon="solar:play-bold" />}
</Card>
......
0% ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter