Skip to content

Commit

Permalink
Merge pull request #445 from techcomrade/bug/ui
Browse files Browse the repository at this point in the history
Bug/UI
  • Loading branch information
hwt75 authored Jul 3, 2024
2 parents b6f6e92 + b594998 commit c9ee512
Show file tree
Hide file tree
Showing 14 changed files with 568 additions and 35 deletions.
Binary file added frontend_web/public/ai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend_web/public/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 4 additions & 5 deletions frontend_web/src/components/chart/EChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ function EChart() {
/>
</div>
<div className="chart-vistior">
<Title level={5}>Active Users</Title>
<Paragraph className="lastweek">
<Title level={5}>Số lượng người dùng đang hoạt động</Title>
{/* <Paragraph className="lastweek">
than last week <span className="bnb2">+30%</span>
</Paragraph>
</Paragraph> */}
<Paragraph className="lastweek">
We have created multiple options for you to put together and customise
into pixel perfect pages.
Tổng hợp số lượng người dùng bao gồm bệnh nhân và bác sĩ và thời gian bắt đầu sủ dụng hệ thống
</Paragraph>
<Row gutter>
{items.map((v, index) => (
Expand Down
6 changes: 3 additions & 3 deletions frontend_web/src/components/chart/LineChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ function LineChart() {
<>
<div className="linechart">
<div>
<Title level={5}>Active Users</Title>
<Paragraph className="lastweek">
<Title level={5}>Số lượng bản ghi mới</Title>
{/* <Paragraph className="lastweek">
than last week <span className="bnb2">+20%</span>
</Paragraph>
</Paragraph> */}
</div>
{/* <div className="sales">
<ul>
Expand Down
5 changes: 1 addition & 4 deletions frontend_web/src/components/chart/configs/eChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const eChart = {
series: [
{
name: "Sales",
data: [450, 200, 100, 220, 500, 100, 400, 230, 500],
data: [0,1, 1, 2, 1, 3],
color: "#fff",
},
],
Expand Down Expand Up @@ -45,9 +45,6 @@ const eChart = {
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
],
labels: {
show: true,
Expand Down
11 changes: 2 additions & 9 deletions frontend_web/src/components/chart/configs/lineChart.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
const lineChart = {
series: [
{
name: "Mobile apps",
data: [350, 40, 300, 220, 500, 250, 400, 230, 500],
offsetY: 0,
},
{
name: "Websites",
data: [30, 90, 40, 140, 290, 290, 340, 230, 400],
data: [ 0, 1, 3, 3, 4, 2],
offsetY: 0,
},
],
Expand Down Expand Up @@ -68,9 +63,7 @@ const lineChart = {
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",

],
},

Expand Down
2 changes: 1 addition & 1 deletion frontend_web/src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const convertDeviceTypeToString = (status) => {
case 1:
return "Đo điện tim";
case 2:
return "Đo chất lượng không khí";
return "Đo chỉ số tim mạch";
case 3:
return "Đo âm thanh";
default:
Expand Down
10 changes: 9 additions & 1 deletion frontend_web/src/layouts/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ import {
DesktopOutlined,
LineChartOutlined,
UserAddOutlined,
UserSwitchOutlined
UserSwitchOutlined,
OpenAIOutlined
} from "@ant-design/icons";
import { userRole } from "../constants";
import { context } from "../utils/context";
import Chat from "../pages/Chat/chat";
import AITraining from "../pages/AITranningChat/chat";

export const AdminRouterMappingGroup = {
User: {
Expand Down Expand Up @@ -50,6 +52,12 @@ export const AdminRouterMappingGroup = {
label: "Xét duyệt tài khoản",
component: <RegisterTable />,
icon: <UserAddOutlined />,
},
Chat: {
key: "/training",
label: "Training AI",
component:<AITraining />,
icon: <OpenAIOutlined />,
}
};

Expand Down
160 changes: 160 additions & 0 deletions frontend_web/src/pages/AITranningChat/chat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
import React, { useState } from "react";
import { FileImageOutlined } from "@ant-design/icons";
import "./chat.scss";

const AITraining = () => {
const [message, setMessage] = useState([
{
id: 0,
actor: "user",
message:
"Quy trình đăng ký sử dụng: người dùng đăng ký thông tin tài khoản sau đó admin sẽ xét duyệt và gửi thông tin về email của người dùng, sau đó người dùng sẽ được chỉ định bởi một bác sĩ điều trị và sử dụng hệ thống",
},
{
id: 1,
actor: "system",
message: "Dữ liệu đã tích hợp thành công",
},
]);
return (
<div className="chat-container">
<div className="sidebar">
<div className="navbar">
<span className="logo">Danh sách trợ lý ảo</span>
</div>
<div className="chats">
<div
className="userChat"
// key={chat[0]}
// onClick={() => handleSelect(chat[1].userInfo)}
>
<img src={/*chat[1].userInfo.photoURL*/ "ai.png"} alt="" />
<div className="userChatInfo">
<span>
{/* {chat[1].userInfo.displayName} */}
ECG AI
</span>
<p>
{/* {chat[1].lastMessage?.text} */}
Mời bạn nhập dữ liệu ...
</p>
</div>
</div>
</div>
</div>
<div className="chat">
<div className="chatInfo">
<span>ECG AI</span>
</div>
<div className="messages">
<div
// ref={ref}
// className={`message ${message.senderId === currentUser.uid && "owner"}`}
className={`message`}
// className={`message owner`}
>
<div className="messageInfo">
<img
src={
// message.senderId === currentUser.uid
// ? currentUser.photoURL
// : data.user.photoURL
"ai.png"
}
alt=""
/>
{/* <span>just now</span> */}
</div>
<div className="messageContent">
{/* <p>{message.text}</p> */}
<p> Mời bạn nhập dữ liệu huấn luyện cho trợ lý ảo </p>
{/* {message.img && <img src={message.img} alt="" />} */}
</div>
</div>
{message &&
message.map((item, index) =>
item.actor === "user" ? (
<div
// ref={ref}
className={`message owner`}
>
<div className="messageInfo">
<img
src={
// message.senderId === currentUser.uid
// ? currentUser.photoURL
// : data.user.photoURL
"avatar.png"
}
alt=""
/>
{/* <span>just now</span> */}
</div>
<div className="messageContent">
{/* <p>{message.text}</p> */}
<p>
{item.message}
</p>
{/* {message.img && <img src={message.img} alt="" />} */}
</div>
</div>
) : (
<div
// ref={ref}
// className={`message ${message.senderId === currentUser.uid && "owner"}`}
className={`message`}
// className={`message owner`}
>
<div className="messageInfo">
<img
src={
// message.senderId === currentUser.uid
// ? currentUser.photoURL
// : data.user.photoURL
"ai.png"
}
alt=""
/>
{/* <span>just now</span> */}
</div>
<div className="messageContent">
{/* <p>{message.text}</p> */}
<p> {item.message}</p>
{/* {message.img && <img src={message.img} alt="" />} */}
</div>
</div>
)
)}

</div>
<div className="input">
<input
type="text"
placeholder="Type something..."
// onChange={(e) => setText(e.target.value)}
// value={text}
/>
<div className="send">
<input
type="file"
style={{ display: "none" }}
id="file"
// onChange={(e) => setImg(e.target.files[0])}
/>
<label htmlFor="file">
{/* <img src={Img} alt="" /> */}
<FileImageOutlined />
</label>
<button
// onClick={handleSend}
>
Send
</button>
</div>
</div>
</div>
</div>
);
};

export default AITraining;
Loading

0 comments on commit c9ee512

Please sign in to comment.