bfg-common 1.4.637 → 1.4.639

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.
@@ -64,13 +64,16 @@
64
64
  @update-vm-clusters="emits('update-vm-clusters', $event)"
65
65
  @submit-preferences="emits('submit-preferences')"
66
66
  />
67
+
68
+ <common-layout-the-header-modals-reconnect />
69
+ <!-- <common-layout-the-header-modals-redirect-login />-->
67
70
  </template>
68
71
 
69
72
  <script setup lang="ts">
70
73
  import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
71
74
  import type { UI_T_Project } from '~/lib/models/types'
72
75
  import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
73
- import { checkIsTokenExpired } from '~/lib/utils/token'
76
+ // import { checkIsTokenExpired } from '~/lib/utils/token'
74
77
 
75
78
  const props = defineProps<{
76
79
  isShowMainMenu: boolean
@@ -114,7 +117,7 @@ const emits = defineEmits<{
114
117
  }>()
115
118
 
116
119
  const inactivityTimer = ref<NodeJS.Timeout | undefined>(undefined)
117
- const inactivityTimeout = ref<number>(20 * 60 * 1000)
120
+ const inactivityTimeout = ref<number>(10 * 60 * 1000)
118
121
 
119
122
  const startInactivityTimer = (): void => {
120
123
  inactivityTimer.value = setTimeout(() => {
@@ -125,17 +128,18 @@ const startInactivityTimer = (): void => {
125
128
  return
126
129
  }
127
130
 
128
- const expireTime =
129
- props.expireTimeFromState || useLocalStorage('accessTokenExpiredTime')
130
-
131
- const isExpiredToken = checkIsTokenExpired(expireTime)
132
-
133
- isExpiredToken && emits('show-redirect-login-modal', true)
134
-
135
- if (!isExpiredToken) {
136
- emits('show-reconnect-modal', true)
137
- startInactivityTimer()
138
- }
131
+ // const expireTime =
132
+ // props.expireTimeFromState || useCookie('token-expired-time')
133
+ //
134
+ // const isExpiredToken = checkIsTokenExpired(expireTime)
135
+ //
136
+ //
137
+ // isExpiredToken && emits('show-redirect-login-modal', true)
138
+ //
139
+ // if (!isExpiredToken) {
140
+ emits('show-reconnect-modal', true)
141
+ startInactivityTimer()
142
+ // }
139
143
 
140
144
  console.log('Пользователь бездействует!')
141
145
  }, inactivityTimeout.value)
@@ -194,10 +194,14 @@ watch(
194
194
  flex-shrink: 0;
195
195
  padding-top: 5px;
196
196
 
197
- .select select {
198
- height: 20px;
199
- margin: 5px;
200
- color: var(--global-font-color);
197
+ .select {
198
+ position: relative;
199
+
200
+ select {
201
+ height: 20px;
202
+ margin: 5px;
203
+ color: var(--global-font-color);
204
+ }
201
205
  }
202
206
  .single-option {
203
207
  margin-left: 5px;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.637",
4
+ "version": "1.4.639",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -1,52 +1,64 @@
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
- let args: any = {}
21
- try {
22
- args = base64.decode(task.args)
23
- } catch (error) {
24
- args = {}
25
- }
26
-
27
- return {
28
- args,
29
- completion: task.completion + '' || '--',
30
- queuedFor: task.start_time - task.creation_time,
31
- execution: Math.abs(task.start_time - task.completion),
32
- details: task.details,
33
- error: task.error,
34
- initiator: task.initiator,
35
- server: task.server,
36
- startTime: task.start_time + '' || '--',
37
- statusIcon: UI_E_IconNameByRecentTaskStatus[task.status],
38
- statusText: task.error || UI_E_RecentTaskStatus[task.status],
39
- status: task.status,
40
- target: task.target,
41
- targetType: task.target_type,
42
- taskName: task.task_name,
43
- id: task.id,
44
- zone: task.zone,
45
- extra: task.extra,
46
- }
47
- }) || []
48
- return {
49
- items,
50
- last: data.last,
51
- }
52
- }
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
+ let args: any = {}
21
+ try {
22
+ args = base64.decode(task.args)
23
+ } catch (error) {
24
+ args = {}
25
+ }
26
+
27
+ let completion: string = task.completion + '' || '--'
28
+ let execution: string | number = Math.abs(task.start_time - task.completion)
29
+ let queuedFor: number = task.start_time - task.creation_time
30
+ let startTime: string = task.start_time + '' || '--'
31
+ // Обрабатываем данные когда задачка в ожидании
32
+ if (task.status === 0) {
33
+ completion = '--'
34
+ execution = '--'
35
+ queuedFor = 0
36
+ startTime = (Date.now() / 1000) + ''
37
+ }
38
+
39
+ return {
40
+ args,
41
+ completion,
42
+ execution,
43
+ queuedFor,
44
+ startTime,
45
+ details: task.details,
46
+ error: task.error,
47
+ initiator: task.initiator,
48
+ server: task.server,
49
+ statusIcon: UI_E_IconNameByRecentTaskStatus[task.status],
50
+ statusText: task.error || UI_E_RecentTaskStatus[task.status],
51
+ status: task.status,
52
+ target: task.target,
53
+ targetType: task.target_type,
54
+ taskName: task.task_name,
55
+ id: task.id,
56
+ zone: task.zone,
57
+ extra: task.extra,
58
+ }
59
+ }) || []
60
+ return {
61
+ items,
62
+ last: data.last,
63
+ }
64
+ }