Bugs again (#703)

* initial

* more fixes

* logs

* more fixes

* working rescuer

* minor log display fix

* mac fixes

* minor fix

* libsselinux1

* linux error

* actions test

* more bugs. Modpack page! BIG changes

* changed minimum 64 -> 8

* removed modpack page moved to modal

* removed unnecessary css

* mac compile

* many revs

* Merge colorful logs (#725)

* make implementation not dumb

* run prettier

* null -> true

* Add line numbers & make errors more robust.

* improvments

* changes; virtual scroll

---------

Co-authored-by: qtchaos <72168435+qtchaos@users.noreply.github.com>

* omorphia colors, comments fix

* fixes; _JAVA_OPTIONS

* revs

* mac specific

* more mac

* some fixes

* quick fix

* add java reinstall option

---------

Co-authored-by: qtchaos <72168435+qtchaos@users.noreply.github.com>
Co-authored-by: Jai A <jaiagr+gpg@pm.me>
This commit is contained in:
Wyatt Verchere
2023-09-12 09:27:03 -07:00
committed by GitHub
parent bc02192d80
commit 1e8852b540
63 changed files with 2677 additions and 719 deletions

View File

@@ -26,21 +26,25 @@
</div>
</div>
<Button
v-if="isPackLinked"
v-tooltip="'Modpack is up to date'"
:disabled="updatingModpack || !canUpdatePack"
v-if="canUpdatePack"
:disabled="installing"
color="secondary"
@click="updateModpack"
@click="modpackVersionModal.show()"
>
<UpdatedIcon />
{{ updatingModpack ? 'Updating' : 'Update modpack' }}
{{ installing ? 'Updating' : 'Update modpack' }}
</Button>
<Button v-else @click="exportModal.show()">
<Button v-else-if="!isPackLocked" @click="exportModal.show()">
<PackageIcon />
Export modpack
</Button>
<Button v-if="!isPackLocked && projects.some((m) => m.outdated)" @click="updateAll">
<UpdatedIcon />
Update all
</Button>
<DropdownButton
v-if="!isPackLinked"
v-if="!isPackLocked"
:options="['search', 'from_file']"
default-value="search"
name="add-content-dropdown"
@@ -107,9 +111,9 @@
<ShareIcon />
Share
</Button>
<div v-tooltip="isPackLinked ? 'Unpair this instance to remove mods' : ''">
<div v-tooltip="isPackLocked ? 'Unlock this instance to remove mods' : ''">
<Button
:disabled="isPackLinked"
:disabled="isPackLocked"
class="transparent trash"
@click="deleteWarning.show()"
@mouseover="selectedOption = 'Delete'"
@@ -118,20 +122,20 @@
Delete
</Button>
</div>
<div v-tooltip="isPackLinked ? 'Unpair this instance to update mods' : ''">
<div v-tooltip="isPackLocked ? 'Unlock this instance to update mods' : ''">
<Button
:disabled="isPackLinked || offline"
:disabled="isPackLocked || offline"
class="transparent update"
@click="updateAll()"
@click="updateSelected()"
@mouseover="selectedOption = 'Update'"
>
<UpdatedIcon />
Update
</Button>
</div>
<div v-tooltip="isPackLinked ? 'Unpair this instance to toggle mods' : ''">
<div v-tooltip="isPackLocked ? 'Unlock this instance to toggle mods' : ''">
<Button
:disabled="isPackLinked"
:disabled="isPackLocked"
class="transparent"
@click="toggleSelected()"
@mouseover="selectedOption = 'Toggle'"
@@ -232,21 +236,18 @@
<span v-tooltip="`${mod.version}`">{{ mod.version }}</span>
</div>
<div class="table-cell table-text manage">
<div v-tooltip="isPackLinked ? 'Unpair this instance to remove mods.' : ''">
<Button
v-tooltip="'Remove project'"
:disabled="isPackLinked"
icon-only
@click="removeMod(mod)"
>
<div v-tooltip="isPackLocked ? 'Unlock this instance to remove mods.' : 'Remove project'">
<Button :disabled="isPackLocked" icon-only @click="removeMod(mod)">
<TrashIcon />
</Button>
</div>
<AnimatedLogo v-if="mod.updating" class="btn icon-only updating-indicator"></AnimatedLogo>
<div v-tooltip="isPackLinked ? 'Unpair this instance to update mods.' : ''">
<div
v-else
v-tooltip="isPackLocked ? 'Unlock this instance to update mods.' : 'Update project'"
>
<Button
v-tooltip="'Update project'"
:disabled="!mod.outdated || offline || isPackLinked"
:disabled="!mod.outdated || offline || isPackLocked"
icon-only
@click="updateProject(mod)"
>
@@ -254,10 +255,10 @@
<CheckIcon v-else />
</Button>
</div>
<div v-tooltip="isPackLinked ? 'Unpair this instance to toggle mods.' : ''">
<div v-tooltip="isPackLocked ? 'Unlock this instance to toggle mods.' : ''">
<input
id="switch-1"
:disabled="isPackLinked"
:disabled="isPackLocked"
autocomplete="off"
type="checkbox"
class="switch stylized-toggle"
@@ -268,7 +269,7 @@
<Button
v-tooltip="`Show ${mod.file_name}`"
icon-only
@click="showProfileInFolder(mod.path)"
@click="highlightModInProfile(instance.path, mod.path)"
>
<FolderOpenIcon />
</Button>
@@ -301,6 +302,14 @@
</DropdownButton>
</div>
</div>
<Pagination
v-if="projects.length > 0"
:page="currentPage"
:count="Math.ceil(search.length / 20)"
class="pagination-after"
:link-function="(page) => `?page=${page}`"
@switch-page="switchPage"
/>
<Modal ref="deleteWarning" header="Are you sure?">
<div class="modal-body">
<div class="markdown-body">
@@ -349,6 +358,12 @@
share-text="Check out the projects I'm using in my modpack!"
/>
<ExportModal v-if="projects.length > 0" ref="exportModal" :instance="instance" />
<ModpackVersionModal
v-if="instance.metadata.linked_data"
ref="modpackVersionModal"
:instance="instance"
:versions="props.versions"
/>
</template>
<script setup>
import {
@@ -385,7 +400,6 @@ import {
remove_project,
toggle_disable_project,
update_all,
update_managed_modrinth,
update_project,
} from '@/helpers/profile.js'
import { handleError } from '@/store/notifications.js'
@@ -393,9 +407,10 @@ import { mixpanel_track } from '@/helpers/mixpanel'
import { open } from '@tauri-apps/api/dialog'
import { listen } from '@tauri-apps/api/event'
import { convertFileSrc } from '@tauri-apps/api/tauri'
import { showProfileInFolder } from '@/helpers/utils.js'
import { highlightModInProfile } from '@/helpers/utils.js'
import { MenuIcon, ToggleIcon, TextInputIcon, AddProjectImage, PackageIcon } from '@/assets/icons'
import ExportModal from '@/components/ui/ExportModal.vue'
import ModpackVersionModal from '@/components/ui/ModpackVersionModal.vue'
const router = useRouter()
@@ -418,20 +433,24 @@ const props = defineProps({
return false
},
},
versions: {
type: Array,
required: true,
},
})
const projects = ref([])
const selectionMap = ref(new Map())
const showingOptions = ref(false)
const isPackLinked = computed(() => {
return props.instance.metadata.linked_data
const isPackLocked = computed(() => {
return props.instance.metadata.linked_data && props.instance.metadata.linked_data.locked
})
const canUpdatePack = computed(() => {
if (!props.instance.metadata.linked_data) return false
return props.instance.metadata.linked_data.version_id !== props.instance.modrinth_update_version
})
const exportModal = ref(null)
console.log(props.instance)
const initProjects = (initInstance) => {
projects.value = []
if (!initInstance || !initInstance.projects) return
@@ -508,6 +527,9 @@ watch(
}
)
const modpackVersionModal = ref(null)
const installing = computed(() => props.instance.install_stage !== 'installed')
const searchFilter = ref('')
const selectAll = ref(false)
const selectedProjectType = ref('All')
@@ -661,6 +683,7 @@ const selectUpdatable = () => {
const updateProject = async (mod) => {
mod.updating = true
await new Promise((resolve) => setTimeout(resolve, 0))
mod.path = await update_project(props.instance.path, mod.path).catch(handleError)
mod.updating = false
@@ -779,6 +802,14 @@ const toggleSelected = async () => {
}
}
const updateSelected = async () => {
const promises = []
for (const project of functionValues.value) {
if (project.outdated) promises.push(updateProject(project))
}
await Promise.all(promises).catch(handleError)
}
const enableAll = async () => {
for (const project of functionValues.value) {
if (project.disabled) {
@@ -828,13 +859,6 @@ const handleContentOptionClick = async (args) => {
}
}
const updatingModpack = ref(false)
const updateModpack = async () => {
updatingModpack.value = true
await update_managed_modrinth(props.instance.path).catch(handleError)
updatingModpack.value = false
}
watch(selectAll, () => {
for (const [key, value] of Array.from(selectionMap.value)) {
if (value !== selectAll.value) {
@@ -1152,4 +1176,8 @@ onUnmounted(() => {
height: 2.5rem;
}
}
.pagination-after {
margin-bottom: 5rem;
}
</style>