diff --git a/build.gradle b/build.gradle index 914ee93..60bf62d 100644 --- a/build.gradle +++ b/build.gradle @@ -41,6 +41,6 @@ build { } halo { - version = '2.11' + version = '2.12.0-alpha.1' debug = true } \ No newline at end of file diff --git a/console/src/components/AppActionButton.vue b/console/src/components/AppActionButton.vue index 2faf65f..ecb5238 100644 --- a/console/src/components/AppActionButton.vue +++ b/console/src/components/AppActionButton.vue @@ -31,8 +31,7 @@ const { app } = toRefs(props); const { installing, handleInstall } = useAppDownload(app); const { isSatisfies, hasInstalled } = useAppCompare(app); -const { paymentCheckModal, paymentCheckModalVisible, onPaymentCheckModalClose, handleOpenCreateOrderPage } = - usePaymentCheckModal(app); +const { paymentCheckModalVisible, handleOpenCreateOrderPage } = usePaymentCheckModal(app); const actions = computed((): Action[] => { return [ @@ -87,10 +86,5 @@ const action = computed(() => { > {{ action.label }} - + diff --git a/console/src/components/AppDetailModal.vue b/console/src/components/AppDetailModal.vue index 56163c1..1c85f19 100644 --- a/console/src/components/AppDetailModal.vue +++ b/console/src/components/AppDetailModal.vue @@ -18,51 +18,35 @@ import TablerDownload from "~icons/tabler/download"; const props = withDefaults( defineProps<{ - visible: boolean; tab?: string; - app?: ApplicationSearchResult; + app: ApplicationSearchResult; }>(), { - visible: false, tab: "readme", - app: undefined, } ); const emit = defineEmits<{ - (event: "update:visible", visible: boolean): void; (event: "close"): void; }>(); -const onVisibleChange = (visible: boolean) => { - emit("update:visible", visible); +const { app } = toRefs(props); - if (!visible) { - setTimeout(() => { - activeId.value = "readme"; - emit("close"); - }, 200); - } -}; - -const { app, visible } = toRefs(props); +const modal = ref(); const { data: appDetail, isLoading, isFetching, } = useQuery({ - queryKey: ["store-app", app, visible], + queryKey: ["store-app", app], queryFn: async () => { - if (!visible.value || !app.value) { - return; - } const { data } = await storeApiClient.get( `/apis/api.store.halo.run/v1alpha1/applications/${app.value?.application.metadata.name}` ); return data; }, - enabled: computed(() => visible.value && !!app.value), + enabled: computed(() => !!app.value), }); const title = computed(() => { @@ -77,9 +61,10 @@ const activeId = ref(props.tab); watch( () => appDetail.value, (value) => { - if (!(props.visible && value)) { + if (!value) { return; } + const { screen: { width, height }, navigator: { language }, @@ -96,20 +81,23 @@ watch( referrer: document.referrer, }, }); + }, + { + immediate: true, } ); @@ -188,7 +176,7 @@ watch( - 关闭 + 关闭 diff --git a/console/src/components/AppStoreTab.vue b/console/src/components/AppStoreTab.vue index ae502d8..7bf0204 100644 --- a/console/src/components/AppStoreTab.vue +++ b/console/src/components/AppStoreTab.vue @@ -92,11 +92,9 @@ const { data, isFetching, isLoading, refetch } = useQuery(); function handleOpenDetailModal(app: ApplicationSearchResult) { selectedApp.value = app; - detailModal.value = true; } const handleSelectPrevious = async () => { @@ -257,7 +255,7 @@ watch([selectedPriceMode, selectedSort, keyword], () => { :size-options="[10, 20, 30, 50, 100]" /> - + diff --git a/console/src/components/AppVersionCheckBar.vue b/console/src/components/AppVersionCheckBar.vue index d2457bc..0ce689c 100644 --- a/console/src/components/AppVersionCheckBar.vue +++ b/console/src/components/AppVersionCheckBar.vue @@ -1,6 +1,6 @@ @@ -57,7 +42,7 @@ function onDetailModalClose() { 有新版本, 查看详情 @@ -67,18 +52,15 @@ function onDetailModalClose() { - 有新版本,版本不兼容 + 有新版本, + 版本不兼容 - + diff --git a/console/src/components/PaymentCheckModal.vue b/console/src/components/PaymentCheckModal.vue index 3e15fad..99b060a 100644 --- a/console/src/components/PaymentCheckModal.vue +++ b/console/src/components/PaymentCheckModal.vue @@ -3,24 +3,23 @@ import type { ApplicationDetail, ApplicationSearchResult } from "@/types"; import storeApiClient from "@/utils/store-api-client"; import { Dialog, VButton, VLoading, VModal } from "@halo-dev/components"; import { useQuery, useQueryClient } from "@tanstack/vue-query"; +import { ref } from "vue"; const queryClient = useQueryClient(); const props = withDefaults( defineProps<{ - app?: ApplicationSearchResult; + app: ApplicationSearchResult; }>(), - { - app: undefined, - } + {} ); -const visible = defineModel({ type: Boolean, default: false }); - const emit = defineEmits<{ (event: "close"): void; }>(); +const modal = ref(); + useQuery({ queryKey: ["app-payment-check"], queryFn: async () => { @@ -31,7 +30,7 @@ useQuery({ }, onSuccess(data) { if (data?.bought) { - visible.value = false; + modal.value.close(); Dialog.success({ title: "支付成功", description: "感谢购买,现在已经可以安装此应用了", @@ -51,14 +50,14 @@ useQuery({ - + 正在检测支付状态,请稍后... - 关闭 + 关闭 diff --git a/console/src/components/ThemeOrPluginVersionCheckBar.vue b/console/src/components/ThemeOrPluginVersionCheckBar.vue index 3061693..66c4081 100644 --- a/console/src/components/ThemeOrPluginVersionCheckBar.vue +++ b/console/src/components/ThemeOrPluginVersionCheckBar.vue @@ -1,7 +1,7 @@ @@ -77,7 +62,7 @@ function onDetailModalClose() { 有新版本, 查看详情 @@ -87,18 +72,20 @@ function onDetailModalClose() { - 有新版本,版本不兼容 + 有新版本, + 版本不兼容 diff --git a/console/src/components/detail/DetailReleaseItem.vue b/console/src/components/detail/DetailReleaseItem.vue index 3eebe1a..5727632 100644 --- a/console/src/components/detail/DetailReleaseItem.vue +++ b/console/src/components/detail/DetailReleaseItem.vue @@ -42,8 +42,7 @@ const { } = useAppDownload(app); const { matchedPlugin, matchedTheme, appType, hasInstalled: appHasInstalled } = useAppCompare(app); -const { paymentCheckModal, paymentCheckModalVisible, onPaymentCheckModalClose, handleOpenCreateOrderPage } = - usePaymentCheckModal(app); +const { paymentCheckModalVisible, handleOpenCreateOrderPage } = usePaymentCheckModal(app); const hasInstalled = computed(() => { if (appType.value === "PLUGIN") { @@ -256,10 +255,5 @@ const { isLoading: installing, mutate: handleInstall } = useMutation({ - + diff --git a/console/src/components/operation-items/ViewAppStoreOperationItem.vue b/console/src/components/operation-items/ViewAppStoreOperationItem.vue index b01c228..a9fe09f 100644 --- a/console/src/components/operation-items/ViewAppStoreOperationItem.vue +++ b/console/src/components/operation-items/ViewAppStoreOperationItem.vue @@ -1,6 +1,6 @@ 应用市场 - + diff --git a/console/src/composables/use-payment-check-modal.ts b/console/src/composables/use-payment-check-modal.ts index a593e4a..15f42d9 100644 --- a/console/src/composables/use-payment-check-modal.ts +++ b/console/src/composables/use-payment-check-modal.ts @@ -2,24 +2,14 @@ import type { ApplicationSearchResult } from "@/types"; import storeApiClient from "@/utils/store-api-client"; import type { DetailedUser } from "@halo-dev/api-client"; import { Dialog } from "@halo-dev/components"; -import { nextTick, ref, type Ref } from "vue"; +import { ref, type Ref } from "vue"; import { useRouter } from "vue-router"; export function usePaymentCheckModal(app: Ref) { const router = useRouter(); - // payment check modal - // fixme: Refactor VModal to simplify the code - const paymentCheckModal = ref(false); const paymentCheckModalVisible = ref(false); - function onPaymentCheckModalClose() { - paymentCheckModalVisible.value = false; - setTimeout(() => { - paymentCheckModal.value = false; - }, 200); - } - async function handleOpenCreateOrderPage() { const { data: user } = await storeApiClient.get("/apis/api.console.halo.run/v1alpha1/users/-"); @@ -41,11 +31,8 @@ export function usePaymentCheckModal(app: Ref { - paymentCheckModalVisible.value = true; - }); + paymentCheckModalVisible.value = true; } - return { paymentCheckModal, paymentCheckModalVisible, handleOpenCreateOrderPage, onPaymentCheckModalClose }; + return { paymentCheckModalVisible, handleOpenCreateOrderPage }; } diff --git a/console/src/views/AppStore.vue b/console/src/views/AppStore.vue index 699073b..1387763 100644 --- a/console/src/views/AppStore.vue +++ b/console/src/views/AppStore.vue @@ -170,12 +170,10 @@ const { data, isFetching, isLoading, refetch } = useQuery(); function handleOpenDetailModal(app: ApplicationSearchResult) { selectedApp.value = app; - detailModal.value = true; } const handleSelectPrevious = async () => { @@ -418,7 +416,7 @@ watch([selectedPriceMode, selectedType, selectedSort, onlyQueryInstalled, keywor - + diff --git a/src/main/resources/plugin.yaml b/src/main/resources/plugin.yaml index 4d2e8da..8ff52ea 100644 --- a/src/main/resources/plugin.yaml +++ b/src/main/resources/plugin.yaml @@ -6,7 +6,7 @@ metadata: "store.halo.run/app-id": "app-VYJbF" spec: enabled: true - requires: ">=2.9.0" + requires: ">=2.12.0" author: name: Halo OSS Team website: https://github.com/halo-dev