-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
322f58f
commit 533e9e0
Showing
25 changed files
with
651 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<template> | ||
<BrowseFile | ||
v-if="props.file.type === 'File'" | ||
:file="props.file.value as RawFile" | ||
:currentPath="props.currentPath" | ||
:repository="props.repository" /> | ||
<BrowseFolder | ||
v-else-if="props.file.type === 'Directory'" | ||
:file="props.file.value as RawDirectory" | ||
:currentPath="props.currentPath" | ||
:repository="props.repository" /> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { apiURL } from '@/config' | ||
import router from '@/router' | ||
import { fixCurrentPath, type RawBrowseFile, type RawDirectory, type RawFile } from '@/types/browse' | ||
import { createRepositoryRoute, type RepositoryWithStorageName } from '@/types/repository' | ||
import { computed, type PropType } from 'vue' | ||
import BrowseFolder from './BrowseFolder.vue' | ||
import BrowseFile from './BrowseFile.vue' | ||
const props = defineProps({ | ||
file: { | ||
type: Object as PropType<RawBrowseFile>, | ||
required: true | ||
}, | ||
currentPath: { | ||
type: String, | ||
required: true | ||
}, | ||
repository: { | ||
type: Object as PropType<RepositoryWithStorageName>, | ||
required: true | ||
} | ||
}) | ||
console.log(props.file) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<template> | ||
<div @click="click" class="browseItem" data-type="file"> | ||
<div class="itemAndName"> | ||
<font-awesome-icon :icon="fileIcon" /> | ||
{{ props.file.name }} | ||
</div> | ||
|
||
<div> | ||
{{ props.file.modified }} | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { apiURL } from '@/config' | ||
import router from '@/router' | ||
import { fixCurrentPath, type RawBrowseFile, type RawFile } from '@/types/browse' | ||
import { createRepositoryRoute, type RepositoryWithStorageName } from '@/types/repository' | ||
import { computed, type PropType } from 'vue' | ||
import './browse.scss' | ||
const props = defineProps({ | ||
file: { | ||
type: Object as PropType<RawFile>, | ||
required: true | ||
}, | ||
currentPath: { | ||
type: String, | ||
required: true | ||
}, | ||
repository: { | ||
type: Object as PropType<RepositoryWithStorageName>, | ||
required: true | ||
} | ||
}) | ||
const fixedPath = fixCurrentPath(props.currentPath) | ||
const repositoryURL = createRepositoryRoute(props.repository, `${fixedPath}/${props.file.name}`) | ||
const fileIcon = computed(() => { | ||
// TODO: More icons | ||
return 'fa-solid fa-file' | ||
}) | ||
function click() { | ||
window.open(repositoryURL, '_blank') | ||
} | ||
</script> |
Oops, something went wrong.