Skip to content

Commit

Permalink
Merge pull request #28 from huankong233/dev
Browse files Browse the repository at this point in the history
[+] 支持自定义 JS脚本
  • Loading branch information
huankong233 authored Feb 1, 2025
2 parents 6bb782c + 4dfa195 commit bc64c85
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 2025

### 02-01 v2.1.0

- [+] 支持自定义 JS脚本

### 02-01 v2.0.27

- [+] 卡密支持搜索
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hklist-frontend",
"version": "2.0.27",
"version": "2.1.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 2 additions & 0 deletions src/api/admin/config/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface GetConfigRes {
show_hero: boolean
show_announce: boolean
announce: string
custom_script: string
custom_button: string
debug: boolean
name: string
Expand All @@ -25,6 +26,7 @@ export interface UpdateConfigReq {
show_hero: boolean
show_announce: boolean
announce: string
custom_script: string
custom_button: string
debug: boolean
name: string
Expand Down
10 changes: 10 additions & 0 deletions src/components/AdminPlatform/Config/General.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@
<t-textarea v-model="formData.announce" />
</t-form-item>

<t-form-item
name="custom_script"
label="自定义JS脚本"
help="无需script标签"
>
<t-textarea v-model="formData.custom_script" />
</t-form-item>

<t-form-item
name="custom_button"
label="自定义按钮"
Expand Down Expand Up @@ -120,6 +128,7 @@ const formData = ref<UpdateConfigReq>({
parse_password: '',
show_announce: false,
announce: '',
custom_script: '',
custom_button: '',
debug: false,
show_hero: false,
Expand All @@ -134,6 +143,7 @@ const generalConfig = ref<GetConfigRes>({
parse_password: '',
show_announce: false,
announce: '',
custom_script: '',
custom_button: '',
debug: false,
show_hero: false,
Expand Down

0 comments on commit bc64c85

Please sign in to comment.