minor file browser design update

This commit is contained in:
arabcoders 2025-03-29 20:23:27 +03:00
parent 43f4e85d7e
commit 0f4c7cedb1
3 changed files with 30 additions and 15 deletions

View file

@ -286,3 +286,7 @@ hr {
max-height: unset !important; max-height: unset !important;
width: unset !important; width: unset !important;
} }
.is-auto {
unicode-bidi: embed;
}

View file

@ -27,7 +27,7 @@
<NuxtLink class="button is-dark has-tooltip-bottom" to="/browser"> <NuxtLink class="button is-dark has-tooltip-bottom" to="/browser">
<span class="icon-text"> <span class="icon-text">
<span class="icon"><i class="fa-solid fa-folder-tree" /></span> <span class="icon"><i class="fa-solid fa-folder-tree" /></span>
<span class="is-hidden-mobile">Browser</span> <span class="is-hidden-mobile">Files</span>
</span> </span>
</NuxtLink> </NuxtLink>
</div> </div>

View file

@ -41,23 +41,19 @@
<thead> <thead>
<tr class="has-text-centered is-unselectable"> <tr class="has-text-centered is-unselectable">
<th width="5%">#</th> <th width="5%">#</th>
<th width="55%">Name</th> <th width="70%">Name</th>
<th width="10%">Size</th> <th width="10%">Size</th>
<th width="15%">Created</th> <th width="15%">Date</th>
<th width="15%">Modified</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="item in items" :key="item.path"> <tr v-for="item in items" :key="item.path">
<td class="has-text-centered is-vcentered"> <td class="has-text-centered is-vcentered user-hint" v-tooltip="item.name">
<span class="icon"> <span class="icon"><i class="fas fa-2x fa-solid" :class="setIcon(item)" /></span>
<i class="fas fa-solid"
:class="{ 'fa-file': 'file' === item.type, 'fa-folder': 'dir' === item.type }" />
</span>
</td> </td>
<td class="is-text-overflow is-vcentered"> <td class="is-text-overflow is-vcentered">
<div class="field is-grouped"> <div class="field is-grouped">
<div class="control is-text-overflow is-expanded" v-tooltip="item.name"> <div class="control is-text-overflow is-expanded">
<a :href="`/browser/${item.path}`" v-if="'dir' === item.type" <a :href="`/browser/${item.path}`" v-if="'dir' === item.type"
@click.prevent="reloadContent(item.path)"> @click.prevent="reloadContent(item.path)">
{{ item.name }} {{ item.name }}
@ -80,11 +76,6 @@
<td class="has-text-centered is-text-overflow is-unselectable"> <td class="has-text-centered is-text-overflow is-unselectable">
{{ 'file' === item.type ? formatBytes(item.size) : 'Dir' }} {{ 'file' === item.type ? formatBytes(item.size) : 'Dir' }}
</td> </td>
<td class="has-text-centered is-text-overflow is-unselectable">
<span :data-datetime="item.ctime" v-tooltip="moment(item.ctime).format('MMMM Do YYYY, h:mm:ss a')">
{{ moment(item.ctime).fromNow() }}
</span>
</td>
<td class="has-text-centered is-text-overflow is-unselectable"> <td class="has-text-centered is-text-overflow is-unselectable">
<span :data-datetime="item.mtime" v-tooltip="moment(item.mtime).format('MMMM Do YYYY, h:mm:ss a')"> <span :data-datetime="item.mtime" v-tooltip="moment(item.mtime).format('MMMM Do YYYY, h:mm:ss a')">
{{ moment(item.mtime).fromNow() }} {{ moment(item.mtime).fromNow() }}
@ -310,4 +301,24 @@ watch(model_item, v => {
document.querySelector('body').setAttribute("style", `opacity: ${v ? 1 : bg_opacity.value}`) document.querySelector('body').setAttribute("style", `opacity: ${v ? 1 : bg_opacity.value}`)
}) })
const setIcon = item => {
if ('dir' === item.content_type) {
return 'fa-folder'
}
if (['video', 'audio'].includes(item.content_type)) {
return 'fa-file-video'
}
if (['text', 'subtitle', 'metadata'].includes(item.content_type)) {
return 'fa-file-alt'
}
if (['image'].includes(item.content_type)) {
return 'fa-file-image'
}
return 'fa-file'
}
</script> </script>