stash
This commit is contained in:
parent
0b46fb152c
commit
a7515d366c
3 changed files with 8 additions and 17 deletions
|
@ -1,11 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<img :src="image_data" :alt="owner + '/' + src"/>
|
||||||
<!--img src=""-->
|
|
||||||
data:{{ image_data }}<br>
|
|
||||||
owner:{{ owner }}<br>
|
|
||||||
src:{{ src }}<br>
|
|
||||||
servers:{{ servers }}
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@ -46,7 +40,9 @@ export default {
|
||||||
async mounted() {
|
async mounted() {
|
||||||
try {
|
try {
|
||||||
this.servers = await this.getFriendServers({username: this.owner});
|
this.servers = await this.getFriendServers({username: this.owner});
|
||||||
this.image_data = await this.servers.get(this.signAuth, this.src);
|
const response = await this.servers.getRaw(this.signAuth, this.src);
|
||||||
|
const mime_type = response.headers.get("content-type");
|
||||||
|
this.image_data = "data:" + mime_type + ";base64," + btoa(String.fromCharCode(...new Uint8Array(await response.arrayBuffer())));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,14 +34,9 @@
|
||||||
</div-->
|
</div-->
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="image" class="form-label">Image</label>
|
<label for="image" class="form-label">Image</label>
|
||||||
<div>
|
|
||||||
<img v-for="file in files" :key="file.id" :alt="file.name"
|
|
||||||
:src="'https://toolshed.j3d1.de'+file.name" class="img-thumbnail border-info">
|
|
||||||
<!-- TODO replace dirty hack with proper solution -->
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<authenticated-image v-for="file in files" :key="file.id" :src="file.name"
|
<authenticated-image v-for="file in files" :key="file.id" :src="file.name"
|
||||||
:owner="file.owner"></authenticated-image>
|
:owner="file.owner" class="img-thumbnail border-info"></authenticated-image>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -22,8 +22,8 @@ export default defineConfig({
|
||||||
'Content-Security-Policy': 'default-src \'self\';'
|
'Content-Security-Policy': 'default-src \'self\';'
|
||||||
+ ' script-src \'self\' \'wasm-unsafe-eval\';'
|
+ ' script-src \'self\' \'wasm-unsafe-eval\';'
|
||||||
+ ' style-src \'self\' \'unsafe-inline\';'
|
+ ' style-src \'self\' \'unsafe-inline\';'
|
||||||
+ ' img-src \'self\' data:; '
|
+ ' img-src \'self\' https://* data:;'
|
||||||
+ ' connect-src * data:', // TODO: change * to https://* for production (probably in nginx config not here)
|
+ ' connect-src * data:', // TODO: change * to https://* for production
|
||||||
},
|
},
|
||||||
/*https: {
|
/*https: {
|
||||||
key: fs.readFileSync('privkey.pem'),
|
key: fs.readFileSync('privkey.pem'),
|
||||||
|
@ -52,7 +52,7 @@ export default defineConfig({
|
||||||
'^/livereload/': {
|
'^/livereload/': {
|
||||||
target: "http://127.0.0.1:8080/",
|
target: "http://127.0.0.1:8080/",
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
test: {
|
test: {
|
||||||
include: ['src/tests/**/*.js'],
|
include: ['src/tests/**/*.js'],
|
||||||
|
|
Loading…
Reference in a new issue