2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 03:29:00 +00:00

fix(ux): show dbPath in the DatabaseSelector

- set lighter colour for disabled input
- if readonly not tabable
This commit is contained in:
18alantom 2023-03-16 10:48:28 +05:30
parent 708d172f7c
commit f484c2b4aa

View File

@ -72,6 +72,7 @@
v-for="(file, i) in files" v-for="(file, i) in files"
:key="file.dbPath" :key="file.dbPath"
@click="selectFile(file)" @click="selectFile(file)"
:title="t`${file.companyName} stored at ${file.dbPath}`"
> >
<div <div
class=" class="
@ -91,19 +92,24 @@
{{ i + 1 }} {{ i + 1 }}
</div> </div>
<div class="w-full"> <div class="w-full">
<p class="font-medium"> <div class="flex justify-between overflow-x-auto items-baseline">
{{ file.companyName }} <h2 class="font-medium">
</p> {{ file.companyName }}
<div </h2>
class="text-sm text-gray-600 flex justify-between overflow-x-auto" <p class="whitespace-nowrap text-sm text-gray-600">
>
<p class="whitespace-nowrap me-2">
{{ formatDate(file.modified) }} {{ formatDate(file.modified) }}
</p> </p>
<p class="text-end" v-if="fyo.store.isDevelopment">
{{ file.dbPath }}
</p>
</div> </div>
<p
class="
text-sm text-gray-600
overflow-x-auto
no-scrollbar
whitespace-nowrap
"
>
{{ truncate(file.dbPath) }}
</p>
</div> </div>
<button <button
class=" class="
@ -244,6 +250,13 @@ export default {
} }
}, },
methods: { methods: {
truncate(value) {
if (value.length < 72) {
return value;
}
return '...' + value.slice(value.length - 72);
},
formatDate(isoDate) { formatDate(isoDate) {
return DateTime.fromISO(isoDate).toRelative(); return DateTime.fromISO(isoDate).toRelative();
}, },