mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39:12 +00:00
Show file type icons for each indexed file in config card of web app
This commit is contained in:
@@ -209,16 +209,20 @@
|
|||||||
border: none;
|
border: none;
|
||||||
color: var(--flower);
|
color: var(--flower);
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
width: 32px;
|
||||||
|
margin-bottom: 0px
|
||||||
}
|
}
|
||||||
|
|
||||||
div.file-element {
|
div.file-element {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr auto;
|
grid-template-columns: 1fr 5fr 1fr;
|
||||||
border: 1px solid rgb(229, 229, 229);
|
border: 1px solid rgb(229, 229, 229);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.1),0px 1px 2px -1px rgba(0,0,0,0.8);
|
box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.1),0px 1px 2px -1px rgba(0,0,0,0.8);
|
||||||
padding: 4px;
|
padding: 4px 0;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
|
justify-items: center;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.remove-button-container {
|
div.remove-button-container {
|
||||||
|
|||||||
@@ -23,6 +23,12 @@
|
|||||||
#desktop-client {
|
#desktop-client {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
.indexed-files {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.content-name {
|
||||||
|
font-size: smaller;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
function removeFile(path) {
|
function removeFile(path) {
|
||||||
@@ -59,6 +65,22 @@
|
|||||||
let fileElement = document.createElement("div");
|
let fileElement = document.createElement("div");
|
||||||
fileElement.classList.add("file-element");
|
fileElement.classList.add("file-element");
|
||||||
|
|
||||||
|
let fileExtension = filename.split('.').pop();
|
||||||
|
if (fileExtension === "org")
|
||||||
|
image_name = "org.svg"
|
||||||
|
else if (fileExtension === "pdf")
|
||||||
|
image_name = "pdf.svg"
|
||||||
|
else if (fileExtension === "markdown" || fileExtension === "md")
|
||||||
|
image_name = "markdown.svg"
|
||||||
|
else
|
||||||
|
image_name = "plaintext.svg"
|
||||||
|
|
||||||
|
let fileIconElement = document.createElement("img");
|
||||||
|
fileIconElement.classList.add("card-icon");
|
||||||
|
fileIconElement.src = `/static/assets/icons/${image_name}`;
|
||||||
|
fileIconElement.alt = "File";
|
||||||
|
fileElement.appendChild(fileIconElement);
|
||||||
|
|
||||||
let fileNameElement = document.createElement("div");
|
let fileNameElement = document.createElement("div");
|
||||||
fileNameElement.classList.add("content-name");
|
fileNameElement.classList.add("content-name");
|
||||||
fileNameElement.innerHTML = filename;
|
fileNameElement.innerHTML = filename;
|
||||||
|
|||||||
Reference in New Issue
Block a user