แสดง ขนาดของไฟล์
This commit is contained in:
parent
319103d8e2
commit
9e44592a1e
2 changed files with 40 additions and 3 deletions
|
|
@ -28,6 +28,7 @@ const {
|
||||||
deleteBackUp,
|
deleteBackUp,
|
||||||
backupRunningList,
|
backupRunningList,
|
||||||
restoreRunningList,
|
restoreRunningList,
|
||||||
|
getSize,
|
||||||
} = useDataStore();
|
} = useDataStore();
|
||||||
const storeData = useDataStore();
|
const storeData = useDataStore();
|
||||||
const { dataBackUp, backupRunTotal, restoreRunTotal } = storeToRefs(storeData);
|
const { dataBackUp, backupRunTotal, restoreRunTotal } = storeToRefs(storeData);
|
||||||
|
|
@ -41,7 +42,13 @@ const tab = defineModel<string>("tab", { required: true });
|
||||||
* Table
|
* Table
|
||||||
*/
|
*/
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("");
|
||||||
const visibleColumns = ref<string[]>(["name", "createAt", "status"]);
|
const visibleColumns = ref<string[]>([
|
||||||
|
"name",
|
||||||
|
"createAt",
|
||||||
|
"databaseSize",
|
||||||
|
"storageSize",
|
||||||
|
"status",
|
||||||
|
]);
|
||||||
const baseColumns = ref<QTableProps["columns"]>([
|
const baseColumns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "name",
|
name: "name",
|
||||||
|
|
@ -63,6 +70,26 @@ const baseColumns = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "databaseSize",
|
||||||
|
align: "center",
|
||||||
|
label: "ขนาดของฐานข้อมูล ",
|
||||||
|
sortable: true,
|
||||||
|
// field: (v) => date2Thai(v, false, true),
|
||||||
|
field: "databaseSize",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "storageSize",
|
||||||
|
align: "center",
|
||||||
|
label: "ขนาดของไฟล์ ",
|
||||||
|
sortable: true,
|
||||||
|
// field: (v) => date2Thai(v, false, true),
|
||||||
|
field: "storageSize",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "status",
|
name: "status",
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|
@ -188,8 +215,16 @@ onMounted(async () => {
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
<q-td v-for="(col, i) in props.cols" :key="col.name" :props="props">
|
<q-td v-for="(col, i) in props.cols" :key="col.name" :props="props">
|
||||||
<div :class="{ 'text-center': i === 2 }">
|
<div :class="{ 'text-center': i === 4 }">
|
||||||
{{ i !== 2 ? col.value : col.value === "สำเร็จ" ? "สำเร็จ" : "" }}
|
{{
|
||||||
|
i !== 4 && i !== 2 && i !== 3
|
||||||
|
? col.value
|
||||||
|
: col.value === "สำเร็จ"
|
||||||
|
? "สำเร็จ"
|
||||||
|
: i === 2 || i === 3
|
||||||
|
? getSize(col.value)
|
||||||
|
: ""
|
||||||
|
}}
|
||||||
|
|
||||||
<q-circular-progress
|
<q-circular-progress
|
||||||
v-if="props.row.status === 'running' && col.name === 'status'"
|
v-if="props.row.status === 'running' && col.name === 'status'"
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ interface DataBackup {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
timestamp: Date;
|
timestamp: Date;
|
||||||
|
databaseSize: number;
|
||||||
|
storageSize: number;
|
||||||
status: string;
|
status: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue