Skip to content

Commit

Permalink
[beta] Bump to v03 • Beta. Fixed CopyLink and OpenLink buttons in Ins…
Browse files Browse the repository at this point in the history
…tance -> Mods (Right click on object). Fixed visual bug while updating instance mod(s)
  • Loading branch information
DIDIRUS4 committed May 4, 2024
1 parent 108cfe0 commit 58cd0f4
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 84 deletions.
2 changes: 1 addition & 1 deletion theseus_gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "theseus_gui",
"private": true,
"version": "0.7.2",
"patch_version": "02 • Beta",
"patch_version": "03 • Beta",
"development_build": true,
"type": "module",
"scripts": {
Expand Down
183 changes: 101 additions & 82 deletions theseus_gui/src/pages/instance/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
<div class="instance-container">
<div class="side-cards">
<Card class="instance-card" @contextmenu.prevent.stop="handleRightClick">
<Avatar
size="lg"
:src="
!instance.metadata.icon ||
(instance.metadata.icon && instance.metadata.icon.startsWith('http'))
? instance.metadata.icon
: convertFileSrc(instance.metadata?.icon)
"
/>
<Avatar size="lg" :src="!instance.metadata.icon ||

Check warning on line 5 in theseus_gui/src/pages/instance/Index.vue

View workflow job for this annotation

GitHub Actions / test-tauri (windows-latest)

Expected a linebreak before this attribute

Check warning on line 5 in theseus_gui/src/pages/instance/Index.vue

View workflow job for this annotation

GitHub Actions / build

Expected a linebreak before this attribute

Check warning on line 5 in theseus_gui/src/pages/instance/Index.vue

View workflow job for this annotation

GitHub Actions / test-tauri (ubuntu-20.04)

Expected a linebreak before this attribute

Check warning on line 5 in theseus_gui/src/pages/instance/Index.vue

View workflow job for this annotation

GitHub Actions / test-tauri (ubuntu-22.04)

Expected a linebreak before this attribute
(instance.metadata.icon && instance.metadata.icon.startsWith('http'))
? instance.metadata.icon
: convertFileSrc(instance.metadata?.icon)
" />
<div class="instance-info">
<h2 class="name">{{ instance.metadata.name }}</h2>
<span class="metadata">
Expand All @@ -19,100 +15,109 @@
</div>
<span class="button-group">
<Button v-if="instance.install_stage !== 'installed'" disabled class="instance-button">
{{t('Instance.Index.Installing')}}
{{ t('Instance.Index.Installing') }}
</Button>
<Button
v-else-if="playing === true"
color="danger"
class="instance-button"
@click="stopInstance('InstancePage')"
@mouseover="checkProcess"
>
<Button v-else-if="playing === true" color="danger" class="instance-button"

Check warning on line 20 in theseus_gui/src/pages/instance/Index.vue

View workflow job for this annotation

GitHub Actions / test-tauri (windows-latest)

Expected a linebreak before this attribute

Check warning on line 20 in theseus_gui/src/pages/instance/Index.vue

View workflow job for this annotation

GitHub Actions / build

Expected a linebreak before this attribute

Check warning on line 20 in theseus_gui/src/pages/instance/Index.vue

View workflow job for this annotation

GitHub Actions / test-tauri (ubuntu-20.04)

Expected a linebreak before this attribute

Check warning on line 20 in theseus_gui/src/pages/instance/Index.vue

View workflow job for this annotation

GitHub Actions / test-tauri (ubuntu-22.04)

Expected a linebreak before this attribute
@click="stopInstance('InstancePage')" @mouseover="checkProcess">
<StopCircleIcon />
{{t('Instance.Index.Stop')}}
{{ t('Instance.Index.Stop') }}
</Button>
<Button
v-else-if="playing === false && loading === false"
color="primary"
class="instance-button"
@click="startInstance('InstancePage')"
@mouseover="checkProcess"
>
<Button v-else-if="playing === false && loading === false" color="primary" class="instance-button"

Check warning on line 25 in theseus_gui/src/pages/instance/Index.vue

View workflow job for this annotation

GitHub Actions / test-tauri (windows-latest)

Expected a linebreak before this attribute

Check warning on line 25 in theseus_gui/src/pages/instance/Index.vue

View workflow job for this annotation

GitHub Actions / build

Expected a linebreak before this attribute

Check warning on line 25 in theseus_gui/src/pages/instance/Index.vue

View workflow job for this annotation

GitHub Actions / test-tauri (ubuntu-20.04)

Expected a linebreak before this attribute

Check warning on line 25 in theseus_gui/src/pages/instance/Index.vue

View workflow job for this annotation

GitHub Actions / test-tauri (ubuntu-22.04)

Expected a linebreak before this attribute
@click="startInstance('InstancePage')" @mouseover="checkProcess">
<PlayIcon />
{{t('Instance.Index.Play')}}
{{ t('Instance.Index.Play') }}
</Button>
<Button
v-else-if="loading === true && playing === false"
disabled
class="instance-button"
>
{{t('Instance.Index.Loading')}}
<Button v-else-if="loading === true && playing === false" disabled class="instance-button">
{{ t('Instance.Index.Loading') }}
</Button>
<Button
:v-tooltip="t('Instance.Index.OpenInstanceFolder')"
class="instance-button"
@click="showProfileInFolder(instance.path)"
>
<Button :v-tooltip="t('Instance.Index.OpenInstanceFolder')" class="instance-button"
@click="showProfileInFolder(instance.path)">
<FolderOpenIcon />
{{t('Instance.Index.Folder')}}
{{ t('Instance.Index.Folder') }}
</Button>
</span>
<hr class="card-divider" />
<div class="pages-list">
<RouterLink :to="`/instance/${encodeURIComponent($route.params.id)}/`" class="btn">
<BoxIcon />
{{t('Instance.Index.Content')}}
{{ t('Instance.Index.Content') }}
</RouterLink>
<RouterLink :to="`/instance/${encodeURIComponent($route.params.id)}/logs`" class="btn">
<FileIcon />
{{t('Instance.Index.Logs')}}
{{ t('Instance.Index.Logs') }}
</RouterLink>
<RouterLink :to="`/instance/${encodeURIComponent($route.params.id)}/options`" class="btn">
<SettingsIcon />
{{t('Instance.Index.Options')}}
{{ t('Instance.Index.Options') }}
</RouterLink>
</div>
</Card>
</div>
<div class="content">
<!-- <Promotion :external="false" query-param="?r=launcher" />-->
<!-- <Promotion :external="false" query-param="?r=launcher" />-->
<RouterView v-slot="{ Component }">
<template v-if="Component">
<Suspense @pending="loadingBar.startLoading()" @resolve="loadingBar.stopLoading()">
<component
:is="Component"
:instance="instance"
:options="options"
:offline="offline"
:playing="playing"
:versions="modrinthVersions"
:installed="instance.install_stage !== 'installed'"
></component>
<component :is="Component" :instance="instance" :options="options" :offline="offline" :playing="playing"
:versions="modrinthVersions" :installed="instance.install_stage !== 'installed'"></component>
</Suspense>
</template>
</RouterView>
</div>
</div>
<ContextMenu ref="options" @option-clicked="handleOptionsClick">
<template #play> <PlayIcon /> {{t('Instance.Index.Play')}} </template>
<template #stop> <StopCircleIcon /> {{t('Instance.Index.Stop')}} </template>
<template #add_content> <PlusIcon /> {{t('Instance.Index.AddContent')}} </template>
<template #edit> <EditIcon /> {{t('Instance.Index.Edit')}} </template>
<template #copy_path> <ClipboardCopyIcon /> {{t('Instance.Index.CopyPath')}} </template>
<template #open_folder> <ClipboardCopyIcon /> {{t('Instance.Index.OpenFolder')}} </template>
<template #copy_link> <ClipboardCopyIcon /> {{t('Instance.Index.CopyLink')}} </template>
<template #open_link> <ClipboardCopyIcon /> {{t('Instance.Index.OpenInMR')}} <ExternalIcon /> </template>
<template #copy_names><EditIcon />{{t('Instance.Index.CopyNames')}}</template>
<template #copy_slugs><HashIcon />{{t('Instance.Index.CopySlugs')}}</template>
<template #copy_links><GlobeIcon />{{t('Instance.Index.CopyLinks')}}</template>
<template #toggle><EditIcon />{{t('Instance.Index.ToggleSelected')}}</template>
<template #disable><XIcon />{{t('Instance.Index.DisableSelected')}}</template>
<template #enable><CheckCircleIcon />{{t('Instance.Index.EnableSelected')}}</template>
<template #hide_show><EyeIcon />{{t('Instance.Index.ShowHideUnSelected')}}</template>
<template #update_all
><UpdatedIcon />{{t('Instance.Index.Update')}} {{ selected.length > 0 ? 'selected' : 'all' }}</template
>
<template #filter_update><UpdatedIcon />{{t('Instance.Index.SelectUpdatable')}}</template>
<template #play>
<PlayIcon /> {{ t('Instance.Index.Play') }}
</template>
<template #stop>
<StopCircleIcon /> {{ t('Instance.Index.Stop') }}
</template>
<template #add_content>
<PlusIcon /> {{ t('Instance.Index.AddContent') }}
</template>
<template #edit>
<EditIcon /> {{ t('Instance.Index.Edit') }}
</template>
<template #copy_path>
<ClipboardCopyIcon /> {{ t('Instance.Index.CopyPath') }}
</template>
<template #open_folder>
<ClipboardCopyIcon /> {{ t('Instance.Index.OpenFolder') }}
</template>
<template #copy_link>
<ClipboardCopyIcon /> {{ t('Instance.Index.CopyLink') }}
</template>
<template #open_link>
<ClipboardCopyIcon /> {{ t('Instance.Index.OpenInMR') }}
<ExternalIcon />
</template>
<template #copy_names>
<EditIcon />{{ t('Instance.Index.CopyNames') }}
</template>
<template #copy_slugs>
<HashIcon />{{ t('Instance.Index.CopySlugs') }}
</template>
<template #copy_links>
<GlobeIcon />{{ t('Instance.Index.CopyLinks') }}
</template>
<template #toggle>
<EditIcon />{{ t('Instance.Index.ToggleSelected') }}
</template>
<template #disable>
<XIcon />{{ t('Instance.Index.DisableSelected') }}
</template>
<template #enable>
<CheckCircleIcon />{{ t('Instance.Index.EnableSelected') }}
</template>
<template #hide_show>
<EyeIcon />{{ t('Instance.Index.ShowHideUnSelected') }}
</template>
<template #update_all>
<UpdatedIcon />{{ t('Instance.Index.Update') }} {{ selected.length > 0 ? 'selected' : 'all' }}
</template>
<template #filter_update>
<UpdatedIcon />{{ t('Instance.Index.SelectUpdatable') }}
</template>
</ContextMenu>
</template>
<script setup>
Expand Down Expand Up @@ -271,19 +276,19 @@ const handleRightClick = (event) => {
instance.value,
playing.value
? [
{
name: 'stop',
color: 'danger',
},
...baseOptions,
]
{
name: 'stop',
color: 'danger',
},
...baseOptions,
]
: [
{
name: 'play',
color: 'primary',
},
...baseOptions,
],
{
name: 'play',
color: 'primary',
},
...baseOptions,
],
)
}
Expand Down Expand Up @@ -312,6 +317,20 @@ const handleOptionsClick = async (args) => {
case 'copy_path':
await navigator.clipboard.writeText(instance.value.path)
break
case "open_link":
window.__TAURI_INVOKE__('tauri', {
__tauriModule: 'Shell',
message: {
cmd: 'open',
path: args.item.link
}
})
break;
case "copy_link":
navigator.clipboard.writeText(
args.item.link
)
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion theseus_gui/src/pages/instance/Mods.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
<TrashIcon />
</Button>
</div>
<AnimatedLogo v-if="mod.updating" class="btn icon-only updating-indicator"></AnimatedLogo>
<AnimatedLogo v-if="mod.updating" class="btn icon-only loading-indicator" ></AnimatedLogo>
<div
v-else
v-tooltip="isPackLocked ? t('Instance.Mods.UnlockThisInstanceUpdate') : t('Instance.Mods.UpdateProject')"
Expand Down

0 comments on commit 58cd0f4

Please sign in to comment.