halo/console
Ryan Wang 3ebb45c266
Refactor menu generation strategy to support sub-menu items. (#5177)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.12.x

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

重构 Console 和 UC 的菜单生成逻辑,支持配置二级菜单项。

<img width="557" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/0f1717ce-bd30-448b-9625-24bfd5e1c5ae">

配置方式:

```ts
export default definePlugin({
  components: {},
  routes: [
    {
      parentName: "AttachmentsRoot",
      route: {
        name: "S3Link",
        path: "s3-link",
        component: markRaw(HomeView),
        meta: {
          title: "S3 关联",
          searchable: true,
          menu: {
            name: "S3 关联",
            icon: markRaw(IconAddCircle),
            priority: 0,
            mobile: true,
          },
        },
      },
    },
  ],
});
```

只需要指定 parentName 并在其下 route 需要配置 meta.menu 即可。

最终文档会补充在:https://github.com/halo-dev/docs/pull/291

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

Fixes https://github.com/halo-dev/halo/issues/4807

#### Special notes for your reviewer:

1. 可以按照上述配置方式测试。
2. 可以安装 [plugin-s3-1.5.0-SNAPSHOT.jar.zip](https://github.com/halo-dev/halo/files/13959977/plugin-s3-1.5.0-SNAPSHOT.jar.zip) 进行测试。

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

```release-note
重构 Console 和 UC 的菜单生成逻辑,支持配置二级菜单项。
```
2024-01-19 05:34:10 +00:00
..
.changeset Move root to console 2023-03-02 15:49:22 +08:00
.husky Refactor workflow for new console project (#3445) 2023-03-02 18:07:23 +08:00
.vscode Move root to console 2023-03-02 15:49:22 +08:00
console-src Refactor menu generation strategy to support sub-menu items. (#5177) 2024-01-19 05:34:10 +00:00
cypress Move root to console 2023-03-02 15:49:22 +08:00
docs refactor: improve project structure for user center feature (#4839) 2023-11-09 06:56:06 +00:00
packages Refactor menu generation strategy to support sub-menu items. (#5177) 2024-01-19 05:34:10 +00:00
public Move root to console 2023-03-02 15:49:22 +08:00
src Refactor menu generation strategy to support sub-menu items. (#5177) 2024-01-19 05:34:10 +00:00
uc-src Refactor menu generation strategy to support sub-menu items. (#5177) 2024-01-19 05:34:10 +00:00
.editorconfig Move root to console 2023-03-02 15:49:22 +08:00
.env.development Configure default external-url as slash (#3655) 2023-04-03 03:50:13 +00:00
.env.production Move root to console 2023-03-02 15:49:22 +08:00
.eslintrc.cjs feat: use storybook to refactor components library docs (#4944) 2023-12-06 08:30:13 +00:00
.gitignore chore: add storybook-static folder to .gitignore (#5075) 2023-12-19 09:12:07 +00:00
.gitpod.yml Move root to console 2023-03-02 15:49:22 +08:00
.npmignore Move root to console 2023-03-02 15:49:22 +08:00
.npmrc Move root to console 2023-03-02 15:49:22 +08:00
.prettierignore feat: add i18n supports for console (#3506) 2023-03-23 08:54:33 +00:00
Makefile Support publishing to maven central repository (#3767) 2023-04-18 14:28:23 +08:00
OWNERS Refactor workflow for new console project (#3445) 2023-03-02 18:07:23 +08:00
README.md chore: bump pnpm version to 8 (#3935) 2023-05-11 08:50:21 +00:00
cypress.json Move root to console 2023-03-02 15:49:22 +08:00
env.d.ts Refactor menu generation strategy to support sub-menu items. (#5177) 2024-01-19 05:34:10 +00:00
index.html feat: build infrastructure for user center feature (#4806) 2023-11-02 09:00:28 +00:00
package.json Support TOTP two-factor authentication for frontend 2024-01-15 15:21:27 +08:00
pnpm-lock.yaml pref: add additional attributes and colgroup for tables (#5176) 2024-01-18 08:40:08 +00:00
pnpm-workspace.yaml Move root to console 2023-03-02 15:49:22 +08:00
postcss.config.js fix: modal height issue in ios devices (#4106) 2023-06-25 02:06:14 +00:00
prettier.config.js Move root to console 2023-03-02 15:49:22 +08:00
tailwind.config.js feat: add tailwindcss/forms plugin to standardize the style of form elements (#4893) 2023-11-23 09:32:09 +00:00
tsconfig.app.json feat: build infrastructure for user center feature (#4806) 2023-11-02 09:00:28 +00:00
tsconfig.json chore: improve the console project infrastructure (#4105) 2023-06-26 03:54:17 +00:00
tsconfig.node.json feat: build infrastructure for user center feature (#4806) 2023-11-02 09:00:28 +00:00
tsconfig.vitest.json Move root to console 2023-03-02 15:49:22 +08:00
vite.config.ts refactor: improve project structure for user center feature (#4839) 2023-11-09 06:56:06 +00:00
vite.uc.config.ts refactor: improve project structure for user center feature (#4839) 2023-11-09 06:56:06 +00:00
vitest.config.ts feat: build infrastructure for user center feature (#4806) 2023-11-02 09:00:28 +00:00

README.md

README

Halo logo

Halo 2.0 的管理端项目(原 halo-admin

GitHub release GitHub GitHub last commit GitHub Workflow Status Gitpod ready-to-code


当前仓库已经将 halo-admin 改为了 console。但对于 Halo 1.x 版本,依旧保持 halo-admin 的概念。

开发环境运行

npm install -g pnpm@8
pnpm install 
pnpm build:packages
pnpm dev

生产构建

pnpm build

状态

Repobeats analytics