bfg-common 1.3.471 → 1.3.472

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.471",
4
+ "version": "1.3.472",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -1,43 +1,45 @@
1
- import {
2
- UI_E_RecentTaskStatus,
3
- UI_E_IconNameByRecentTaskStatus,
4
- } from '~/lib/models/store/tasks/enums'
5
- import type {
6
- API_UI_I_RecentTask,
7
- UI_I_RecentTask,
8
- } from '~/lib/models/store/tasks/interfaces'
9
-
10
- export const recentTasks = (
11
- data: API_UI_I_RecentTask<string>
12
- ): UI_I_RecentTask<string> => {
13
- const items =
14
- data.items
15
- ?.sort((a, b) => {
16
- return b.start_time - a.start_time
17
- })
18
- .map((task) => {
19
- return {
20
- completion: task.completion + '' || '-',
21
- queuedFor: task.creation_time - task.start_time,
22
- execution: Math.abs(task.start_time - task.completion),
23
- details: task.details,
24
- error: task.error,
25
- initiator: task.initiator,
26
- server: task.server,
27
- startTime: task.start_time + '' || '-',
28
- statusIcon: UI_E_IconNameByRecentTaskStatus[task.status],
29
- statusText: task.error || UI_E_RecentTaskStatus[task.status],
30
- status: task.status,
31
- target: task.target,
32
- targetType: task.target_type,
33
- taskName: task.task_name,
34
- id: task.id,
35
- zone: task.zone,
36
- extra: task.extra,
37
- }
38
- }) || []
39
- return {
40
- items,
41
- last: data.last,
42
- }
43
- }
1
+ import {
2
+ UI_E_RecentTaskStatus,
3
+ UI_E_IconNameByRecentTaskStatus,
4
+ } from '~/lib/models/store/tasks/enums'
5
+ import type {
6
+ API_UI_I_RecentTask,
7
+ UI_I_RecentTask,
8
+ } from '~/lib/models/store/tasks/interfaces'
9
+ import { base64 } from '~/lib/utils/base64'
10
+
11
+ export const recentTasks = (
12
+ data: API_UI_I_RecentTask<string>
13
+ ): UI_I_RecentTask<string> => {
14
+ const items =
15
+ data.items
16
+ ?.sort((a, b) => {
17
+ return b.start_time - a.start_time
18
+ })
19
+ .map((task) => {
20
+ return {
21
+ args: base64.decode(task.args),
22
+ completion: task.completion + '' || '-',
23
+ queuedFor: task.creation_time - task.start_time,
24
+ execution: Math.abs(task.start_time - task.completion),
25
+ details: task.details,
26
+ error: task.error,
27
+ initiator: task.initiator,
28
+ server: task.server,
29
+ startTime: task.start_time + '' || '-',
30
+ statusIcon: UI_E_IconNameByRecentTaskStatus[task.status],
31
+ statusText: task.error || UI_E_RecentTaskStatus[task.status],
32
+ status: task.status,
33
+ target: task.target,
34
+ targetType: task.target_type,
35
+ taskName: task.task_name,
36
+ id: task.id,
37
+ zone: task.zone,
38
+ extra: task.extra,
39
+ }
40
+ }) || []
41
+ return {
42
+ items,
43
+ last: data.last,
44
+ }
45
+ }