@ddj-v2/user-management 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npmignore +20 -20
- package/LICENSE +21 -21
- package/README.md +80 -77
- package/index.ts +479 -341
- package/package.json +25 -25
- package/pages/user_manage_detail.page.js +267 -267
- package/pages/user_manage_main.page.js +199 -199
- package/templates/domain_user.html +109 -0
- package/templates/user_manage_detail.html +285 -285
- package/templates/user_manage_main.html +233 -183
package/.npmignore
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
# 排除所有隱藏檔案與資料夾
|
|
2
|
-
.*
|
|
3
|
-
!/.npmignore
|
|
4
|
-
|
|
5
|
-
# 排除 CI 與開發工具設定
|
|
6
|
-
.github/
|
|
7
|
-
.vscode/
|
|
8
|
-
node_modules/
|
|
9
|
-
*.log
|
|
10
|
-
|
|
11
|
-
# 排除測試與原始碼 (如果你的 build 結果在 dist/ 或 lib/)
|
|
12
|
-
test/
|
|
13
|
-
tests/
|
|
14
|
-
src/
|
|
15
|
-
__tests__/
|
|
16
|
-
jest.config.js
|
|
17
|
-
tsconfig.json
|
|
18
|
-
|
|
19
|
-
# 排除 semantic-release 可能產生的檔案
|
|
20
|
-
release.config.js
|
|
1
|
+
# 排除所有隱藏檔案與資料夾
|
|
2
|
+
.*
|
|
3
|
+
!/.npmignore
|
|
4
|
+
|
|
5
|
+
# 排除 CI 與開發工具設定
|
|
6
|
+
.github/
|
|
7
|
+
.vscode/
|
|
8
|
+
node_modules/
|
|
9
|
+
*.log
|
|
10
|
+
|
|
11
|
+
# 排除測試與原始碼 (如果你的 build 結果在 dist/ 或 lib/)
|
|
12
|
+
test/
|
|
13
|
+
tests/
|
|
14
|
+
src/
|
|
15
|
+
__tests__/
|
|
16
|
+
jest.config.js
|
|
17
|
+
tsconfig.json
|
|
18
|
+
|
|
19
|
+
# 排除 semantic-release 可能產生的檔案
|
|
20
|
+
release.config.js
|
|
21
21
|
.releaserc
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 oRangeSumMer
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 oRangeSumMer
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,77 +1,80 @@
|
|
|
1
|
-
# HydroOJ插件
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
- **
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
- ✅
|
|
55
|
-
- ✅
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1
|
+
# HydroOJ插件 使用者管理面板
|
|
2
|
+
|
|
3
|
+
修改自 https://github.com/SummerofOrange/hydrooj-user-management
|
|
4
|
+
|
|
5
|
+
這是一個為 HydroOJ 提供可視化使用者管理功能的插件,讓管理員能在控制面板中方便地管理使用者資訊、權限與狀態。
|
|
6
|
+
|
|
7
|
+
> 程式碼很簡單,佛系不定期更新~
|
|
8
|
+
>
|
|
9
|
+
> 如果覺得好用請幫我點個 star,感激不盡。
|
|
10
|
+
|
|
11
|
+
## 安裝方法
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
sudo su
|
|
15
|
+
yarn global add @ddj-v2/user-management
|
|
16
|
+
hydrooj addon add @ddj-v2/user-management
|
|
17
|
+
pm2 restart hydrooj
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 使用方法
|
|
21
|
+
|
|
22
|
+
1. **進入使用者管理**:登入 HydroOJ 後,在控制面板側邊欄找到「使用者管理」選單項
|
|
23
|
+
2. **搜尋使用者**:在使用者列表頁面使用搜尋框查找特定使用者
|
|
24
|
+
3. **編輯使用者**:點擊使用者列表中的「編輯」按鈕進入使用者詳細頁面
|
|
25
|
+
4. **管理權限**:在使用者詳細頁面的「權限管理」部分設定使用者權限
|
|
26
|
+
5. **重設密碼**:在「密碼管理」部分為使用者重設新密碼
|
|
27
|
+
6. **封鎖使用者**:在「使用者狀態」部分封鎖或解封使用者
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
1. **域用戶管理**: 可看見 default role
|
|
31
|
+
## 權限說明
|
|
32
|
+
|
|
33
|
+
插件使用以下權限等級:
|
|
34
|
+
|
|
35
|
+
- **-1**:root(超級管理員)
|
|
36
|
+
- **0**:已封鎖使用者
|
|
37
|
+
- **4**:系統保留
|
|
38
|
+
- **8**:訪客使用者
|
|
39
|
+
- **16842756**:預設使用者權限
|
|
40
|
+
- **其他值**:自訂權限
|
|
41
|
+
|
|
42
|
+
## 介面展示
|
|
43
|
+
|
|
44
|
+
### 使用者列表頁面
|
|
45
|
+
|
|
46
|
+

|
|
47
|
+
|
|
48
|
+
### 使用者詳細頁面
|
|
49
|
+
|
|
50
|
+

|
|
51
|
+
|
|
52
|
+
## 安全特性
|
|
53
|
+
|
|
54
|
+
- ✅ 權限驗證:只有具有系統管理權限的使用者才能訪問
|
|
55
|
+
- ✅ 操作確認:重要操作(如重設密碼、封鎖使用者)需確認
|
|
56
|
+
- ✅ 權限保護:防止非超級管理員修改超級管理員帳戶
|
|
57
|
+
- ✅ 資料驗證:自動驗證使用者名稱與電子郵件唯一性
|
|
58
|
+
- ✅ 輸入驗證:前端與後端雙重驗證使用者輸入
|
|
59
|
+
|
|
60
|
+
## 開發說明
|
|
61
|
+
|
|
62
|
+
### 貢獻程式碼
|
|
63
|
+
|
|
64
|
+
歡迎提交 Issue 與 Pull Request 改進此插件。
|
|
65
|
+
|
|
66
|
+
## 授權
|
|
67
|
+
|
|
68
|
+
MIT License
|
|
69
|
+
|
|
70
|
+
## 支援
|
|
71
|
+
|
|
72
|
+
若您在使用過程中遇到問題,請:
|
|
73
|
+
|
|
74
|
+
1. 查看 [Issues](https://github.com/SummerofOrange/hydrooj-user-management/issues) 頁面
|
|
75
|
+
2. 提交新的 Issue 描述您的問題
|
|
76
|
+
3. 聯絡作者取得技術支援
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
**注意**:此插件需 HydroOJ v5.0.0-beta.6 或更高版本。使用前請確保您有足夠的系統管理權限。
|