Files
modrinth/apps/app-frontend/src/components/ui/world/modal/DesyncServerModal.vue
T
Calum H.andtdgao 7c67cca7a7 feat(instance-sync): screenshots sync (#7218)
* pnpm prepr

* feat(instance-sync): screenshots sync

* fix: prepr + fmt

* fix: qa

* feat: screenshit editor

* feat: screenshot* editor qa

* fix: qa

* fix: lint

* fix: aecsocket rev

* qa: a11y tab navigation focus is cut off

* qa: Change “Edited” badge to be bg-highlight-green

* qa: friends list input style wrong

* qa: toolbar width + labels

* qa: multiselect changes

* qa: anim changes

* qa: card hover colors

* qa: copy feedback

* qa: hide date

* qa: instance icon in overflow/contextmenu

* qa: spacing

* qa: group empty state text

* qa: drag preview badge

* qa: group deletion skip warning if no screenshots

* qa: redesign editor

* qa: remove screenshot parent/edited badge stuff

* qa: control font size consistency

* qa: viewer copy control

* qa: editor fixes

* qa: redirect on disable screenshot sync

* qa: margin police

* fix: crop

* fix: qa

* feat: initial start on basic instance file syncing (#7220)

* qa: final

* qa: final 2

* fix: lint + prepr

* fix: copy

* fix: screenshot editing outside of app causing ghost files in db + sync fail rollback impl

* chore: split up

* fix: fmt

---------

Co-authored-by: tdgao <mr.trumgao@gmail.com>
2026-08-27 16:49:46 +00:00

75 lines
2.0 KiB
Vue

<script setup lang="ts">
import { LinkIcon, TrashIcon, XIcon } from '@modrinth/assets'
import { Button, commonMessages, defineMessages, NewModal, useVIntl } from '@modrinth/ui'
import { ref } from 'vue'
import type { DesyncServerMode, ServerWorld } from '@/helpers/worlds'
const { formatMessage } = useVIntl()
const modal = ref<InstanceType<typeof NewModal> | null>(null)
const server = ref<ServerWorld | null>(null)
const emit = defineEmits<{
confirm: [server: ServerWorld, mode: DesyncServerMode]
}>()
const messages = defineMessages({
title: {
id: 'instance.worlds.desync-server.title',
defaultMessage: 'Desync server',
},
description: {
id: 'instance.worlds.desync-server.description',
defaultMessage:
'Do you want to keep this server in other synced instances, or remove it from them?',
},
keep: {
id: 'instance.worlds.desync-server.keep',
defaultMessage: 'Keep',
},
remove: {
id: 'instance.worlds.desync-server.remove',
defaultMessage: 'Remove',
},
})
function show(value: ServerWorld) {
server.value = value
modal.value?.show()
}
function confirm(mode: DesyncServerMode) {
if (server.value) emit('confirm', server.value, mode)
modal.value?.hide()
}
defineExpose({ show })
</script>
<template>
<NewModal ref="modal" :header="formatMessage(messages.title)" max-width="540px">
<p class="m-0 text-secondary">{{ formatMessage(messages.description) }}</p>
<template #actions>
<div class="flex justify-end gap-2">
<Button type="outlined" class="whitespace-nowrap" @click="modal?.hide()">
<XIcon />
{{ formatMessage(commonMessages.cancelButton) }}
</Button>
<Button class="whitespace-nowrap" @click="confirm('keep_in_other_instances')">
<LinkIcon />
{{ formatMessage(messages.keep) }}
</Button>
<Button
type="colored"
color="red"
class="whitespace-nowrap"
@click="confirm('remove_from_other_instances')"
>
<TrashIcon />
{{ formatMessage(messages.remove) }}
</Button>
</div>
</template>
</NewModal>
</template>