2022-09-08 08:49:42 +00:00
|
|
|
<script lang="ts" setup>
|
2024-06-26 10:42:50 +00:00
|
|
|
import UserFilterDropdown from "@/components/filter/UserFilterDropdown.vue";
|
|
|
|
import { singlePageLabels } from "@/constants/labels";
|
|
|
|
import type { ListedSinglePage, SinglePage } from "@halo-dev/api-client";
|
|
|
|
import { consoleApiClient, coreApiClient } from "@halo-dev/api-client";
|
2022-09-08 08:49:42 +00:00
|
|
|
import {
|
2024-05-23 03:02:49 +00:00
|
|
|
Dialog,
|
|
|
|
IconAddCircle,
|
2022-09-08 08:49:42 +00:00
|
|
|
IconArrowLeft,
|
|
|
|
IconArrowRight,
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
IconPages,
|
2024-05-23 03:02:49 +00:00
|
|
|
IconRefreshLine,
|
|
|
|
Toast,
|
2022-09-08 08:49:42 +00:00
|
|
|
VButton,
|
|
|
|
VCard,
|
|
|
|
VEmpty,
|
2022-11-24 03:46:10 +00:00
|
|
|
VLoading,
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
VPageHeader,
|
2024-05-23 03:02:49 +00:00
|
|
|
VPagination,
|
|
|
|
VSpace,
|
2022-09-08 08:49:42 +00:00
|
|
|
} from "@halo-dev/components";
|
2024-06-26 10:42:50 +00:00
|
|
|
import { useQuery } from "@tanstack/vue-query";
|
|
|
|
import { useRouteQuery } from "@vueuse/router";
|
2024-05-23 03:02:49 +00:00
|
|
|
import type { Ref } from "vue";
|
|
|
|
import { computed, provide, ref, watch } from "vue";
|
2023-03-23 08:54:33 +00:00
|
|
|
import { useI18n } from "vue-i18n";
|
2023-07-20 07:40:18 +00:00
|
|
|
import SinglePageListItem from "./components/SinglePageListItem.vue";
|
2024-06-26 10:42:50 +00:00
|
|
|
import SinglePageSettingModal from "./components/SinglePageSettingModal.vue";
|
2022-09-30 09:48:19 +00:00
|
|
|
|
2023-03-23 08:54:33 +00:00
|
|
|
const { t } = useI18n();
|
2022-09-08 08:49:42 +00:00
|
|
|
|
|
|
|
const settingModal = ref(false);
|
|
|
|
const selectedSinglePage = ref<SinglePage>();
|
2022-11-02 09:48:23 +00:00
|
|
|
const selectedPageNames = ref<string[]>([]);
|
|
|
|
const checkedAll = ref(false);
|
2022-09-08 08:49:42 +00:00
|
|
|
|
2023-07-20 07:40:18 +00:00
|
|
|
provide<Ref<string[]>>("selectedPageNames", selectedPageNames);
|
|
|
|
|
2023-02-24 09:58:21 +00:00
|
|
|
// Filters
|
2023-07-19 11:46:17 +00:00
|
|
|
const selectedContributor = useRouteQuery<string | undefined>("contributor");
|
|
|
|
const selectedVisible = useRouteQuery<
|
|
|
|
"PUBLIC" | "INTERNAL" | "PRIVATE" | undefined
|
|
|
|
>("visible");
|
|
|
|
const selectedPublishStatus = useRouteQuery<string | undefined>("status");
|
|
|
|
const selectedSort = useRouteQuery<string | undefined>("sort");
|
|
|
|
const keyword = useRouteQuery<string>("keyword", "");
|
2023-02-24 09:58:21 +00:00
|
|
|
|
2023-07-11 07:15:10 +00:00
|
|
|
watch(
|
|
|
|
() => [
|
|
|
|
selectedContributor.value,
|
|
|
|
selectedVisible.value,
|
|
|
|
selectedPublishStatus.value,
|
2023-07-19 11:46:17 +00:00
|
|
|
selectedSort.value,
|
2023-07-11 07:15:10 +00:00
|
|
|
keyword.value,
|
|
|
|
],
|
|
|
|
() => {
|
|
|
|
page.value = 1;
|
2023-02-24 09:58:21 +00:00
|
|
|
}
|
2023-07-11 07:15:10 +00:00
|
|
|
);
|
2023-02-24 09:58:21 +00:00
|
|
|
|
|
|
|
const hasFilters = computed(() => {
|
|
|
|
return (
|
|
|
|
selectedContributor.value ||
|
2023-07-11 07:15:10 +00:00
|
|
|
selectedVisible.value ||
|
|
|
|
selectedPublishStatus.value !== undefined ||
|
2023-07-19 11:46:17 +00:00
|
|
|
selectedSort.value
|
2023-02-24 09:58:21 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
function handleClearFilters() {
|
|
|
|
selectedContributor.value = undefined;
|
2023-07-11 07:15:10 +00:00
|
|
|
selectedVisible.value = undefined;
|
|
|
|
selectedPublishStatus.value = undefined;
|
2023-07-19 11:46:17 +00:00
|
|
|
selectedSort.value = undefined;
|
2023-02-24 09:58:21 +00:00
|
|
|
}
|
|
|
|
|
2023-07-19 11:46:17 +00:00
|
|
|
const page = useRouteQuery<number>("page", 1, {
|
|
|
|
transform: Number,
|
|
|
|
});
|
|
|
|
const size = useRouteQuery<number>("size", 20, {
|
|
|
|
transform: Number,
|
|
|
|
});
|
2023-02-24 09:58:21 +00:00
|
|
|
const total = ref(0);
|
|
|
|
const hasNext = ref(false);
|
|
|
|
const hasPrevious = ref(false);
|
|
|
|
|
|
|
|
const {
|
|
|
|
data: singlePages,
|
|
|
|
isLoading,
|
|
|
|
isFetching,
|
|
|
|
refetch,
|
|
|
|
} = useQuery<ListedSinglePage[]>({
|
|
|
|
queryKey: [
|
|
|
|
"singlePages",
|
|
|
|
selectedContributor,
|
2023-07-11 07:15:10 +00:00
|
|
|
selectedPublishStatus,
|
2023-02-24 09:58:21 +00:00
|
|
|
page,
|
|
|
|
size,
|
2023-07-11 07:15:10 +00:00
|
|
|
selectedVisible,
|
2023-07-19 11:46:17 +00:00
|
|
|
selectedSort,
|
2023-02-24 09:58:21 +00:00
|
|
|
keyword,
|
|
|
|
],
|
|
|
|
queryFn: async () => {
|
2022-09-28 15:50:18 +00:00
|
|
|
let contributors: string[] | undefined;
|
2022-11-10 16:24:10 +00:00
|
|
|
const labelSelector: string[] = ["content.halo.run/deleted=false"];
|
2022-09-28 15:50:18 +00:00
|
|
|
|
|
|
|
if (selectedContributor.value) {
|
2023-07-11 07:15:10 +00:00
|
|
|
contributors = [selectedContributor.value];
|
2022-09-28 15:50:18 +00:00
|
|
|
}
|
|
|
|
|
2023-07-11 07:15:10 +00:00
|
|
|
if (selectedPublishStatus.value !== undefined) {
|
2022-11-10 16:24:10 +00:00
|
|
|
labelSelector.push(
|
2023-07-11 07:15:10 +00:00
|
|
|
`${singlePageLabels.PUBLISHED}=${selectedPublishStatus.value}`
|
2022-11-10 16:24:10 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2024-06-25 04:31:44 +00:00
|
|
|
const { data } = await consoleApiClient.content.singlePage.listSinglePages({
|
2022-11-10 16:24:10 +00:00
|
|
|
labelSelector,
|
2023-02-24 09:58:21 +00:00
|
|
|
page: page.value,
|
|
|
|
size: size.value,
|
2023-07-11 07:15:10 +00:00
|
|
|
visible: selectedVisible.value,
|
2023-07-19 11:46:17 +00:00
|
|
|
sort: [selectedSort.value].filter(Boolean) as string[],
|
2022-09-28 15:50:18 +00:00
|
|
|
keyword: keyword.value,
|
|
|
|
contributor: contributors,
|
2022-09-08 08:49:42 +00:00
|
|
|
});
|
2022-10-24 14:10:10 +00:00
|
|
|
|
2023-02-24 09:58:21 +00:00
|
|
|
total.value = data.total;
|
|
|
|
hasNext.value = data.hasNext;
|
|
|
|
hasPrevious.value = data.hasPrevious;
|
|
|
|
|
|
|
|
return data.items;
|
|
|
|
},
|
|
|
|
refetchInterval(data) {
|
2024-05-27 08:26:58 +00:00
|
|
|
const hasAbnormalSinglePage = data?.some((singlePage) => {
|
|
|
|
const { spec, metadata } = singlePage.page;
|
2022-11-10 16:24:10 +00:00
|
|
|
return (
|
|
|
|
spec.deleted ||
|
2024-05-27 08:26:58 +00:00
|
|
|
metadata.labels?.[singlePageLabels.PUBLISHED] !== spec.publish + ""
|
2022-11-10 16:24:10 +00:00
|
|
|
);
|
|
|
|
});
|
2024-05-27 08:26:58 +00:00
|
|
|
return hasAbnormalSinglePage ? 1000 : false;
|
2023-02-24 09:58:21 +00:00
|
|
|
},
|
2022-10-24 14:10:10 +00:00
|
|
|
});
|
|
|
|
|
2022-09-08 08:49:42 +00:00
|
|
|
const handleOpenSettingModal = async (singlePage: SinglePage) => {
|
2024-06-25 04:31:44 +00:00
|
|
|
const { data } = await coreApiClient.content.singlePage.getSinglePage({
|
|
|
|
name: singlePage.metadata.name,
|
|
|
|
});
|
2022-09-08 08:49:42 +00:00
|
|
|
selectedSinglePage.value = data;
|
|
|
|
settingModal.value = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
const onSettingModalClose = () => {
|
|
|
|
selectedSinglePage.value = undefined;
|
2024-05-23 03:02:49 +00:00
|
|
|
settingModal.value = false;
|
2023-02-24 09:58:21 +00:00
|
|
|
refetch();
|
2022-09-08 08:49:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const handleSelectPrevious = async () => {
|
2023-02-24 09:58:21 +00:00
|
|
|
if (!singlePages.value) return;
|
|
|
|
|
|
|
|
const index = singlePages.value.findIndex(
|
2022-09-08 08:49:42 +00:00
|
|
|
(singlePage) =>
|
|
|
|
singlePage.page.metadata.name === selectedSinglePage.value?.metadata.name
|
|
|
|
);
|
|
|
|
if (index > 0) {
|
2024-06-25 04:31:44 +00:00
|
|
|
const { data } = await coreApiClient.content.singlePage.getSinglePage({
|
|
|
|
name: singlePages.value[index - 1].page.metadata.name,
|
|
|
|
});
|
2022-09-08 08:49:42 +00:00
|
|
|
selectedSinglePage.value = data;
|
|
|
|
return;
|
|
|
|
}
|
2023-02-24 09:58:21 +00:00
|
|
|
if (index === 0 && hasPrevious.value) {
|
|
|
|
page.value--;
|
|
|
|
await refetch();
|
2022-09-08 08:49:42 +00:00
|
|
|
selectedSinglePage.value =
|
2023-02-24 09:58:21 +00:00
|
|
|
singlePages.value[singlePages.value.length - 1].page;
|
2022-09-08 08:49:42 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
const handleSelectNext = async () => {
|
2023-02-24 09:58:21 +00:00
|
|
|
if (!singlePages.value) return;
|
|
|
|
|
|
|
|
const index = singlePages.value.findIndex(
|
2022-09-08 08:49:42 +00:00
|
|
|
(singlePage) =>
|
|
|
|
singlePage.page.metadata.name === selectedSinglePage.value?.metadata.name
|
|
|
|
);
|
2023-02-24 09:58:21 +00:00
|
|
|
if (index < singlePages.value.length - 1) {
|
2024-06-25 04:31:44 +00:00
|
|
|
const { data } = await coreApiClient.content.singlePage.getSinglePage({
|
|
|
|
name: singlePages.value[index + 1].page.metadata.name,
|
|
|
|
});
|
2022-09-08 08:49:42 +00:00
|
|
|
selectedSinglePage.value = data;
|
|
|
|
return;
|
|
|
|
}
|
2023-02-24 09:58:21 +00:00
|
|
|
if (index === singlePages.value.length - 1 && hasNext.value) {
|
|
|
|
page.value++;
|
|
|
|
await refetch();
|
|
|
|
selectedSinglePage.value = singlePages.value[0].page;
|
2022-09-08 08:49:42 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-11-02 09:48:23 +00:00
|
|
|
const checkSelection = (singlePage: SinglePage) => {
|
|
|
|
return (
|
|
|
|
singlePage.metadata.name === selectedSinglePage.value?.metadata.name ||
|
|
|
|
selectedPageNames.value.includes(singlePage.metadata.name)
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
const handleCheckAllChange = (e: Event) => {
|
|
|
|
const { checked } = e.target as HTMLInputElement;
|
|
|
|
|
|
|
|
if (checked) {
|
|
|
|
selectedPageNames.value =
|
2023-02-24 09:58:21 +00:00
|
|
|
singlePages.value?.map((singlePage) => {
|
2022-11-02 09:48:23 +00:00
|
|
|
return singlePage.page.metadata.name;
|
|
|
|
}) || [];
|
|
|
|
} else {
|
|
|
|
selectedPageNames.value = [];
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
const handleDeleteInBatch = async () => {
|
|
|
|
Dialog.warning({
|
2023-03-23 08:54:33 +00:00
|
|
|
title: t("core.page.operations.delete_in_batch.title"),
|
|
|
|
description: t("core.page.operations.delete_in_batch.description"),
|
2022-11-02 09:48:23 +00:00
|
|
|
confirmType: "danger",
|
2023-03-23 08:54:33 +00:00
|
|
|
confirmText: t("core.common.buttons.confirm"),
|
|
|
|
cancelText: t("core.common.buttons.cancel"),
|
2022-11-02 09:48:23 +00:00
|
|
|
onConfirm: async () => {
|
|
|
|
await Promise.all(
|
|
|
|
selectedPageNames.value.map((name) => {
|
2023-02-24 09:58:21 +00:00
|
|
|
const page = singlePages.value?.find(
|
2022-11-02 09:48:23 +00:00
|
|
|
(item) => item.page.metadata.name === name
|
|
|
|
)?.page;
|
|
|
|
|
|
|
|
if (!page) {
|
|
|
|
return Promise.resolve();
|
|
|
|
}
|
|
|
|
|
2024-08-13 03:42:55 +00:00
|
|
|
return coreApiClient.content.singlePage.patchSinglePage({
|
2024-06-25 04:31:44 +00:00
|
|
|
name: page.metadata.name,
|
2024-08-13 03:42:55 +00:00
|
|
|
jsonPatchInner: [
|
|
|
|
{
|
|
|
|
op: "add",
|
|
|
|
path: "/spec/deleted",
|
|
|
|
value: true,
|
2023-02-24 09:58:21 +00:00
|
|
|
},
|
2024-08-13 03:42:55 +00:00
|
|
|
],
|
2024-06-25 04:31:44 +00:00
|
|
|
});
|
2022-11-02 09:48:23 +00:00
|
|
|
})
|
|
|
|
);
|
2023-02-24 09:58:21 +00:00
|
|
|
await refetch();
|
2022-11-02 09:48:23 +00:00
|
|
|
selectedPageNames.value = [];
|
2022-12-20 11:04:29 +00:00
|
|
|
|
2023-03-23 08:54:33 +00:00
|
|
|
Toast.success(t("core.common.toast.delete_success"));
|
2022-11-02 09:48:23 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
watch(selectedPageNames, (newValue) => {
|
2023-02-24 09:58:21 +00:00
|
|
|
checkedAll.value = newValue.length === singlePages.value?.length;
|
2022-11-23 04:59:28 +00:00
|
|
|
});
|
2022-09-08 08:49:42 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<SinglePageSettingModal
|
2024-05-23 03:02:49 +00:00
|
|
|
v-if="settingModal"
|
2022-11-10 16:24:10 +00:00
|
|
|
:single-page="selectedSinglePage"
|
2022-09-08 08:49:42 +00:00
|
|
|
@close="onSettingModalClose"
|
|
|
|
>
|
|
|
|
<template #actions>
|
2022-09-11 09:10:25 +00:00
|
|
|
<span @click="handleSelectPrevious">
|
2023-03-23 08:54:33 +00:00
|
|
|
<IconArrowLeft v-tooltip="$t('core.common.buttons.previous')" />
|
2022-09-11 09:10:25 +00:00
|
|
|
</span>
|
|
|
|
<span @click="handleSelectNext">
|
2023-03-23 08:54:33 +00:00
|
|
|
<IconArrowRight v-tooltip="$t('core.common.buttons.next')" />
|
2022-09-11 09:10:25 +00:00
|
|
|
</span>
|
2022-09-08 08:49:42 +00:00
|
|
|
</template>
|
|
|
|
</SinglePageSettingModal>
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
|
2023-03-23 08:54:33 +00:00
|
|
|
<VPageHeader :title="$t('core.page.title')">
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
<template #icon>
|
|
|
|
<IconPages class="mr-2 self-center" />
|
|
|
|
</template>
|
|
|
|
<template #actions>
|
|
|
|
<VSpace>
|
|
|
|
<VButton
|
|
|
|
v-permission="['system:singlepages:view']"
|
|
|
|
:route="{ name: 'DeletedSinglePages' }"
|
|
|
|
size="sm"
|
|
|
|
>
|
2023-03-23 08:54:33 +00:00
|
|
|
{{ $t("core.page.actions.recycle_bin") }}
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
</VButton>
|
|
|
|
<VButton
|
|
|
|
v-permission="['system:singlepages:manage']"
|
|
|
|
:route="{ name: 'SinglePageEditor' }"
|
|
|
|
type="secondary"
|
2022-09-08 08:49:42 +00:00
|
|
|
>
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
<template #icon>
|
|
|
|
<IconAddCircle class="h-full w-full" />
|
|
|
|
</template>
|
2023-03-23 08:54:33 +00:00
|
|
|
{{ $t("core.common.buttons.new") }}
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
</VButton>
|
|
|
|
</VSpace>
|
|
|
|
</template>
|
|
|
|
</VPageHeader>
|
|
|
|
|
|
|
|
<div class="m-0 md:m-4">
|
|
|
|
<VCard :body-class="['!p-0']">
|
|
|
|
<template #header>
|
|
|
|
<div class="block w-full bg-gray-50 px-4 py-3">
|
2022-09-30 09:48:19 +00:00
|
|
|
<div
|
2023-09-14 16:14:14 +00:00
|
|
|
class="relative flex flex-col flex-wrap items-start gap-4 sm:flex-row sm:items-center"
|
2022-09-30 09:48:19 +00:00
|
|
|
>
|
2022-11-02 09:48:23 +00:00
|
|
|
<div
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
v-permission="['system:singlepages:manage']"
|
2023-09-14 16:14:14 +00:00
|
|
|
class="hidden items-center sm:flex"
|
2022-11-02 09:48:23 +00:00
|
|
|
>
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
<input
|
|
|
|
v-model="checkedAll"
|
|
|
|
type="checkbox"
|
|
|
|
@change="handleCheckAllChange"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="flex w-full flex-1 items-center sm:w-auto">
|
2023-07-11 07:15:10 +00:00
|
|
|
<SearchInput v-if="!selectedPageNames.length" v-model="keyword" />
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
<VSpace v-else>
|
2023-03-23 08:54:33 +00:00
|
|
|
<VButton type="danger" @click="handleDeleteInBatch">
|
|
|
|
{{ $t("core.common.buttons.delete") }}
|
|
|
|
</VButton>
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
</VSpace>
|
|
|
|
</div>
|
2023-09-14 16:14:14 +00:00
|
|
|
<VSpace spacing="lg" class="flex-wrap">
|
|
|
|
<FilterCleanButton
|
|
|
|
v-if="hasFilters"
|
|
|
|
@click="handleClearFilters"
|
|
|
|
/>
|
|
|
|
<FilterDropdown
|
|
|
|
v-model="selectedPublishStatus"
|
|
|
|
:label="$t('core.common.filters.labels.status')"
|
|
|
|
:items="[
|
|
|
|
{
|
|
|
|
label: t('core.common.filters.item_labels.all'),
|
|
|
|
value: undefined,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: t('core.page.filters.status.items.published'),
|
|
|
|
value: 'true',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: t('core.page.filters.status.items.draft'),
|
|
|
|
value: 'false',
|
|
|
|
},
|
|
|
|
]"
|
|
|
|
/>
|
|
|
|
<FilterDropdown
|
|
|
|
v-model="selectedVisible"
|
|
|
|
:label="$t('core.page.filters.visible.label')"
|
|
|
|
:items="[
|
|
|
|
{
|
|
|
|
label: t('core.common.filters.item_labels.all'),
|
|
|
|
value: undefined,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: t('core.page.filters.visible.items.public'),
|
|
|
|
value: 'PUBLIC',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: t('core.page.filters.visible.items.private'),
|
|
|
|
value: 'PRIVATE',
|
|
|
|
},
|
|
|
|
]"
|
|
|
|
/>
|
2023-09-22 08:11:53 +00:00
|
|
|
<HasPermission :permissions="['system:users:view']">
|
|
|
|
<UserFilterDropdown
|
|
|
|
v-model="selectedContributor"
|
|
|
|
:label="$t('core.page.filters.author.label')"
|
|
|
|
/>
|
|
|
|
</HasPermission>
|
2023-09-14 16:14:14 +00:00
|
|
|
<FilterDropdown
|
|
|
|
v-model="selectedSort"
|
|
|
|
:label="$t('core.common.filters.labels.sort')"
|
|
|
|
:items="[
|
|
|
|
{
|
|
|
|
label: t('core.common.filters.item_labels.default'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: t('core.page.filters.sort.items.publish_time_desc'),
|
|
|
|
value: 'publishTime,desc',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: t('core.page.filters.sort.items.publish_time_asc'),
|
|
|
|
value: 'publishTime,asc',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: t('core.page.filters.sort.items.create_time_desc'),
|
|
|
|
value: 'creationTimestamp,desc',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: t('core.page.filters.sort.items.create_time_asc'),
|
|
|
|
value: 'creationTimestamp,asc',
|
|
|
|
},
|
|
|
|
]"
|
|
|
|
/>
|
|
|
|
<div class="flex flex-row gap-2">
|
|
|
|
<div
|
|
|
|
class="group cursor-pointer rounded p-1 hover:bg-gray-200"
|
|
|
|
@click="refetch()"
|
|
|
|
>
|
|
|
|
<IconRefreshLine
|
|
|
|
v-tooltip="$t('core.common.buttons.refresh')"
|
|
|
|
:class="{ 'animate-spin text-gray-900': isFetching }"
|
|
|
|
class="h-4 w-4 text-gray-600 group-hover:text-gray-900"
|
|
|
|
/>
|
2022-10-24 03:18:16 +00:00
|
|
|
</div>
|
2023-09-14 16:14:14 +00:00
|
|
|
</div>
|
|
|
|
</VSpace>
|
2022-09-08 08:49:42 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
</template>
|
2023-02-24 09:58:21 +00:00
|
|
|
<VLoading v-if="isLoading" />
|
|
|
|
<Transition v-else-if="!singlePages?.length" appear name="fade">
|
2023-03-23 08:54:33 +00:00
|
|
|
<VEmpty
|
|
|
|
:message="$t('core.page.empty.message')"
|
|
|
|
:title="$t('core.page.empty.title')"
|
|
|
|
>
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
<template #actions>
|
|
|
|
<VSpace>
|
2023-03-23 08:54:33 +00:00
|
|
|
<VButton @click="refetch">
|
|
|
|
{{ $t("core.common.buttons.refresh") }}
|
|
|
|
</VButton>
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
<VButton
|
|
|
|
v-permission="['system:singlepages:manage']"
|
|
|
|
:route="{ name: 'SinglePageEditor' }"
|
2024-09-26 08:47:31 +00:00
|
|
|
type="secondary"
|
2022-11-24 03:46:10 +00:00
|
|
|
>
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
<template #icon>
|
|
|
|
<IconAddCircle class="h-full w-full" />
|
|
|
|
</template>
|
2023-03-23 08:54:33 +00:00
|
|
|
{{ $t("core.common.buttons.new") }}
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
</VButton>
|
|
|
|
</VSpace>
|
|
|
|
</template>
|
|
|
|
</VEmpty>
|
|
|
|
</Transition>
|
|
|
|
<Transition v-else appear name="fade">
|
|
|
|
<ul
|
|
|
|
class="box-border h-full w-full divide-y divide-gray-100"
|
|
|
|
role="list"
|
|
|
|
>
|
2023-07-20 07:40:18 +00:00
|
|
|
<li
|
|
|
|
v-for="singlePage in singlePages"
|
|
|
|
:key="singlePage.page.metadata.name"
|
|
|
|
>
|
|
|
|
<SinglePageListItem
|
|
|
|
:single-page="singlePage"
|
|
|
|
:is-selected="checkSelection(singlePage.page)"
|
|
|
|
@open-setting-modal="handleOpenSettingModal"
|
|
|
|
/>
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</Transition>
|
|
|
|
|
|
|
|
<template #footer>
|
2023-07-28 03:15:08 +00:00
|
|
|
<VPagination
|
|
|
|
v-model:page="page"
|
|
|
|
v-model:size="size"
|
|
|
|
:page-label="$t('core.components.pagination.page_label')"
|
|
|
|
:size-label="$t('core.components.pagination.size_label')"
|
|
|
|
:total-label="
|
|
|
|
$t('core.components.pagination.total_label', { total: total })
|
|
|
|
"
|
|
|
|
:total="total"
|
|
|
|
:size-options="[20, 30, 50, 100]"
|
|
|
|
/>
|
refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?
/kind api-change
/kind improvement
#### What this PR does / why we need it:
1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。
原由请看:https://github.com/halo-dev/halo/issues/3124
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3124
#### Screenshots:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">
插件需要自己定义菜单配置,如:
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">
```diff
export default definePlugin({
- name: "PluginLinks",
components: {},
routes: [
{
parentName: "Root",
route: {
- path: "/pages/functional/links",
+ path: "/links",
name: "Links",
component: LinkList,
meta: {
permissions: ["plugin:links:view"],
+ menu: {
+ name: "链接",
+ group: "content",
+ icon: markRaw(RiLinksLine),
+ },
},
},
},
],
- extensionPoints: {
- "page:functional:create": () => {
- return [
- {
- name: "链接",
- url: "/links",
- path: "/pages/functional/links",
- permissions: ["plugin:links:view"],
- },
- ];
- },
- },
});
```
#### Special notes for your reviewer:
测试方式:
1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)
#### Does this PR introduce a user-facing change?
```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
|
|
|
</template>
|
|
|
|
</VCard>
|
|
|
|
</div>
|
2022-09-08 08:49:42 +00:00
|
|
|
</template>
|