Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
FMS_Project_Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bashar.hussein
FMS_Project_Frontend
Commits
048ae270
Commit
048ae270
authored
Jul 17, 2023
by
ReemyHasan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add setting page
parent
ad0cca50
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1621 additions
and
629 deletions
+1621
-629
_app.tsx
packages/admin/pages/_app.tsx
+10
-0
index.tsx
packages/admin/pages/setup/index.tsx
+6
-1
index.tsx
packages/admin/pages/setup/setting-about-content/index.tsx
+22
-0
index.tsx
packages/admin/pages/setup/setting-profile-content/index.tsx
+22
-0
index.tsx
packages/admin/pages/user/index.tsx
+0
-0
app-constant.tsx
packages/admin/src/data/constant/app-constant.tsx
+2
-0
footer.tsx
packages/admin/src/features/about/footer.tsx
+7
-7
index.tsx
packages/admin/src/features/about/index.tsx
+401
-495
index.tsx
packages/admin/src/features/edit-user/index.tsx
+0
-31
index.tsx
packages/admin/src/features/login/index.tsx
+6
-0
index.tsx
packages/admin/src/features/profile/index.tsx
+5
-2
index.tsx
packages/admin/src/features/setting/index.tsx
+44
-0
setting-about-content.tsx
...ages/admin/src/features/setting/setting-about-content.tsx
+668
-0
setting-profile.tsx
packages/admin/src/features/setting/setting-profile.tsx
+195
-0
index.tsx
packages/admin/src/features/show-traps/index.tsx
+54
-69
columns.tsx
packages/admin/src/features/show-users/columns.tsx
+9
-14
edit-user-popup.tsx
packages/admin/src/features/show-users/edit-user-popup.tsx
+49
-0
index.tsx
packages/admin/src/features/show-users/index.tsx
+10
-5
setting-service.tsx
packages/admin/src/services/setting-service.tsx
+57
-0
traps-service.tsx
packages/admin/src/services/traps-service.tsx
+23
-0
global.less
packages/admin/src/styles/global.less
+31
-5
No files found.
packages/admin/pages/_app.tsx
View file @
048ae270
...
...
@@ -40,6 +40,16 @@ export default function App({ Component, pageProps }: AppProps) {
if
(
loader
)
loader
.
remove
();
}
},
[]);
useEffect
(()
=>
{
if
(
!
websocket
)
{
return
;
}
return
()
=>
{
if
(
websocket
)
{
websocket
.
close
();
}
};
},
[]);
return
(
<
Fragment
>
...
...
packages/admin/pages/setup/index.tsx
View file @
048ae270
...
...
@@ -4,6 +4,7 @@ import AppLayout from "@/src/components/layout";
import
{
Fragment
}
from
"react"
;
import
useTranslation
from
"next-translate/useTranslation"
;
import
{
TranslationFiles
}
from
"@/src/data/core"
;
import
Setting
from
"@/src/features/setting"
;
export
default
function
Setup
()
{
const
{
t
}
=
useTranslation
(
TranslationFiles
.
COMMON
);
return
(
...
...
@@ -12,7 +13,11 @@ export default function Setup() {
<
title
>
{
t
(
"setup"
)
}
</
title
>
</
Head
>
<
AppLayout
>
<
main
className=
{
`app-main-container`
}
>
{
t
(
"setup"
)
}
</
main
>
<
main
className=
{
`app-main-container`
}
>
<
div
className=
" w-full px-4 max-w-full flex-grow flex-1"
>
<
Setting
/>
</
div
>
</
main
>
</
AppLayout
>
</
Fragment
>
);
...
...
packages/admin/pages/setup/setting-about-content/index.tsx
0 → 100644
View file @
048ae270
import
*
as
React
from
"react"
;
import
Head
from
"next/head"
;
import
AppLayout
from
"@/src/components/layout"
;
import
{
Fragment
}
from
"react"
;
import
useTranslation
from
"next-translate/useTranslation"
;
import
{
TranslationFiles
}
from
"@/src/data/core"
;
import
SettingAboutContent
from
"../../../src/features/setting/setting-about-content"
;
export
default
function
Setup
()
{
const
{
t
}
=
useTranslation
(
TranslationFiles
.
COMMON
);
return
(
<
Fragment
>
<
Head
>
<
title
>
{
t
(
"setup"
)
}
</
title
>
</
Head
>
<
AppLayout
>
<
main
className=
{
`app-main-container`
}
>
<
SettingAboutContent
/>
</
main
>
</
AppLayout
>
</
Fragment
>
);
}
packages/admin/pages/setup/setting-profile-content/index.tsx
0 → 100644
View file @
048ae270
import
*
as
React
from
"react"
;
import
Head
from
"next/head"
;
import
AppLayout
from
"@/src/components/layout"
;
import
{
Fragment
}
from
"react"
;
import
useTranslation
from
"next-translate/useTranslation"
;
import
{
TranslationFiles
}
from
"@/src/data/core"
;
import
SettingProfileContent
from
"../../../src/features/setting/setting-profile"
;
export
default
function
Setup
()
{
const
{
t
}
=
useTranslation
(
TranslationFiles
.
COMMON
);
return
(
<
Fragment
>
<
Head
>
<
title
>
{
t
(
"setup"
)
}
</
title
>
</
Head
>
<
AppLayout
>
<
main
className=
{
`app-main-container`
}
>
<
SettingProfileContent
/>
</
main
>
</
AppLayout
>
</
Fragment
>
);
}
packages/admin/pages/user/index.tsx
0 → 100644
View file @
048ae270
packages/admin/src/data/constant/app-constant.tsx
View file @
048ae270
export
const
AUTH_TOKEN
:
string
=
"app-auth-token"
;
export
const
Default_Language
:
string
=
"app-language"
;
export
const
TrapURL
:
string
=
"http://localhost:6647/api/rethink/data"
;
export
const
SettingURL
:
string
=
"http://localhost:6647/api/about"
;
packages/admin/src/features/about/footer.tsx
View file @
048ae270
...
...
@@ -2,7 +2,7 @@ import { GithubOutlined, MailOutlined } from "@ant-design/icons";
import
React
,
{
useState
}
from
"react"
;
export
default
function
Footer
()
{
const
[
showEmail
,
setShowEmail
]
=
useState
(
false
);
const
email
=
"example@example.com"
;
const
email
=
<
span
>
{
"example@example.com "
}
</
span
>
;
const
handleButtonClick
=
()
=>
{
setShowEmail
(
!
showEmail
);
...
...
@@ -32,12 +32,12 @@ export default function Footer() {
<
div
className=
"container mx-auto px-4"
>
<
div
className=
"flex flex-wrap text-center lg:text-left"
>
<
div
className=
"w-full lg:w-6/12 px-4"
>
<
h4
className=
"text-3xl font-semibold"
>
Let's keep in touch!
</
h4
>
{
/*
<h4 className="text-3xl font-semibold">Let's keep in touch!</h4>
<h5 className="text-lg mt-0 mb-2 text-blueGray-600">
Find us on any of these platform.
</
h5
>
</h5>
*/
}
<
div
className=
"mt-6 lg:mb-0 mb-6"
>
<
button
{
/*
<button
className="bg-white text-lightBlue-400 shadow-lg font-normal h-10 w-10 items-center justify-center align-center rounded-full outline-none focus:outline-none mr-2"
type="button"
onClick={handleButtonClick}
...
...
@@ -59,13 +59,13 @@ export default function Footer() {
style={{ fontSize: "19px", color: "#000f24" }}
className={"ExclamationCircleOutlined "}
/>
</
button
>
</button>
*/
}
</
div
>
</
div
>
<
div
className=
"w-full lg:w-6/12 px-4"
>
<
div
className=
"flex flex-wrap items-top mb-6"
>
<
div
className=
"w-full lg:w-4/12 px-4 ml-auto"
>
<
span
className=
"block uppercase text-blueGray-500 text-sm font-semibold mb-2"
>
{
/*
<span className="block uppercase text-blueGray-500 text-sm font-semibold mb-2">
Useful Links
</span>
<ul className="list-unstyled">
...
...
@@ -77,7 +77,7 @@ export default function Footer() {
Contact Us
</a>
</li>
</
ul
>
</ul>
*/
}
</
div
>
</
div
>
</
div
>
...
...
packages/admin/src/features/about/index.tsx
View file @
048ae270
import
useTranslation
from
"next-translate/useTranslation"
;
import
{
TranslationFiles
}
from
"@/src/data/core"
;
import
{
useRouter
}
from
"next/router"
;
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
React
from
"react"
;
// components
import
Footer
from
"./footer"
;
export
default
function
AboutContent
()
{
import
Footer
from
"./footer"
;
import
{
Alert
}
from
"antd"
;
import
{
fetchAboutSettingData
,
sendEmailMessage
,
}
from
"@/src/services/setting-service"
;
export
default
function
AboutContent
()
{
const
{
t
}
=
useTranslation
(
TranslationFiles
.
COMMON
);
const
router
=
useRouter
();
const
[
formData
,
setFormData
]
=
useState
({
subject
:
""
,
//fullName
email
:
""
,
body
:
""
,
});
const
[
sendingStatus
,
setSendingStatus
]
=
useState
(
""
);
const
[
data
,
setData
]
=
useState
([]);
useEffect
(()
=>
{
getAboutInfo
();
},
[]);
async
function
getAboutInfo
()
{
const
response
=
await
fetchAboutSettingData
();
setData
(
response
);
console
.
log
(
data
);
}
async
function
sendMessage
()
{
const
response
=
await
sendEmailMessage
(
formData
);
console
.
log
(
response
);
if
(
response
==
true
)
{
setSendingStatus
(
"success"
);
}
else
{
setSendingStatus
(
"error"
);
}
}
const
getTextValueByKey
=
(
key
)
=>
{
const
item
=
data
.
find
((
item
)
=>
item
.
key
===
key
);
return
item
?
item
.
value
:
""
;
};
return
(
<>
<
main
>
...
...
@@ -31,10 +63,10 @@ import { TranslationFiles } from "@/src/data/core";
<
div
className=
"w-full lg:w-6/12 px-4 ml-auto mr-auto text-center"
>
<
div
className=
"pr-12"
>
<
h1
className=
"text-white font-semibold text-5xl"
>
Your story starts with us.
{
getTextValueByKey
(
"h1-text"
)
}
</
h1
>
<
p
className=
"mt-4 text-lg text-blueGray-200"
>
About page
{
getTextValueByKey
(
"p1-text"
)
}
</
p
>
</
div
>
</
div
>
...
...
@@ -67,12 +99,12 @@ import { TranslationFiles } from "@/src/data/core";
<
div
className=
"lg:pt-12 pt-6 w-full md:w-4/12 px-4 text-center"
>
<
div
className=
"relative flex flex-col min-w-0 break-words bg-white w-full mb-8 shadow-lg rounded-lg"
>
<
div
className=
"px-4 py-5 flex-auto"
>
<
div
className=
"text-white p-3 text-center inline-flex items-center justify-center w-12 h-12 mb-5 shadow-lg rounded-full bg-red-400"
>
<
i
className=
"fas fa-award"
></
i
>
</
div
>
<
h6
className=
"text-xl font-semibold"
>
Fault management System
</
h6
>
<
div
className=
"text-white p-3 text-center inline-flex items-center justify-center w-12 h-12 mb-5 shadow-lg rounded-full bg-red-400"
></
div
>
<
h6
className=
"text-xl font-semibold"
>
{
getTextValueByKey
(
"red-h"
)
}
</
h6
>
<
p
className=
"mt-2 mb-4 text-blueGray-500"
>
Start here.
{
getTextValueByKey
(
"red-p"
)
}
</
p
>
</
div
>
</
div
>
...
...
@@ -81,12 +113,12 @@ import { TranslationFiles } from "@/src/data/core";
<
div
className=
"w-full md:w-4/12 px-4 text-center"
>
<
div
className=
"relative flex flex-col min-w-0 break-words bg-white w-full mb-8 shadow-lg rounded-lg"
>
<
div
className=
"px-4 py-5 flex-auto"
>
<
div
className=
"text-white p-3 text-center inline-flex items-center justify-center w-12 h-12 mb-5 shadow-lg rounded-full bg-lightBlue-400"
>
<
i
className=
"fas fa-retweet"
></
i
>
</
div
>
<
h6
className=
"text-xl font-semibold"
>
FMS
</
h6
>
<
div
className=
"text-white p-3 text-center inline-flex items-center justify-center w-12 h-12 mb-5 shadow-lg rounded-full bg-lightBlue-400"
></
div
>
<
h6
className=
"text-xl font-semibold"
>
{
getTextValueByKey
(
"blue-h"
)
}
</
h6
>
<
p
className=
"mt-2 mb-4 text-blueGray-500"
>
CURIOUSITY
{
getTextValueByKey
(
"blue-p"
)
}
</
p
>
</
div
>
</
div
>
...
...
@@ -95,12 +127,12 @@ import { TranslationFiles } from "@/src/data/core";
<
div
className=
"pt-6 w-full md:w-4/12 px-4 text-center"
>
<
div
className=
"relative flex flex-col min-w-0 break-words bg-white w-full mb-8 shadow-lg rounded-lg"
>
<
div
className=
"px-4 py-5 flex-auto"
>
<
div
className=
"text-white p-3 text-center inline-flex items-center justify-center w-12 h-12 mb-5 shadow-lg rounded-full bg-emerald-400"
>
<
i
className=
"fas fa-fingerprint"
></
i
>
</
div
>
<
h6
className=
"text-xl font-semibold"
>
OUR Company
</
h6
>
<
div
className=
"text-white p-3 text-center inline-flex items-center justify-center w-12 h-12 mb-5 shadow-lg rounded-full bg-emerald-400"
></
div
>
<
h6
className=
"text-xl font-semibold"
>
{
getTextValueByKey
(
"green-h"
)
}
</
h6
>
<
p
className=
"mt-2 mb-4 text-blueGray-500"
>
Stay with us
{
getTextValueByKey
(
"green-p"
)
}
</
p
>
</
div
>
</
div
>
...
...
@@ -109,17 +141,12 @@ import { TranslationFiles } from "@/src/data/core";
<
div
className=
"flex flex-wrap items-center mt-32"
>
<
div
className=
"w-full md:w-5/12 px-4 mr-auto ml-auto"
>
<
div
className=
"text-blueGray-500 p-3 text-center inline-flex items-center justify-center w-16 h-16 mb-6 shadow-lg rounded-full bg-white"
>
<
i
className=
"fas fa-user-friends text-xl"
></
i
>
</
div
>
<
div
className=
"text-blueGray-500 p-3 text-center inline-flex items-center justify-center w-16 h-16 mb-6 shadow-lg rounded-full bg-white"
></
div
>
<
h3
className=
"text-3xl mb-2 font-semibold leading-normal"
>
Working with us is a pleasure
{
getTextValueByKey
(
"section2-h3"
)
}
</
h3
>
<
p
className=
"text-lg font-light leading-relaxed mt-4 mb-4 text-blueGray-600"
>
FMS.
</
p
>
<
p
className=
"text-lg font-light leading-relaxed mt-0 mb-4 text-blueGray-600"
>
Abnomaly Detection.
{
getTextValueByKey
(
"section2-p"
)
}
</
p
>
</
div
>
...
...
@@ -143,10 +170,10 @@ import { TranslationFiles } from "@/src/data/core";
></
polygon
>
</
svg
>
<
h4
className=
"text-xl font-bold text-white"
>
Top Services
{
t
(
"top-services"
)
}
</
h4
>
<
p
className=
"text-md font-light mt-2 text-white"
>
FMS
{
getTextValueByKey
(
"topservice-p"
)
}
</
p
>
</
blockquote
>
</
div
>
...
...
@@ -187,57 +214,13 @@ import { TranslationFiles } from "@/src/data/core";
</
div
>
<
div
className=
"w-full md:w-5/12 ml-auto mr-auto px-4"
>
<
div
className=
"md:pr-12"
>
<
div
className=
"text-blueGray-500 p-3 text-center inline-flex items-center justify-center w-16 h-16 mb-6 shadow-lg rounded-full bg-blueGray-200"
>
<
i
className=
"fas fa-rocket text-xl"
></
i
>
</
div
>
<
h3
className=
"text-3xl font-semibold"
>
A growing company
</
h3
>
<
div
className=
"text-blueGray-500 p-3 text-center inline-flex items-center justify-center w-16 h-16 mb-6 shadow-lg rounded-full bg-blueGray-200"
></
div
>
<
h3
className=
"text-3xl font-semibold"
>
{
getTextValueByKey
(
"section3-h"
)
}
</
h3
>
<
p
className=
"mt-4 text-lg leading-relaxed text-blueGray-500"
>
FMS
{
getTextValueByKey
(
"section3-p"
)
}
</
p
>
<
ul
className=
"list-none mt-6"
>
<
li
className=
"py-2"
>
<
div
className=
"flex items-center"
>
<
div
>
<
span
className=
"text-xs font-semibold inline-block py-1 px-2 uppercase rounded-full text-blueGray-500 bg-blueGray-100 mr-3"
>
<
i
className=
"fas fa-fingerprint"
></
i
>
</
span
>
</
div
>
<
div
>
<
h4
className=
"text-blueGray-500"
>
A
</
h4
>
</
div
>
</
div
>
</
li
>
<
li
className=
"py-2"
>
<
div
className=
"flex items-center"
>
<
div
>
<
span
className=
"text-xs font-semibold inline-block py-1 px-2 uppercase rounded-full text-blueGray-500 bg-blueGray-100 mr-3"
>
<
i
className=
"fab fa-html5"
></
i
>
</
span
>
</
div
>
<
div
>
<
h4
className=
"text-blueGray-500"
>
B
</
h4
>
</
div
>
</
div
>
</
li
>
<
li
className=
"py-2"
>
<
div
className=
"flex items-center"
>
<
div
>
<
span
className=
"text-xs font-semibold inline-block py-1 px-2 uppercase rounded-full text-blueGray-500 bg-blueGray-100 mr-3"
>
<
i
className=
"far fa-paper-plane"
></
i
>
</
span
>
</
div
>
<
div
>
<
h4
className=
"text-blueGray-500"
>
C
</
h4
>
</
div
>
</
div
>
</
li
>
</
ul
>
</
div
>
</
div
>
</
div
>
...
...
@@ -248,9 +231,9 @@ import { TranslationFiles } from "@/src/data/core";
<
div
className=
"container mx-auto px-4"
>
<
div
className=
"flex flex-wrap justify-center text-center mb-24"
>
<
div
className=
"w-full lg:w-6/12 px-4"
>
<
h2
className=
"text-4xl font-semibold"
>
Here are our heroes
</
h2
>
<
h2
className=
"text-4xl font-semibold"
>
{
getTextValueByKey
(
"Hero-title"
)
}
</
h2
>
<
p
className=
"text-lg leading-relaxed m-4 text-blueGray-500"
>
We ara HEROES.
{
getTextValueByKey
(
"Hero-p"
)
}
</
p
>
</
div
>
</
div
>
...
...
@@ -267,26 +250,6 @@ import { TranslationFiles } from "@/src/data/core";
<
p
className=
"mt-1 text-sm text-blueGray-400 uppercase font-semibold"
>
Web Developer
</
p
>
<
div
className=
"mt-6"
>
<
button
className=
"bg-lightBlue-400 text-white w-8 h-8 rounded-full outline-none focus:outline-none mr-1 mb-1"
type=
"button"
>
<
i
className=
"fab fa-twitter"
></
i
>
</
button
>
<
button
className=
"bg-lightBlue-600 text-white w-8 h-8 rounded-full outline-none focus:outline-none mr-1 mb-1"
type=
"button"
>
<
i
className=
"fab fa-facebook-f"
></
i
>
</
button
>
<
button
className=
"bg-pink-500 text-white w-8 h-8 rounded-full outline-none focus:outline-none mr-1 mb-1"
type=
"button"
>
<
i
className=
"fab fa-dribbble"
></
i
>
</
button
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
@@ -302,20 +265,6 @@ import { TranslationFiles } from "@/src/data/core";
<
p
className=
"mt-1 text-sm text-blueGray-400 uppercase font-semibold"
>
Marketing Specialist
</
p
>
<
div
className=
"mt-6"
>
<
button
className=
"bg-red-600 text-white w-8 h-8 rounded-full outline-none focus:outline-none mr-1 mb-1"
type=
"button"
>
<
i
className=
"fab fa-google"
></
i
>
</
button
>
<
button
className=
"bg-lightBlue-600 text-white w-8 h-8 rounded-full outline-none focus:outline-none mr-1 mb-1"
type=
"button"
>
<
i
className=
"fab fa-facebook-f"
></
i
>
</
button
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
@@ -331,26 +280,6 @@ import { TranslationFiles } from "@/src/data/core";
<
p
className=
"mt-1 text-sm text-blueGray-400 uppercase font-semibold"
>
UI/UX Designer
</
p
>
<
div
className=
"mt-6"
>
<
button
className=
"bg-red-600 text-white w-8 h-8 rounded-full outline-none focus:outline-none mr-1 mb-1"
type=
"button"
>
<
i
className=
"fab fa-google"
></
i
>
</
button
>
<
button
className=
"bg-lightBlue-400 text-white w-8 h-8 rounded-full outline-none focus:outline-none mr-1 mb-1"
type=
"button"
>
<
i
className=
"fab fa-twitter"
></
i
>
</
button
>
<
button
className=
"bg-blueGray-700 text-white w-8 h-8 rounded-full outline-none focus:outline-none mr-1 mb-1"
type=
"button"
>
<
i
className=
"fab fa-instagram"
></
i
>
</
button
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
@@ -366,32 +295,6 @@ import { TranslationFiles } from "@/src/data/core";
<
p
className=
"mt-1 text-sm text-blueGray-400 uppercase font-semibold"
>
Founder and CEO
</
p
>
<
div
className=
"mt-6"
>
<
button
className=
"bg-pink-500 text-white w-8 h-8 rounded-full outline-none focus:outline-none mr-1 mb-1"
type=
"button"
>
<
i
className=
"fab fa-dribbble"
></
i
>
</
button
>
<
button
className=
"bg-red-600 text-white w-8 h-8 rounded-full outline-none focus:outline-none mr-1 mb-1"
type=
"button"
>
<
i
className=
"fab fa-google"
></
i
>
</
button
>
<
button
className=
"bg-lightBlue-400 text-white w-8 h-8 rounded-full outline-none focus:outline-none mr-1 mb-1"
type=
"button"
>
<
i
className=
"fab fa-twitter"
></
i
>
</
button
>
<
button
className=
"bg-blueGray-700 text-white w-8 h-8 rounded-full outline-none focus:outline-none mr-1 mb-1"
type=
"button"
>
<
i
className=
"fab fa-instagram"
></
i
>
</
button
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
@@ -423,47 +326,28 @@ import { TranslationFiles } from "@/src/data/core";
<
div
className=
"container mx-auto px-4 lg:pt-24 lg:pb-64"
>
<
div
className=
"flex flex-wrap text-center justify-center"
>
<
div
className=
"w-full lg:w-6/12 px-4"
>
<
h2
className=
"text-4xl font-semibold text-white"
>
MORE IFO
</
h2
>
<
p
className=
"text-lg leading-relaxed mt-4 mb-4 text-blueGray-400"
>
HERE
</
p
>
<
h2
className=
"text-4xl font-semibold text-white"
>
MORE IFO
</
h2
>
</
div
>
</
div
>
<
div
className=
"flex flex-wrap mt-12 justify-center"
>
<
div
className=
"w-full lg:w-3/12 px-4 text-center"
>
<
div
className=
"text-blueGray-800 p-3 w-12 h-12 shadow-lg rounded-full bg-white inline-flex items-center justify-center"
>
<
i
className=
"fas fa-medal text-xl"
></
i
>
</
div
>
<
div
className=
"text-blueGray-800 p-3 w-12 h-12 shadow-lg rounded-full bg-white inline-flex items-center justify-center"
></
div
>
<
h6
className=
"text-xl mt-5 font-semibold text-white"
>
Excelent Services
{
getTextValueByKey
(
"moreInfo-h1"
)
}
</
h6
>
<
p
className=
"mt-2 mb-4 text-blueGray-400"
>
detection.
</
p
>
<
p
className=
"mt-2 mb-4 text-blueGray-400"
>
{
getTextValueByKey
(
"moreInfo-p1"
)
}
</
p
>
</
div
>
<
div
className=
"w-full lg:w-3/12 px-4 text-center"
>
<
div
className=
"text-blueGray-800 p-3 w-12 h-12 shadow-lg rounded-full bg-white inline-flex items-center justify-center"
>
<
i
className=
"fas fa-poll text-xl"
></
i
>
</
div
>
<
h5
className=
"text-xl mt-5 font-semibold text-white"
>
MODEL
</
h5
>
<
p
className=
"mt-2 mb-4 text-blueGray-400"
>
ML
</
p
>
<
div
className=
"text-blueGray-800 p-3 w-12 h-12 shadow-lg rounded-full bg-white inline-flex items-center justify-center"
></
div
>
<
h5
className=
"text-xl mt-5 font-semibold text-white"
>
{
getTextValueByKey
(
"moreInfo-h2"
)
}
</
h5
>
<
p
className=
"mt-2 mb-4 text-blueGray-400"
>
{
getTextValueByKey
(
"moreInfo-p2"
)
}
</
p
>
</
div
>
<
div
className=
"w-full lg:w-3/12 px-4 text-center"
>
<
div
className=
"text-blueGray-800 p-3 w-12 h-12 shadow-lg rounded-full bg-white inline-flex items-center justify-center"
>
<
i
className=
"fas fa-lightbulb text-xl"
></
i
>
</
div
>
<
div
className=
"text-blueGray-800 p-3 w-12 h-12 shadow-lg rounded-full bg-white inline-flex items-center justify-center"
></
div
>
<
h5
className=
"text-xl mt-5 font-semibold text-white"
>
WEB APP
{
getTextValueByKey
(
"moreInfo-h3"
)
}
</
h5
>
<
p
className=
"mt-2 mb-4 text-blueGray-400"
>
OUR APP.
</
p
>
<
p
className=
"mt-2 mb-4 text-blueGray-400"
>
{
getTextValueByKey
(
"moreInfo-p3"
)
}
</
p
>
</
div
>
</
div
>
</
div
>
...
...
@@ -492,9 +376,12 @@ import { TranslationFiles } from "@/src/data/core";
type=
"text"
className=
"border-0 px-3 py-3 placeholder-blueGray-300 text-blueGray-600 bg-white rounded text-sm shadow focus:outline-none focus:ring w-full ease-linear transition-all duration-150"
placeholder=
"Full Name"
value=
{
formData
.
subject
}
onChange=
{
(
e
)
=>
setFormData
({
...
formData
,
subject
:
e
.
target
.
value
})
}
/>
</
div
>
<
div
className=
"relative w-full mb-3"
>
<
label
className=
"block uppercase text-blueGray-600 text-xs font-bold mb-2"
...
...
@@ -506,6 +393,10 @@ import { TranslationFiles } from "@/src/data/core";
type=
"email"
className=
"border-0 px-3 py-3 placeholder-blueGray-300 text-blueGray-600 bg-white rounded text-sm shadow focus:outline-none focus:ring w-full ease-linear transition-all duration-150"
placeholder=
"Email"
value=
{
formData
.
email
}
onChange=
{
(
e
)
=>
setFormData
({
...
formData
,
email
:
e
.
target
.
value
})
}
/>
</
div
>
...
...
@@ -521,15 +412,31 @@ import { TranslationFiles } from "@/src/data/core";
cols=
"80"
className=
"border-0 px-3 py-3 placeholder-blueGray-300 text-blueGray-600 bg-white rounded text-sm shadow focus:outline-none focus:ring w-full"
placeholder=
"Type a message..."
value=
{
formData
.
body
}
onChange=
{
(
e
)
=>
setFormData
({
...
formData
,
body
:
e
.
target
.
value
})
}
/>
</
div
>
<
div
className=
"text-center mt-6"
>
<
button
className=
"bg-blueGray-800 text-white active:bg-blueGray-600 text-sm font-bold uppercase px-6 py-3 rounded shadow hover:shadow-lg outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150"
type=
"button"
onClick=
{
sendMessage
}
>
Send Message
</
button
>
<
div
>
{
sendingStatus
==
"success"
&&
(
<
Alert
message=
"Message was sent successfully"
type=
"success"
/>
)
}
{
sendingStatus
==
"error"
&&
(
<
Alert
message=
"Sending errors"
type=
"error"
/>
)
}
</
div
>
</
div
>
</
div
>
</
div
>
...
...
@@ -541,5 +448,4 @@ import { TranslationFiles } from "@/src/data/core";
<
Footer
/>
</>
);
}
\ No newline at end of file
}
packages/admin/src/features/edit-user/index.tsx
deleted
100644 → 0
View file @
ad0cca50
import
{
useEffect
,
useState
}
from
'react'
;
import
{
DynamicFormTypes
}
from
"@/src/components/dynamic-form/dtos/dynamic-form.dto"
;
import
DynamicForm
from
"@/src/components/dynamic-form"
;
import
{
formItems
}
from
"./add-user-data"
;
import
useTranslation
from
"next-translate/useTranslation"
;
import
{
TranslationFiles
}
from
"@/src/data/core"
;
const
EditForm
=
({
id
})
=>
{
const
{
t
}
=
useTranslation
(
TranslationFiles
.
COMMON
);
const
[
initialValues
,
setInitialValues
]
=
useState
({});
useEffect
(()
=>
{
// Fetch user data from API or database
// const fetchUser = async () => {
// const response = await fetch(`/api/users/${id}`);
// const data = await response.json();
// setInitialValues(data);
// };
// fetchUser();
},
[
id
]);
return
(
<
div
data
-
testid=
"new-stock-form"
>
<
DynamicForm
type=
{
DynamicFormTypes
.
Update
}
title=
{
t
(
"edit-user"
)
}
initialValues=
{
{}
}
onFinish=
{
(
values
)
=>
console
.
log
({
values
})
}
formCol=
{
formItems
(
t
)
}
/>
</
div
>
);
};
export
default
EditForm
;
packages/admin/src/features/login/index.tsx
View file @
048ae270
...
...
@@ -13,8 +13,14 @@ const Login = () => {
const
[
cookies
,
setCookies
]
=
useCookies
([
AUTH_TOKEN
]);
const
onFinishSend
=
(
values
:
any
)
=>
{
if
(
values
.
email
==
"admin@f.com"
){
setCookies
(
AUTH_TOKEN
,
values
.
email
);
router
.
push
(
"/"
);
}
else
if
(
values
.
email
==
"user@f.com"
){
setCookies
(
AUTH_TOKEN
,
values
.
email
);
router
.
push
(
"/user"
);
}
};
return
(
<
div
data
-
testid=
"login-component"
>
...
...
packages/admin/src/features/profile/index.tsx
View file @
048ae270
import
useTranslation
from
"next-translate/useTranslation"
;
import
{
TranslationFiles
}
from
"@/src/data/core"
;
import
FmsButton
from
"../../../../shared-library/src/buttons/fms-button"
;
import
{
useRouter
}
from
"next/router"
;
const
ProfileForm
=
()
=>
{
const
{
t
}
=
useTranslation
(
TranslationFiles
.
COMMON
);
const
router
=
useRouter
();
return
(
<>
<
main
className=
"profile-page"
>
...
...
@@ -60,7 +61,9 @@ const ProfileForm = () => {
className=
"bg-blueGray-700 active:bg-blueGray-600 uppercase text-white font-bold hover:shadow-md shadow text-xs px-4 py-2 rounded outline-none focus:outline-none sm:mr-2 mb-1 ease-linear transition-all duration-150"
type=
"primary"
borderRadius=
"32"
onClick=
{
()
=>
{
router
.
push
(
"/setup/setting-profile-content"
);
}
}
>
{
t
(
"edit"
)
}
</
FmsButton
>
...
...
packages/admin/src/features/setting/index.tsx
0 → 100644
View file @
048ae270
import
React
from
"react"
;
import
useTranslation
from
"next-translate/useTranslation"
;
import
{
TranslationFiles
}
from
"@/src/data/core"
;
import
FmsButton
from
"../../../../shared-library/src/buttons/fms-button"
;
import
{
useRouter
}
from
"next/router"
;
import
{
Col
,
Divider
,
Row
}
from
"antd"
;
const
Setting
=
()
=>
{
const
{
t
}
=
useTranslation
(
TranslationFiles
.
COMMON
);
const
router
=
useRouter
();
return
(
<>
<
Divider
orientation=
"left"
>
{
t
(
"setting-pages"
)
}
</
Divider
>
<
Col
span=
{
24
}
className=
{
"pd"
}
>
<
FmsButton
type=
"move"
size=
{
"large"
}
borderRadius=
"8"
onClick=
{
()
=>
{
router
.
push
(
"/setup/setting-about-content"
);
}
}
>
{
t
(
"About-page-setting"
).
toUpperCase
()
}
</
FmsButton
>
</
Col
>
<
Divider
orientation=
"left"
></
Divider
>
<
Col
span=
{
12
}
className=
{
"pd"
}
>
<
FmsButton
type=
"move"
size=
{
"large"
}
borderRadius=
"8"
onClick=
{
()
=>
{
router
.
push
(
"/setup/setting-profile-content"
);
}
}
>
{
t
(
"profile-page-setting"
).
toUpperCase
()
}
</
FmsButton
>
</
Col
>
</>
);
};
export
default
Setting
;
packages/admin/src/features/setting/setting-about-content.tsx
0 → 100644
View file @
048ae270
import
useTranslation
from
"next-translate/useTranslation"
;
import
{
TranslationFiles
}
from
"@/src/data/core"
;
import
React
,
{
useState
}
from
"react"
;
import
{
Alert
,
Input
,
message
}
from
"antd"
;
import
FmsButton
from
"../../../../shared-library/src/buttons/fms-button"
;
import
{
ExclamationOutlined
}
from
"@ant-design/icons"
;
import
{
useRouter
}
from
"next/router"
;
import
{
UpdateAboutSettingData
,
sendEmailMessage
,
}
from
"@/src/services/setting-service"
;
import
MainUtils
from
"../../utils/main"
;
export
default
function
SettingAboutContent
()
{
const
{
t
}
=
useTranslation
(
TranslationFiles
.
COMMON
);
const
router
=
useRouter
();
const
[
formData
,
setFormData
]
=
useState
({
subject
:
""
,
//fullName
email
:
""
,
body
:
""
,
});
const
[
sendingStatus
,
setSendingStatus
]
=
useState
(
""
);
const
[
data
,
setData
]
=
useState
([]);
async
function
sendMessage
()
{
const
response
=
await
sendEmailMessage
(
formData
);
console
.
log
(
response
);
if
(
response
==
true
)
{
setSendingStatus
(
"success"
);
}
else
{
setSendingStatus
(
"error"
);
}
}
async
function
UpdateAboutInfo
()
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
console
.
log
(
"data"
,
data
[
i
]);
if
(
!
MainUtils
.
isEmptyValue
(
data
[
i
].
value
))
{
const
response
=
await
UpdateAboutSettingData
(
data
[
i
]);
console
.
log
(
response
);
if
(
!
MainUtils
.
isEmptyObject
(
response
))
{
message
.
success
(
data
[
i
].
key
+
" Updated successfully"
);
}
else
{
message
.
error
(
"error"
);
}
}
}
}
const
handleInputChange
=
(
key
:
string
,
value
:
string
)
=>
{
setData
((
prevData
:
any
)
=>
{
let
dataArray
=
Array
.
isArray
(
prevData
)
?
prevData
:
Object
.
values
(
prevData
);
const
index
=
dataArray
.
findIndex
((
item
:
any
)
=>
item
.
key
===
key
);
if
(
index
!==
-
1
)
{
// If the object already exists, update its value property
return
[
...
dataArray
.
slice
(
0
,
index
),
{
...
dataArray
[
index
],
value
},
...
dataArray
.
slice
(
index
+
1
),
];
}
else
{
// Otherwise, create a new object and add it to the array
return
[
...
dataArray
,
{
key
,
value
},
];
}
});
};
return
(
<>
<
main
>
<
div
className=
" w-full px-4 max-w-full flex-grow flex-1 m-1 text-right"
>
<
FmsButton
type=
"move"
size=
"large"
borderRadius=
"32"
onClick=
{
()
=>
{
UpdateAboutInfo
();
}
}
>
{
"Save"
.
toUpperCase
()
}
</
FmsButton
>
<
span
>
</
span
>
<
FmsButton
type=
"secondary"
size=
"large"
borderRadius=
"32"
onClick=
{
()
=>
{
router
.
push
(
"/about"
);
}
}
>
{
"check-about-page"
.
toUpperCase
()
}
</
FmsButton
>
</
div
>
<
div
className=
"relative pt-16 pb-32 flex content-center items-center justify-center min-h-screen-75"
>
<
div
className=
"absolute top-0 w-full h-full bg-center bg-cover"
style=
{
{
backgroundImage
:
"url('https://images.unsplash.com/photo-1557804506-669a67965ba0?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1267&q=80')"
,
}
}
>
<
span
id=
"blackOverlay"
className=
"w-full h-full absolute opacity-75 bg-black"
></
span
>
</
div
>
<
div
className=
"container relative mx-auto"
>
<
div
className=
"items-center flex flex-wrap"
>
<
div
className=
"w-full lg:w-6/12 px-4 ml-auto mr-auto text-center"
>
<
div
className=
"pr-12"
>
<
h1
className=
"text-white font-semibold text-5xl"
>
<
Input
placeholder=
{
"h1-text"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"h1-text"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"h1-text"
,
e
.
target
.
value
)
}
/>
</
h1
>
<
p
className=
"mt-4 text-lg text-blueGray-200"
>
<
Input
placeholder=
{
"p1-text"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"p1-text"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"p1-text"
,
e
.
target
.
value
)
}
/>
</
p
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"top-auto bottom-0 left-0 right-0 w-full absolute pointer-events-none overflow-hidden h-16"
style=
{
{
transform
:
"translateZ(0)"
}
}
>
<
svg
className=
"absolute bottom-0 overflow-hidden"
xmlns=
"http://www.w3.org/2000/svg"
preserveAspectRatio=
"none"
version=
"1.1"
viewBox=
"0 0 2560 100"
x=
"0"
y=
"0"
></
svg
>
</
div
>
</
div
>
<
section
className=
"pb-20 bg-blueGray-200 -mt-24"
>
<
div
className=
"container mx-auto px-4"
>
<
div
className=
"flex flex-wrap"
>
<
div
className=
"lg:pt-12 pt-6 w-full md:w-4/12 px-4 text-center"
>
<
div
className=
"relative flex flex-col min-w-0 break-words bg-white w-full mb-8 shadow-lg rounded-lg"
>
<
div
className=
"px-4 py-5 flex-auto"
>
<
div
className=
"text-white p-3 text-center inline-flex items-center justify-center w-12 h-12 mb-5 shadow-lg rounded-full bg-red-400"
>
<
ExclamationOutlined
style=
{
{
fontSize
:
"30px"
,
color
:
"#fff"
}
}
className=
{
"ExclamationCircleOutlined "
}
/>
</
div
>
<
h6
className=
"text-xl font-semibold"
>
<
Input
placeholder=
{
"red-h"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"red-h"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"red-h"
,
e
.
target
.
value
)
}
/>
</
h6
>
<
p
className=
"mt-2 mb-4 text-blueGray-500"
>
<
Input
.
TextArea
placeholder=
{
"red-p"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"red-p"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"red-p"
,
e
.
target
.
value
)
}
/>
</
p
>
</
div
>
</
div
>
</
div
>
<
div
className=
"w-full md:w-4/12 px-4 text-center"
>
<
div
className=
"relative flex flex-col min-w-0 break-words bg-white w-full mb-8 shadow-lg rounded-lg"
>
<
div
className=
"px-4 py-5 flex-auto"
>
<
div
className=
"text-white p-3 text-center inline-flex items-center justify-center w-12 h-12 mb-5 shadow-lg rounded-full bg-lightBlue-400"
>
<
ExclamationOutlined
style=
{
{
fontSize
:
"30px"
,
color
:
"#fff"
}
}
className=
{
"ExclamationCircleOutlined "
}
/>
</
div
>
<
h6
className=
"text-xl font-semibold"
>
<
Input
placeholder=
{
"blue-h"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"blue-h"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"blue-h"
,
e
.
target
.
value
)
}
/>
</
h6
>
<
p
className=
"mt-2 mb-4 text-blueGray-500"
>
<
Input
.
TextArea
placeholder=
{
"blue-p"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"blue-p"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"blue-p"
,
e
.
target
.
value
)
}
/>
</
p
>
</
div
>
</
div
>
</
div
>
<
div
className=
"pt-6 w-full md:w-4/12 px-4 text-center"
>
<
div
className=
"relative flex flex-col min-w-0 break-words bg-white w-full mb-8 shadow-lg rounded-lg"
>
<
div
className=
"px-4 py-5 flex-auto"
>
<
div
className=
"text-white p-3 text-center inline-flex items-center justify-center w-12 h-12 mb-5 shadow-lg rounded-full bg-emerald-400"
>
<
ExclamationOutlined
style=
{
{
fontSize
:
"30px"
,
color
:
"#fff"
}
}
className=
{
"ExclamationCircleOutlined "
}
/>
</
div
>
<
h6
className=
"text-xl font-semibold"
>
<
Input
placeholder=
{
"green-h"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"green-h"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"green-h"
,
e
.
target
.
value
)
}
/>
</
h6
>
<
p
className=
"mt-2 mb-4 text-blueGray-500"
>
<
Input
.
TextArea
placeholder=
{
"green-p"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"green-p"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"green-p"
,
e
.
target
.
value
)
}
/>
</
p
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"flex flex-wrap items-center mt-32"
>
<
div
className=
"w-full md:w-5/12 px-4 mr-auto ml-auto"
>
<
div
className=
"text-blueGray-500 p-3 text-center inline-flex items-center justify-center w-16 h-16 mb-6 shadow-lg rounded-full bg-white"
>
<
ExclamationOutlined
style=
{
{
fontSize
:
"30px"
,
color
:
"#000"
}
}
className=
{
"ExclamationCircleOutlined "
}
/>
</
div
>
<
h3
className=
"text-3xl mb-2 font-semibold leading-normal"
>
<
Input
placeholder=
{
"section2-h3"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"section2-h3"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"section2-h3"
,
e
.
target
.
value
)
}
/>
</
h3
>
<
p
className=
"text-lg font-light leading-relaxed mt-4 mb-4 text-blueGray-600"
>
<
Input
.
TextArea
placeholder=
{
"section2-p"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"section2-p"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"section2-p"
,
e
.
target
.
value
)
}
/>
</
p
>
</
div
>
<
div
className=
"w-full md:w-4/12 px-4 mr-auto ml-auto"
>
<
div
className=
"relative flex flex-col min-w-0 break-words bg-white w-full mb-6 shadow-lg rounded-lg bg-blueGray-700"
>
<
img
alt=
"..."
src=
"https://images.unsplash.com/photo-1522202176988-66273c2fd55f?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1051&q=80"
className=
"w-full align-middle rounded-t-lg"
/>
<
blockquote
className=
"relative p-8 mb-4"
>
<
svg
preserveAspectRatio=
"none"
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 583 95"
className=
"absolute left-0 w-full block h-95-px -top-94-px"
>
<
polygon
points=
"-30,95 583,95 583,65"
className=
"text-blueGray-700 fill-current"
></
polygon
>
</
svg
>
<
h4
className=
"text-xl font-bold text-white"
>
{
"top-services"
}
</
h4
>
<
p
className=
"text-md font-light mt-2 text-white"
>
<
Input
.
TextArea
placeholder=
{
"topservice-p"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"topservice-p"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"topservice-p"
,
e
.
target
.
value
)
}
/>
</
p
>
</
blockquote
>
</
div
>
</
div
>
</
div
>
</
div
>
</
section
>
<
section
className=
"relative py-20"
>
<
div
className=
"bottom-auto top-0 left-0 right-0 w-full absolute pointer-events-none overflow-hidden -mt-20 h-20"
style=
{
{
transform
:
"translateZ(0)"
}
}
>
<
svg
className=
"absolute bottom-0 overflow-hidden"
xmlns=
"http://www.w3.org/2000/svg"
preserveAspectRatio=
"none"
version=
"1.1"
viewBox=
"0 0 2560 100"
x=
"0"
y=
"0"
>
<
polygon
className=
"text-white fill-current"
points=
"2560 0 2560 100 0 100"
></
polygon
>
</
svg
>
</
div
>
<
div
className=
"container mx-auto px-4"
>
<
div
className=
"items-center flex flex-wrap"
>
<
div
className=
"w-full md:w-4/12 ml-auto mr-auto px-4"
>
<
img
alt=
"..."
className=
"max-w-full rounded-lg shadow-lg"
src=
"https://images.unsplash.com/photo-1555212697-194d092e3b8f?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=634&q=80"
/>
</
div
>
<
div
className=
"w-full md:w-5/12 ml-auto mr-auto px-4"
>
<
div
className=
"md:pr-12"
>
<
div
className=
"text-blueGray-500 p-3 text-center inline-flex items-center justify-center w-16 h-16 mb-6 shadow-lg rounded-full bg-blueGray-200"
>
<
ExclamationOutlined
style=
{
{
fontSize
:
"30px"
,
color
:
"#000"
}
}
className=
{
"ExclamationCircleOutlined "
}
/>
</
div
>
<
h3
className=
"text-3xl font-semibold"
>
<
Input
placeholder=
{
"section3-h"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"section3-h"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"section3-h"
,
e
.
target
.
value
)
}
/>
</
h3
>
<
p
className=
"mt-4 text-lg leading-relaxed text-blueGray-500"
>
<
Input
.
TextArea
placeholder=
{
"section3-p"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"section3-p"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"section3-p"
,
e
.
target
.
value
)
}
/>
</
p
>
</
div
>
</
div
>
</
div
>
</
div
>
</
section
>
<
section
className=
"pt-20 pb-48"
>
<
div
className=
"container mx-auto px-4"
>
<
div
className=
"flex flex-wrap justify-center text-center mb-24"
>
<
div
className=
"w-full lg:w-6/12 px-4"
>
<
h2
className=
"text-4xl font-semibold"
>
<
Input
placeholder=
{
"Hero-title"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"Hero-title"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"Hero-title"
,
e
.
target
.
value
)
}
/>
</
h2
>
<
p
className=
"text-lg leading-relaxed m-4 text-blueGray-500"
>
<
Input
.
TextArea
placeholder=
{
"Hero-p"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"Hero-p"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"Hero-p"
,
e
.
target
.
value
)
}
/>
</
p
>
</
div
>
</
div
>
<
div
className=
"flex flex-wrap"
>
<
div
className=
"w-full md:w-6/12 lg:w-3/12 lg:mb-0 mb-12 px-4"
>
<
div
className=
"px-6"
>
<
img
alt=
"..."
src=
"/images/Reem.jpg"
className=
"shadow-lg rounded-full mx-auto max-w-120-px"
/>
<
div
className=
"pt-6 text-center"
>
<
h5
className=
"text-xl font-bold"
>
REEM HASAN
</
h5
>
<
p
className=
"mt-1 text-sm text-blueGray-400 uppercase font-semibold"
>
Web Developer
</
p
>
</
div
>
</
div
>
</
div
>
<
div
className=
"w-full md:w-6/12 lg:w-3/12 lg:mb-0 mb-12 px-4"
>
<
div
className=
"px-6"
>
<
img
alt=
"..."
src=
"/images/Ali.jpg"
className=
"shadow-lg rounded-full mx-auto max-w-120-px"
/>
<
div
className=
"pt-6 text-center"
>
<
h5
className=
"text-xl font-bold"
>
ALI MOUHAMMAD
</
h5
>
<
p
className=
"mt-1 text-sm text-blueGray-400 uppercase font-semibold"
>
Marketing Specialist
</
p
>
</
div
>
</
div
>
</
div
>
<
div
className=
"w-full md:w-6/12 lg:w-3/12 lg:mb-0 mb-12 px-4"
>
<
div
className=
"px-6"
>
<
img
alt=
"..."
src=
"/images/Bashar.jpg"
className=
"shadow-lg rounded-full mx-auto max-w-120-px"
/>
<
div
className=
"pt-6 text-center"
>
<
h5
className=
"text-xl font-bold"
>
BASHAR HUSSAIN
</
h5
>
<
p
className=
"mt-1 text-sm text-blueGray-400 uppercase font-semibold"
>
UI/UX Designer
</
p
>
</
div
>
</
div
>
</
div
>
<
div
className=
"w-full md:w-6/12 lg:w-3/12 lg:mb-0 mb-12 px-4"
>
<
div
className=
"px-6"
>
<
img
alt=
"..."
src=
"/images/Nour.jpg"
className=
"shadow-lg rounded-full mx-auto max-w-120-px"
/>
<
div
className=
"pt-6 text-center"
>
<
h5
className=
"text-xl font-bold"
>
NOUR
</
h5
>
<
p
className=
"mt-1 text-sm text-blueGray-400 uppercase font-semibold"
>
Founder and CEO
</
p
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
section
>
<
section
className=
"pb-20 relative block bg-blueGray-800"
>
<
div
className=
"bottom-auto top-0 left-0 right-0 w-full absolute pointer-events-none overflow-hidden -mt-20 h-20"
style=
{
{
transform
:
"translateZ(0)"
}
}
>
<
svg
className=
"absolute bottom-0 overflow-hidden"
xmlns=
"http://www.w3.org/2000/svg"
preserveAspectRatio=
"none"
version=
"1.1"
viewBox=
"0 0 2560 100"
x=
"0"
y=
"0"
>
<
polygon
className=
"text-blueGray-800 fill-current"
points=
"2560 0 2560 100 0 100"
></
polygon
>
</
svg
>
</
div
>
<
div
className=
"container mx-auto px-4 lg:pt-24 lg:pb-64"
>
<
div
className=
"flex flex-wrap text-center justify-center"
>
<
div
className=
"w-full lg:w-6/12 px-4"
>
<
h2
className=
"text-4xl font-semibold text-white"
>
{
t
(
"more-info"
).
toUpperCase
}
</
h2
>
</
div
>
</
div
>
<
div
className=
"flex flex-wrap mt-12 justify-center"
>
<
div
className=
"w-full lg:w-3/12 px-4 text-center"
>
<
div
className=
"text-blueGray-800 p-3 w-12 h-12 shadow-lg rounded-full bg-white inline-flex items-center justify-center"
>
<
ExclamationOutlined
style=
{
{
fontSize
:
"30px"
,
color
:
"#000"
}
}
className=
{
"ExclamationCircleOutlined "
}
/>
</
div
>
<
h6
className=
"text-xl mt-5 font-semibold text-white"
>
<
Input
placeholder=
{
"moreInfo-h1"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"moreInfo-h1"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"moreInfo-h1"
,
e
.
target
.
value
)
}
/>
</
h6
>
<
p
className=
"mt-2 mb-4 text-blueGray-400"
>
<
Input
.
TextArea
placeholder=
{
"moreInfo-p1"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"moreInfo-p1"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"moreInfo-p1"
,
e
.
target
.
value
)
}
/>
</
p
>
</
div
>
<
div
className=
"w-full lg:w-3/12 px-4 text-center"
>
<
div
className=
"text-blueGray-800 p-3 w-12 h-12 shadow-lg rounded-full bg-white inline-flex items-center justify-center"
>
<
ExclamationOutlined
style=
{
{
fontSize
:
"30px"
,
color
:
"#000"
}
}
className=
{
"ExclamationCircleOutlined "
}
/>
</
div
>
<
h5
className=
"text-xl mt-5 font-semibold text-white"
>
<
Input
placeholder=
{
"moreInfo-h2"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"moreInfo-h2"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"moreInfo-h2"
,
e
.
target
.
value
)
}
/>
</
h5
>
<
p
className=
"mt-2 mb-4 text-blueGray-400"
>
<
Input
.
TextArea
placeholder=
{
"moreInfo-p2"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"moreInfo-p2"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"moreInfo-p2"
,
e
.
target
.
value
)
}
/>
</
p
>
</
div
>
<
div
className=
"w-full lg:w-3/12 px-4 text-center"
>
<
div
className=
"text-blueGray-800 p-3 w-12 h-12 shadow-lg rounded-full bg-white inline-flex items-center justify-center"
>
<
ExclamationOutlined
style=
{
{
fontSize
:
"30px"
,
color
:
"#000"
}
}
className=
{
"ExclamationCircleOutlined "
}
/>
</
div
>
<
h5
className=
"text-xl mt-5 font-semibold text-white"
>
<
Input
placeholder=
{
"moreInfo-h3"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"moreInfo-h3"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"moreInfo-h3"
,
e
.
target
.
value
)
}
/>
</
h5
>
<
p
className=
"mt-2 mb-4 text-blueGray-400"
>
<
Input
.
TextArea
placeholder=
{
"moreInfo-p3"
}
value=
{
data
.
find
((
item
)
=>
item
.
key
===
"moreInfo-p3"
)?.
value
}
onChange=
{
(
e
:
any
)
=>
handleInputChange
(
"moreInfo-p3"
,
e
.
target
.
value
)
}
/>
</
p
>
</
div
>
</
div
>
</
div
>
</
section
>
<
section
className=
"relative block py-24 lg:pt-0 bg-blueGray-800"
>
<
div
className=
"container mx-auto px-4"
>
<
div
className=
"flex flex-wrap justify-center lg:-mt-64 -mt-48"
>
<
div
className=
"w-full lg:w-6/12 px-4"
>
<
div
className=
"relative flex flex-col min-w-0 break-words w-full mb-6 shadow-lg rounded-lg bg-blueGray-200"
>
<
div
className=
"flex-auto p-5 lg:p-10"
>
<
h4
className=
"text-2xl font-semibold"
>
Want to work with us?
</
h4
>
<
p
className=
"leading-relaxed mt-1 mb-4 text-blueGray-500"
>
Complete this form and we will get back to you in 24
hours.
</
p
>
<
div
className=
"relative w-full mb-3 mt-8"
>
<
label
className=
"block uppercase text-blueGray-600 text-xs font-bold mb-2"
htmlFor=
"full-name"
>
{
t
(
"full-name"
).
toUpperCase
()
}
</
label
>
<
input
type=
"text"
className=
"border-0 px-3 py-3 placeholder-blueGray-300 text-blueGray-600 bg-white rounded text-sm shadow focus:outline-none focus:ring w-full ease-linear transition-all duration-150"
placeholder=
"Full Name"
value=
{
formData
.
subject
}
onChange=
{
(
e
)
=>
setFormData
({
...
formData
,
subject
:
e
.
target
.
value
})
}
/>
</
div
>
<
div
className=
"relative w-full mb-3"
>
<
label
className=
"block uppercase text-blueGray-600 text-xs font-bold mb-2"
htmlFor=
"email"
>
{
t
(
"email"
)
}
</
label
>
<
input
type=
"email"
className=
"border-0 px-3 py-3 placeholder-blueGray-300 text-blueGray-600 bg-white rounded text-sm shadow focus:outline-none focus:ring w-full ease-linear transition-all duration-150"
placeholder=
"Email"
value=
{
formData
.
email
}
onChange=
{
(
e
)
=>
setFormData
({
...
formData
,
email
:
e
.
target
.
value
})
}
/>
</
div
>
<
div
className=
"relative w-full mb-3"
>
<
label
className=
"block uppercase text-blueGray-600 text-xs font-bold mb-2"
htmlFor=
"message"
>
{
t
(
"message"
)
}
</
label
>
<
textarea
rows=
"4"
cols=
"80"
className=
"border-0 px-3 py-3 placeholder-blueGray-300 text-blueGray-600 bg-white rounded text-sm shadow focus:outline-none focus:ring w-full"
placeholder=
"Type a message..."
value=
{
formData
.
body
}
onChange=
{
(
e
)
=>
setFormData
({
...
formData
,
body
:
e
.
target
.
value
})
}
/>
</
div
>
<
div
className=
"text-center mt-6"
>
<
button
className=
"bg-blueGray-800 text-white active:bg-blueGray-600 text-sm font-bold uppercase px-6 py-3 rounded shadow hover:shadow-lg outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150"
type=
"button"
onClick=
{
sendMessage
}
>
{
t
(
"send"
)
}
</
button
>
<
div
>
{
sendingStatus
==
"success"
&&
(
<
Alert
message=
"Message was sent successfully"
type=
"success"
/>
)
}
{
sendingStatus
==
"error"
&&
(
<
Alert
message=
"Sending errors"
type=
"error"
/>
)
}
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
section
>
</
main
>
</>
);
}
packages/admin/src/features/setting/setting-profile.tsx
0 → 100644
View file @
048ae270
import
{
useState
}
from
"react"
;
import
useTranslation
from
"next-translate/useTranslation"
;
import
{
TranslationFiles
}
from
"@/src/data/core"
;
import
FmsButton
from
"../../../../shared-library/src/buttons/fms-button"
;
import
{
DatePicker
,
Input
,
Select
}
from
"antd"
;
import
{
FileAddOutlined
,
UploadOutlined
}
from
"@ant-design/icons"
;
const
SettingProfileContent
=
()
=>
{
const
{
t
}
=
useTranslation
(
TranslationFiles
.
COMMON
);
const
[
imageSrc
,
setImageSrc
]
=
useState
(
"/images/Reem.jpg"
);
const
handleImageUpload
=
(
e
)
=>
{
const
file
=
e
.
target
.
files
[
0
];
const
reader
=
new
FileReader
();
reader
.
onloadend
=
()
=>
{
setImageSrc
(
reader
.
result
);
};
reader
.
readAsDataURL
(
file
);
};
return
(
<>
<
main
className=
"profile-page"
>
<
section
className=
"relative block h-500-px"
>
<
div
className=
"absolute top-0 w-full h-full bg-center bg-cover"
style=
{
{
backgroundImage
:
"url('https://images.unsplash.com/photo-1499336315816-097655dcfbda?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2710&q=80')"
,
}
}
>
<
span
id=
"blackOverlay"
className=
"w-full h-full absolute opacity-50 bg-black"
></
span
>
</
div
>
<
div
className=
"top-auto bottom-0 left-0 right-0 w-full absolute pointer-events-none overflow-hidden h-16"
style=
{
{
transform
:
"translateZ(0)"
}
}
>
<
svg
className=
"absolute bottom-0 overflow-hidden"
xmlns=
"http://www.w3.org/2000/svg"
preserveAspectRatio=
"none"
version=
"1.1"
viewBox=
"0 0 2560 100"
x=
"0"
y=
"0"
>
<
polygon
className=
"text-blueGray-200 fill-current"
points=
"2560 0 2560 100 0 100"
></
polygon
>
</
svg
>
</
div
>
</
section
>
<
section
className=
"relative py-16 bg-blueGray-200"
>
<
div
className=
"container mx-auto px-4"
>
<
div
className=
"relative flex flex-col min-w-0 break-words bg-white w-full mb-6 shadow-xl rounded-lg -mt-64"
>
<
div
className=
"px-6"
>
<
div
className=
"flex flex-wrap justify-center"
>
<
div
className=
"w-full lg:w-3/12 px-4 lg:order-2 flex justify-center"
>
<
div
className=
"relative"
>
<
label
htmlFor=
"image-upload"
className=
"file-input-label"
>
<
img
alt=
"..."
src=
{
imageSrc
}
className=
"shadow-xl rounded-full h-auto align-middle border-none absolute -m-16 -ml-20 lg:-ml-16 max-w-150-px"
/>
<
div
className=
"add-image-button pd-top"
>
<
FmsButton
type=
{
"secondary"
}
className=
{
"pd-top"
}
size=
{
"large"
}
borderRadius=
{
8
}
onclick=
{
handleImageUpload
}
>
<
input
type=
"file"
id=
"image-upload"
accept=
".jpg,.jpeg,.png"
onChange=
{
handleImageUpload
}
// className="hidden"
/>
</
FmsButton
>
</
div
>
</
label
>
</
div
>
</
div
>
<
div
className=
"w-full lg:w-4/12 px-4 lg:order-3 lg:text-right lg:self-center"
>
<
div
className=
"py-6 px-3 mt-32 sm:mt-0"
>
<
FmsButton
className=
"bg-blueGray-700 active:bg-blueGray-600 uppercase text-white font-bold hover:shadow-md shadow text-xs px-4 py-2 rounded outline-none focus:outline-none sm:mr-2 mb-1 ease-linear transition-all duration-150"
type=
"primary"
borderRadius=
"32"
>
{
t
(
"save"
)
}
</
FmsButton
>
</
div
>
</
div
>
<
div
className=
"w-full lg:w-4/12 px-4 lg:order-1"
>
<
div
className=
"flex justify-center py-4 lg:pt-4 pt-8"
>
<
div
className=
"mr-4 p-3 text-center"
>
<
span
className=
"text-xl font-bold block uppercase tracking-wide text-blueGray-600"
>
</
span
>
<
span
className=
"text-sm text-blueGray-400"
>
</
span
>
</
div
>
<
div
className=
"pd-top mr-4 p-3 text-center"
>
<
span
className=
" text-xl font-bold block uppercase tracking-wide text-blueGray-600"
>
<
Select
placeholder=
{
t
(
"gender"
)
}
// value={""}
onChange=
{
(
e
:
any
)
=>
{}
}
/>
</
span
>
</
div
>
<
div
className=
"pd-top lg:mr-4 p-3 text-center"
>
<
span
className=
"text-xl font-bold block uppercase tracking-wide text-blueGray-600"
>
<
DatePicker
placeholder=
{
t
(
"start-working-date"
)
}
// value={""}
onChange=
{
(
e
:
any
)
=>
{}
}
/>
</
span
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"text-center mt-12"
>
<
h3
className=
"text-4xl font-semibold leading-normal mb-2 text-blueGray-700 mb-2"
>
<
Input
className=
{
"med-size"
}
placeholder=
{
"name"
}
// value={""}
onChange=
{
(
e
:
any
)
=>
{}
}
/>
</
h3
>
<
div
className=
"text-sm leading-normal mt-0 mb-2 text-blueGray-400 font-bold uppercase"
>
<
i
className=
"fas fa-map-marker-alt text-lg text-blueGray-400"
></
i
>
<
Input
className=
{
"med-size"
}
placeholder=
{
"country"
}
// value={""}
onChange=
{
(
e
:
any
)
=>
{}
}
/>
</
div
>
</
div
>
<
div
className=
"mt-10 py-10 border-t border-blueGray-200 text-center"
>
<
div
className=
"flex flex-wrap justify-center"
>
<
div
className=
"w-full lg:w-9/12 px-4"
>
<
p
className=
"mb-4 text-lg leading-relaxed text-blueGray-700"
>
<
Input
placeholder=
{
"role"
}
// value={""}
onChange=
{
(
e
:
any
)
=>
{}
}
/>
</
p
>
<
div
className=
"mb-2 text-lightBlue-500 mt-10"
>
<
i
className=
"fas fa-briefcase mr-2 text-lg text-blueGray-400"
></
i
>
{
t
(
"description"
)
}
</
div
>
<
div
className=
"mb-2 text-lightBlue-500"
>
<
i
className=
"fas fa-university mr-2 text-lg "
></
i
>
<
Input
.
TextArea
placeholder=
{
"description"
}
// value={""}
onChange=
{
(
e
:
any
)
=>
{}
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
section
>
</
main
>
</>
);
};
export
default
SettingProfileContent
;
packages/admin/src/features/show-traps/index.tsx
View file @
048ae270
...
...
@@ -9,6 +9,7 @@ import { DataSource } from "./data-source";
import
ShowDetailsPopup
from
"./show-details-popup"
;
import
axios
from
"axios"
;
import
{
Spin
}
from
"antd"
;
import
{
fetchData
}
from
"@/src/services/traps-service"
;
export
default
function
ShowTraps
()
{
const
{
t
}
=
useTranslation
(
TranslationFiles
.
COMMON
);
...
...
@@ -21,80 +22,64 @@ export default function ShowTraps() {
const
[
loading
,
setLoading
]
=
useState
(
false
);
useEffect
(()
=>
{
setLoading
(
true
);
const
fetchData
=
async
()
=>
{
axios
.
get
(
"http://192.168.93.198:6647/api/rethink/data"
)
.
then
((
res
:
any
)
=>
{
if
(
res
.
data
)
{
// console.log(res.data);
const
transformedData
=
res
.
data
.
map
((
item
:
any
)
=>
({
id
:
item
.
id
,
timestamp
:
item
.
timestamp
,
agentAddress
:
item
.
agentAddress
,
severity
:
item
.
severity
,
specificTrap
:
item
.
specificTrap
,
genericTrap
:
item
.
genericTrap
,
variableBindings
:
item
.
variableBindings
,
}));
fetchData
().
then
((
transformedData
)
=>
{
if
(
transformedData
)
setData1
(
transformedData
);
// console.log(data1);
if
(
new_val
!=
null
){
if
(
new_val
.
flag
==
'0'
)
{
// const transformedData2 =data.map((newData:any)=>({
// id: newData.id,
// timestamp: newData.timestamp,
// agentAddress: newData.agentAddress,
// severity: newData.severity,
// specificTrap: newData.specificTrap,
// genericTrap: newData.genericTrap,
// variableBindings: newData.variableBindings,
// }))
console
.
log
(
new_val
);
setData1
((
prevData
:
any
)
=>
[...
prevData
,
new_val
]);
setNewVal
(
null
);
// transformedData2.forEach((item:any) => {
// setData1((prevData:any) => [...prevData, item]);
// });
}
else
if
(
new_val
.
flag
==-
1
){
setData1
((
prevData
:
any
)
=>
prevData
.
filter
((
item
:
any
)
=>
item
.
id
!==
new_val
.
id
));
}
}
}
else
{
alert
(
"Error"
);
}
})
.
catch
((
err
:
any
)
=>
console
.
log
(
err
));
};
fetchData
();
});
setLoading
(
false
);
},
[
new_val
]);
// useEffect(() => {
// if (!websocket) {
// return;
// }
// setLoading(true);
// const fetchData = async () => {
// axios
// .get("http://192.168.93.198:6647/api/rethink/data")
// .then((res: any) => {
// if (res.data) {
// const transformedData = res.data.map((item: any) => ({
// id: item.id,
// timestamp: item.timestamp,
// agentAddress: item.agentAddress,
// severity: item.severity,
// specificTrap: item.specificTrap,
// genericTrap: item.genericTrap,
// variableBindings: item.variableBindings,
// }));
// setData1(transformedData);
// if(new_val!=null){
// if (new_val.flag == '0') {
// websocket.onmessage = function (event) {
// const message = JSON.parse(event.data);
// console.log(new_val);
// setData1((prevData:any) => [...prevData, new_val]);
// setNewVal(null);
//
const newData = message.new_val;
//
const transformedData =
{
//
id: newData.id,
//
agentAddress: newData.agentAddress,
//
timestamp: newData.timestamp,
//
severity: newData.severity,
//
specificTrap: newData.specificTrap,
//
genericTrap: newData.genericTrap,
//
variableBindings: newData.variableBindings,
//
};
//
setData((prevData: any) => [...prevData, transformedData]
);
//
}
//
else if (new_val.flag==-1)
{
//
setData1((prevData:any) => prevData.filter((item:any) => item.id !== new_val.id));
//
}
//
}
//
}
//
else {
//
alert("Error");
//
}
//
})
//
.catch((err: any) => console.log(err)
);
// };
// fetchData();
// setLoading(false);
// }, [new_val]);
// }, [websocket]);
return
(
<
div
>
<
Spin
spinning=
{
loading
}
>
...
...
packages/admin/src/features/show-users/columns.tsx
View file @
048ae270
import
{
useRouter
}
from
"next/router"
;
import
FmsButton
from
"../../../../shared-library/src/buttons/fms-button"
;
export
const
Columns
=
[
export
function
getColumns
(
setModalProps
:
any
)
{
return
[
{
title
:
"Name"
,
dataIndex
:
"name"
,
...
...
@@ -19,20 +20,14 @@ export const Columns = [
{
title
:
"Actions"
,
key
:
"actions"
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
span
>
<
EditButton
id=
{
record
.
id
}
/>
</
span
>
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
FmsButton
type=
"primary"
onClick=
{
()
=>
setModalProps
({
isOpen
:
true
,
data
:
null
})
}
>
{
"edit"
}
</
FmsButton
>
),
},
];
const
EditButton
=
({
id
})
=>
{
const
router
=
useRouter
();
// Get the router object from useRouter
const
handleEditClick
=
()
=>
{
router
.
push
(
`/edit-user`
);
// Navigate to the edit page URL
};
return
<
FmsButton
type
=
"
link
"
onClick=
{
handleEditClick
}
>
Edit
</
FmsButton
>;
};
\ No newline at end of file
packages/admin/src/features/show-users/edit-user-popup.tsx
0 → 100644
View file @
048ae270
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
{
Col
,
DatePicker
,
Input
,
Modal
,
Row
,
Select
}
from
"antd"
;
import
useTranslation
from
"next-translate/useTranslation"
;
import
{
TranslationFiles
}
from
"@/src/data/core"
;
interface
Props
{
modalProps
:
any
;
setModalProps
:
any
;
}
export
default
function
EditUserPopup
({
modalProps
,
setModalProps
}:
Props
)
{
const
{
t
}
=
useTranslation
(
TranslationFiles
.
COMMON
);
const
[
isModalOpen
,
setIsModalOpen
]
=
useState
(
false
);
const
handleCancel
=
()
=>
{
setModalProps
(
false
,
null
);
};
useEffect
(()
=>
{
setIsModalOpen
(
modalProps
.
isOpen
);
},
[
modalProps
])
return
(
<
Modal
title=
"edit-user"
visible=
{
isModalOpen
}
onOk=
{
handleCancel
}
onCancel=
{
handleCancel
}
>
<
Row
gutter=
{
[
12
,
12
]
}
>
<
Col
span=
{
24
}
>
<
Input
/>
</
Col
>
<
Col
span=
{
24
}
>
<
Input
/>
</
Col
>
<
Col
span=
{
24
}
>
<
Select
/>
</
Col
>
<
Col
span=
{
24
}
>
<
Select
/>
</
Col
>
<
Col
span=
{
24
}
>
<
Select
/>
</
Col
>
<
Col
span=
{
24
}
>
<
DatePicker
/>
</
Col
>
<
Col
span=
{
24
}
>
<
Input
.
TextArea
/>
</
Col
>
</
Row
>
</
Modal
>
);
}
\ No newline at end of file
packages/admin/src/features/show-users/index.tsx
View file @
048ae270
...
...
@@ -3,28 +3,33 @@ import { useState } from "react";
import
useTranslation
from
"next-translate/useTranslation"
;
import
{
TranslationFiles
}
from
"@/src/data/core"
;
import
FmsTable
from
"../../../../shared-library/src/tables/fms-table"
;
import
{
Columns
}
from
"./columns"
;
import
{
get
Columns
}
from
"./columns"
;
import
{
DataSource
}
from
"./data-source"
;
import
EditUserPopup
from
"./edit-user-popup"
export
default
function
ShowUsers
()
{
const
{
t
}
=
useTranslation
(
TranslationFiles
.
COMMON
);
const
[
columns
,
setColumns
]
=
useState
({
columns
:
Columns
const
[
modalProps
,
setModalProps
]
=
useState
({
isOpen
:
false
,
data
:
null
,
});
const
[
data
,
setData
]
=
useState
(
DataSource
);
return
(
<
div
>
<
FmsTable
title=
{
t
(
"users"
)
}
columns=
{
columns
.
columns
}
columns=
{
getColumns
(
setModalProps
)
}
data=
{
data
}
rowSelection=
{
{
type
:
"checkbox"
,
}
}
t=
{
t
}
setData=
{
setData
}
setColumns=
{
setColumns
}
pageSizeOptions=
{
[
"10"
,
"20"
,
"50"
]
}
defaultPageSize=
{
10
}
/>
<
EditUserPopup
modalProps=
{
modalProps
}
setModalProps=
{
setModalProps
}
/>
</
div
>
);
...
...
packages/admin/src/services/setting-service.tsx
0 → 100644
View file @
048ae270
import
axios
from
"axios"
;
import
{
SettingURL
}
from
"../data/constant/app-constant"
;
export
const
fetchAboutSettingData
=
async
()
=>
{
try
{
const
response
=
await
axios
.
get
(
SettingURL
+
"/data"
);
if
(
response
.
data
)
{
const
data
=
response
.
data
.
map
((
item
:
any
)
=>
({
id
:
item
.
id
,
key
:
item
.
key
,
value
:
item
.
value
,
}));
return
data
;
}
else
{
alert
(
"Error"
);
}
}
catch
(
error
)
{
console
.
log
(
error
);
}
};
export
const
putAboutSettingData
=
async
(
data
:
any
)
=>
{
try
{
const
response
=
await
axios
.
post
(
SettingURL
+
"/post"
,
data
);
console
.
log
(
response
.
data
);
}
catch
(
error
)
{
console
.
error
(
error
);
}
};
export
const
deleteByKeyAboutSettingData
=
async
(
key
:
any
)
=>
{
try
{
const
response
=
await
axios
.
delete
(
SettingURL
+
`/delete/
${
key
}
`
);
console
.
log
(
response
.
data
);
}
catch
(
error
)
{
console
.
error
(
error
);
}
};
export
const
UpdateAboutSettingData
=
async
(
data
:
any
)
=>
{
try
{
const
response
=
await
axios
.
put
(
SettingURL
+
`/update`
,
data
);
console
.
log
(
response
);
return
response
;
}
catch
(
error
)
{
console
.
error
(
error
);
return
error
;
}
};
export
const
sendEmailMessage
=
async
(
data
:
any
)
=>
{
try
{
const
response
=
await
axios
.
post
(
SettingURL
+
`/send-message`
,
data
);
return
response
.
data
;
}
catch
(
error
)
{
return
error
;
}
};
\ No newline at end of file
packages/admin/src/services/traps-service.tsx
0 → 100644
View file @
048ae270
import
axios
from
"axios"
;
import
{
TrapURL
}
from
"../data/constant/app-constant"
;
export
const
fetchData
=
async
()
=>
{
try
{
const
response
=
await
axios
.
get
(
TrapURL
);
if
(
response
.
data
)
{
const
transformedData
=
response
.
data
.
map
((
item
:
any
)
=>
({
id
:
item
.
id
,
timestamp
:
item
.
timestamp
,
agentAddress
:
item
.
agentAddress
,
severity
:
item
.
severity
,
specificTrap
:
item
.
specificTrap
,
genericTrap
:
item
.
genericTrap
,
variableBindings
:
item
.
variableBindings
,
}));
return
transformedData
;
}
else
{
alert
(
"Error"
);
}
}
catch
(
error
)
{
console
.
log
(
error
);
}
};
\ No newline at end of file
packages/admin/src/styles/global.less
View file @
048ae270
...
...
@@ -149,21 +149,47 @@ a {
color: #e2d303;
font-weight: 1000;
// font-size: larger;
font-family:
'Times New Roman'
, Times, serif;
font-family:
"Times New Roman"
, Times, serif;
}
.severity-ERROR {
color: #ff2306;
font-weight: 1000;
// font-size: larger;
font-family:
'Times New Roman'
, Times, serif;
font-family:
"Times New Roman"
, Times, serif;
}
.severity-INFO {
color: #06ff83;
font-weight: 1000;
// font-size: larger;
font-family:
'Times New Roman'
, Times, serif;
font-family:
"Times New Roman"
, Times, serif;
}
.ExclamationCircleOutlined {
margin-bottom: 2px;
}
.pd {
margin-bottom: 20px;
}
.pd-top {
margin-top: 20px;
}
.med-size {
width: 20vw;
}
.add-image-button {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
margin: 15px;
margin-top: 40px;
}
.file-input-label input[type="file"] {
// margin: 20px;
cursor: pointer;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment