mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
[CodeFactor] Apply fixes to commit 8d62550
This commit is contained in:
parent
8d62550775
commit
1f38267626
3 changed files with 40 additions and 21 deletions
|
@ -2,11 +2,23 @@
|
||||||
<div class="row justify-content-start mb-2">
|
<div class="row justify-content-start mb-2">
|
||||||
<div :class="messageWidthClass">
|
<div :class="messageWidthClass">
|
||||||
<div class="card bg-light border-0 text-dark">
|
<div class="card bg-light border-0 text-dark">
|
||||||
|
<div
|
||||||
<div v-for="attachment in message.attachments" :key="attachment.id" class="card-header">
|
v-for="attachment in message.attachments"
|
||||||
|
:key="attachment.id"
|
||||||
|
class="card-header"
|
||||||
|
>
|
||||||
<div class="btn-group w-100" role="group">
|
<div class="btn-group w-100" role="group">
|
||||||
<button class="btn btn-light text-truncate" disabled>{{ attachment.name }}</button>
|
<button class="btn btn-light text-truncate" disabled>
|
||||||
<button @click="downloadAttachment(attachment.hash_sha512, attachment.name)" class="btn btn-light w-25"><i class="bi bi-download strong"></i></button>
|
{{ attachment.name }}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
@click="
|
||||||
|
downloadAttachment(attachment.hash_sha512, attachment.name)
|
||||||
|
"
|
||||||
|
class="btn btn-light w-25"
|
||||||
|
>
|
||||||
|
<i class="bi bi-download strong"></i>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -33,8 +45,6 @@
|
||||||
<i class="bi bi-info-circle"></i>
|
<i class="bi bi-info-circle"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<button class="btn btn-outline-secondary border-0" @click="deleteMessage">
|
<button class="btn btn-outline-secondary border-0" @click="deleteMessage">
|
||||||
<i class="bi bi-trash"></i>
|
<i class="bi bi-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
|
@ -92,7 +102,7 @@ export default {
|
||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
|
|
||||||
// Creating a temporary anchor element to download the file
|
// Creating a temporary anchor element to download the file
|
||||||
const anchor = document.createElement('a');
|
const anchor = document.createElement("a");
|
||||||
anchor.href = url;
|
anchor.href = url;
|
||||||
anchor.download = fileName;
|
anchor.download = fileName;
|
||||||
document.body.appendChild(anchor);
|
document.body.appendChild(anchor);
|
||||||
|
@ -107,7 +117,6 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
||||||
messageWidthClass() {
|
messageWidthClass() {
|
||||||
// Calculate a Bootstrap grid class based on message length
|
// Calculate a Bootstrap grid class based on message length
|
||||||
// Adjust the logic as needed to fit your requirements
|
// Adjust the logic as needed to fit your requirements
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
<div class="row justify-content-end mb-2">
|
<div class="row justify-content-end mb-2">
|
||||||
<!-- control area -->
|
<!-- control area -->
|
||||||
<div class="col-auto p-0 m-0">
|
<div class="col-auto p-0 m-0">
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="btn btn-outline-secondary border-0 me-1"
|
class="btn btn-outline-secondary border-0 me-1"
|
||||||
@click="repeatMessage"
|
@click="repeatMessage"
|
||||||
|
@ -27,15 +26,26 @@
|
||||||
<!-- message area -->
|
<!-- message area -->
|
||||||
<div :class="messageWidthClass">
|
<div :class="messageWidthClass">
|
||||||
<div class="card bg-secondary text-white">
|
<div class="card bg-secondary text-white">
|
||||||
<div v-for="attachment in message.attachments" :key="attachment.id" class="card-header">
|
<div
|
||||||
|
v-for="attachment in message.attachments"
|
||||||
|
:key="attachment.id"
|
||||||
|
class="card-header"
|
||||||
|
>
|
||||||
<div class="btn-group w-100" role="group">
|
<div class="btn-group w-100" role="group">
|
||||||
<button class="btn btn-light text-truncate" disabled>{{ attachment.name }}</button>
|
<button class="btn btn-light text-truncate" disabled>
|
||||||
<button @click="downloadAttachment(attachment.hash_sha512, attachment.name)" class="btn btn-light w-25"><i class="bi bi-download strong"></i></button>
|
{{ attachment.name }}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
@click="
|
||||||
|
downloadAttachment(attachment.hash_sha512, attachment.name)
|
||||||
|
"
|
||||||
|
class="btn btn-light w-25"
|
||||||
|
>
|
||||||
|
<i class="bi bi-download strong"></i>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p class="card-text">{{ message.body }}</p>
|
<p class="card-text">{{ message.body }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -137,7 +147,7 @@ export default {
|
||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
|
|
||||||
// Creating a temporary anchor element to download the file
|
// Creating a temporary anchor element to download the file
|
||||||
const anchor = document.createElement('a');
|
const anchor = document.createElement("a");
|
||||||
anchor.href = url;
|
anchor.href = url;
|
||||||
anchor.download = fileName;
|
anchor.download = fileName;
|
||||||
document.body.appendChild(anchor);
|
document.body.appendChild(anchor);
|
||||||
|
|
|
@ -78,7 +78,7 @@ function createSortedMessagesList(data: {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function newMessage(dxcall, body, attachments) {
|
export function newMessage(dxcall, body, attachments) {
|
||||||
console.log(attachments)
|
console.log(attachments);
|
||||||
sendFreedataMessage(dxcall, body, attachments);
|
sendFreedataMessage(dxcall, body, attachments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,5 +102,5 @@ export function requestMessageInfo(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getMessageAttachment(data_sha512) {
|
export async function getMessageAttachment(data_sha512) {
|
||||||
return await getFreedataAttachmentBySha512(data_sha512)
|
return await getFreedataAttachmentBySha512(data_sha512);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue