dashboard-shell-shell 1.0.113 → 1.0.114

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.
Files changed (119) hide show
  1. package/components/ActionDropdown.vue +1 -1
  2. package/components/ActionMenu.vue +2 -2
  3. package/components/ActionMenuShell.vue +0 -1
  4. package/components/AppModal.vue +6 -78
  5. package/components/AssignTo.vue +11 -25
  6. package/components/AsyncButton.vue +7 -24
  7. package/components/BannerGraphic.vue +0 -1
  8. package/components/ButtonDropdown.vue +4 -26
  9. package/components/ButtonGroup.vue +0 -4
  10. package/components/ButtonMultiAction.vue +0 -1
  11. package/components/CommunityLinks.vue +3 -3
  12. package/components/ConsumptionGauge.vue +5 -24
  13. package/components/CopyToClipboardText.vue +1 -2
  14. package/components/CruResource.vue +7 -12
  15. package/components/CruResourceFooter.vue +2 -2
  16. package/components/DashboardOptions.vue +15 -21
  17. package/components/DetailText.vue +0 -5
  18. package/components/DisableAuthProviderModal.vue +0 -1
  19. package/components/ExplorerMembers.vue +1 -1
  20. package/components/ExplorerProjectsNamespaces.vue +14 -56
  21. package/components/FixedBanner.vue +12 -19
  22. package/components/GlobalRoleBindings.vue +1 -5
  23. package/components/GrafanaDashboard.vue +4 -4
  24. package/components/GrowlManager.vue +1 -4
  25. package/components/HardwareResourceGauge.vue +3 -39
  26. package/components/InfoBox.vue +3 -3
  27. package/components/InputOrDisplay.vue +2 -28
  28. package/components/LabelValue.vue +1 -16
  29. package/components/LandingPagePreference.vue +3 -5
  30. package/components/LocaleSelector.vue +93 -39
  31. package/components/ModalWithCard.vue +0 -2
  32. package/components/MoveModal.vue +0 -1
  33. package/components/PromptChangePassword.vue +1 -1
  34. package/components/PromptModal.vue +2 -15
  35. package/components/PromptRemove.vue +8 -28
  36. package/components/PromptRestore.vue +0 -1
  37. package/components/ResourceCancelModal.vue +0 -1
  38. package/components/ResourceDetail/Masthead.vue +43 -188
  39. package/components/ResourceDetail/__tests__/Masthead.test.ts +1 -5
  40. package/components/ResourceDetail/index.vue +14 -49
  41. package/components/ResourceList/Masthead.vue +18 -80
  42. package/components/ResourceTable.vue +19 -60
  43. package/components/SideNav.vue +12 -32
  44. package/components/SortableTable/THead.vue +5 -34
  45. package/components/SortableTable/actions.js +1 -1
  46. package/components/SortableTable/index.vue +142 -649
  47. package/components/SortableTable/paging.js +28 -36
  48. package/components/SortableTable/selection.js +11 -0
  49. package/components/Tabbed/Tab.vue +3 -3
  50. package/components/Tabbed/index.vue +26 -44
  51. package/components/Wizard.vue +2 -2
  52. package/components/__tests__/AsyncButton.test.ts +2 -2
  53. package/components/__tests__/FixedBanner.test.ts +3 -3
  54. package/components/auth/Principal.vue +3 -10
  55. package/components/auth/__tests__/RoleDetailEdit.test.ts +2 -3
  56. package/components/form/ArrayList.vue +85 -123
  57. package/components/form/ArrayListGrouped.vue +2 -10
  58. package/components/form/Command.vue +15 -6
  59. package/components/form/EnvVars.vue +8 -16
  60. package/components/form/Footer.vue +5 -8
  61. package/components/form/HealthCheck.vue +3 -3
  62. package/components/form/HookOption.vue +16 -11
  63. package/components/form/KeyValue.vue +7 -16
  64. package/components/form/LabeledSelect.vue +76 -59
  65. package/components/form/LifecycleHooks.vue +3 -3
  66. package/components/form/MatchExpressions.vue +12 -35
  67. package/components/form/NameNsDescription.vue +115 -147
  68. package/components/form/Networking.vue +12 -20
  69. package/components/form/NodeAffinity.vue +23 -31
  70. package/components/form/NodeScheduling.vue +3 -13
  71. package/components/form/Password.vue +5 -11
  72. package/components/form/PodAffinity.vue +44 -43
  73. package/components/form/Probe.vue +66 -68
  74. package/components/form/ResourceQuota/Project.vue +1 -5
  75. package/components/form/ResourceSelector.vue +9 -7
  76. package/components/form/SSHKnownHosts/KnownHostsEditDialog.vue +3 -6
  77. package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +1 -12
  78. package/components/form/SSHKnownHosts/index.vue +2 -16
  79. package/components/form/Security.vue +56 -54
  80. package/components/form/Select.vue +7 -41
  81. package/components/form/ShellInput.vue +1 -5
  82. package/components/form/Tolerations.vue +1 -5
  83. package/components/form/UnitInput.vue +2 -2
  84. package/components/form/ValueFromResource.vue +121 -134
  85. package/components/form/WorkloadPorts.vue +18 -18
  86. package/components/form/__tests__/ArrayList.test.ts +2 -5
  87. package/components/form/__tests__/MatchExpressions.test.ts +12 -12
  88. package/components/form/__tests__/NameNsDescription.test.ts +14 -115
  89. package/components/form/__tests__/Probe.test.ts +8 -12
  90. package/components/form/__tests__/SSHKnownHosts.test.ts +0 -11
  91. package/components/form/__tests__/Select.test.ts +0 -37
  92. package/components/form/__tests__/UnitInput.test.ts +5 -4
  93. package/components/formatter/BadgeStateFormatter.vue +5 -8
  94. package/components/formatter/ExtensionCache.vue +74 -0
  95. package/components/formatter/InternalExternalIP.vue +0 -2
  96. package/components/formatter/Port.vue +24 -0
  97. package/components/formatter/SecretData.vue +7 -20
  98. package/components/formatter/SecretType.vue +41 -0
  99. package/components/nav/Favorite.vue +1 -5
  100. package/components/nav/Group.vue +27 -60
  101. package/components/nav/Header.vue +13 -39
  102. package/components/nav/Jump.vue +0 -7
  103. package/components/nav/NamespaceFilter.vue +8 -14
  104. package/components/nav/Pinned.vue +1 -1
  105. package/components/nav/TopLevelMenu.vue +17 -5
  106. package/components/nav/Type.vue +35 -32
  107. package/components/nav/__tests__/TopLevelMenu.test.ts +40 -0
  108. package/components/templates/blank.vue +1 -4
  109. package/components/templates/default.vue +0 -8
  110. package/components/templates/home.vue +1 -10
  111. package/components/templates/plain.vue +1 -10
  112. package/package.json +1 -1
  113. package/components/ActionDropdownShell.vue +0 -71
  114. package/components/DotState.vue +0 -84
  115. package/components/ModalManager.vue +0 -55
  116. package/components/SlideInPanelManager.vue +0 -126
  117. package/components/StatusBadge.vue +0 -77
  118. package/components/__tests__/ModalManager.spec.ts +0 -176
  119. package/components/__tests__/SlideInPanelManager.spec.ts +0 -166
@@ -84,14 +84,53 @@ export default {
84
84
  },
85
85
 
86
86
  data() {
87
+ if (!this.value[this.field]) {
88
+ this.value[this.field] = {};
89
+ }
90
+ const { podAffinity = {}, podAntiAffinity = {} } = this.value[this.field];
91
+ const allAffinityTerms = [...(podAffinity.preferredDuringSchedulingIgnoredDuringExecution || []), ...(podAffinity.requiredDuringSchedulingIgnoredDuringExecution || [])].map((term) => {
92
+ let out = clone(term);
93
+
94
+ out._id = randomStr(4);
95
+ out._anti = false;
96
+ if (term.podAffinityTerm) {
97
+ Object.assign(out, term.podAffinityTerm);
98
+ out = this.parsePodAffinityTerm(out);
99
+
100
+ delete out.podAffinityTerm;
101
+ } else {
102
+ out = this.parsePodAffinityTerm(out);
103
+ }
104
+
105
+ return out;
106
+ });
107
+ const allAntiTerms = [...(podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution || []), ...(podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution || [])].map((term) => {
108
+ let out = clone(term);
109
+
110
+ out._id = randomStr(4);
111
+ out._anti = true;
112
+ if (term.podAffinityTerm) {
113
+ Object.assign(out, term.podAffinityTerm);
114
+ out = this.parsePodAffinityTerm(out);
115
+
116
+ delete out.podAffinityTerm;
117
+ } else {
118
+ out = this.parsePodAffinityTerm(out);
119
+ }
120
+
121
+ return out;
122
+ });
123
+
124
+ const allSelectorTerms = [...allAffinityTerms, ...allAntiTerms];
125
+
87
126
  return {
88
- allSelectorTerms: [],
89
- defaultWeight: 1,
127
+ allSelectorTerms,
128
+ defaultWeight: 1,
90
129
  // rules in MatchExpressions.vue can not catch changes what happens on parent component
91
130
  // we need re-render it via key changing
92
- rerenderNums: randomStr(4),
131
+ rerenderNums: randomStr(4),
93
132
  NAMESPACE_SELECTION_OPTION_VALUES,
94
- defaultAddValue: {
133
+ defaultAddValue: {
95
134
  _namespaceOption: NAMESPACE_SELECTION_OPTION_VALUES.POD,
96
135
  matchExpressions: [],
97
136
  namespaces: null,
@@ -99,7 +138,6 @@ export default {
99
138
  }
100
139
  };
101
140
  },
102
-
103
141
  computed: {
104
142
  ...mapGetters({ t: 'i18n/t' }),
105
143
  isView() {
@@ -188,44 +226,6 @@ export default {
188
226
  },
189
227
 
190
228
  created() {
191
- if (!this.value[this.field]) {
192
- this.value[this.field] = {};
193
- }
194
- const { podAffinity = {}, podAntiAffinity = {} } = this.value[this.field];
195
- const allAffinityTerms = [...(podAffinity.preferredDuringSchedulingIgnoredDuringExecution || []), ...(podAffinity.requiredDuringSchedulingIgnoredDuringExecution || [])].map((term) => {
196
- let out = clone(term);
197
-
198
- out._id = randomStr(4);
199
- out._anti = false;
200
- if (term.podAffinityTerm) {
201
- Object.assign(out, term.podAffinityTerm);
202
- out = this.parsePodAffinityTerm(out);
203
-
204
- delete out.podAffinityTerm;
205
- } else {
206
- out = this.parsePodAffinityTerm(out);
207
- }
208
-
209
- return out;
210
- });
211
- const allAntiTerms = [...(podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution || []), ...(podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution || [])].map((term) => {
212
- let out = clone(term);
213
-
214
- out._id = randomStr(4);
215
- out._anti = true;
216
- if (term.podAffinityTerm) {
217
- Object.assign(out, term.podAffinityTerm);
218
- out = this.parsePodAffinityTerm(out);
219
-
220
- delete out.podAffinityTerm;
221
- } else {
222
- out = this.parsePodAffinityTerm(out);
223
- }
224
-
225
- return out;
226
- });
227
-
228
- this.allSelectorTerms = [...allAffinityTerms, ...allAntiTerms];
229
229
  this.queueUpdate = debounce(this.update, 500);
230
230
  },
231
231
 
@@ -364,6 +364,7 @@ export default {
364
364
  <div class="col span-12">
365
365
  <ArrayListGrouped
366
366
  v-model:value="allSelectorTerms"
367
+ class="mt-20"
367
368
  :default-add-value="defaultAddValue"
368
369
  :mode="mode"
369
370
  :add-label="addLabel"
@@ -6,7 +6,6 @@ import { LabeledInput } from '@components/Form/LabeledInput';
6
6
  import LabeledSelect from '@shell/components/form/LabeledSelect';
7
7
  import ShellInput from '@shell/components/form/ShellInput';
8
8
  import KeyValue from '@shell/components/form/KeyValue';
9
- import { computed, ref, watch } from 'vue';
10
9
 
11
10
  const KINDS = [
12
11
  'none',
@@ -44,29 +43,29 @@ export default {
44
43
  },
45
44
  },
46
45
 
47
- setup(props, { emit }) {
48
- const kind = ref('none');
49
- const probe = ref(null);
50
- const exec = ref(null);
51
- const httpGet = ref(null);
52
- const tcpSocket = ref(null);
53
-
54
- if ( props.value ) {
55
- probe.value = clone(props.value);
56
-
57
- if ( probe.value.exec ) {
58
- kind.value = 'exec';
59
- } else if ( probe.value.httpGet ) {
60
- if ( (probe.value.httpGet.scheme || '').toLowerCase() === 'https' ) {
61
- kind.value = 'HTTPS';
46
+ data() {
47
+ let kind = 'none';
48
+ let probe = null;
49
+ let exec = null;
50
+ let httpGet = null;
51
+ let tcpSocket = null;
52
+
53
+ if ( this.value ) {
54
+ probe = clone(this.value);
55
+
56
+ if ( probe.exec ) {
57
+ kind = 'exec';
58
+ } else if ( probe.httpGet ) {
59
+ if ( (probe.httpGet.scheme || '').toLowerCase() === 'https' ) {
60
+ kind = 'HTTPS';
62
61
  } else {
63
- kind.value = 'HTTP';
62
+ kind = 'HTTP';
64
63
  }
65
- } else if ( probe.value.tcpSocket ) {
66
- kind.value = 'tcp';
64
+ } else if ( probe.tcpSocket ) {
65
+ kind = 'tcp';
67
66
  }
68
67
  } else {
69
- probe.value = {
68
+ probe = {
70
69
  failureThreshold: 3,
71
70
  successThreshold: 1,
72
71
  initialDelaySeconds: 0,
@@ -78,68 +77,68 @@ export default {
78
77
  };
79
78
  }
80
79
 
81
- exec.value = probe.value.exec || {};
82
- httpGet.value = probe.value.httpGet || {};
83
- tcpSocket.value = probe.value.tcpSocket || {};
80
+ exec = probe.exec || {};
81
+ httpGet = probe.httpGet || {};
82
+ tcpSocket = probe.tcpSocket || {};
84
83
 
85
- const isNone = computed(() => {
86
- return kind.value === 'none';
87
- });
84
+ return {
85
+ probe, kind, exec, httpGet, tcpSocket
86
+ };
87
+ },
88
+
89
+ computed: {
90
+ isView() {
91
+ return this.mode === _VIEW;
92
+ },
93
+
94
+ isNone() {
95
+ return this.kind === 'none';
96
+ },
88
97
 
89
- const update = () => {
90
- if ( isNone.value ) {
91
- emit('update:value', null);
98
+ kindOptions() {
99
+ return KINDS.map((k) => {
100
+ return { label: this.t(`workload.container.healthCheck.kind.${ k }`), value: k };
101
+ });
102
+ }
103
+ },
104
+
105
+ watch: {
106
+ kind() {
107
+ this.update();
108
+ }
109
+ },
110
+
111
+ methods: {
112
+ update() {
113
+ const probe = this.probe;
114
+
115
+ if ( this.isNone ) {
116
+ this.$emit('update:value', null);
92
117
 
93
118
  return;
94
119
  }
95
120
 
96
- switch ( kind.value ) {
121
+ switch ( this.kind ) {
97
122
  case 'HTTP':
98
123
  case 'HTTPS':
99
- httpGet.value.scheme = kind.value;
100
- probe.value.httpGet = httpGet.value;
101
- probe.value.tcpSocket = null;
102
- probe.value.exec = null;
124
+ this.httpGet.scheme = this.kind;
125
+ probe.httpGet = this.httpGet;
126
+ probe.tcpSocket = null;
127
+ probe.exec = null;
103
128
  break;
104
129
  case 'tcp':
105
- probe.value.httpGet = null;
106
- probe.value.tcpSocket = tcpSocket.value;
107
- probe.value.exec = null;
130
+ probe.httpGet = null;
131
+ probe.tcpSocket = this.tcpSocket;
132
+ probe.exec = null;
108
133
  break;
109
134
  case 'exec':
110
- probe.value.httpGet = null;
111
- probe.value.tcpSocket = null;
112
- probe.value.exec = exec.value;
135
+ probe.httpGet = null;
136
+ probe.tcpSocket = null;
137
+ probe.exec = this.exec;
113
138
  break;
114
139
  }
115
140
 
116
- emit('update:value', probe.value);
117
- };
118
-
119
- watch(kind, () => {
120
- update();
121
- });
122
-
123
- return {
124
- probe,
125
- kind,
126
- exec,
127
- httpGet,
128
- tcpSocket,
129
- update,
130
- isNone,
131
- };
132
- },
133
-
134
- computed: {
135
- isView() {
136
- return this.mode === _VIEW;
137
- },
138
-
139
- kindOptions() {
140
- return KINDS.map((k) => {
141
- return { label: this.t(`workload.container.healthCheck.kind.${ k }`), value: k };
142
- });
141
+ this.$emit('update:value', probe);
143
142
  }
144
143
  },
145
144
  };
@@ -245,7 +244,6 @@ export default {
245
244
  v-if="kind && kind!=='none'"
246
245
  :style="{'position':'relative', 'margin':'0px'}"
247
246
  class="vertical"
248
- role="none"
249
247
  >
250
248
  </div>
251
249
 
@@ -28,15 +28,11 @@ export default {
28
28
  },
29
29
 
30
30
  data() {
31
- return { typeValues: null };
32
- },
33
-
34
- created() {
35
31
  this.value['spec'] = this.value.spec || {};
36
32
  this.value.spec['namespaceDefaultResourceQuota'] = this.value.spec.namespaceDefaultResourceQuota || { limit: {} };
37
33
  this.value.spec['resourceQuota'] = this.value.spec.resourceQuota || { limit: {} };
38
34
 
39
- this.typeValues = Object.keys(this.value.spec.resourceQuota.limit);
35
+ return { typeValues: Object.keys(this.value.spec.resourceQuota.limit) };
40
36
  },
41
37
 
42
38
  computed: { ...QUOTA_COMPUTED },
@@ -45,14 +45,16 @@ export default {
45
45
  },
46
46
 
47
47
  data() {
48
+ const matchingResources = {
49
+ matched: 0,
50
+ matches: [],
51
+ none: true,
52
+ sample: null,
53
+ total: 0,
54
+ };
55
+
48
56
  return {
49
- matchingResources: {
50
- matched: 0,
51
- matches: [],
52
- none: true,
53
- sample: null,
54
- total: 0,
55
- },
57
+ matchingResources,
56
58
  allResources: [],
57
59
  allResourcesInScope: [],
58
60
  tableHeaders: this.$store.getters['type-map/headersFor'](
@@ -22,7 +22,7 @@ export default {
22
22
  mode: {
23
23
  type: String,
24
24
  default: _EDIT
25
- }
25
+ },
26
26
  },
27
27
 
28
28
  data() {
@@ -40,9 +40,8 @@ export default {
40
40
 
41
41
  return {
42
42
  codeMirrorOptions,
43
- text: this.value,
44
- showModal: false,
45
- returnFocusSelector: '#known-ssh-hosts-trigger'
43
+ text: this.value,
44
+ showModal: false,
46
45
  };
47
46
  },
48
47
 
@@ -84,8 +83,6 @@ export default {
84
83
  data-testid="sshKnownHostsDialog"
85
84
  height="auto"
86
85
  :scrollable="true"
87
- :trigger-focus-trap="true"
88
- :return-focus-selector="returnFocusSelector"
89
86
  @close="closeDialog(false)"
90
87
  >
91
88
  <div
@@ -14,17 +14,6 @@ const requiredSetup = () => {
14
14
  return { global: { mocks: { $store: mockedStore() } } };
15
15
  };
16
16
 
17
- jest.mock('focus-trap', () => {
18
- return {
19
- createFocusTrap: jest.fn().mockImplementation(() => {
20
- return {
21
- activate: jest.fn(),
22
- deactivate: jest.fn(),
23
- };
24
- }),
25
- };
26
- });
27
-
28
17
  describe('component: KnownHostsEditDialog', () => {
29
18
  beforeEach(() => {
30
19
  document.body.innerHTML = '<div id="modals"></div>';
@@ -32,7 +21,7 @@ describe('component: KnownHostsEditDialog', () => {
32
21
  attachTo: document.body,
33
22
  props: {
34
23
  mode: _EDIT,
35
- value: 'line1\nline2\n'
24
+ value: 'line1\nline2\n',
36
25
  },
37
26
  ...requiredSetup(),
38
27
  });
@@ -65,18 +65,12 @@ export default defineComponent({
65
65
  </div>
66
66
  <template v-if="!isViewMode">
67
67
  <button
68
- id="known-ssh-hosts-trigger"
69
68
  ref="button"
70
- role="button"
71
- :aria-label="t('secret.ssh.editKnownHosts.title')"
72
69
  data-testid="input-known-ssh-hosts_open-dialog"
73
70
  class="show-dialog-btn btn"
74
71
  @click="openDialog"
75
72
  >
76
- <i
77
- class="icon icon-edit"
78
- :alt="t('secret.ssh.editKnownHosts.title')"
79
- />
73
+ <i class="icon icon-edit" />
80
74
  </button>
81
75
 
82
76
  <KnownHostsEditDialog
@@ -100,16 +94,8 @@ export default defineComponent({
100
94
  }
101
95
 
102
96
  .show-dialog-btn {
97
+ display: contents;
103
98
  background-color: transparent;
104
- padding: 4px;
105
- height: 22px;
106
- margin: -3px -3px 0 0;
107
- min-height: unset;
108
-
109
- &:focus-visible {
110
- @include focus-outline;
111
- outline-offset: 1px;
112
- }
113
99
  }
114
100
  }
115
101
  </style>
@@ -5,45 +5,6 @@ import { _VIEW } from '@shell/config/query-params';
5
5
  import { mapGetters } from 'vuex';
6
6
  import LabeledSelect from '@shell/components/form/LabeledSelect';
7
7
 
8
- const allCapabilities = ['ALL',
9
- 'AUDIT_CONTROL',
10
- 'AUDIT_WRITE',
11
- 'BLOCK_SUSPEND',
12
- 'CHOWN',
13
- 'DAC_OVERRIDE',
14
- 'DAC_READ_SEARCH',
15
- 'FOWNER',
16
- 'FSETID',
17
- 'IPC_LOCK',
18
- 'IPC_OWNER',
19
- 'KILL',
20
- 'LEASE',
21
- 'LINUX_IMMUTABLE',
22
- 'MAC_ADMIN',
23
- 'MAC_OVERRIDE',
24
- 'MKNOD',
25
- 'NET_ADMIN',
26
- 'NET_BIND_SERVICE',
27
- 'NET_BROADCAST',
28
- 'NET_RAW',
29
- 'SETFCAP',
30
- 'SETGID',
31
- 'SETPCAP',
32
- 'SETUID',
33
- 'SYSLOG',
34
- 'SYS_ADMIN',
35
- 'SYS_BOOT',
36
- 'SYS_CHROOT',
37
- 'SYS_MODULE',
38
- 'SYS_NICE',
39
- 'SYS_PACCT',
40
- 'SYS_PTRACE',
41
- 'SYS_RAWIO',
42
- 'SYS_RESOURCE',
43
- 'SYS_TIME',
44
- 'SYS_TTY_CONFIG',
45
- 'WAKE_ALARM'];
46
-
47
8
  export default {
48
9
  emits: ['update:value'],
49
10
 
@@ -64,27 +25,68 @@ export default {
64
25
  },
65
26
 
66
27
  data() {
67
- return {
68
- privileged: this.value.privileged || false,
69
- allowPrivilegeEscalation: this.value.allowPrivilegeEscalation || false,
70
- allCapabilities,
71
- runAsNonRoot: this.value.runAsNonRoot || false,
72
- readOnlyRootFilesystem: this.value.readOnlyRootFilesystem || false,
73
- add: [],
74
- drop: [],
75
- runAsUser: this.value.runAsUser
76
- };
77
- },
28
+ const allCapabilities = ['ALL',
29
+ 'AUDIT_CONTROL',
30
+ 'AUDIT_WRITE',
31
+ 'BLOCK_SUSPEND',
32
+ 'CHOWN',
33
+ 'DAC_OVERRIDE',
34
+ 'DAC_READ_SEARCH',
35
+ 'FOWNER',
36
+ 'FSETID',
37
+ 'IPC_LOCK',
38
+ 'IPC_OWNER',
39
+ 'KILL',
40
+ 'LEASE',
41
+ 'LINUX_IMMUTABLE',
42
+ 'MAC_ADMIN',
43
+ 'MAC_OVERRIDE',
44
+ 'MKNOD',
45
+ 'NET_ADMIN',
46
+ 'NET_BIND_SERVICE',
47
+ 'NET_BROADCAST',
48
+ 'NET_RAW',
49
+ 'SETFCAP',
50
+ 'SETGID',
51
+ 'SETPCAP',
52
+ 'SETUID',
53
+ 'SYSLOG',
54
+ 'SYS_ADMIN',
55
+ 'SYS_BOOT',
56
+ 'SYS_CHROOT',
57
+ 'SYS_MODULE',
58
+ 'SYS_NICE',
59
+ 'SYS_PACCT',
60
+ 'SYS_PTRACE',
61
+ 'SYS_RAWIO',
62
+ 'SYS_RESOURCE',
63
+ 'SYS_TIME',
64
+ 'SYS_TTY_CONFIG',
65
+ 'WAKE_ALARM'];
78
66
 
79
- created() {
80
- const { capabilities = {} } = this.value;
67
+ const {
68
+ capabilities = {},
69
+ runAsNonRoot = false,
70
+ readOnlyRootFilesystem = false,
71
+ privileged = false,
72
+ allowPrivilegeEscalation = false,
73
+ runAsUser
74
+ } = this.value;
81
75
  const {
82
76
  add = [],
83
77
  drop = []
84
78
  } = capabilities;
85
79
 
86
- this.add = add;
87
- this.drop = drop;
80
+ return {
81
+ privileged,
82
+ allowPrivilegeEscalation,
83
+ allCapabilities,
84
+ runAsNonRoot,
85
+ readOnlyRootFilesystem,
86
+ add,
87
+ drop,
88
+ runAsUser
89
+ };
88
90
  },
89
91
 
90
92
  computed: {
@@ -2,12 +2,11 @@
2
2
  import { get } from '@shell/utils/object';
3
3
  import LabeledFormElement from '@shell/mixins/labeled-form-element';
4
4
  import VueSelectOverrides from '@shell/mixins/vue-select-overrides';
5
- import { generateRandomAlphaString } from '@shell/utils/string';
6
5
  import { LabeledTooltip } from '@components/LabeledTooltip';
7
6
  import { onClickOption, calculatePosition } from '@shell/utils/select';
8
7
 
9
8
  export default {
10
- emits: ['update:value', 'createdListItem', 'on-open', 'on-close'],
9
+ emits: ['update:value', 'createdListItem'],
11
10
 
12
11
  components: { LabeledTooltip },
13
12
  mixins: [
@@ -88,17 +87,8 @@ export default {
88
87
  type: Boolean,
89
88
  default: null
90
89
  },
91
- isLangSelect: {
92
- type: Boolean,
93
- default: false
94
- }
95
- },
96
- data() {
97
- return {
98
- isOpen: false,
99
- generatedUid: `s-uid-${ generateRandomAlphaString(12) }`
100
- };
101
90
  },
91
+
102
92
  methods: {
103
93
  // resizeHandler = in mixin
104
94
  getOptionLabel(option) {
@@ -197,26 +187,14 @@ export default {
197
187
  return Math.random(100000);
198
188
  }
199
189
  },
200
-
201
190
  report(e) {
202
191
  alert(e);
203
192
  },
204
-
205
193
  handleDropdownOpen(args) {
206
194
  // function that prevents the "opening dropdown on focus"
207
195
  // default behaviour of v-select
208
196
  return args.noDrop || args.disabled ? false : args.open;
209
- },
210
- onOpen() {
211
- this.isOpen = true;
212
- this.$emit('on-open');
213
- this.resizeHandler();
214
- },
215
-
216
- onClose() {
217
- this.isOpen = false;
218
- this.$emit('on-close');
219
- },
197
+ }
220
198
  },
221
199
  computed: {
222
200
  requiredField() {
@@ -277,10 +255,6 @@ export default {
277
255
  [$attrs.class]: $attrs.class
278
256
  }"
279
257
  :tabindex="disabled || isView ? -1 : 0"
280
- role="combobox"
281
- :aria-expanded="isOpen"
282
- :aria-label="$attrs['aria-label'] || undefined"
283
- :aria-describedby="$attrs['aria-describedby'] || undefined"
284
258
  @click="focusSearch"
285
259
  @keydown.enter="focusSearch"
286
260
  @keydown.down.prevent="focusSearch"
@@ -308,23 +282,15 @@ export default {
308
282
  :modelValue="value != null ? value : ''"
309
283
  :dropdownShouldOpen="handleDropdownOpen"
310
284
  :tabindex="-1"
311
- role="listitem"
312
- :uid="generatedUid"
313
- :aria-label="'-'"
285
+ role="listbox"
314
286
  @update:modelValue="$emit('update:value', $event)"
315
287
  @search:blur="onBlur"
316
288
  @search:focus="onFocus"
317
- @open="onOpen"
318
- @close="onClose"
289
+ @open="resizeHandler"
319
290
  @option:created="(e) => $emit('createdListItem', e)"
320
291
  >
321
- <template
322
- #option="option"
323
- >
324
- <div
325
- :lang="isLangSelect ? option.value : undefined"
326
- @mousedown="(e) => onClickOption(option, e)"
327
- >
292
+ <template #option="option">
293
+ <div @mousedown="(e) => onClickOption(option, e)">
328
294
  {{ getOptionLabel(option.label) }}
329
295
  </div>
330
296
  </template>
@@ -21,10 +21,6 @@ export default {
21
21
  causes $emit 'input' of ["-c", "sleep 600"]
22
22
  */
23
23
  data() {
24
- return { userValue: '' };
25
- },
26
-
27
- created() {
28
24
  let userValue = '';
29
25
 
30
26
  if ( this.value ) {
@@ -40,7 +36,7 @@ export default {
40
36
  }, '').trim();
41
37
  }
42
38
 
43
- this.userValue = userValue;
39
+ return { userValue };
44
40
  },
45
41
 
46
42
  methods: {