@alauda-fe/dynamic-plugin-shared 0.0.1-alpha.0
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/README.md +7 -0
- package/array-form-table/base-string-map-form.component.d.ts +22 -0
- package/array-form-table/form/component.d.ts +106 -0
- package/array-form-table/form/index.d.ts +2 -0
- package/array-form-table/index.d.ts +10 -0
- package/array-form-table/key-value-form/component.d.ts +38 -0
- package/array-form-table/key-value-table/component.d.ts +9 -0
- package/array-form-table/string-array-form/component.d.ts +41 -0
- package/assets/images/abnormal.svg +1 -0
- package/assets/images/dark/disconnected.svg +1 -0
- package/assets/images/dark/license-abnormal.svg +1 -0
- package/assets/images/dark/network-abnormal.svg +1 -0
- package/assets/images/dark/no-data.svg +1 -0
- package/assets/images/dark/no-message.svg +1 -0
- package/assets/images/dark/no-permission.svg +1 -0
- package/assets/images/dark/no_realtime_alarm.svg +1 -0
- package/assets/images/dark/not-deployed.svg +1 -0
- package/assets/images/dark/not-found.svg +1 -0
- package/assets/images/dark/not-supported.svg +1 -0
- package/assets/images/dark/system-abnormal.svg +1 -0
- package/assets/images/light/disconnected.svg +1 -0
- package/assets/images/light/license-abnormal.svg +1 -0
- package/assets/images/light/network-abnormal.svg +1 -0
- package/assets/images/light/no-data.svg +1 -0
- package/assets/images/light/no-message.svg +1 -0
- package/assets/images/light/no-permission.svg +1 -0
- package/assets/images/light/no_realtime_alarm.svg +1 -0
- package/assets/images/light/not-deployed.svg +1 -0
- package/assets/images/light/not-found.svg +1 -0
- package/assets/images/light/not-supported.svg +1 -0
- package/assets/images/light/system-abnormal.svg +1 -0
- package/assets/images/no-data.png +0 -0
- package/async-data/async-data-loader.d.ts +31 -0
- package/async-data/error-page/component.d.ts +30 -0
- package/async-data/index.d.ts +13 -0
- package/async-data/page-state/component.d.ts +21 -0
- package/async-data/types.d.ts +29 -0
- package/code-editor/code-display-dialog/component.d.ts +17 -0
- package/code-editor/code-editor-configs.d.ts +19 -0
- package/code-editor/index.d.ts +10 -0
- package/code-editor/k8s-yaml-display-dialog/component.d.ts +16 -0
- package/code-editor/resource-yaml-display/component.d.ts +21 -0
- package/components/card-section/card-section.component.d.ts +9 -0
- package/components/confirm-delete/confirm-delete.component.d.ts +57 -0
- package/components/confirm-delete/utils.d.ts +25 -0
- package/components/current-time/component.d.ts +14 -0
- package/components/custom-columns-setting/component.d.ts +16 -0
- package/components/custom-columns-setting/index.d.ts +1 -0
- package/components/date-range-picker/component.d.ts +55 -0
- package/components/date-range-picker/index.d.ts +3 -0
- package/components/date-range-picker/type.d.ts +36 -0
- package/components/date-range-picker/util.d.ts +11 -0
- package/components/disabled-container/disabled-container.component.d.ts +21 -0
- package/components/disabled-container/index.d.ts +7 -0
- package/components/field-set/column/component.d.ts +10 -0
- package/components/field-set/group/component.d.ts +6 -0
- package/components/field-set/index.d.ts +7 -0
- package/components/field-set/item/component.d.ts +13 -0
- package/components/foldable-block/component.d.ts +17 -0
- package/components/foldable-item-in-table/component.d.ts +21 -0
- package/components/help-document/component.d.ts +29 -0
- package/components/help-document/directive.d.ts +20 -0
- package/components/help-document/index.d.ts +8 -0
- package/components/help-document/service.d.ts +20 -0
- package/components/index.d.ts +31 -0
- package/components/loading-mask/loading-mask.component.d.ts +13 -0
- package/components/page-guard/component/component.d.ts +40 -0
- package/components/page-guard/component/helper-directives.d.ts +17 -0
- package/components/page-guard/component/page-guard.type.d.ts +86 -0
- package/components/page-guard/index.d.ts +12 -0
- package/components/password-input/component.d.ts +39 -0
- package/components/pod-status/component.d.ts +25 -0
- package/components/pod-status/index.d.ts +3 -0
- package/components/pod-status/status.d.ts +4 -0
- package/components/pod-status/typings.d.ts +16 -0
- package/components/relative-time/component.d.ts +15 -0
- package/components/resource-label/component.d.ts +25 -0
- package/components/resource-multi-select/component.d.ts +41 -0
- package/components/resource-multi-select/util.d.ts +10 -0
- package/components/search-panel/component.d.ts +16 -0
- package/components/search-panel/helper.directive.d.ts +5 -0
- package/components/search-panel/search-item/component.d.ts +7 -0
- package/components/select-prefix-label/directive.d.ts +17 -0
- package/components/status-icon/status-icon.component.d.ts +16 -0
- package/components/tags-label/component.d.ts +56 -0
- package/components/terminating-tag/component.d.ts +7 -0
- package/components/text-ellipsis/component.d.ts +9 -0
- package/components/text-tooltip/directive.d.ts +21 -0
- package/components/text-with-url/component.d.ts +12 -0
- package/components/upload-file/component.d.ts +32 -0
- package/components/zero-state/zero-state.component.d.ts +16 -0
- package/constants/common.d.ts +64 -0
- package/constants/index.d.ts +6 -0
- package/constants/k8s.d.ts +12 -0
- package/constants/patterns.d.ts +124 -0
- package/constants/resource-definitions.d.ts +414 -0
- package/constants/status-icons.d.ts +34 -0
- package/constants/timezones.d.ts +6 -0
- package/directives/aui-code-editor.directive.d.ts +13 -0
- package/directives/click-outside.directive.d.ts +12 -0
- package/directives/declare.directive.d.ts +8 -0
- package/directives/disabled.directive.d.ts +28 -0
- package/directives/effect-directive/coerce-number.directive.d.ts +8 -0
- package/directives/effect-directive/e2e-attribute-binding.directive.d.ts +10 -0
- package/directives/effect-directive/event.directive.d.ts +47 -0
- package/directives/effect-directive/index.d.ts +12 -0
- package/directives/effect-directive/min-max.directive.d.ts +30 -0
- package/directives/effect-directive/trim.directive.d.ts +7 -0
- package/directives/effect-directive/validators.directive.d.ts +12 -0
- package/directives/feature-gate.directive.d.ts +31 -0
- package/directives/index.d.ts +12 -0
- package/directives/last-form-item.directive.d.ts +8 -0
- package/directives/readonly-field.directive.d.ts +39 -0
- package/directives/resize.directive.d.ts +17 -0
- package/directives/scroll-border-observer.directive.d.ts +23 -0
- package/directives/scroll-to-first-invalid.directive.d.ts +24 -0
- package/directives/value-trace.directive.d.ts +27 -0
- package/esm2022/alauda-fe-dynamic-plugin-shared.mjs +5 -0
- package/esm2022/array-form-table/base-string-map-form.component.mjs +92 -0
- package/esm2022/array-form-table/form/component.mjs +266 -0
- package/esm2022/array-form-table/form/index.mjs +12 -0
- package/esm2022/array-form-table/index.mjs +11 -0
- package/esm2022/array-form-table/key-value-form/component.mjs +135 -0
- package/esm2022/array-form-table/key-value-table/component.mjs +24 -0
- package/esm2022/array-form-table/string-array-form/component.mjs +168 -0
- package/esm2022/async-data/async-data-loader.mjs +63 -0
- package/esm2022/async-data/error-page/component.mjs +54 -0
- package/esm2022/async-data/index.mjs +18 -0
- package/esm2022/async-data/page-state/component.mjs +62 -0
- package/esm2022/async-data/types.mjs +6 -0
- package/esm2022/code-editor/code-display-dialog/component.mjs +35 -0
- package/esm2022/code-editor/code-editor-configs.mjs +66 -0
- package/esm2022/code-editor/index.mjs +11 -0
- package/esm2022/code-editor/k8s-yaml-display-dialog/component.mjs +26 -0
- package/esm2022/code-editor/resource-yaml-display/component.mjs +67 -0
- package/esm2022/components/card-section/card-section.component.mjs +24 -0
- package/esm2022/components/confirm-delete/confirm-delete.component.mjs +192 -0
- package/esm2022/components/confirm-delete/utils.mjs +8 -0
- package/esm2022/components/current-time/component.mjs +39 -0
- package/esm2022/components/custom-columns-setting/component.mjs +75 -0
- package/esm2022/components/custom-columns-setting/index.mjs +2 -0
- package/esm2022/components/date-range-picker/component.mjs +215 -0
- package/esm2022/components/date-range-picker/index.mjs +4 -0
- package/esm2022/components/date-range-picker/type.mjs +2 -0
- package/esm2022/components/date-range-picker/util.mjs +57 -0
- package/esm2022/components/disabled-container/disabled-container.component.mjs +81 -0
- package/esm2022/components/disabled-container/index.mjs +8 -0
- package/esm2022/components/field-set/column/component.mjs +25 -0
- package/esm2022/components/field-set/group/component.mjs +16 -0
- package/esm2022/components/field-set/index.mjs +14 -0
- package/esm2022/components/field-set/item/component.mjs +41 -0
- package/esm2022/components/foldable-block/component.mjs +60 -0
- package/esm2022/components/foldable-item-in-table/component.mjs +56 -0
- package/esm2022/components/help-document/component.mjs +69 -0
- package/esm2022/components/help-document/directive.mjs +70 -0
- package/esm2022/components/help-document/index.mjs +9 -0
- package/esm2022/components/help-document/service.mjs +43 -0
- package/esm2022/components/index.mjs +32 -0
- package/esm2022/components/loading-mask/loading-mask.component.mjs +35 -0
- package/esm2022/components/page-guard/component/component.mjs +101 -0
- package/esm2022/components/page-guard/component/helper-directives.mjs +51 -0
- package/esm2022/components/page-guard/component/page-guard.type.mjs +82 -0
- package/esm2022/components/page-guard/index.mjs +19 -0
- package/esm2022/components/password-input/component.mjs +143 -0
- package/esm2022/components/pod-status/component.mjs +49 -0
- package/esm2022/components/pod-status/index.mjs +4 -0
- package/esm2022/components/pod-status/status.mjs +84 -0
- package/esm2022/components/pod-status/typings.mjs +19 -0
- package/esm2022/components/relative-time/component.mjs +58 -0
- package/esm2022/components/resource-label/component.mjs +100 -0
- package/esm2022/components/resource-multi-select/component.mjs +152 -0
- package/esm2022/components/resource-multi-select/util.mjs +24 -0
- package/esm2022/components/search-panel/component.mjs +51 -0
- package/esm2022/components/search-panel/helper.directive.mjs +14 -0
- package/esm2022/components/search-panel/search-item/component.mjs +15 -0
- package/esm2022/components/select-prefix-label/directive.mjs +89 -0
- package/esm2022/components/status-icon/status-icon.component.mjs +56 -0
- package/esm2022/components/tags-label/component.mjs +224 -0
- package/esm2022/components/terminating-tag/component.mjs +16 -0
- package/esm2022/components/text-ellipsis/component.mjs +28 -0
- package/esm2022/components/text-tooltip/directive.mjs +71 -0
- package/esm2022/components/text-with-url/component.mjs +40 -0
- package/esm2022/components/upload-file/component.mjs +95 -0
- package/esm2022/components/zero-state/zero-state.component.mjs +51 -0
- package/esm2022/constants/common.mjs +86 -0
- package/esm2022/constants/index.mjs +7 -0
- package/esm2022/constants/k8s.mjs +13 -0
- package/esm2022/constants/patterns.mjs +142 -0
- package/esm2022/constants/resource-definitions.mjs +424 -0
- package/esm2022/constants/status-icons.mjs +65 -0
- package/esm2022/constants/timezones.mjs +234 -0
- package/esm2022/directives/aui-code-editor.directive.mjs +30 -0
- package/esm2022/directives/click-outside.directive.mjs +49 -0
- package/esm2022/directives/declare.directive.mjs +27 -0
- package/esm2022/directives/disabled.directive.mjs +76 -0
- package/esm2022/directives/effect-directive/coerce-number.directive.mjs +54 -0
- package/esm2022/directives/effect-directive/e2e-attribute-binding.directive.mjs +57 -0
- package/esm2022/directives/effect-directive/event.directive.mjs +129 -0
- package/esm2022/directives/effect-directive/index.mjs +21 -0
- package/esm2022/directives/effect-directive/min-max.directive.mjs +107 -0
- package/esm2022/directives/effect-directive/trim.directive.mjs +40 -0
- package/esm2022/directives/effect-directive/validators.directive.mjs +43 -0
- package/esm2022/directives/feature-gate.directive.mjs +90 -0
- package/esm2022/directives/index.mjs +13 -0
- package/esm2022/directives/last-form-item.directive.mjs +18 -0
- package/esm2022/directives/readonly-field.directive.mjs +145 -0
- package/esm2022/directives/resize.directive.mjs +39 -0
- package/esm2022/directives/scroll-border-observer.directive.mjs +77 -0
- package/esm2022/directives/scroll-to-first-invalid.directive.mjs +126 -0
- package/esm2022/directives/value-trace.directive.mjs +61 -0
- package/esm2022/form/base-form-container.mjs +126 -0
- package/esm2022/form/base-nested-form-control.mjs +190 -0
- package/esm2022/form/errors-mapper/base-errors-mapper.mjs +41 -0
- package/esm2022/form/errors-mapper/default-errors-mapper.service.mjs +65 -0
- package/esm2022/form/errors-mapper/errors-mapper-component/component.mjs +53 -0
- package/esm2022/form/errors-mapper/errors-mapper.directive.mjs +109 -0
- package/esm2022/form/errors-mapper/index.mjs +10 -0
- package/esm2022/form/errors-mapper/types.mjs +2 -0
- package/esm2022/form/index.mjs +6 -0
- package/esm2022/form/utils.mjs +61 -0
- package/esm2022/form/validators/async-function-validator.directive.mjs +49 -0
- package/esm2022/form/validators/dns1123-subdomain.mjs +42 -0
- package/esm2022/form/validators/function-validator.directive.mjs +49 -0
- package/esm2022/form/validators/index.mjs +10 -0
- package/esm2022/form/validators/maxlength-minlength-validator.directive.mjs +71 -0
- package/esm2022/form/validators/not-be-validator.directive.mjs +56 -0
- package/esm2022/form/validators/one-of-validator.directive.mjs +57 -0
- package/esm2022/form/validators/resource-limit.mjs +79 -0
- package/esm2022/form/validators/strong-password/index.mjs +4 -0
- package/esm2022/form/validators/strong-password/strong-password-tooltip/component.mjs +15 -0
- package/esm2022/form/validators/strong-password/strong-password-validator.directive.mjs +171 -0
- package/esm2022/form/validators/strong-password/strong-password-validator.module.mjs +36 -0
- package/esm2022/form/validators/utils.mjs +155 -0
- package/esm2022/index.mjs +15 -0
- package/esm2022/k8s-resource-list/footer/component.mjs +156 -0
- package/esm2022/k8s-resource-list/index.mjs +18 -0
- package/esm2022/k8s-resource-list/k8s-resource-list.mjs +224 -0
- package/esm2022/k8s-resource-list/k8s-resource-paged-list.mjs +174 -0
- package/esm2022/k8s-resource-list/types.mjs +11 -0
- package/esm2022/k8s-resource-list/utils.mjs +84 -0
- package/esm2022/k8s-shared/constants.mjs +53 -0
- package/esm2022/k8s-shared/index.mjs +12 -0
- package/esm2022/k8s-shared/k8s-resource-translate-key.pipe.mjs +31 -0
- package/esm2022/k8s-shared/k8s-shared-util.service.mjs +152 -0
- package/esm2022/k8s-shared/resource-mark/component.mjs +54 -0
- package/esm2022/k8s-shared/resource-mark/util.mjs +137 -0
- package/esm2022/k8s-shared/update-description-dialog/component.mjs +66 -0
- package/esm2022/k8s-shared/update-display-name-dialog/component.mjs +59 -0
- package/esm2022/k8s-shared/update-key-value-dialog/component.mjs +76 -0
- package/esm2022/page-deactivate/deactivate.directive.mjs +50 -0
- package/esm2022/page-deactivate/deactivate.guard.mjs +41 -0
- package/esm2022/page-deactivate/deactivate.service.mjs +78 -0
- package/esm2022/page-deactivate/index.mjs +4 -0
- package/esm2022/pipes/calc.pipe.mjs +21 -0
- package/esm2022/pipes/cron-human-readable.pipe.mjs +30 -0
- package/esm2022/pipes/crontab-next.pipe.mjs +67 -0
- package/esm2022/pipes/duration.pipe.mjs +51 -0
- package/esm2022/pipes/field-not-available.pipe.mjs +25 -0
- package/esm2022/pipes/img-header.pipe.mjs +18 -0
- package/esm2022/pipes/img-theme.pipe.mjs +38 -0
- package/esm2022/pipes/index.mjs +19 -0
- package/esm2022/pipes/keyvalue.pipe.mjs +20 -0
- package/esm2022/pipes/marked.pipe.mjs +18 -0
- package/esm2022/pipes/minimum-format.pipe.mjs +25 -0
- package/esm2022/pipes/page-env.pipe.mjs +69 -0
- package/esm2022/pipes/parse-json-translate.pipe.mjs +28 -0
- package/esm2022/pipes/parse-json.pipe.mjs +22 -0
- package/esm2022/pipes/pure.pipe.mjs +26 -0
- package/esm2022/pipes/safe.pipe.mjs +49 -0
- package/esm2022/pipes/sanitize.pipe.mjs +31 -0
- package/esm2022/pipes/time.pipe.mjs +113 -0
- package/esm2022/pipes/timezone-display.pipe.mjs +21 -0
- package/esm2022/services/form-row-duplicate/form-row-duplicate.service.mjs +280 -0
- package/esm2022/services/index.mjs +4 -0
- package/esm2022/services/on-resize.service.mjs +52 -0
- package/esm2022/services/yaml-util.service.mjs +99 -0
- package/esm2022/types/common.mjs +6 -0
- package/esm2022/types/helpers.mjs +12 -0
- package/esm2022/types/index.mjs +9 -0
- package/esm2022/types/k8s/core.mjs +2 -0
- package/esm2022/types/k8s/crd.mjs +57 -0
- package/esm2022/types/k8s/index.mjs +4 -0
- package/esm2022/types/k8s/raw.mjs +77 -0
- package/esm2022/types/schema.mjs +2 -0
- package/esm2022/utils/browser.mjs +21 -0
- package/esm2022/utils/cache-store.mjs +83 -0
- package/esm2022/utils/color-helpers.mjs +6 -0
- package/esm2022/utils/common.mjs +315 -0
- package/esm2022/utils/cron-util.mjs +44 -0
- package/esm2022/utils/decorators.mjs +137 -0
- package/esm2022/utils/disabled-state.mjs +47 -0
- package/esm2022/utils/format-number.mjs +227 -0
- package/esm2022/utils/index.mjs +24 -0
- package/esm2022/utils/local-storage-constants.mjs +2 -0
- package/esm2022/utils/node.mjs +18 -0
- package/esm2022/utils/observable.mjs +32 -0
- package/esm2022/utils/operators.mjs +38 -0
- package/esm2022/utils/request-pool.mjs +37 -0
- package/esm2022/utils/resources.mjs +66 -0
- package/esm2022/utils/router.mjs +20 -0
- package/esm2022/utils/sort-fn.mjs +7 -0
- package/esm2022/utils/tree.mjs +79 -0
- package/esm2022/utils/unit.mjs +191 -0
- package/esm2022/utils/version.mjs +76 -0
- package/esm2022/utils/with-load-state.mjs +21 -0
- package/esm2022/utils/workload.mjs +183 -0
- package/esm2022/utils/workspace.mjs +59 -0
- package/esm2022/utils/yaml.mjs +54 -0
- package/fesm2022/alauda-fe-dynamic-plugin-shared.mjs +11151 -0
- package/fesm2022/alauda-fe-dynamic-plugin-shared.mjs.map +1 -0
- package/form/base-form-container.d.ts +41 -0
- package/form/base-nested-form-control.d.ts +58 -0
- package/form/errors-mapper/base-errors-mapper.d.ts +13 -0
- package/form/errors-mapper/default-errors-mapper.service.d.ts +10 -0
- package/form/errors-mapper/errors-mapper-component/component.d.ts +19 -0
- package/form/errors-mapper/errors-mapper.directive.d.ts +39 -0
- package/form/errors-mapper/index.d.ts +6 -0
- package/form/errors-mapper/types.d.ts +16 -0
- package/form/index.d.ts +5 -0
- package/form/utils.d.ts +40 -0
- package/form/validators/async-function-validator.directive.d.ts +11 -0
- package/form/validators/dns1123-subdomain.d.ts +28 -0
- package/form/validators/function-validator.directive.d.ts +11 -0
- package/form/validators/index.d.ts +9 -0
- package/form/validators/maxlength-minlength-validator.directive.d.ts +20 -0
- package/form/validators/not-be-validator.directive.d.ts +12 -0
- package/form/validators/one-of-validator.directive.d.ts +12 -0
- package/form/validators/resource-limit.d.ts +17 -0
- package/form/validators/strong-password/index.d.ts +3 -0
- package/form/validators/strong-password/strong-password-tooltip/component.d.ts +6 -0
- package/form/validators/strong-password/strong-password-validator.directive.d.ts +34 -0
- package/form/validators/strong-password/strong-password-validator.module.d.ts +12 -0
- package/form/validators/utils.d.ts +67 -0
- package/index.d.ts +14 -0
- package/k8s-resource-list/footer/component.d.ts +42 -0
- package/k8s-resource-list/index.d.ts +13 -0
- package/k8s-resource-list/k8s-resource-list.d.ts +42 -0
- package/k8s-resource-list/k8s-resource-paged-list.d.ts +61 -0
- package/k8s-resource-list/types.d.ts +70 -0
- package/k8s-resource-list/utils.d.ts +19 -0
- package/k8s-shared/constants.d.ts +7 -0
- package/k8s-shared/index.d.ts +11 -0
- package/k8s-shared/k8s-resource-translate-key.pipe.d.ts +9 -0
- package/k8s-shared/k8s-shared-util.service.d.ts +48 -0
- package/k8s-shared/resource-mark/component.d.ts +16 -0
- package/k8s-shared/resource-mark/util.d.ts +2 -0
- package/k8s-shared/update-description-dialog/component.d.ts +33 -0
- package/k8s-shared/update-display-name-dialog/component.d.ts +27 -0
- package/k8s-shared/update-key-value-dialog/component.d.ts +38 -0
- package/package.json +56 -0
- package/page-deactivate/deactivate.directive.d.ts +18 -0
- package/page-deactivate/deactivate.guard.d.ts +13 -0
- package/page-deactivate/deactivate.service.d.ts +28 -0
- package/page-deactivate/index.d.ts +3 -0
- package/pipes/calc.pipe.d.ts +11 -0
- package/pipes/cron-human-readable.pipe.d.ts +9 -0
- package/pipes/crontab-next.pipe.d.ts +18 -0
- package/pipes/duration.pipe.d.ts +10 -0
- package/pipes/field-not-available.pipe.d.ts +13 -0
- package/pipes/img-header.pipe.d.ts +7 -0
- package/pipes/img-theme.pipe.d.ts +13 -0
- package/pipes/index.d.ts +18 -0
- package/pipes/keyvalue.pipe.d.ts +9 -0
- package/pipes/marked.pipe.d.ts +8 -0
- package/pipes/minimum-format.pipe.d.ts +10 -0
- package/pipes/page-env.pipe.d.ts +34 -0
- package/pipes/parse-json-translate.pipe.d.ts +8 -0
- package/pipes/parse-json.pipe.d.ts +7 -0
- package/pipes/pure.pipe.d.ts +17 -0
- package/pipes/safe.pipe.d.ts +10 -0
- package/pipes/sanitize.pipe.d.ts +10 -0
- package/pipes/time.pipe.d.ts +40 -0
- package/pipes/timezone-display.pipe.d.ts +10 -0
- package/services/form-row-duplicate/form-row-duplicate.service.d.ts +45 -0
- package/services/index.d.ts +3 -0
- package/services/on-resize.service.d.ts +20 -0
- package/services/yaml-util.service.d.ts +20 -0
- package/styles/ansi-color.scss +131 -0
- package/styles/global.scss +904 -0
- package/styles/lib.scss +1 -0
- package/styles/markdown-body.scss +107 -0
- package/styles/mixins.scss +710 -0
- package/styles/var.scss +30 -0
- package/types/common.d.ts +42 -0
- package/types/helpers.d.ts +35 -0
- package/types/index.d.ts +8 -0
- package/types/k8s/core.d.ts +100 -0
- package/types/k8s/crd.d.ts +497 -0
- package/types/k8s/index.d.ts +3 -0
- package/types/k8s/raw.d.ts +860 -0
- package/types/schema.d.ts +14 -0
- package/utils/browser.d.ts +4 -0
- package/utils/cache-store.d.ts +35 -0
- package/utils/color-helpers.d.ts +4 -0
- package/utils/common.d.ts +64 -0
- package/utils/cron-util.d.ts +8 -0
- package/utils/decorators.d.ts +14 -0
- package/utils/disabled-state.d.ts +20 -0
- package/utils/format-number.d.ts +11 -0
- package/utils/index.d.ts +23 -0
- package/utils/local-storage-constants.d.ts +1 -0
- package/utils/node.d.ts +8 -0
- package/utils/observable.d.ts +5 -0
- package/utils/operators.d.ts +22 -0
- package/utils/request-pool.d.ts +12 -0
- package/utils/resources.d.ts +19 -0
- package/utils/router.d.ts +3 -0
- package/utils/sort-fn.d.ts +2 -0
- package/utils/tree.d.ts +16 -0
- package/utils/unit.d.ts +21 -0
- package/utils/version.d.ts +39 -0
- package/utils/with-load-state.d.ts +11 -0
- package/utils/workload.d.ts +66 -0
- package/utils/workspace.d.ts +28 -0
- package/utils/yaml.d.ts +11 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface OpenAPIV3SchemaObject {
|
|
2
|
+
type: JSONSchema6TypeName;
|
|
3
|
+
description?: string;
|
|
4
|
+
enum?: string[];
|
|
5
|
+
properties?: {
|
|
6
|
+
[key: string]: OpenAPIV3SchemaObject;
|
|
7
|
+
};
|
|
8
|
+
required?: string[];
|
|
9
|
+
items?: OpenAPIV3SchemaObject;
|
|
10
|
+
title?: string;
|
|
11
|
+
default?: any;
|
|
12
|
+
additionalProperties?: OpenAPIV3SchemaObject;
|
|
13
|
+
}
|
|
14
|
+
export type JSONSchema6TypeName = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null' | 'any';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction, Observable } from 'rxjs';
|
|
2
|
+
export declare class CacheStore<P, V> {
|
|
3
|
+
private readonly fetcher;
|
|
4
|
+
private readonly share;
|
|
5
|
+
private readonly validator;
|
|
6
|
+
private readonly store;
|
|
7
|
+
constructor({ fetcher, share, validator }: CacheStoreOptions<P, V>);
|
|
8
|
+
fetchState(params: P): Observable<CacheLoadState<V>>;
|
|
9
|
+
fetch(params: P): Observable<V>;
|
|
10
|
+
refetch(params: P): void;
|
|
11
|
+
refetchAll(): void;
|
|
12
|
+
get(params: P): Cache<V>;
|
|
13
|
+
has(params: P): boolean;
|
|
14
|
+
delete(params: P): void;
|
|
15
|
+
clear(): void;
|
|
16
|
+
forEach: (callbackfn: (value: Cache<V>, key: P, map: Map<P, Cache<V>>) => void, thisArg?: any) => void;
|
|
17
|
+
entries: () => IterableIterator<[P, Cache<V>]>;
|
|
18
|
+
values: () => IterableIterator<Cache<V>>;
|
|
19
|
+
keys: () => IterableIterator<P>;
|
|
20
|
+
}
|
|
21
|
+
export interface CacheStoreOptions<P, V> {
|
|
22
|
+
fetcher: (params: P) => Observable<V>;
|
|
23
|
+
share?: <T>() => MonoTypeOperatorFunction<T>;
|
|
24
|
+
validator?: (loadState: CacheLoadState<V>) => boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface CacheLoadState<V> {
|
|
27
|
+
state: 'loading' | 'loaded' | 'loadFailed';
|
|
28
|
+
result?: V;
|
|
29
|
+
error?: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface Cache<V> {
|
|
32
|
+
loadState: Observable<CacheLoadState<V>>;
|
|
33
|
+
refetch: () => void;
|
|
34
|
+
finish: () => void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @module utils
|
|
4
|
+
*/
|
|
5
|
+
import { Sort } from '@alauda/ui';
|
|
6
|
+
import { UnionToIntersection } from 'ts-essentials';
|
|
7
|
+
import { Callback, Keys, KubernetesResource, Nullable, Readonlyable } from '../types';
|
|
8
|
+
/**
|
|
9
|
+
* 保证任何语言环境下将数字转换为非科学计数法且不带千位分隔符并保留三位有效小数的数字字符串
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* numToStr(123123.3456) // "123123.346"
|
|
13
|
+
* numToStr(123.12) // "123.12"
|
|
14
|
+
*/
|
|
15
|
+
export declare const numToStr: (num?: number) => string;
|
|
16
|
+
export declare const shortNum: (num?: number | string, digits?: number) => string;
|
|
17
|
+
export declare const isBlank: (str?: unknown) => boolean;
|
|
18
|
+
export declare const getBaseHref: () => string;
|
|
19
|
+
export declare const ifExist: <T>(toCheck: boolean | Nullable<T>, truthyValue: T, fallback?: T) => T;
|
|
20
|
+
export declare const isAbsoluteUrl: (url: string) => boolean;
|
|
21
|
+
export declare const noop: Callback;
|
|
22
|
+
export declare const toKeys: <T extends object>(source: T) => Keys<T>;
|
|
23
|
+
export declare const wrapText: (text?: string, wrapper?: Readonlyable<[string, string]>, fallback?: string) => string;
|
|
24
|
+
export declare function parseJSONStream<T>(text: string): T[];
|
|
25
|
+
export declare const trackByUid: <T extends KubernetesResource>(_: number, resource: T) => string;
|
|
26
|
+
export declare const isK8sResource: <T extends KubernetesResource = KubernetesResource>(value: object) => value is T;
|
|
27
|
+
export declare const arrayify: <T, R = T extends (infer S)[] ? NonNullable<S> : NonNullable<T>>(...args: Array<R | R[]>) => R[];
|
|
28
|
+
export declare function sleep(ms?: number): Promise<unknown>;
|
|
29
|
+
export declare const delay: typeof sleep;
|
|
30
|
+
export declare function scrollIntoView(container: HTMLElement, selected: HTMLElement): void;
|
|
31
|
+
export declare const isEqual: <T, V = T>(a: T, b: V) => boolean;
|
|
32
|
+
export declare const parseJson: <T>(str: string, defaultValue?: T) => any;
|
|
33
|
+
export declare function isJsonObjectString(str: string): boolean;
|
|
34
|
+
export declare const parseValidImageName: (image: string) => string;
|
|
35
|
+
export declare const atobWithFallback: (str: string, fallbackValue?: string) => string;
|
|
36
|
+
export interface SafeAssignOptions {
|
|
37
|
+
notice: (duplicates: string[]) => any;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 带重复检查的assign,只做一级key的重复检查
|
|
41
|
+
* 如果有重复项默认会throw error,如果你明确这不是一个关键性错误,则可以通过指定notice函数修改该默认行为
|
|
42
|
+
* @param sources
|
|
43
|
+
* @param optionsOrNotice
|
|
44
|
+
* @return object 一个全新的对象
|
|
45
|
+
*/
|
|
46
|
+
export declare const safeAssign: <T extends Record<string, any>>(sources: T[], optionsOrNotice?: SafeAssignOptions["notice"] | SafeAssignOptions) => UnionToIntersection<T>;
|
|
47
|
+
export declare const toLowerFirstLetter: (text: string) => string;
|
|
48
|
+
export declare const loadEnv: (envText: string) => Array<[string, string]>;
|
|
49
|
+
export declare function filterEmptyValue<T extends Record<string, unknown>>(obj: T): Partial<T>;
|
|
50
|
+
export declare function parseBase64Type(base64Str: string): string;
|
|
51
|
+
export declare function appendImageHeader(value: string, prefix?: string): string;
|
|
52
|
+
export declare const getRelativePath: (from: string, to: string) => string;
|
|
53
|
+
export declare const getToPath: (from: string, relative: string) => string;
|
|
54
|
+
export declare const trackByName: <T extends KubernetesResource>(_: number, resource: T) => string;
|
|
55
|
+
export declare function tableSort<T>(list: T[], sort: Sort, sortActiveValueFn: (item: T, name: string) => string | number): T[];
|
|
56
|
+
export declare function tableSortAdvance<T>(list: T[], sort: Sort, sortActiveValueFn: (item: T, name: string) => string | number): T[];
|
|
57
|
+
export declare const buildImageAddress: (url: string, tagOrDigest: string) => string;
|
|
58
|
+
export declare const parseImageAddress: (addr: string) => {
|
|
59
|
+
digest?: string;
|
|
60
|
+
tag?: string;
|
|
61
|
+
url: string;
|
|
62
|
+
};
|
|
63
|
+
export declare const clearWindowsXtermTools: () => void;
|
|
64
|
+
export declare const buildUrl: (baseUri: string, params?: Record<string, string | boolean>) => string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const CRON_ENABLE_7_FOR_SUNDAY = false;
|
|
2
|
+
export type CronWeekDay = 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
|
|
3
|
+
export declare const CronWeekDays: CronWeekDay[];
|
|
4
|
+
export declare const WEEK_DAYS: CronWeekDay[];
|
|
5
|
+
export declare function getCronWeekDayNumbers(schedule: string): number[];
|
|
6
|
+
export declare function isCronWeekDayCorrect(schedule: string): boolean;
|
|
7
|
+
export declare function isCronWeekDaysContinuous(days: number[]): boolean;
|
|
8
|
+
export declare function isCronFieldCountCorrect(exp: string): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @module utils
|
|
4
|
+
*/
|
|
5
|
+
import { DebounceSettings, DebouncedFunc } from 'lodash-es';
|
|
6
|
+
import { ObservableType } from '../types';
|
|
7
|
+
export declare function ValueHook<T = any, K extends keyof T = any>(setter?: (this: T, value?: T[K]) => boolean | void, getter?: (this: T, value?: T[K]) => T[K], afterSetter?: (this: T, value?: T[K]) => void): (target: T, propertyKey: K) => void;
|
|
8
|
+
export type ObservableInputPropertyKey<T> = T extends `${infer R}$` ? ObservableInputPropertyKey<R> : T;
|
|
9
|
+
export declare function ObservableInput<T = any, OK extends keyof T = any, K extends keyof T = ObservableInputPropertyKey<OK> & keyof T>(propertyKey?: K | boolean, initialValue?: ObservableType<T[OK]>): (target: T, oPropertyKey: OK) => void;
|
|
10
|
+
/**
|
|
11
|
+
* @see https://github.com/NoHomey/bind-decorator
|
|
12
|
+
*/
|
|
13
|
+
export declare function bind<T extends Function>(_target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;
|
|
14
|
+
export declare function debounceFn<T extends (...args: any) => any>(delay?: number, options?: DebounceSettings): (_target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<DebouncedFunc<T>> | void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export type DisabledResult = {
|
|
3
|
+
disabled: boolean;
|
|
4
|
+
tooltip?: string;
|
|
5
|
+
} | boolean;
|
|
6
|
+
export type QueryDisabledFunc = () => DisabledResult | Observable<DisabledResult>;
|
|
7
|
+
/**
|
|
8
|
+
* @description 获取同步状态
|
|
9
|
+
*/
|
|
10
|
+
export declare function getDisabledState(...judgeFns: QueryDisabledFunc[]): {
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
tooltip?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* @description 获取异步状态
|
|
16
|
+
*/
|
|
17
|
+
export declare function getDisabledState$(...judgeFns: QueryDisabledFunc[]): Observable<{
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
tooltip?: string;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ngModule CommonModule
|
|
3
|
+
*
|
|
4
|
+
* Formats a number as text. Group sizing and separator and other locale-specific
|
|
5
|
+
* configurations are based on the locale.
|
|
6
|
+
*
|
|
7
|
+
* Where:
|
|
8
|
+
* - `value` is a number.
|
|
9
|
+
* - `digitInfo` See {@link DecimalPipe} for more details.
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatNumber(value: number, digitsInfo?: number[]): string;
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export * from './observable';
|
|
2
|
+
export * from './operators';
|
|
3
|
+
export * from './decorators';
|
|
4
|
+
export * from './browser';
|
|
5
|
+
export * from './cache-store';
|
|
6
|
+
export * from './color-helpers';
|
|
7
|
+
export * from './common';
|
|
8
|
+
export * from './cron-util';
|
|
9
|
+
export * from './request-pool';
|
|
10
|
+
export * from './tree';
|
|
11
|
+
export * from './with-load-state';
|
|
12
|
+
export * from './workspace';
|
|
13
|
+
export * from './unit';
|
|
14
|
+
export * from './yaml';
|
|
15
|
+
export * from './version';
|
|
16
|
+
export * from './resources';
|
|
17
|
+
export * from './local-storage-constants';
|
|
18
|
+
export * from './format-number';
|
|
19
|
+
export * from './node';
|
|
20
|
+
export * from './sort-fn';
|
|
21
|
+
export * from './workload';
|
|
22
|
+
export * from './router';
|
|
23
|
+
export * from './disabled-state';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LOCAL_STORAGE_KEY_THEME_MODE = "theme-mode";
|
package/utils/node.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Node } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 从 underlord 节点 utils 中抽离出来,作为通用的内部IP、内部IPv6、hostname 获取方式
|
|
4
|
+
*/
|
|
5
|
+
export declare function getPrivateIPv4(node: Node): string;
|
|
6
|
+
export declare function getPrivateIPv6(node: Node): string;
|
|
7
|
+
export declare function getPrivateIP(node: Node): string;
|
|
8
|
+
export declare function getHostname(node: Node): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DestroyRef } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
export declare const createPollObservable: <TResult>(fetch$: Observable<TResult>, pollIn: number | Observable<number>) => Observable<TResult>;
|
|
4
|
+
export declare function onDestroy(destroyRef?: DestroyRef): Observable<void>;
|
|
5
|
+
export declare const tapSkip: <T>(nEmissions: number, callback: (args: T) => void) => (source$: Observable<T>) => Observable<T>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @module utils
|
|
4
|
+
*/
|
|
5
|
+
import { DestroyRef } from '@angular/core';
|
|
6
|
+
import { MonoTypeOperatorFunction, Observable, SchedulerLike, TimestampProvider } from 'rxjs';
|
|
7
|
+
export type PublishRefConfig<T> = number | (import('rxjs/internal/operators/share').ShareConfig<T> & {
|
|
8
|
+
bufferSize?: number;
|
|
9
|
+
windowTime?: number;
|
|
10
|
+
timestampProvider?: TimestampProvider;
|
|
11
|
+
});
|
|
12
|
+
export declare const publishRef: <T>(bufferSizeOrConfig?: PublishRefConfig<T>) => MonoTypeOperatorFunction<T>;
|
|
13
|
+
export declare const shareUntil: <T>(destroy$: Observable<unknown>, bufferSize?: number, windowTime?: number, scheduler?: SchedulerLike) => import("rxjs").UnaryFunction<Observable<T>, Observable<T>>;
|
|
14
|
+
export declare const skipError: <T, R = never>(mapped?: R | Observable<R>, debug?: boolean) => import("rxjs").OperatorFunction<T, T | R>;
|
|
15
|
+
export declare const catchPromise: <T, R = never>(promise: Promise<T>, mapped?: R | Observable<R>) => Observable<T | R>;
|
|
16
|
+
declare const NULL: unique symbol;
|
|
17
|
+
export declare const startWithCondition: <T>(condition: boolean, value: T) => (source: Observable<T>) => Observable<typeof NULL | T>;
|
|
18
|
+
export declare const shareUntilDestroyed: <T>(destroyRef?: DestroyRef, bufferSize?: number, windowTime?: number, scheduler?: SchedulerLike) => import("rxjs").UnaryFunction<Observable<T>, Observable<T>>;
|
|
19
|
+
export declare const safePluck: (...properties: Array<string | number>) => import("rxjs").UnaryFunction<Observable<unknown>, Observable<any>>;
|
|
20
|
+
export declare function switchTap<T, R>(next: (x: T) => Observable<R>): MonoTypeOperatorFunction<T>;
|
|
21
|
+
export declare function switchTap<R>(observable: Observable<R>): MonoTypeOperatorFunction<R>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export declare class RequestPool {
|
|
3
|
+
private readonly maxParallel;
|
|
4
|
+
private readonly runnerQueue;
|
|
5
|
+
private runningCount;
|
|
6
|
+
constructor({ maxParallel }: {
|
|
7
|
+
maxParallel: number;
|
|
8
|
+
});
|
|
9
|
+
queue<T>(request: Observable<T>): Observable<T>;
|
|
10
|
+
private flushQueue;
|
|
11
|
+
}
|
|
12
|
+
export declare function maxParallelByHttpVersion(http_2?: number, http_1?: number): number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ResourceControl } from '../form/validators/resource-limit';
|
|
2
|
+
export declare const RESOURCE_MAC_TYPES: readonly ["cpu", "memory"];
|
|
3
|
+
export declare const RESOURCE_REQUIREMENT_KEYS: readonly ["requests", "limits"];
|
|
4
|
+
export type ResourceMacKey = (typeof RESOURCE_MAC_TYPES)[number];
|
|
5
|
+
export type ResourceMacs = Record<ResourceMacKey, string>;
|
|
6
|
+
export type ResourceMacFormModal = Record<ResourceMacKey, ResourceControl>;
|
|
7
|
+
export type ResourceRequirementKey = (typeof RESOURCE_REQUIREMENT_KEYS)[number];
|
|
8
|
+
export type ResourceRequirementStrict = Record<ResourceRequirementKey, ResourceMacs>;
|
|
9
|
+
export type ResourceRequirementFormModal = Record<ResourceRequirementKey, ResourceMacFormModal>;
|
|
10
|
+
export declare function getResourceViewModel(data: string, type: 'cpu' | 'memory', preferEmptyOrC?: boolean): ResourceControl;
|
|
11
|
+
export declare const resourceUnits: {
|
|
12
|
+
cpu: {
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
}[];
|
|
16
|
+
memory: string[];
|
|
17
|
+
};
|
|
18
|
+
export declare function getResourceValue(data: ResourceControl | string): string;
|
|
19
|
+
export declare function transferResource(resource: ResourceMacFormModal): ResourceMacs;
|
package/utils/tree.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @module utils
|
|
4
|
+
*/
|
|
5
|
+
export declare const reduceTrees: (subtreeKey: string) => <T extends Tree, R>(fn: TreeReducer<T, R>) => (seed: R) => (trees: T[]) => R;
|
|
6
|
+
export declare const mapTrees: (subtreeKey: string) => <T extends Tree, R extends Tree>(fn: TreeMapper<T, R>) => (trees: T[]) => R[];
|
|
7
|
+
export declare const filterTrees: (subtreeKey: string) => <T extends Tree>(fn: TreeFilter<T>) => (trees: T[]) => T[];
|
|
8
|
+
export declare const findPath: (subtreeKey: string) => <T extends Tree>(fn: TreeFilter<T>) => (trees: T[]) => T[];
|
|
9
|
+
export declare const firstPath: (subtreeKey: string) => <T extends Tree>(trees: T[]) => T[];
|
|
10
|
+
export declare function setNode<T extends Tree>(subtreeKey: string, path: number[], source: T[], target: T): T[];
|
|
11
|
+
export interface Tree {
|
|
12
|
+
[key: string]: Tree[];
|
|
13
|
+
}
|
|
14
|
+
export type TreeReducer<T extends Tree, R> = (acc: R, currentNode: T, parents: T[], path: number[]) => R;
|
|
15
|
+
export type TreeMapper<T extends Tree, R extends Tree> = (tree: T, parents: T[], path: number[]) => R;
|
|
16
|
+
export type TreeFilter<T extends Tree> = (tree: T, parents: T[], path: number[]) => boolean;
|
package/utils/unit.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const CORE_UNITS: string[];
|
|
2
|
+
export declare const CORE_UNIT_REG: RegExp;
|
|
3
|
+
export declare const toUnitNumM: (coreStr?: string | number) => string;
|
|
4
|
+
export declare const toUnitNum: (coreStr?: string | number) => string;
|
|
5
|
+
export declare const UNITS: string[];
|
|
6
|
+
export declare const UNIT_REG: RegExp;
|
|
7
|
+
export declare const toUnitI: (str?: string | number, negative?: boolean) => string;
|
|
8
|
+
export declare const toUnitMi: (str?: string | number, negative?: boolean) => string;
|
|
9
|
+
export declare const toUnitGi: (str?: string | number, negative?: boolean) => string;
|
|
10
|
+
export declare const addUnitCoreM: (coreStr?: string | number) => string;
|
|
11
|
+
export declare const addUnitMi: (miStr?: string | number) => string;
|
|
12
|
+
export declare const addUnitGi: (giStr?: string | number) => string;
|
|
13
|
+
export declare function getAppropriateMemory(base: number): {
|
|
14
|
+
value: number;
|
|
15
|
+
unit: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const parseValueAndUnit: (str: string) => string[];
|
|
18
|
+
export declare function formatMemory(mem: string): number;
|
|
19
|
+
export declare function getMemory(base: number, unit: string): number;
|
|
20
|
+
export declare function getCpu(base: number, unit: string): number;
|
|
21
|
+
export declare function formatCPU(cpu: string): number;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 基于相对严格的版本号规则,规范可以参考https://semver.org/
|
|
3
|
+
* 但在比较版本号时使用相对宽松的规则,具体可以查看compare-versions库的实现
|
|
4
|
+
* 自测用例:https://stackblitz.com/edit/typescript-jqszbj
|
|
5
|
+
*/
|
|
6
|
+
import { CompareOperator } from 'compare-versions';
|
|
7
|
+
export { CompareOperator as VersionCompareOperator, compareVersions as compareVersionToNum, satisfies as satisfiesVersion, } from 'compare-versions';
|
|
8
|
+
export interface VersionObject {
|
|
9
|
+
version: string;
|
|
10
|
+
major: number;
|
|
11
|
+
minor: number;
|
|
12
|
+
patch: number;
|
|
13
|
+
prerelease?: Array<number | string>;
|
|
14
|
+
}
|
|
15
|
+
export declare const versionRegex: RegExp;
|
|
16
|
+
/**
|
|
17
|
+
* 获取有效的版本号,如果符合规范则返回,否则返回null
|
|
18
|
+
* eg: getValidVersion('v1.2.3') // '1.2.3'
|
|
19
|
+
*/
|
|
20
|
+
export declare const getValidVersion: (version: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* 解析版本号,如果符合规范则返回一个包含版本信息的对象
|
|
23
|
+
*/
|
|
24
|
+
export declare const parseVersion: (version: string) => VersionObject;
|
|
25
|
+
/**
|
|
26
|
+
* 使用给定规则比较两个版本
|
|
27
|
+
* lt: v1小于v2; gt: v1大于v2; lte: v1小于等于v2; gte: v1大于等于v2;
|
|
28
|
+
* eg: compareVersion.lt('1.2.3', '9.8.7') // true
|
|
29
|
+
* compareVersion.cmp('1.2.3', '9.8.7', '<') // true
|
|
30
|
+
*/
|
|
31
|
+
export declare const compareVersion: {
|
|
32
|
+
lt: (v1: string, v2: string) => boolean;
|
|
33
|
+
gt: (v1: string, v2: string) => boolean;
|
|
34
|
+
eq: (v1: string, v2: string) => boolean;
|
|
35
|
+
lte: (v1: string, v2: string) => boolean;
|
|
36
|
+
gte: (v1: string, v2: string) => boolean;
|
|
37
|
+
cmp: (v1: string, v2: string, operator: CompareOperator) => boolean;
|
|
38
|
+
};
|
|
39
|
+
export declare const compareMinorVersion: (v1: string, v2: string) => 1 | 0 | -1;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @module utils
|
|
4
|
+
*/
|
|
5
|
+
import { Observable } from 'rxjs';
|
|
6
|
+
export interface WithLoadState<T, E = unknown> {
|
|
7
|
+
loading: boolean;
|
|
8
|
+
data: T;
|
|
9
|
+
error: E;
|
|
10
|
+
}
|
|
11
|
+
export declare function withLoadState<T>(input: Observable<T>, defaultValue?: T): Observable<WithLoadState<T>>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { GenericStatusColor, GenericStatusIcon } from '../constants/status-icons';
|
|
2
|
+
import { DaemonSet, Deployment, Job, Pod, StatefulSet } from '../types';
|
|
3
|
+
export type Workload = Deployment | StatefulSet | DaemonSet;
|
|
4
|
+
export declare enum WorkloadKind {
|
|
5
|
+
Deployment = "Deployment",
|
|
6
|
+
StatefulSet = "StatefulSet",
|
|
7
|
+
DaemonSet = "DaemonSet"
|
|
8
|
+
}
|
|
9
|
+
export declare enum JobStatusEnum {
|
|
10
|
+
EXECUTING = "executing",
|
|
11
|
+
EXECUTE_SUCCEEDED = "execute_succeeded",
|
|
12
|
+
EXECUTE_FAILED = "execute_failed",
|
|
13
|
+
UNKNOWN = "unknown"
|
|
14
|
+
}
|
|
15
|
+
export declare const JobStatusColorMapper: {
|
|
16
|
+
executing: GenericStatusColor;
|
|
17
|
+
execute_succeeded: GenericStatusColor;
|
|
18
|
+
execute_failed: GenericStatusColor;
|
|
19
|
+
unknown: GenericStatusColor;
|
|
20
|
+
};
|
|
21
|
+
export declare const JobStatusIconMapper: {
|
|
22
|
+
executing: GenericStatusIcon;
|
|
23
|
+
execute_succeeded: GenericStatusIcon;
|
|
24
|
+
execute_failed: GenericStatusIcon;
|
|
25
|
+
unknown: GenericStatusIcon;
|
|
26
|
+
};
|
|
27
|
+
export declare enum WorkloadStatusEnum {
|
|
28
|
+
running = "running",
|
|
29
|
+
stopped = "stopped",
|
|
30
|
+
pending = "pending",
|
|
31
|
+
killed = "killed"
|
|
32
|
+
}
|
|
33
|
+
export interface GenericWorkloadStatus {
|
|
34
|
+
status?: WorkloadStatusEnum;
|
|
35
|
+
desired?: number;
|
|
36
|
+
current?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface WorkloadStatus extends GenericWorkloadStatus {
|
|
39
|
+
name?: string;
|
|
40
|
+
group?: string;
|
|
41
|
+
kind?: string;
|
|
42
|
+
messages?: Array<{
|
|
43
|
+
message: string;
|
|
44
|
+
reason?: string;
|
|
45
|
+
}>;
|
|
46
|
+
}
|
|
47
|
+
export declare const WorkloadStatusColorMapper: {
|
|
48
|
+
running: GenericStatusColor;
|
|
49
|
+
pending: GenericStatusColor;
|
|
50
|
+
stopped: GenericStatusColor;
|
|
51
|
+
killed: GenericStatusColor;
|
|
52
|
+
};
|
|
53
|
+
export declare const WorkloadStatusIconMapper: {
|
|
54
|
+
running: GenericStatusIcon;
|
|
55
|
+
pending: GenericStatusIcon;
|
|
56
|
+
stopped: GenericStatusIcon;
|
|
57
|
+
killed: GenericStatusIcon;
|
|
58
|
+
};
|
|
59
|
+
export declare const STATUS = "status";
|
|
60
|
+
export declare function parseDeploymentStatus(res: Deployment): WorkloadStatusEnum.running | WorkloadStatusEnum.stopped | WorkloadStatusEnum.pending;
|
|
61
|
+
export declare function parseDaemonSetStatus(res: DaemonSet): WorkloadStatusEnum.running | WorkloadStatusEnum.stopped | WorkloadStatusEnum.pending;
|
|
62
|
+
export declare function parseStatefulSetStatus(res: StatefulSet): WorkloadStatusEnum.running | WorkloadStatusEnum.stopped | WorkloadStatusEnum.pending;
|
|
63
|
+
export declare function parseToWorkloadStatus(data: Deployment): GenericWorkloadStatus;
|
|
64
|
+
export declare function getJobStatus(data: Job): JobStatusEnum;
|
|
65
|
+
export declare function getWorkloadStatus(status: GenericWorkloadStatus): WorkloadStatusEnum;
|
|
66
|
+
export declare function getPodIPs(pod: Pod): string[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ActivatedRoute, ActivatedRouteSnapshot, ParamMap, Params } from '@angular/router';
|
|
2
|
+
import { WorkspaceParams } from '../types';
|
|
3
|
+
export type Workspace = Readonly<{
|
|
4
|
+
project: string;
|
|
5
|
+
cluster: string;
|
|
6
|
+
namespace: string;
|
|
7
|
+
}>;
|
|
8
|
+
export interface ResourceIdentifier extends Workspace {
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function parseWorkspace(workspace: string): Workspace;
|
|
12
|
+
export declare function stringifyWorkspace(workspace: WorkspaceParams, strict?: boolean): string;
|
|
13
|
+
export declare function isValidWorkspace(obj: any): obj is Workspace;
|
|
14
|
+
export declare function parseRID(rid: string): ResourceIdentifier;
|
|
15
|
+
export declare function stringifyRID(rid: ResourceIdentifier): string;
|
|
16
|
+
export declare function stringifyRID(workspace: Workspace, name: string): string;
|
|
17
|
+
export declare function isValidRID(obj: any): obj is ResourceIdentifier;
|
|
18
|
+
export declare function extractWorkspace(params: Params | ParamMap): Readonly<{
|
|
19
|
+
project: string;
|
|
20
|
+
cluster: string;
|
|
21
|
+
namespace: string;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function extractWorkspaceFromRoute(route: ActivatedRoute | ActivatedRouteSnapshot): Readonly<{
|
|
24
|
+
project: string;
|
|
25
|
+
cluster: string;
|
|
26
|
+
namespace: string;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const workspaceToPath: (workspace: Partial<Workspace>) => string;
|
package/utils/yaml.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions } from 'yaml';
|
|
2
|
+
import { KubernetesResource } from '../types';
|
|
3
|
+
export { stringify } from 'yaml';
|
|
4
|
+
export declare const parse: <T>(yaml: string, options?: ParseOptions & DocumentOptions & SchemaOptions & ToJSOptions) => T;
|
|
5
|
+
export declare const safeParseYaml: <T>(yaml: string, defaultValue?: T, options?: ParseOptions & DocumentOptions & SchemaOptions & ToJSOptions) => T;
|
|
6
|
+
export declare const parseAll: <T>(yaml: string) => T[];
|
|
7
|
+
export type YamlFilterItem = string | ((resource: KubernetesResource) => string[]);
|
|
8
|
+
export declare function yamlFilterField<T extends KubernetesResource>(resource: T, filterList: YamlFilterItem[], deepClone?: boolean): T;
|
|
9
|
+
export declare const removeDirtyFieldsBeforeUpdate: <T extends KubernetesResource>(resource: T) => T;
|
|
10
|
+
export declare function prefixFilterRuleFactory(prefix: string, path: string[], includeOrStartsWith?: Extract<keyof string, 'includes' | 'startsWith'>): <T extends KubernetesResource>(resource: T) => string[];
|
|
11
|
+
export declare function emptyObjectRemoveRuleFactory(path: string[]): <T extends KubernetesResource>(resource: T) => string[];
|