Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e54906ef
authored
May 16, 2023
by
JustSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: disable operations for root user (close #76)
parent
146ab7d2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
web/src/components/UsersTable.js
+5
-1
No files found.
web/src/components/UsersTable.js
View file @
e54906ef
...
@@ -234,6 +234,7 @@ const UsersTable = () => {
...
@@ -234,6 +234,7 @@ const UsersTable = () => {
onClick
=
{()
=>
{
onClick
=
{()
=>
{
manageUser
(
user
.
username
,
'promote'
,
idx
);
manageUser
(
user
.
username
,
'promote'
,
idx
);
}}
}}
disabled
=
{
user
.
role
===
100
}
>
>
提升
提升
<
/Button
>
<
/Button
>
...
@@ -243,12 +244,13 @@ const UsersTable = () => {
...
@@ -243,12 +244,13 @@ const UsersTable = () => {
onClick
=
{()
=>
{
onClick
=
{()
=>
{
manageUser
(
user
.
username
,
'demote'
,
idx
);
manageUser
(
user
.
username
,
'demote'
,
idx
);
}}
}}
disabled
=
{
user
.
role
===
100
}
>
>
降级
降级
<
/Button
>
<
/Button
>
<
Popup
<
Popup
trigger
=
{
trigger
=
{
<
Button
size
=
'small'
negative
>
<
Button
size
=
'small'
negative
disabled
=
{
user
.
role
===
100
}
>
删除
删除
<
/Button
>
<
/Button
>
}
}
...
@@ -274,6 +276,7 @@ const UsersTable = () => {
...
@@ -274,6 +276,7 @@ const UsersTable = () => {
idx
idx
);
);
}}
}}
disabled
=
{
user
.
role
===
100
}
>
>
{
user
.
status
===
1
?
'禁用'
:
'启用'
}
{
user
.
status
===
1
?
'禁用'
:
'启用'
}
<
/Button
>
<
/Button
>
...
@@ -281,6 +284,7 @@ const UsersTable = () => {
...
@@ -281,6 +284,7 @@ const UsersTable = () => {
size
=
{
'small'
}
size
=
{
'small'
}
as
=
{
Link
}
as
=
{
Link
}
to
=
{
'/user/edit/'
+
user
.
id
}
to
=
{
'/user/edit/'
+
user
.
id
}
disabled
=
{
user
.
role
===
100
}
>
>
编辑
编辑
<
/Button
>
<
/Button
>
...
...
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