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
@@ -1,6 +1,6 @@
1
1
  <script>
2
- import { mapGetters, useStore } from 'vuex';
3
- import { defineAsyncComponent, ref, onMounted, onBeforeUnmount } from 'vue';
2
+ import { mapGetters } from 'vuex';
3
+ import { defineAsyncComponent, useTemplateRef, onMounted, onBeforeUnmount } from 'vue';
4
4
  import day from 'dayjs';
5
5
  import isEmpty from 'lodash/isEmpty';
6
6
  import { dasherize, ucFirst } from '@shell/utils/string';
@@ -8,7 +8,6 @@ import { get, clone } from '@shell/utils/object';
8
8
  import { removeObject } from '@shell/utils/array';
9
9
  import { Checkbox } from '@components/Form/Checkbox';
10
10
  import AsyncButton, { ASYNC_BUTTON_STATES } from '@shell/components/AsyncButton';
11
- import Select from '@shell/components/form/Select';
12
11
  import ActionDropdown from '@shell/components/ActionDropdown';
13
12
  import throttle from 'lodash/throttle';
14
13
  import debounce from 'lodash/debounce';
@@ -25,9 +24,6 @@ import { getParent } from '@shell/utils/dom';
25
24
  import { FORMATTERS } from '@shell/components/SortableTable/sortable-config';
26
25
  import ButtonMultiAction from '@shell/components/ButtonMultiAction.vue';
27
26
  import ActionMenu from '@shell/components/ActionMenuShell.vue';
28
- import { useRuntimeFlag } from '@shell/composables/useRuntimeFlag';
29
- import ActionDropdownShell from '@shell/components/ActionDropdownShell.vue';
30
-
31
27
 
32
28
  // Uncomment for table performance debugging
33
29
  // import tableDebug from './debug';
@@ -60,12 +56,10 @@ export default {
60
56
  THead,
61
57
  Checkbox,
62
58
  AsyncButton,
63
- Select,
64
59
  ActionDropdown,
65
60
  LabeledSelect,
66
61
  ButtonMultiAction,
67
62
  ActionMenu,
68
- ActionDropdownShell,
69
63
  },
70
64
  mixins: [
71
65
  filtering,
@@ -381,19 +375,6 @@ export default {
381
375
  manualRefreshButtonSize: {
382
376
  type: String,
383
377
  default: ''
384
- },
385
- isBanner: {
386
- // Show isBanner input to filter rows
387
- type: Boolean,
388
- default: false
389
- },
390
- marginTopValue: {
391
- type: Number,
392
- default: 0
393
- },
394
- isFilterLabel: {
395
- type: Boolean,
396
- default: false
397
378
  }
398
379
 
399
380
  },
@@ -410,19 +391,11 @@ export default {
410
391
 
411
392
  const isLoading = this.loading || false;
412
393
 
413
- let isCreatable = false;
414
- const lastPath = this.$route.path.split('/').pop();
415
-
416
- if (lastPath.includes('.')) {
417
- isCreatable = this.$store.getters['type-map/optionsFor'](lastPath).isCreatable;
418
- }
419
-
420
394
  return {
421
395
  refreshButtonPhase: isLoading ? ASYNC_BUTTON_STATES.WAITING : ASYNC_BUTTON_STATES.ACTION,
422
396
  expanded: {},
423
397
  searchQuery,
424
398
  eventualSearchQuery,
425
- isCreatable,
426
399
  subMatches: null,
427
400
  actionOfInterest: null,
428
401
  loadingDelay: false,
@@ -430,28 +403,7 @@ export default {
430
403
  /**
431
404
  * The is the bool the DOM uses to show loading state. it's proxied from `loading` to avoid blipping the indicator (see usages)
432
405
  */
433
- isLoading,
434
- isMuchSelected: false,
435
- inputPerPage: '10',
436
- inputPage: '', // 输入的要跳至的页码
437
- perPageOptions: [
438
- {
439
- label: '10条/页',
440
- value: '10',
441
- },
442
- {
443
- label: '25条/页',
444
- value: '25',
445
- },
446
- {
447
- label: '50条/页',
448
- value: '50',
449
- },
450
- {
451
- label: '100条/页',
452
- value: '100',
453
- }
454
- ]
406
+ isLoading
455
407
  };
456
408
  },
457
409
 
@@ -466,13 +418,6 @@ export default {
466
418
  this._onScroll = this.onScroll.bind(this);
467
419
  $main?.addEventListener('scroll', this._onScroll);
468
420
 
469
- const tables = document.querySelectorAll('.sort-table-div');
470
-
471
- tables.forEach((table) => {
472
- this._onTableScroll = this.onTableScroll.bind(this, table);
473
- table.addEventListener('scroll', this._onTableScroll.bind(this, table));
474
- });
475
-
476
421
  this.debouncedPaginationChanged();
477
422
  },
478
423
 
@@ -487,12 +432,6 @@ export default {
487
432
  const $main = document.querySelector('main');
488
433
 
489
434
  $main?.removeEventListener('scroll', this._onScroll);
490
- // 移除所有表格容器的滚动事件监听器
491
- const tables = document.querySelectorAll('.sort-table-div');
492
-
493
- tables.forEach((table) => {
494
- table.removeEventListener('scroll', this._onTableScroll);
495
- });
496
435
  },
497
436
 
498
437
  watch: {
@@ -542,14 +481,6 @@ export default {
542
481
  this.watcherUpdateLiveAndDelayed(neu, old);
543
482
  },
544
483
 
545
- selectedRowsText(neu, old) {
546
- if (neu) {
547
- this.isMuchSelected = true;
548
- } else {
549
- this.isMuchSelected = false;
550
- }
551
- },
552
-
553
484
  // Ensure we update live and delayed columns on first load
554
485
  initalLoad: {
555
486
  handler(neu) {
@@ -597,7 +528,7 @@ export default {
597
528
  },
598
529
  },
599
530
  setup(_props, { emit }) {
600
- const table = ref(null);
531
+ const table = useTemplateRef('table');
601
532
 
602
533
  const handleEnterKey = (event) => {
603
534
  if (event.key === 'Enter' && !event.target?.classList?.contains('checkbox-custom')) {
@@ -612,14 +543,6 @@ export default {
612
543
  onBeforeUnmount(() => {
613
544
  table.value.removeEventListener('keyup', handleEnterKey);
614
545
  });
615
-
616
- const store = useStore();
617
- const { featureDropdownMenu } = useRuntimeFlag(store);
618
-
619
- return {
620
- table,
621
- featureDropdownMenu,
622
- };
623
546
  },
624
547
 
625
548
  created() {
@@ -840,100 +763,15 @@ export default {
840
763
  });
841
764
 
842
765
  return rows;
843
- },
766
+ }
844
767
  },
845
768
 
846
769
  methods: {
847
- onTableScroll(table, e) {
848
- // 记录最后滚动的距离
849
- let lastScrollTop = 0;
850
- let lastScrollLeft = 0;
851
-
852
- // 监听容器滚动
853
- table.addEventListener('scroll', (e) => {
854
- // 如果当前垂直滚动距离不等于上次
855
- if (e.target.scrollTop !== lastScrollTop) {
856
- // 更新最后距离
857
- lastScrollTop = e.target.scrollTop;
858
-
859
- // 移除左右阴影样式
860
- table.classList.remove('shadow-left');
861
- table.classList.remove('shadow-right');
862
-
863
- // 如果滚动到顶部,移除顶部阴影样式
864
- // if (lastScrollTop === 0) {
865
- // table.classList.remove('shadow-top');
866
- // }
867
- // // 否则添加顶部阴影样式
868
- // else {
869
- // table.classList.add('shadow-top');
870
- // }
871
-
872
- // 如果滚动到底部,移除底部阴影样式
873
- // if (lastScrollTop + table.clientHeight === table.scrollHeight) {
874
- // table.classList.remove('shadow-bottom');
875
- // }
876
- // // 否则添加底部阴影样式
877
- // else {
878
- // table.classList.add('shadow-bottom');
879
- // }
880
-
881
- // 阴影效果修正
882
- table.classList.remove('shadow-x');
883
- table.classList.add('shadow-y');
884
- }
885
-
886
- // 如果当前水平滚动距离不等于上次
887
- else if (e.target.scrollLeft !== lastScrollLeft) {
888
- // 更新最后距离
889
- lastScrollLeft = e.target.scrollLeft;
890
-
891
- // 移除上下阴影样式
892
- // table.classList.remove('shadow-top');
893
- // table.classList.remove('shadow-bottom');
894
-
895
- // 如果滚动到左边,移除左边阴影样式
896
- if (lastScrollLeft === 0) {
897
- table.classList.remove('shadow-left');
898
- }
899
- // 否则添加左边阴影样式
900
- else {
901
- table.classList.add('shadow-left');
902
- }
903
-
904
- // 如果滚动到右边,移除右边阴影样式
905
- if (lastScrollLeft + table.clientWidth === table.scrollWidth) {
906
- table.classList.remove('shadow-right');
907
- }
908
- // 否则添加右边阴影样式
909
- else {
910
- table.classList.add('shadow-right');
911
- }
912
-
913
- // 阴影效果修正
914
- table.classList.remove('shadow-y');
915
- table.classList.add('shadow-x');
916
- }
917
- });
918
- },
919
- changePerPage(value) {
920
- this.inputPerPage = value;
921
- this.setgetPerPage(value);
922
- },
923
- handleToPage() {
924
- this.setPage(parseInt(this.inputPage, 10));
925
- },
926
770
  refreshTableData() {
927
771
  this.$store.dispatch('resource-fetch/doManualRefresh');
928
772
  },
929
773
  get,
930
774
  dasherize,
931
- muchSelect(value) {
932
- console.log(value);
933
-
934
- this.isMuchSelected = !this.isMuchSelected;
935
- this.onToggleAll(value);
936
- },
937
775
 
938
776
  onScroll() {
939
777
  if (this.hasLiveColumns || this.hasDelayedColumns) {
@@ -1218,27 +1056,96 @@ export default {
1218
1056
  :data-testid="componentTestid + '-list-container'"
1219
1057
  >
1220
1058
  <div
1221
- :class="{'titled': $slots.title && $slots.title.length, 'mb-40': isFilterLabel}"
1222
- class="sortable-table-header mb-20"
1223
- :style="{marginTop: search&& !isBanner ? marginTopValue + 'px' : '0px',marginLeft: isCreatable ? '100px' : '-10px',maxHeight: '32px'}"
1059
+ :class="{'titled': $slots.title && $slots.title.length}"
1060
+ class="sortable-table-header"
1224
1061
  >
1225
1062
  <slot name="title" />
1226
1063
  <div
1227
1064
  v-if="showHeaderRow"
1228
1065
  class="fixed-header-actions"
1229
- :class="{button: !!$slots['header-button'], 'advanced-filtering': hasAdvancedFiltering, }"
1230
- style="display: flex;"
1066
+ :class="{button: !!$slots['header-button'], 'advanced-filtering': hasAdvancedFiltering}"
1231
1067
  >
1232
- <!-- <div
1068
+ <div
1233
1069
  :class="bulkActionsClass"
1234
1070
  class="bulk"
1235
1071
  >
1236
-
1237
- </div> -->
1072
+ <slot name="header-left">
1073
+ <template v-if="tableActions">
1074
+ <button
1075
+ v-for="(act) in availableActions"
1076
+ :id="act.action"
1077
+ :key="act.action"
1078
+ v-clean-tooltip="actionTooltip"
1079
+ type="button"
1080
+ class="btn role-primary"
1081
+ :class="{[bulkActionClass]:true}"
1082
+ :disabled="!act.enabled"
1083
+ :data-testid="componentTestid + '-' + act.action"
1084
+ @click="applyTableAction(act, null, $event)"
1085
+ @keydown.enter.stop
1086
+ @mouseover="setBulkActionOfInterest(act)"
1087
+ @mouseleave="setBulkActionOfInterest(null)"
1088
+ >
1089
+ <i
1090
+ v-if="act.icon"
1091
+ :class="act.icon"
1092
+ />
1093
+ <span v-clean-html="act.label" />
1094
+ </button>
1095
+ <ActionDropdown
1096
+ :class="bulkActionsDropdownClass"
1097
+ class="bulk-actions-dropdown"
1098
+ :disable-button="!selectedRows.length"
1099
+ size="sm"
1100
+ >
1101
+ <template #button-content>
1102
+ <button
1103
+ ref="actionDropDown"
1104
+ class="btn bg-primary mr-0"
1105
+ :disabled="!selectedRows.length"
1106
+ >
1107
+ <i class="icon icon-gear" />
1108
+ <span>{{ t('sortableTable.bulkActions.collapsed.label') }}</span>
1109
+ <i class="ml-10 icon icon-chevron-down" />
1110
+ </button>
1111
+ </template>
1112
+ <template #popover-content>
1113
+ <ul class="list-unstyled menu">
1114
+ <li
1115
+ v-for="(act, i) in hiddenActions"
1116
+ :key="i"
1117
+ v-close-popper
1118
+ v-clean-tooltip="{
1119
+ content: actionTooltip,
1120
+ placement: 'right'
1121
+ }"
1122
+ :class="{ disabled: !act.enabled }"
1123
+ @click="applyTableAction(act, null, $event)"
1124
+ @mouseover="setBulkActionOfInterest(act)"
1125
+ @mouseleave="setBulkActionOfInterest(null)"
1126
+ >
1127
+ <i
1128
+ v-if="act.icon"
1129
+ :class="act.icon"
1130
+ />
1131
+ <span v-clean-html="act.label" />
1132
+ </li>
1133
+ </ul>
1134
+ </template>
1135
+ </ActionDropdown>
1136
+ <label
1137
+ v-if="selectedRowsText"
1138
+ :class="bulkActionAvailabilityClass"
1139
+ class="action-availability"
1140
+ >
1141
+ {{ selectedRowsText }}
1142
+ </label>
1143
+ </template>
1144
+ </slot>
1145
+ </div>
1238
1146
  <div
1239
1147
  v-if="!hasAdvancedFiltering && $slots['header-middle']"
1240
1148
  class="middle"
1241
- style="margin-left: 10px;margin-right: -10px;"
1242
1149
  >
1243
1150
  <slot name="header-middle" />
1244
1151
  </div>
@@ -1247,7 +1154,6 @@ export default {
1247
1154
  v-if="search || hasAdvancedFiltering || isTooManyItemsToAutoUpdate || $slots['header-right']"
1248
1155
  class="search row"
1249
1156
  data-testid="search-box-filter-row"
1250
- style="max-height: 32px;display: contents;"
1251
1157
  >
1252
1158
  <ul
1253
1159
  v-if="hasAdvancedFiltering"
@@ -1328,32 +1234,19 @@ export default {
1328
1234
  </div>
1329
1235
  </div>
1330
1236
  </div>
1331
- <p
1332
- v-else-if="search"
1333
- id="describe-filter-sortable-table"
1334
- hidden
1335
- >
1336
- {{ t('sortableTable.filteringDescription') }}
1337
- </p>
1338
- <slot name="header-button" />
1339
1237
  <input
1340
- v-if="search"
1238
+ v-else-if="search"
1341
1239
  ref="searchQuery"
1342
1240
  v-model="eventualSearchQuery"
1343
1241
  type="search"
1344
1242
  class="input-sm search-box"
1345
1243
  :aria-label="t('sortableTable.searchLabel')"
1346
- aria-describedby="describe-filter-sortable-table"
1347
1244
  :placeholder="t('sortableTable.search')"
1348
1245
  >
1349
-
1246
+ <slot name="header-button" />
1350
1247
  </div>
1351
1248
  </div>
1352
1249
  </div>
1353
- <div v-if="$slots['banner']">
1354
- <slot name="banner"></slot>
1355
- </div>
1356
- <div class="sort-table-div">
1357
1250
  <table
1358
1251
  ref="table"
1359
1252
  class="sortable-table"
@@ -1544,9 +1437,9 @@ export default {
1544
1437
  :value="col.value"
1545
1438
  :row="row.row"
1546
1439
  :col="col.col"
1547
- :get-custom-detail-link="getCustomDetailLink"
1548
1440
  v-bind="col.col.formatterOpts"
1549
1441
  :row-key="row.key"
1442
+ :get-custom-detail-link="getCustomDetailLink"
1550
1443
  />
1551
1444
  <component
1552
1445
  :is="col.component"
@@ -1578,43 +1471,23 @@ export default {
1578
1471
  </template>
1579
1472
  <td
1580
1473
  v-if="rowActions"
1581
- :align="'left'"
1582
- style="height:60px"
1583
1474
  >
1584
- <div style="display: flex;align-items: center;">
1585
1475
  <slot
1586
1476
  name="row-actions"
1587
1477
  :row="row.row"
1588
1478
  :index="i"
1589
1479
  >
1480
+ <ActionMenu
1481
+ :resource="row.row"
1482
+ :data-testid="componentTestid + '-' + i + '-action-button'"
1483
+ :button-aria-label="t('sortableTable.tableActionsLabel', { resource: row?.row?.id || '' })"
1484
+ />
1590
1485
  </slot>
1591
- <template v-if="featureDropdownMenu">
1592
- <ActionMenu
1593
- :resource="row.row"
1594
- :data-testid="componentTestid + '-' + i + '-action-button'"
1595
- :button-aria-label="t('sortableTable.tableActionsLabel', { resource: row?.row?.id || '' })"
1596
- />
1597
- </template>
1598
- <template v-else>
1599
- <ButtonMultiAction
1600
- :id="`actionButton+${i}+${(row.row && row.row.name) ? row.row.name : ''}`"
1601
- :ref="`actionButton${i}`"
1602
- aria-haspopup="true"
1603
- aria-expanded="false"
1604
- :aria-label="t('sortableTable.tableActionsLabel', { resource: row?.row?.id || '' })"
1605
- :data-testid="componentTestid + '-' + i + '-action-button'"
1606
- :borderless="true"
1607
- @click="handleActionButtonClick(i, $event)"
1608
- @keyup.enter="handleActionButtonClick(i, $event)"
1609
- @keyup.space="handleActionButtonClick(i, $event)"
1610
- />
1611
- </template>
1612
- </div>
1613
1486
  </td>
1614
1487
  </tr>
1615
1488
  </slot>
1616
1489
  </slot>
1617
- <!-- <slot
1490
+ <slot
1618
1491
  v-if="row.showSubRow"
1619
1492
  name="sub-row"
1620
1493
  :full-colspan="fullColspan"
@@ -1646,270 +1519,53 @@ export default {
1646
1519
  {{ row.row.stateDescription }}
1647
1520
  </td>
1648
1521
  </tr>
1649
- </slot> -->
1522
+ </slot>
1650
1523
  </template>
1651
1524
  </tbody>
1652
1525
  </table>
1653
- </div>
1654
1526
  <div
1655
- v-if="!noRows && !noResults"
1656
- :class="$route.path=== '/account'? 'chebox-padding':''"
1657
- style="display: flex;justify-content: flex-start;align-content: center;height: 62px;position: sticky;bottom: 0;background-color: var(--header-bg);padding: 15px 20px 0 30px;margin: 0 -20px 0 -20px;z-index:20"
1527
+ v-if="showPaging"
1528
+ class="paging"
1658
1529
  >
1659
- <div style="display: flex;justify-content: center;height: 32px;">
1660
- <Checkbox
1661
- v-if="tableActions&&availableActions.some(item => item.action != 'download')"
1662
- :value="isMuchSelected"
1663
- class="check"
1664
- data-testid="sortable-table_check_select_all"
1665
- :disabled="noRows || noResults"
1666
- style="display: flex;justify-content: center;align-content: center;"
1667
- @update:value = "muchSelect"
1668
- />
1669
- </div>
1670
- <div
1671
- :class="{'titled': $slots.title && $slots.title.length}"
1672
- class="sortable-table-header"
1673
- style="margin-left: 10px;min-width: 55%;"
1530
+ <button
1531
+ type="button"
1532
+ class="btn btn-sm role-multi-action"
1533
+ data-testid="pagination-first"
1534
+ :disabled="page == 1 || loading"
1535
+ @click="goToPage('first')"
1674
1536
  >
1675
- <slot name="title" />
1676
- <div
1677
- v-if="showHeaderRow"
1678
- class="fixed-header-actions"
1679
- :class="{button: !!$slots['header-button'], 'advanced-filtering': hasAdvancedFiltering,}"
1680
- >
1681
- <div
1682
- :class="bulkActionsClass"
1683
- class="bulk"
1684
- >
1685
- <slot name="header-left">
1686
- <template v-if="tableActions">
1687
- <button
1688
- v-for="(act) in availableActions"
1689
- :id="act.action"
1690
- :key="act.action"
1691
- v-clean-tooltip="actionTooltip"
1692
- type="button"
1693
- class="btn role-primary"
1694
- :class="{[bulkActionClass]:true}"
1695
- :disabled="!act.enabled"
1696
- :data-testid="componentTestid + '-' + act.action"
1697
- role="button"
1698
- :aria-label="act.label"
1699
- @click="applyTableAction(act, null, $event)"
1700
- @keydown.enter.stop
1701
- @mouseover="setBulkActionOfInterest(act)"
1702
- @mouseleave="setBulkActionOfInterest(null)"
1703
- >
1704
- <i
1705
- v-if="act.icon"
1706
- :class="act.icon"
1707
- />
1708
- <span v-clean-html="act.label" />
1709
- </button>
1710
- <template v-if="featureDropdownMenu">
1711
- <ActionDropdownShell
1712
- :disabled="!selectedRows.length"
1713
- :hidden-actions="hiddenActions"
1714
- :action-tooltip="actionTooltip"
1715
- @click="applyTableAction"
1716
- @mouseover="setBulkActionOfInterest"
1717
- @mouseleave="setBulkActionOfInterest"
1718
- />
1719
- </template>
1720
- <template v-else>
1721
- <ActionDropdown
1722
- :class="bulkActionsDropdownClass"
1723
- class="bulk-actions-dropdown"
1724
- :disable-button="!selectedRows.length"
1725
- size="sm"
1726
- >
1727
- <template #button-content>
1728
- <button
1729
- ref="actionDropDown"
1730
- class="btn bg-primary mr-0"
1731
- :disabled="!selectedRows.length"
1732
- >
1733
- <i class="icon icon-gear" />
1734
- <span>{{ t('sortableTable.bulkActions.collapsed.label') }}</span>
1735
- <i class="ml-10 icon icon-chevron-down" />
1736
- </button>
1737
- </template>
1738
- <template #popover-content>
1739
- <ul class="list-unstyled menu">
1740
- <li
1741
- v-for="(act, i) in hiddenActions"
1742
- :key="i"
1743
- v-close-popper
1744
- v-clean-tooltip="{
1745
- content: actionTooltip,
1746
- placement: 'right'
1747
- }"
1748
- :class="{ disabled: !act.enabled }"
1749
- @click="applyTableAction(act, null, $event)"
1750
- @mouseover="setBulkActionOfInterest(act)"
1751
- @mouseleave="setBulkActionOfInterest(null)"
1752
- >
1753
- <i
1754
- v-if="act.icon"
1755
- :class="act.icon"
1756
- />
1757
- <span v-clean-html="act.label" />
1758
- </li>
1759
- </ul>
1760
- </template>
1761
- </ActionDropdown>
1762
- </template>
1763
- <label
1764
- v-if="selectedRowsText"
1765
- :class="bulkActionAvailabilityClass"
1766
- class="action-availability"
1767
- >
1768
- {{ selectedRowsText }}
1769
- </label>
1770
- </template>
1771
- </slot>
1772
- </div>
1773
- </div>
1774
- </div>
1775
-
1776
- <!-- 分页 -->
1777
- <div
1778
- v-if="showPaging"
1779
- class="paging"
1537
+ <i class="icon icon-chevron-beginning" />
1538
+ </button>
1539
+ <button
1540
+ type="button"
1541
+ class="btn btn-sm role-multi-action"
1542
+ data-testid="pagination-prev"
1543
+ :disabled="page == 1 || loading"
1544
+ @click="goToPage('prev')"
1780
1545
  >
1781
- <div style="height: 100%; align-content: center;">
1782
- 共 {{ filteredRows.length }} 条
1783
- </div>
1784
-
1785
- <button
1786
- type="button"
1787
- class="btn btn-sm role-multi-action page-btn-normal"
1788
- :disabled="page == 1"
1789
- :style="{ color: page <= totalPages ? `var(--default-text) !important` : `var(--paimary)`,border: page <= totalPages ? `solid thin var(--border)` : `solid thin var(--paimary)`}"
1790
- @click="goToPage('prev')"
1791
- >
1792
- <!-- <i class="icon icon-chevron-left" /> -->
1793
- <
1794
- </button>
1795
- <button
1796
- type="button"
1797
- class="btn btn-sm role-multi-action page-btn-normal"
1798
- :style="{ color: (page == 1) ? `var(--primary)`:`var(--default-text) !important`,border: (page == 1) ? `solid thin var(--primary)` : `solid thin var(--border)`}"
1799
- @click="goToPage('first')"
1800
- >
1801
- <!-- <i class="icon icon-chevron-beginning" /> -->
1802
- {{ 1 }}
1803
- </button>
1804
- <template v-if="totalPages > 2">
1805
- <div style="display: flex;flex-direction: row;gap: 10px;">
1806
- <button
1807
- v-if="page - 2 > 1 && page <= totalPages "
1808
- type="button"
1809
- class="btn btn-sm role-multi-action page-btn-normal"
1810
- :style="{ color: `var(--default-text) !important`,border: `solid thin white`}"
1811
- >
1812
- ...
1813
- </button>
1814
- <button
1815
- v-if="page - 1 > 1 && page <= totalPages "
1816
- type="button"
1817
- class="btn btn-sm role-multi-action page-btn-normal"
1818
- :style="{ color: `var(--default-text) !important`,border: `solid thin var(--border)`}"
1819
- @click="setPage(page-1)"
1820
- >
1821
- {{ page-1 }}
1822
- </button>
1823
- <button
1824
- v-if="page > 1 && page < totalPages"
1825
- type="button"
1826
- class="btn btn-sm role-multi-action page-btn-normal"
1827
- :style="{ color: `var(--default-text)`,border: `solid thin var(--primary)`}"
1828
- @click="setPage(page)"
1829
- >
1830
- {{ page }}
1831
- </button>
1832
- <button
1833
- v-if="page + 1 < totalPages "
1834
- type="button"
1835
- class="btn btn-sm role-multi-action page-btn-normal"
1836
- :style="{ color: `var(--default-text) !important`,border: `solid thin var(--border)`}"
1837
- @click="setPage(page+1)"
1838
- >
1839
- {{ page+1 }}
1840
- </button>
1841
- <button
1842
- v-if="page +2 < totalPages "
1843
- type="button"
1844
- class="btn btn-sm role-multi-action page-btn-normal"
1845
- :style="{ color: `var(--default-text) !important`,border: `solid thin white`}"
1846
- >
1847
- ...
1848
- </button>
1849
- </div>
1850
- </template>
1851
- <!-- <button
1852
- type="button"
1853
- class="btn btn-sm role-multi-action"
1854
- style="padding: 0;max-width: 32px;background-color: white !important;"
1855
- >
1856
- {{ page }}
1857
- </button> -->
1858
- <button
1859
- v-if="totalPages > 1"
1860
- type="button"
1861
- class="btn btn-sm role-multi-action page-btn-normal"
1862
- :style="{ color: (page == totalPages) ? `var(--primary)`:`var(--default-text) !important`,border: (page == totalPages) ? `solid thin var(--primary)` : `solid thin var(--border)`}"
1863
- @click="goToPage('last')"
1864
- >
1865
- <!-- <i class="icon icon-chevron-end" /> -->
1866
- {{ totalPages }}
1867
- </button>
1868
- <button
1869
- type="button"
1870
- class="btn btn-sm role-multi-action page-btn-normal"
1871
- :disabled="page == totalPages"
1872
- :style="{ color: page <= totalPages ? `var(--default-text) !important` : `var(--paimary)`,border: page <= totalPages ? `solid thin var(--border)` : `solid thin var(--paimary)`}"
1873
- @click="goToPage('next')"
1874
- >
1875
- <!-- <i class="icon icon-chevron-right" /> -->
1876
- >
1877
- </button>
1878
-
1879
- <!-- 分页页码切换 -->
1880
- <Select
1881
- :mode="inputPerPage"
1882
- :searchable="false"
1883
- :clearable="false"
1884
- :options="perPageOptions"
1885
- v-model:value="inputPerPage"
1886
- class="pageSelect"
1887
- @update:value="changePerPage"
1888
- />
1889
-
1890
- <div style="height: 100%; align-content: center;">
1891
- 跳至
1892
- </div>
1893
- <input
1894
- v-model="inputPage"
1895
- type="number"
1896
- min="1"
1897
- step="1"
1898
- style="padding: 0px 10px;"
1899
- @keyup.enter="handleToPage"
1900
- >
1901
- <div style="height: 100%; align-content: center;">
1902
-
1903
- </div>
1904
- <!-- <button
1546
+ <i class="icon icon-chevron-left" />
1547
+ </button>
1548
+ <span>
1549
+ {{ pagingDisplay }}
1550
+ </span>
1551
+ <button
1905
1552
  type="button"
1906
1553
  class="btn btn-sm role-multi-action"
1907
- style="padding: 0;max-width: 80px;background-color: white !important;"
1908
- @click="setPage(inputPage)"
1554
+ data-testid="pagination-next"
1555
+ :disabled="page == totalPages || loading"
1556
+ @click="goToPage('next')"
1909
1557
  >
1910
-
1911
- </button> -->
1912
- </div>
1558
+ <i class="icon icon-chevron-right" />
1559
+ </button>
1560
+ <button
1561
+ type="button"
1562
+ class="btn btn-sm role-multi-action"
1563
+ data-testid="pagination-last"
1564
+ :disabled="page == totalPages || loading"
1565
+ @click="goToPage('last')"
1566
+ >
1567
+ <i class="icon icon-chevron-end" />
1568
+ </button>
1913
1569
  </div>
1914
1570
  <button
1915
1571
  v-if="search"
@@ -2093,12 +1749,9 @@ export default {
2093
1749
  }
2094
1750
 
2095
1751
  .search-box {
2096
- height: 32px;
2097
- margin-left: 0px;
2098
- /* min-width: 180px; */
2099
- min-width: 280px;
2100
- width: 280px !important;
2101
- border: 1px solid rgb(217, 217, 217);
1752
+ height: 40px;
1753
+ margin-left: 10px;
1754
+ min-width: 180px;
2102
1755
  }
2103
1756
  </style>
2104
1757
 
@@ -2124,8 +1777,7 @@ export default {
2124
1777
  border-collapse: collapse;
2125
1778
  min-width: 400px;
2126
1779
  border-radius: 5px 5px 0 0;
2127
- border-bottom: 1px solid var(--border);
2128
- /* outline: 1px solid var(--border); */
1780
+ outline: 1px solid var(--border);
2129
1781
  background: var(--sortable-table-bg);
2130
1782
  border-radius: 4px;
2131
1783
 
@@ -2139,77 +1791,32 @@ export default {
2139
1791
  td {
2140
1792
  padding: 8px 5px;
2141
1793
  border: 0;
2142
- background: var(--sortable-table-row-bg);
2143
1794
 
2144
1795
  &:first-child {
2145
1796
  padding-left: 10px;
2146
- position: sticky;
2147
- left: 0;
2148
- z-index: 2;
2149
- }
2150
- &:nth-child(2) {
2151
- padding-left: 10px;
2152
- position: sticky;
2153
- left: 29px;
2154
- z-index: 2;
2155
1797
  }
2156
1798
 
2157
1799
  &:last-child {
2158
1800
  padding-right: 10px;
2159
- position: sticky;
2160
- right: 0;
2161
- z-index: 2;
2162
- /* padding-left: 10px; */
2163
1801
  }
2164
1802
 
2165
1803
  &.row-check {
2166
1804
  padding-top: 12px;
2167
- right: 0;
2168
- position: sticky;
2169
1805
  }
2170
1806
  }
2171
- th {
2172
- padding: 13px 5px;
2173
- border: 0;
2174
- /* height: 50.84px; */
2175
- box-sizing: border-box;
2176
- background: var(--sortable-table-header-bg);
2177
-
2178
- &:first-child {
2179
- padding-left: 10px;
2180
- position: sticky;
2181
- left: 0;
2182
- z-index: 2;
2183
- }
2184
- &:nth-child(2) {
2185
- padding-left: 10px;
2186
- position: sticky;
2187
- left: 29px;
2188
- z-index: 2;
2189
- }
2190
1807
 
2191
- &:last-child {
2192
- padding-left: 10px;
2193
- padding-right: 10px;
2194
- position: sticky;
2195
- right: 0;
2196
- z-index: 2;
2197
- }
2198
-
2199
- }
2200
1808
  tbody {
2201
1809
  tr {
2202
1810
  border-bottom: 1px solid var(--sortable-table-top-divider);
2203
1811
  background-color: var(--sortable-table-row-bg);
2204
- height: 60px;
2205
1812
 
2206
1813
  &.main-row.has-sub-row {
2207
- /* border-bottom: 0; */
1814
+ border-bottom: 0;
2208
1815
  }
2209
1816
 
2210
1817
  // if a main-row is hovered also hover it's sibling sub row. note - the reverse is handled in selection.js
2211
1818
  &.main-row:not(.row-selected):hover + .sub-row {
2212
- /* background-color: var(--sortable-table-hover-bg); */
1819
+ background-color: var(--sortable-table-hover-bg);
2213
1820
  }
2214
1821
 
2215
1822
  &:last-of-type {
@@ -2217,7 +1824,7 @@ export default {
2217
1824
  }
2218
1825
 
2219
1826
  &:hover, &.sub-row-hovered {
2220
- /* background-color: var(--sortable-table-hover-bg); */
1827
+ background-color: var(--sortable-table-hover-bg);
2221
1828
  }
2222
1829
 
2223
1830
  &.state-description > td {
@@ -2232,7 +1839,7 @@ export default {
2232
1839
  }
2233
1840
 
2234
1841
  tr.row-selected {
2235
- /* background: var(--sortable-table-selected-bg); */
1842
+ background: var(--sortable-table-selected-bg);
2236
1843
  }
2237
1844
 
2238
1845
  .no-rows {
@@ -2247,22 +1854,18 @@ export default {
2247
1854
  background-color: var(--body-bg);
2248
1855
  }
2249
1856
  }
2250
- .no-results{
2251
- height: 60px;
2252
- }
2253
1857
 
2254
1858
  &.group {
2255
1859
  &:before {
2256
1860
  content: "";
2257
1861
  display: block;
2258
- height: 0px;
1862
+ height: 20px;
2259
1863
  background-color: transparent;
2260
1864
  }
2261
1865
  }
2262
1866
 
2263
1867
  tr.group-row {
2264
1868
  background-color: initial;
2265
- height: 40px;
2266
1869
 
2267
1870
  &:first-child {
2268
1871
  border-bottom: 2px solid var(--sortable-table-row-bg);
@@ -2359,7 +1962,7 @@ export default {
2359
1962
  }
2360
1963
 
2361
1964
  .fixed-header-actions {
2362
- /* padding: 0 0 20px 0; */
1965
+ padding: 0 0 20px 0;
2363
1966
  width: 100%;
2364
1967
  z-index: z-index('fixedTableHeader');
2365
1968
  background: transparent;
@@ -2475,122 +2078,12 @@ export default {
2475
2078
  }
2476
2079
 
2477
2080
  .paging {
2478
- //text-align: center;
2479
- display: flex;
2480
- justify-content: flex-end;
2481
- gap: 0 10px;
2081
+ margin-top: 10px;
2482
2082
  text-align: center;
2483
- max-height: 32px;
2484
- background-color: transparent;
2485
- flex: 1;
2083
+
2486
2084
  SPAN {
2487
2085
  display: inline-block;
2488
- //min-width: 200px;
2489
- }
2490
-
2491
- /* 针对Webkit浏览器(如Chrome, Safari) */
2492
- input[type="number"]::-webkit-inner-spin-button,
2493
- input[type="number"]::-webkit-outer-spin-button {
2494
- -webkit-appearance: none;
2495
- margin: 0;
2496
- }
2497
-
2498
- /* 针对Firefox */
2499
- input[type="number"] {
2500
- -moz-appearance: textfield;
2501
- // background-color: var(--disabled-bg) !important;
2502
- border: 1px var(--border) solid;
2503
- border-radius: 2px;
2504
- width: 50px;
2505
- height: 100%;
2086
+ min-width: 200px;
2506
2087
  }
2507
2088
  }
2508
-
2509
2089
  </style>
2510
- <style scoped lang="scss">
2511
- :deep() .role-link{
2512
- min-width: unset !important;
2513
- width: 38px;
2514
- min-height: 20px !important;
2515
- height: 20px !important;
2516
- line-height: 20px !important;
2517
- &:hover{
2518
- background-color: unset !important;
2519
- }
2520
- }
2521
- :deep() .checkbox-outer-container-extra{
2522
- margin-top: 0px !important;
2523
- }
2524
- .pageSelect {
2525
- max-width: 100px;
2526
- }
2527
- .page-btn-normal {
2528
- padding: 0;
2529
- max-width: 32px;
2530
- background-color:white !important;
2531
- }
2532
-
2533
- .pageSelect{
2534
- &:deep() .vs__actions:after{
2535
- padding-top: 10px;
2536
- }
2537
- }
2538
- .sort-table-div{
2539
- width:100%;
2540
- white-space:nowrap;
2541
- overflow-x: auto;
2542
- }
2543
-
2544
- /* 滚动阴影左边 */
2545
- .shadow-left td:nth-child(2)::after{
2546
- content: "";
2547
- position: absolute;
2548
- top: 0;
2549
- width: 10px;
2550
- height: 100%;
2551
- right: -10px;
2552
- background: linear-gradient(to right, rgba(5, 5, 5, 0.06), transparent);
2553
- }
2554
- .shadow-left{
2555
- &:deep() th:nth-child(2)::after{
2556
- content: "";
2557
- position: absolute;
2558
- top: 0;
2559
- width: 10px;
2560
- height: 100%;
2561
- right: -10px;
2562
- background: linear-gradient(to right, rgba(5, 5, 5, 0.06), transparent);
2563
- }
2564
- }
2565
-
2566
- /* 滚动阴影右边 */
2567
- .shadow-right td:nth-last-child(1)::after{
2568
- content: "";
2569
- position: absolute;
2570
- top: 0;
2571
- width: 10px;
2572
- height: 100%;
2573
- left: -10px;
2574
- background: linear-gradient(to left, rgba(5, 5, 5, 0.06), transparent);
2575
- }
2576
-
2577
- .shadow-right{
2578
- &:deep() th:nth-last-child(1)::after {
2579
- content: "";
2580
- position: absolute;
2581
- top: 0;
2582
- width: 10px;
2583
- height: 100%;
2584
- left: -10px;
2585
- background: linear-gradient(to left, rgba(5, 5, 5, 0.06), transparent);
2586
- }
2587
- }
2588
-
2589
- /* 滚动阴影垂直修正 */
2590
- .shadow-y td:nth-child(-n + 2), /* 前两列 */
2591
- .shadow-y td:nth-last-child(1) /* 后一列 */
2592
- {
2593
- z-index: 3;
2594
- }
2595
- </style>
2596
-