mirror of
https://github.com/modrinth/code.git
synced 2026-08-27 01:54:47 +00:00
feat: instances v2 (#6431)
* feat: base of instances v2 * feat: use old profiles with compat layer * prototype: instances v2 * fix: install_from using profile * fix: skins migration fix * fix: frontend still using profile path * fix: add update proj multiselect guard * fix: cargo fmt * fix: content missing fields * feat: break up app-lib/api/instance.rs * fix: check_content_updates mismatch * fix: updater modal cleanup w/new structure * feat: better update all handling * fix: remove preview_update_all * fix: feedback on bulk update + lint * fix: rem transitions * fix: change to jsonb * feat: app db backup after update * fix: lint * fix: sqlx prepare + use sqlx macros * fix: lint * fix: bugs * feat: defuck the installing process up * fix: bug of hell * fix: shear * fix: fmt * fix: install progress spacing + change mc/content/overrides to bytes * fix: lint * fix: prepr * fix: navtabs anim not working in app * fix: worlds.vue improvements + browse page fixes * feat: optimise queries + adapter fns * fix: lint * fix: lint * feat: shared modrinth-content-management crate (#6469) * feat: disable warnings setting * feat: add instances shortcuts (#6329) * Add modrinth://launch deep link to start a profile Support external profile launching via modrinth://launch/{profile_path} for integrations such as Stream Deck. * Change route to /launch/profile/{id} for future extensibility * fix: ensure profile path is url decoded * fix: URL-decode profile path from deep link * fix: use urlencoding crate for URL decoding * feat: implement app instance shortcuts * feat: change windows shortcut creation to use windows api instead * feat: implement creating a shortcut launching world/server * format * fmt * fix multiline inline tables * pnpm prepr * feat: move create shortcut to last item * refactor: split up shortcuts.rs for individual platforms * refactor: turn profile launch url into url type * use string literal and add safety comment * pt2 * refactor: rename anything that's profile into instance * update mac shortcut --------- Co-authored-by: DJCheesusReal <134006619+DJCheesusReal@users.noreply.github.com> --------- Co-authored-by: Truman Gao <106889354+tdgao@users.noreply.github.com> Co-authored-by: DJCheesusReal <134006619+DJCheesusReal@users.noreply.github.com>
This commit is contained in:
co-authored by
DJCheesusReal
Truman Gao
parent
ef4044534f
commit
734720e11e
@@ -25,6 +25,10 @@
|
||||
:status-text="item.toast.statusText"
|
||||
:progress="item.toast.progress"
|
||||
:waiting="item.toast.waiting"
|
||||
:show-progress="item.toast.showProgress"
|
||||
:progress-type="item.toast.progressType"
|
||||
:progress-current="item.toast.progressCurrent"
|
||||
:progress-total="item.toast.progressTotal"
|
||||
@accept="handleToastAction(item, item.toast.onAccept)"
|
||||
@decline="handleToastAction(item, item.toast.onDecline)"
|
||||
@dismiss="handleToastAction(item, item.toast.onDismiss)"
|
||||
@@ -33,17 +37,25 @@
|
||||
@open-instance="handleToastAction(item, item.toast.onOpenInstance)"
|
||||
/>
|
||||
<div v-else-if="isDownloadNotification(item)" class="flex flex-col gap-4">
|
||||
<NotificationToast
|
||||
v-for="progressItem in downloadToastItems(item)"
|
||||
:key="progressItem.id"
|
||||
type="instance-download"
|
||||
:entity-name="progressItem.title || item.title"
|
||||
:entity-icon-url="progressItem.iconUrl ?? item.iconUrl ?? MinecraftServerIcon"
|
||||
:status-text="downloadStatusText(progressItem)"
|
||||
:progress="progressItem.progress"
|
||||
:waiting="progressItem.waiting"
|
||||
@dismiss="dismiss(item.id)"
|
||||
/>
|
||||
<div v-for="progressItem in downloadToastItems(item)" :key="progressItem.id">
|
||||
<NotificationToast
|
||||
type="instance-download"
|
||||
:entity-name="progressItem.title || item.title"
|
||||
:entity-icon-url="progressItem.iconUrl ?? item.iconUrl ?? MinecraftServerIcon"
|
||||
:status-text="progressItem.text"
|
||||
:progress="progressItem.progress"
|
||||
:waiting="progressItem.waiting"
|
||||
:show-progress="progressItem.showProgress"
|
||||
:wrap-text="progressItem.wrapText"
|
||||
:progress-type="progressItem.progressType"
|
||||
:progress-current="progressItem.progressCurrent"
|
||||
:progress-total="progressItem.progressTotal"
|
||||
:action-label="progressItem.buttons?.[0]?.label"
|
||||
:action-icon="progressItem.buttons?.[0]?.icon"
|
||||
@dismiss="handleProgressItemDismiss(item, progressItem)"
|
||||
@action="handleProgressItemAction(progressItem)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
@@ -203,12 +215,39 @@ function downloadToastItems(item: PopupNotification): PopupNotificationProgressI
|
||||
iconUrl: item.iconUrl,
|
||||
progress: item.progress ?? 0,
|
||||
waiting: item.waiting ?? false,
|
||||
showProgress: true,
|
||||
progressType: 'percentage',
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
function downloadStatusText(progressItem: PopupNotificationProgressItem) {
|
||||
return progressItem.text?.replace(/^\d+%\s*/, '') ?? ''
|
||||
async function handleProgressItemDismiss(
|
||||
item: PopupNotification,
|
||||
progressItem: PopupNotificationProgressItem,
|
||||
) {
|
||||
if (progressItem.onDismiss) {
|
||||
await progressItem.onDismiss()
|
||||
return
|
||||
}
|
||||
|
||||
dismiss(item.id)
|
||||
}
|
||||
|
||||
async function handleProgressItemAction(progressItem: PopupNotificationProgressItem) {
|
||||
const button = progressItem.buttons?.[0]
|
||||
if (button) {
|
||||
await handleProgressItemButtonClick(progressItem, button)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleProgressItemButtonClick(
|
||||
progressItem: PopupNotificationProgressItem,
|
||||
btn: PopupNotificationButton,
|
||||
) {
|
||||
await btn.action()
|
||||
if (!btn.keepOpen) {
|
||||
await progressItem.onDismiss?.()
|
||||
}
|
||||
}
|
||||
|
||||
function handleButtonClick(id: string | number, btn: PopupNotificationButton) {
|
||||
|
||||
Reference in New Issue
Block a user