Folder names (#318)

This commit is contained in:
Wyatt Verchere
2023-07-21 20:16:07 -07:00
committed by GitHub
parent 4941260805
commit 3fa33dc241
42 changed files with 1129 additions and 535 deletions

View File

@@ -69,14 +69,12 @@ const exportPack = async () => {
}
})
})
console.log(filesToExport)
const outputPath = await open({
directory: true,
multiple: false,
})
if (outputPath) {
console.log(outputPath)
export_profile_mrpack(
props.instance.path,
outputPath + `/${nameInput.value} ${versionInput.value}.mrpack`,

View File

@@ -18,14 +18,13 @@ import {
get,
list,
} from '@/helpers/profile'
import { tauri } from '@tauri-apps/api'
import { open } from '@tauri-apps/api/dialog'
import { convertFileSrc } from '@tauri-apps/api/tauri'
import { create } from '@/helpers/profile'
import { installVersionDependencies } from '@/helpers/utils'
import { handleError } from '@/store/notifications.js'
import mixpanel from 'mixpanel-browser'
import { useTheming } from '@/store/theme.js'
import { tauri } from '@tauri-apps/api'
const themeStore = useTheming()
@@ -227,7 +226,7 @@ const check_valid = computed(() => {
!profile.metadata.icon ||
(profile.metadata.icon && profile.metadata.icon.startsWith('http'))
? profile.metadata.icon
: convertFileSrc(profile.metadata?.icon)
: tauri.convertFileSrc(profile.metadata?.icon)
"
class="profile-image"
/>

View File

@@ -37,3 +37,9 @@ export async function get() {
export async function set(settings) {
return await invoke('plugin:settings|settings_set', { settings })
}
// Changes the config dir
// Seizes the entire application state until its done
export async function change_config_dir(newConfigDir) {
return await invoke('plugin:settings|settings_change_config_dir', { newConfigDir })
}

View File

@@ -147,13 +147,13 @@ import {
import { process_listener, profile_listener } from '@/helpers/events'
import { useRoute, useRouter } from 'vue-router'
import { ref, onUnmounted } from 'vue'
import { convertFileSrc } from '@tauri-apps/api/tauri'
import { handleError, useBreadcrumbs, useLoading } from '@/store/state'
import { showInFolder } from '@/helpers/utils.js'
import ContextMenu from '@/components/ui/ContextMenu.vue'
import mixpanel from 'mixpanel-browser'
import { PackageIcon } from '@/assets/icons/index.js'
import ExportModal from '@/components/ui/ExportModal.vue'
import { convertFileSrc } from '@tauri-apps/api/tauri'
const route = useRoute()
@@ -278,6 +278,12 @@ const handleOptionsClick = async (args) => {
const unlistenProfiles = await profile_listener(async (event) => {
if (event.path === route.params.id) {
if (event.event === 'removed') {
await router.push({
path: '/',
})
return
}
instance.value = await get(route.params.id).catch(handleError)
}
})

View File

@@ -107,7 +107,7 @@ async function getLiveLog() {
}
async function getLogs() {
return (await get_logs(props.instance.uuid, true).catch(handleError)).reverse().map((log) => {
return (await get_logs(props.instance.path, true).catch(handleError)).reverse().map((log) => {
log.name = dayjs(
log.datetime_string.slice(0, 8) + 'T' + log.datetime_string.slice(9)
).calendar()
@@ -149,7 +149,7 @@ watch(selectedLogIndex, async (newIndex) => {
if (logs.value.length > 1 && newIndex !== 0) {
logs.value[newIndex].stdout = 'Loading...'
logs.value[newIndex].stdout = await get_output_by_datetime(
props.instance.uuid,
props.instance.path,
logs.value[newIndex].datetime_string
).catch(handleError)
}
@@ -164,7 +164,7 @@ const deleteLog = async () => {
let deleteIndex = selectedLogIndex.value
selectedLogIndex.value = deleteIndex - 1
await delete_logs_by_datetime(
props.instance.uuid,
props.instance.path,
logs.value[deleteIndex].datetime_string
).catch(handleError)
await setLogs()

View File

@@ -331,7 +331,6 @@ import {
CodeIcon,
} from 'omorphia'
import { computed, ref, watch } from 'vue'
import { convertFileSrc } from '@tauri-apps/api/tauri'
import { useRouter } from 'vue-router'
import {
add_project_from_path,
@@ -345,6 +344,7 @@ import { handleError } from '@/store/notifications.js'
import mixpanel from 'mixpanel-browser'
import { open } from '@tauri-apps/api/dialog'
import { listen } from '@tauri-apps/api/event'
import { convertFileSrc } from '@tauri-apps/api/tauri'
import { showInFolder } from '@/helpers/utils.js'
import { MenuIcon, ToggleIcon, TextInputIcon, AddProjectImage } from '@/assets/icons'