Skip to content

Commit

Permalink
feat: add issues field for plugin and theme manifest (#5755)
Browse files Browse the repository at this point in the history
#### What type of PR is this?

/area core
/area ui
/kind feature
/kind api-change

#### What this PR does / why we need it:

为主题和插件的定义文件添加 issues 字段,用于填写问题反馈地址。方便使用者可以清楚的知道可以在哪里反馈问题。

<img width="767" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/b7dfce3f-8362-4964-82b8-cc018b85bb82">


#### Which issue(s) this PR fixes:

Fixes #5715 

#### Does this PR introduce a user-facing change?

```release-note
为主题和插件的定义文件添加问题反馈(issues)字段
```
  • Loading branch information
ruibaby authored Apr 26, 2024
1 parent f2b883f commit ee76f19
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api-docs/openapi/v3_0/aggregated.json
Original file line number Diff line number Diff line change
Expand Up @@ -16464,6 +16464,9 @@
"homepage": {
"type": "string"
},
"issues": {
"type": "string"
},
"license": {
"type": "array",
"items": {
Expand Down Expand Up @@ -19471,6 +19474,9 @@
"homepage": {
"type": "string"
},
"issues": {
"type": "string"
},
"license": {
"type": "array",
"items": {
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/run/halo/app/core/extension/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public static class PluginSpec {

private String repo;

private String issues;

private String description;

private List<License> license;
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/run/halo/app/core/extension/Theme.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public static class ThemeSpec {

private String repo;

private String issues;

private String version;

@Deprecated(forRemoval = true, since = "2.2.0")
Expand Down
13 changes: 13 additions & 0 deletions ui/console-src/modules/interface/themes/ThemeDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,19 @@ const handleReloadTheme = async () => {
{{ $t("core.common.text.none") }}
</span>
</VDescriptionItem>
<VDescriptionItem :label="$t('core.theme.detail.fields.issues')">
<a
v-if="selectedTheme?.spec.issues"
:href="selectedTheme.spec.issues"
class="hover:text-gray-600"
target="_blank"
>
{{ selectedTheme.spec.issues }}
</a>
<span v-else>
{{ $t("core.common.text.none") }}
</span>
</VDescriptionItem>
<VDescriptionItem :label="$t('core.theme.detail.fields.license')">
<ul
v-if="
Expand Down
13 changes: 13 additions & 0 deletions ui/console-src/modules/system/plugins/tabs/Detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,19 @@ const pluginRoleTemplateGroups = computed<RoleTemplateGroup[]>(() => {
{{ $t("core.common.text.none") }}
</span>
</VDescriptionItem>
<VDescriptionItem :label="$t('core.plugin.detail.fields.issues')">
<a
v-if="plugin?.spec.issues"
:href="plugin.spec.issues"
class="hover:text-gray-600"
target="_blank"
>
{{ plugin.spec.issues }}
</a>
<span v-else>
{{ $t("core.common.text.none") }}
</span>
</VDescriptionItem>
<VDescriptionItem :label="$t('core.plugin.detail.fields.license')">
<ul
v-if="plugin?.spec.license && plugin?.spec.license.length"
Expand Down
6 changes: 6 additions & 0 deletions ui/packages/api-client/src/models/plugin-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ export interface PluginSpec {
* @memberof PluginSpec
*/
'homepage'?: string;
/**
*
* @type {string}
* @memberof PluginSpec
*/
'issues'?: string;
/**
*
* @type {Array<License>}
Expand Down
6 changes: 6 additions & 0 deletions ui/packages/api-client/src/models/theme-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export interface ThemeSpec {
* @memberof ThemeSpec
*/
'homepage'?: string;
/**
*
* @type {string}
* @memberof ThemeSpec
*/
'issues'?: string;
/**
*
* @type {Array<License>}
Expand Down
2 changes: 2 additions & 0 deletions ui/src/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,7 @@ core:
plugin_requires: Plugin Requires
description: Description
license: License
issues: Issues feedback
settings:
title: Theme settings
custom_templates:
Expand Down Expand Up @@ -882,6 +883,7 @@ core:
homepage: Homepage
repo: Source Repository
load_location: Storage Location
issues: Issues feedback
loader:
toast:
entry_load_failed: Failed to load plugins entry file
Expand Down
2 changes: 2 additions & 0 deletions ui/src/locales/zh-CN.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ core:
plugin_requires: 插件依赖
description: 描述
license: 协议
issues: 问题反馈
settings:
title: 主题设置
custom_templates:
Expand Down Expand Up @@ -840,6 +841,7 @@ core:
homepage: 网站
repo: 源码仓库
load_location: 存储位置
issues: 问题反馈
loader:
toast:
entry_load_failed: 加载插件入口文件失败
Expand Down
2 changes: 2 additions & 0 deletions ui/src/locales/zh-TW.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ core:
plugin_requires: 插件依賴
description: 描述
license: 協議
issues: 問題回饋
settings:
title: 主題設置
custom_templates:
Expand Down Expand Up @@ -820,6 +821,7 @@ core:
homepage: 網站
repo: 源碼倉庫
load_location: 存儲位置
issues: 問題回饋
loader:
toast:
entry_load_failed: 讀取插件入口文件失敗
Expand Down

0 comments on commit ee76f19

Please sign in to comment.