-
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
23 changed files
with
528 additions
and
372 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><title>Reposilite</title><link rel=icon href="data:;base64,iVBORw0KGgo="><link href="https://fonts.googleapis.com/css2?family=Manrope:wght@300;500&display=swap" rel=stylesheet><script src=https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js></script><script>window.REPOSILITE_BASE_PATH = '{{REPOSILITE.BASE_PATH}}' | ||
window.REPOSILITE_VUE_BASE_PATH = '{{REPOSILITE.VUE_BASE_PATH}}' | ||
window.REPOSILITE_MESSAGE = '{{REPOSILITE.MESSAGE}}'</script><link href={{REPOSILITE.VUE_BASE_PATH}}/js/app.js rel=preload as=script></head><body><noscript><strong>We're sorry but reposilite-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src={{REPOSILITE.VUE_BASE_PATH}}/js/app.js></script></body></html> | ||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><title>{{REPOSILITE.TITLE}}</title><meta name=description content={{REPOSILITE.DESCRIPTION}}><meta name=twitter:card content=summary><meta name=twitter:title content={{REPOSILITE.TITLE}}><meta name=twitter:description content={{REPOSILITE.DESCRIPTION}}><meta property=og:title content={{REPOSILITE.TITLE}}><meta property=og:site_name content={{REPOSILITE.TITLE}}><meta property=og:type content=website><meta property=og:description content={{REPOSILITE.DESCRIPTION}}><link rel=icon href="data:;base64,iVBORw0KGgo="><link href="https://fonts.googleapis.com/css2?family=Manrope:wght@300;500&display=swap" rel=stylesheet><script src=https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js></script><script>// don't assign placeholders to window | ||
if (!'{{REPOSILITE.BASE_PATH}}'.includes('REPOSILITE.BASE_PATH')) { | ||
window.REPOSILITE_BASE_PATH = '{{REPOSILITE.BASE_PATH}}' | ||
window.REPOSILITE_VUE_BASE_PATH = '{{REPOSILITE.VUE_BASE_PATH}}' | ||
window.REPOSILITE_TITLE = '{{REPOSILITE.TITLE}}' | ||
window.REPOSILITE_DESCRIPTION = '{{REPOSILITE.DESCRIPTION}}' | ||
window.REPOSILITE_ACCENT_COLOR = '{{REPOSILITE.ACCENT_COLOR}}' | ||
window.REPOSILITE_MESSAGE = '{{REPOSILITE.MESSAGE}}' | ||
}</script><link href={{REPOSILITE.VUE_BASE_PATH}}/js/app.js rel=preload as=script></head><body><noscript><strong>We're sorry but reposilite-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src={{REPOSILITE.VUE_BASE_PATH}}/js/app.js></script></body></html> |
Large diffs are not rendered by default.
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
83 changes: 83 additions & 0 deletions
83
reposilite-frontend/src/components/browser/FileBrowser.vue
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,83 @@ | ||
<template lang="pug"> | ||
.browser | ||
.flex.justify-between.py-4 | ||
h1.text-xl | ||
| Index of | ||
span.ml-2 | ||
span(v-for="(element, idx) in splitQualifier()") | ||
router-link(:to="pathFragmentUri(idx)") {{ element }} | ||
span / | ||
router-link(v-if="!isDashboard()" :to="'/dashboard' + this.qualifier") | ||
span.ml-3(:style="'color: ' + configuration.accentColor") | ||
i.fas.fa-feather-alt | ||
router-link(v-if="!isRoot()" :to='prefix + parentPath()') ← Back | ||
FileEntry( | ||
v-if="hasFiles()" | ||
v-for="file in response.files" | ||
:key="file.name" | ||
:prefix="prefix" | ||
:file="file" | ||
:auth="auth") | ||
h1(v-if="isEmpty()") Empty directory | ||
h1(v-if="!hasFiles()").font-bold {{ response.message }} | ||
notifications(group="index" position="center top") | ||
</template> | ||
|
||
<script> | ||
import Vue from 'vue' | ||
import FileEntry from './FileEntry' | ||
export default { | ||
props: { | ||
qualifier: String, | ||
prefix: String, | ||
auth: Object | ||
}, | ||
data () { | ||
return { | ||
configuration: Vue.prototype.$reposilite, | ||
response: [] | ||
} | ||
}, | ||
components: { | ||
FileEntry | ||
}, | ||
watch: { | ||
$route: { | ||
immediate: true, | ||
handler: function () { | ||
this.qualifier = this.getQualifier() | ||
this.api(this.qualifier, this.auth) | ||
.then(response => (this.response = response.data)) | ||
.catch(err => { | ||
this.$notify({ | ||
group: 'index', | ||
type: 'error', | ||
title: err.response.data.message | ||
}) | ||
}) | ||
} | ||
} | ||
}, | ||
methods: { | ||
pathFragmentUri (index) { | ||
return this.splitQualifier() | ||
.slice(0, index + 1) | ||
.join('/') | ||
}, | ||
hasFiles () { | ||
return this.response.files !== undefined | ||
}, | ||
isEmpty () { | ||
return this.hasFiles() && this.response.files.length === 0 | ||
}, | ||
isDashboard () { | ||
return this.prefix === '/dashboard' | ||
}, | ||
isRoot () { | ||
return this.qualifier === undefined || this.qualifier.length < 2 | ||
} | ||
} | ||
} | ||
</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
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
Oops, something went wrong.