Skip to content

Commit 5eb7c5a

Browse files
committed
✨ 优化授权管理
1 parent 0c43741 commit 5eb7c5a

14 files changed

Lines changed: 295 additions & 97 deletions

File tree

.github/workflows/build.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- release/*
78
- dev
89

910
jobs:

.github/workflows/test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- release/*
78
- dev
89
- develop/*
910
pull_request:

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scriptcat",
3-
"version": "0.16.0",
3+
"version": "0.15.1",
44
"description": "脚本猫,一个可以执行用户脚本的浏览器扩展,万物皆可脚本化,让你的浏览器可以做更多的事情!",
55
"author": "CodFrm",
66
"license": "GPLv3",
@@ -16,7 +16,7 @@
1616
"changlog": "gitmoji-changelog"
1717
},
1818
"dependencies": {
19-
"@arco-design/web-react": "^2.47.0",
19+
"@arco-design/web-react": "^2.51.1",
2020
"@dnd-kit/core": "^6.0.5",
2121
"@dnd-kit/sortable": "^7.0.1",
2222
"@dnd-kit/utilities": "^3.2.0",

src/app/cache.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,8 @@ export default class Cache {
3535
public del(key: string): void {
3636
this.map.delete(key);
3737
}
38+
39+
public list(): string[] {
40+
return Array.from(this.map.keys());
41+
}
3842
}

src/app/service/permission/controller.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,19 @@ export default class PermissionController {
4545
confirm,
4646
});
4747
}
48+
49+
// 添加权限
50+
addPermission(scriptId: number, permission: Permission) {
51+
return this.msg.syncSend("addPermission", {
52+
scriptId,
53+
permission,
54+
});
55+
}
56+
57+
// 重置权限
58+
resetPermission(scriptId: number) {
59+
return this.msg.syncSend("resetPermission", {
60+
scriptId,
61+
});
62+
}
4863
}

src/locales/en-US/translation.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ script_setting: Script Setting
198198
basic_info: Basic Information
199199
update_url: Update URL
200200
permission_management: Permission Management
201+
add_permission: Add Permission
201202
# Script Setting Match ScriptSetting/Match
202203
match: Match
203204
user_setting: User Setting

src/locales/zh-CN/translation.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ script_setting: 脚本设置
199199
basic_info: 基本信息
200200
update_url: 更新URL
201201
permission_management: 授权管理
202+
add_permission: 添加授权
203+
permission_cors: 跨域(cors)
204+
permission_cookie: 管理cookie
202205
# 脚本设置Match ScriptSetting/Match
203206
match: 匹配
204207
user_setting: 用户设定

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 2,
33
"name": "ScriptCat",
4-
"version": "0.16.0",
4+
"version": "0.15.1",
55
"author": "CodFrm",
66
"description": "脚本猫,一个用户脚本管理器,支持后台脚本、定时脚本、页面脚本,可编写脚本每天帮你自动处理事务.",
77
"options_ui": {

src/pages/components/ScriptSetting/Match.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ const Match: React.FC<{
289289
</Popconfirm>
290290
</Space>
291291
</div>
292-
<Table columns={columns} data={match} rowKey="id" />
292+
<Table columns={columns} data={match} rowKey="id" pagination={false} />
293293
<Divider />
294294
<div className="flex flex-row justify-between pb-2">
295295
<Typography.Title heading={6}>{t("website_exclude")}</Typography.Title>
@@ -318,7 +318,7 @@ const Match: React.FC<{
318318
</Popconfirm>
319319
</Space>
320320
</div>
321-
<Table columns={columns} data={exclude} rowKey="id" />
321+
<Table columns={columns} data={exclude} rowKey="id" pagination={false} />
322322
<Divider />
323323
</>
324324
);

0 commit comments

Comments
 (0)