diff --git a/web/app/src/components/JobsTable.vue b/web/app/src/components/JobsTable.vue index 0d9e94e0..26ed0dbf 100644 --- a/web/app/src/components/JobsTable.vue +++ b/web/app/src/components/JobsTable.vue @@ -11,6 +11,7 @@ import { TabulatorFull as Tabulator } from 'tabulator-tables'; import * as datetime from "@/datetime"; import * as API from '@/manager-api' +import { toTitleCase } from '@/strings'; import { apiClient } from '@/stores/api-query-count'; import JobActionsBar from '@/components/JobActionsBar.vue' @@ -29,7 +30,8 @@ export default { title: 'Status', field: 'status', sorter: 'string', formatter(cell, formatterParams) { // eslint-disable-line no-unused-vars const cellValue = cell.getData(); - return ''; + const label = toTitleCase(cellValue.status); + return ``; } }, { title: 'Name', field: 'name', sorter: 'string' }, diff --git a/web/app/src/components/TasksTable.vue b/web/app/src/components/TasksTable.vue index c186dc58..bc15d2fb 100644 --- a/web/app/src/components/TasksTable.vue +++ b/web/app/src/components/TasksTable.vue @@ -9,6 +9,7 @@ import { TabulatorFull as Tabulator } from 'tabulator-tables'; import * as datetime from "@/datetime"; import * as API from '@/manager-api' +import { toTitleCase } from '@/strings'; import { apiClient } from '@/stores/api-query-count'; import { useTasks } from '@/stores/tasks'; @@ -31,7 +32,8 @@ export default { title: 'Status', field: 'status', sorter: 'string', formatter(cell, formatterParams) { // eslint-disable-line no-unused-vars const cellValue = cell.getData(); - return ''; + const label = toTitleCase(cellValue.status); + return ``; } }, { title: 'Name', field: 'name', sorter: 'string' }, diff --git a/web/app/src/strings.js b/web/app/src/strings.js new file mode 100644 index 00000000..a2d68b21 --- /dev/null +++ b/web/app/src/strings.js @@ -0,0 +1,7 @@ +export function toTitleCase(str) { + return str + .toLowerCase() + .split(' ') + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) + .join(' '); +}