Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: place the entry for the S3 link page in the side menu #116

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
},
"dependencies": {
"@halo-dev/api-client": "^2.10.0",
"@halo-dev/components": "^1.9.0",
"@halo-dev/console-shared": "^2.10.0",
"@halo-dev/api-client": "^2.11.0",
"@halo-dev/components": "^1.10.0",
"@halo-dev/console-shared": "^2.11.0",
"@tanstack/vue-query": "4.29.1",
"axios": "^1.4.0",
"canvas-confetti": "^1.6.0",
Expand Down
26 changes: 13 additions & 13 deletions console/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 33 additions & 21 deletions console/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
import type {Attachment} from "@halo-dev/api-client";
import type {PluginTab} from "@halo-dev/console-shared";
import {definePlugin} from "@halo-dev/console-shared";
import type { Attachment } from "@halo-dev/api-client";
import { definePlugin } from "@halo-dev/console-shared";
import S3Link from "./views/S3Link.vue";
import S3Unlink from "./views/S3Unlink.vue"
import type {Ref} from "vue";
import {markRaw} from "vue";
import S3Unlink from "./views/S3Unlink.vue";
import type { Ref } from "vue";
import { markRaw } from "vue";
import CarbonFolderDetailsReference from "~icons/carbon/folder-details-reference";

export default definePlugin({
components: {},
routes: [],
extensionPoints: {
"plugin:self:tabs:create": (): PluginTab[] => {
return [
{
id: "s3-link",
label: "关联S3文件",
// @ts-ignore
component: markRaw(S3Link),
permissions: ["plugin:s3os:link"]
routes: [
{
parentName: "ToolsRoot",
route: {
path: "s3-link",
name: "S3Link",
component: S3Link,
meta: {
title: "S3 关联",
description: "提供将 S3 存储桶中的文件关联到 Halo 中的功能。",
searchable: true,
permissions: ["plugin:s3os:link"],
menu: {
name: "S3 关联",
icon: markRaw(CarbonFolderDetailsReference),
priority: 0,
},
},
];
},
},
// @ts-ignore
],
extensionPoints: {
"attachment:list-item:operation:create": (attachment: Ref<Attachment>) => {
return [
{
priority: 21,
component: markRaw(S3Unlink),
permissions: ["plugin:s3os:unlink"],
props: {
"attachment": attachment,
attachment: attachment,
},
hidden: !(attachment.value.metadata.annotations
&& attachment.value.metadata.annotations["s3os.plugin.halo.run/object-key"])
hidden: !(
attachment.value.metadata.annotations &&
attachment.value.metadata.annotations[
"s3os.plugin.halo.run/object-key"
]
),
},
];
},
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: PluginS3ObjectStorage
spec:
enabled: true
requires: ">=2.10.0"
requires: ">=2.12.0"
author:
name: Halo OSS Team
website: https://github.com/halo-dev
Expand Down
Loading