add security icons

This commit is contained in:
2023-09-29 11:10:08 +10:00
parent 35ccb03c2b
commit 5d8a5ede7d

View File

@@ -12,10 +12,21 @@
class="w-full border-1 rounded-2 bg-white text-sm mt-2">
<tbody>
<tr v-for="file of fileList" :key="file.id">
<td class="py-2 pl-2 hidden sm:block">
<td class="py-2 pl-2 hidden sm:block relative">
<img
:src="getFileIconImagePath(file.name || file.title)"
class="h-10 text-center" />
<div
v-if="file.security_type != ''"
class="absolute right--1 top-0 h-4 w-4">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24">
<title>locked</title>
<path
d="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z" />
</svg>
</div>
</td>
<td class="pl-2 py-4 w-full">
<a :href="file.url" target="_blank">{{
@@ -23,7 +34,7 @@
}}</a>
</td>
<td class="pr-2">
<a :href="file.url + '?download=1'"
<a :href="file.url"
><svg
viewBox="0 0 24 24"
fill="none"
@@ -83,8 +94,6 @@ import { openDialog } from "../components/SMDialog";
import SMDialogMedia from "./dialogs/SMDialogMedia.vue";
import { Media } from "../helpers/api.types";
import { onMounted, ref, watch } from "vue";
import { ImportMetaExtras } from "../../../import-meta";
import { strCaseCmp } from "../helpers/string";
import { mediaGetWebURL } from "../helpers/media";
const emits = defineEmits(["update:modelValue"]);
@@ -109,6 +118,7 @@ const fileList = ref([]);
const handleClickAdd = async () => {
if (props.showEditor) {
let result = await openDialog(SMDialogMedia, {
initial: fileList.value,
mime: "",
accepts: "",
allowUpload: true,
@@ -158,6 +168,7 @@ const updateFileList = (newFileList: Array<Media>) => {
fileList.value = [];
for (const mediaItem of newFileList) {
console.log(mediaItem.url);
mediaItem.url = mediaGetWebURL(mediaItem);
if (mediaItem.url != "") {
fileList.value.push(mediaItem);