refactor: 移除遥测并修复启动器流程

This commit is contained in:
Disy committed 2026-09-13 20:32:57 +08:00
1 parent 1fa56add19
commit 1593ac7a7c
175 files changed
+547 -12210

No files matched your search

@@ -18,7 +18,6 @@ import {
} from '@modrinth/ui'
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { trackEvent } from '@/helpers/analytics'
import {
type ProjectGalleryCaptionField,
projectGalleryTranslationSegmentId,
@@ -130,10 +129,6 @@ function viewImage(entry: GalleryEntry) {
zoomedIn.value = false
viewerModal.value?.show()
trackEvent('GalleryImageExpand', {
project_id: props.project.id,
url: entry.image.url,
})
}
function changeImage(offset: number) {
@@ -146,10 +141,6 @@ function changeImage(offset: number) {
selectedGalleryItem.value = filteredGallery.value[nextIndex]
zoomedIn.value = false
trackEvent(offset > 0 ? 'GalleryImageNext' : 'GalleryImagePrevious', {
project_id: props.project.id,
url: selectedGalleryItem.value.image.url,
})
}
function handleViewerHide() {
@@ -210,25 +210,6 @@
{{ installButtonLabel }}
</button>
</ButtonStyled>
<!-- 开服功能暂有问题,隐藏该按钮
<Transition name="start-server">
<ButtonStyled
v-if="serverCapableModpack"
key="modpack-start-server"
size="large"
type="outlined"
>
<button
v-tooltip="formatMessage(messages.startServer)"
type="button"
@click="openModpackServerFlow"
>
<ServerIcon />
{{ formatMessage(messages.startServer) }}
</button>
</ButtonStyled>
</Transition>
-->
<ButtonStyled size="large" circular type="transparent">
<OverflowMenu
:tooltip="`More options`"
@@ -339,7 +320,6 @@
:translations="translations"
:translation-mode="translationMode"
:translation-style="translationStyle"
:start-server="(version) => openModpackServerFlow(version)"
/>
</template>
<template v-else> Project data couldn't not be loaded. </template>
@@ -408,7 +388,6 @@ import {
PlusIcon,
ReportIcon,
SearchIcon,
ServerIcon,
SpinnerIcon,
StopCircleIcon,
} from '@modrinth/assets'
@@ -424,7 +403,6 @@ import {
getLatestMatchingInstallVersion,
getTargetInstallPreferences,
injectNotificationManager,
injectPopupNotificationManager,
NavTabs,
OverflowMenu,
ProjectBackgroundGradient,
@@ -501,7 +479,6 @@ import UpgradeProjectReturnBar from './UpgradeProjectReturnBar.vue'
dayjs.extend(relativeTime)
const { addNotification, handleError } = injectNotificationManager()
const popupNotificationManager = injectPopupNotificationManager()
const { install: installVersion } = injectContentInstall()
const contentSelection = injectContentSelection()
const route = useRoute()
@@ -603,22 +580,6 @@ const messages = defineMessages({
id: 'project.actions.view-modpacks',
defaultMessage: 'View modpacks',
},
startServer: {
id: 'app.project.modpack-server.start',
defaultMessage: 'Start server',
},
serverCreated: {
id: 'app.project.modpack-server.created-title',
defaultMessage: 'Server created',
},
serverCreatedDescription: {
id: 'app.project.modpack-server.created-description',
defaultMessage: '{name} is ready. Configure and start it in Multiplayer.',
},
openServer: {
id: 'app.project.modpack-server.open',
defaultMessage: 'Open server',
},
})
const { installingServerProjects, playServerProject, showAddServerToInstanceModal } =
@@ -642,15 +603,6 @@ const favoriteSaved = computed(() =>
data.value ? contentFavorites.isFavorite('modrinth', data.value.id) : false,
)
const serverCapableModpack = computed(
() => data.value?.project_type === 'modpack' && data.value.server_side !== 'unsupported',
)
async function openModpackServerFlow() {
// 服务器创建弹窗(CreateModpackServerModal)已在上游移除,此流程暂不可用。
// 如需恢复:重新实现该组件,并在此处调用其 show() 方法。
}
async function toggleFavorite() {
if (!data.value || !favoriteSupported.value || favoritePending.value) return
await contentFavorites
@@ -30,16 +30,6 @@
<CheckIcon v-else />
</button>
</ButtonStyled>
<!-- 开服功能暂有问题,隐藏该按钮
<ButtonStyled v-if="serverCapable && startServer" circular type="transparent">
<button
v-tooltip="formatMessage(messages.startServer)"
@click.stop="() => startServer(version)"
>
<ServerIcon />
</button>
</ButtonStyled>
-->
<ButtonStyled circular type="transparent">
<OverflowMenu
v-if="false"
@@ -87,7 +77,6 @@ import {
DownloadIcon,
ExternalIcon,
MoreVerticalIcon,
ServerIcon,
} from '@modrinth/assets'
import {
ButtonStyled,
@@ -98,7 +87,7 @@ import {
ProjectPageVersions,
useVIntl,
} from '@modrinth/ui'
import { computed, ref } from 'vue'
import { ref } from 'vue'
import { useRoute } from 'vue-router'
import { SwapIcon } from '@/assets/icons/index.js'
@@ -117,10 +106,6 @@ const messages = defineMessages({
id: 'app.project.versions.add-to-another-instance',
defaultMessage: 'Add to another instance',
},
startServer: {
id: 'app.project.versions.start-server',
defaultMessage: 'Create server',
},
})
const props = defineProps({
@@ -152,16 +137,8 @@ const props = defineProps({
type: String,
default: null,
},
startServer: {
type: Function,
default: null,
},
})
const serverCapable = computed(
() => props.project?.project_type === 'modpack' && props.project?.server_side !== 'unsupported',
)
const { handleError } = injectNotificationManager()
const route = useRoute()