@phis/ui 0.8.1 → 0.8.3
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 +9 -2
- package/components/calendar/gregory-calendar-adapter-client.js +1 -0
- package/components/controls/phi-accordion-control.d.ts +6 -0
- package/components/controls/phi-accordion-control.js +8 -13
- package/components/controls/phi-background-control.js +2 -5
- package/components/controls/phi-builder-insert-picker-control-labels.d.ts +2 -0
- package/components/controls/phi-builder-insert-picker-control-labels.js +1 -0
- package/components/controls/phi-builder-insert-picker-control.js +10 -11
- package/components/controls/phi-cascader-control.d.ts +9 -3
- package/components/controls/phi-cascader-control.js +38 -10
- package/components/controls/phi-checkbox-group-control.d.ts +3 -1
- package/components/controls/phi-checkbox-group-control.js +2 -2
- package/components/controls/phi-collapse-control.d.ts +9 -2
- package/components/controls/phi-collapse-control.js +14 -2
- package/components/controls/phi-color-control.d.ts +3 -1
- package/components/controls/phi-color-control.js +2 -2
- package/components/controls/phi-color-field-control.d.ts +6 -1
- package/components/controls/phi-color-field-control.js +2 -2
- package/components/controls/phi-confirm-control.d.ts +1 -1
- package/components/controls/phi-confirm-control.js +71 -2
- package/components/controls/phi-confirm-dialog.js +2 -1
- package/components/controls/phi-date-picker-control.js +1 -1
- package/components/controls/phi-dimension-control.d.ts +3 -1
- package/components/controls/phi-dimension-control.js +2 -2
- package/components/controls/phi-geometry-control.js +1 -1
- package/components/controls/phi-length-control.d.ts +6 -1
- package/components/controls/phi-length-control.js +3 -2
- package/components/controls/phi-multi-select-control.d.ts +6 -1
- package/components/controls/phi-multi-select-control.js +3 -3
- package/components/controls/phi-segmented-control.d.ts +6 -1
- package/components/controls/phi-segmented-control.js +3 -3
- package/components/controls/phi-switch-control.d.ts +3 -1
- package/components/controls/phi-switch-control.js +3 -3
- package/components/controls/phi-table-control.d.ts +8 -1
- package/components/controls/phi-table-control.js +11 -5
- package/components/forms/compound-form-controls.js +16 -1
- package/components/layouts/clients/phi-collapsible-layout-client.js +2 -6
- package/components/media/media-upload-flow.d.ts +62 -5
- package/components/media/media-upload-flow.js +62 -24
- package/components/media/media-widget-labels.d.ts +2 -0
- package/components/media/media-widget-labels.js +2 -0
- package/components/media/phi-area-upload-widget.d.ts +44 -1
- package/components/media/phi-area-upload-widget.js +32 -7
- package/components/media/phi-asset-inspector-section.js +19 -1
- package/components/media/phi-media-upload.d.ts +10 -3
- package/components/media/phi-media-upload.js +11 -8
- package/components/regions/presets/phi-area-shell-preset-nodes.js +2 -0
- package/components/shell/phi-builder-icon.js +9 -1
- package/components/shell/phi-widget-icon.js +1 -0
- package/components/tables/phi-table-surface.d.ts +25 -0
- package/components/tables/phi-table-surface.js +25 -0
- package/components/widgets/builder/phi-static-rows-editor.js +4 -1
- package/components/widgets/client/html-editor-link-node.d.ts +12 -0
- package/components/widgets/client/html-editor-link-node.js +60 -0
- package/components/widgets/client/html-editor.js +10 -6
- package/components/widgets/client/shared/phi-choice-controller.d.ts +8 -1
- package/components/widgets/client/shared/phi-choice-controller.js +16 -1
- package/components/widgets/client/shared/phi-collection-view-binding.js +33 -26
- package/components/widgets/config/choice-shared.d.ts +2 -0
- package/components/widgets/config/choice-shared.js +1 -0
- package/components/widgets/config/image-variant-options.d.ts +4 -1
- package/components/widgets/config/image-variant-options.js +27 -14
- package/components/widgets/inspector-field-row.d.ts +14 -1
- package/components/widgets/inspector-field-row.js +21 -1
- package/components/widgets/label-sets/builder-chrome.js +2 -0
- package/components/widgets/label-sets/inspector.js +10 -0
- package/components/widgets/label-sets/security.js +2 -0
- package/components/widgets/label-types/inspector.d.ts +5 -0
- package/components/widgets/label-types/inspector.js +5 -0
- package/components/widgets/label-types/security.d.ts +2 -0
- package/components/widgets/signals/signal-endpoint-list.js +4 -1
- package/constants/cms-widget-types.d.ts +1 -0
- package/constants/cms-widget-types.js +3 -0
- package/constants/runtime-module-ownership.js +1 -0
- package/gateway/site-proxy.d.ts +12 -0
- package/gateway/site-proxy.js +20 -0
- package/helpers/cms-inspector-drawer.d.ts +15 -0
- package/helpers/cms-inspector-drawer.js +37 -0
- package/helpers/cms-layout-defaults.js +1 -1
- package/helpers/preset-tree-contract-check.js +56 -0
- package/helpers/text-source.js +2 -0
- package/net/phi-next-proxy.d.ts +7 -0
- package/net/phi-next-proxy.js +1 -1
- package/package.json +27 -14
- package/plugins/runtime-modules/accounting/definition.d.ts +1 -1
- package/plugins/runtime-modules/accounting/definition.js +0 -1
- package/plugins/runtime-modules/accounting/ids.d.ts +4 -4
- package/plugins/runtime-modules/accounting/ids.js +4 -2
- package/plugins/runtime-modules/accounting/module.d.ts +1 -1
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +2 -1
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +5 -4
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +80 -38
- package/plugins/runtime-modules/admin/definition.d.ts +1 -1
- package/plugins/runtime-modules/admin/definition.js +0 -1
- package/plugins/runtime-modules/admin/module.d.ts +1 -1
- package/plugins/runtime-modules/app/definition.d.ts +1 -1
- package/plugins/runtime-modules/app/definition.js +0 -1
- package/plugins/runtime-modules/app/module.d.ts +1 -1
- package/plugins/runtime-modules/area-base-definition.d.ts +19 -1
- package/plugins/runtime-modules/area-base-definition.js +18 -0
- package/plugins/runtime-modules/area-contributions/admin.d.ts +1 -1
- package/plugins/runtime-modules/area-contributions/admin.js +2 -0
- package/plugins/runtime-modules/area-definitions.d.ts +8 -8
- package/plugins/runtime-modules/area-definitions.js +4 -3
- package/plugins/runtime-modules/area-root-route.d.ts +8 -0
- package/plugins/runtime-modules/area-root-route.js +11 -1
- package/plugins/runtime-modules/asset/labels.js +4 -0
- package/plugins/runtime-modules/asset/metadata-form.d.ts +0 -28
- package/plugins/runtime-modules/asset/metadata-form.js +6 -10
- package/plugins/runtime-modules/asset/services/options.d.ts +3 -2
- package/plugins/runtime-modules/asset/services/options.js +4 -3
- package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +2 -1
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +3 -3
- package/plugins/runtime-modules/auth/widgets/security/client.js +2 -2
- package/plugins/runtime-modules/avatar/addresses.d.ts +1 -1
- package/plugins/runtime-modules/builder/addresses.d.ts +1 -1
- package/plugins/runtime-modules/builder/addresses.js +1 -1
- package/plugins/runtime-modules/builder/area-settings-form.js +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-condition-group.d.ts +16 -0
- package/plugins/runtime-modules/builder/clients/inspector-condition-group.js +9 -0
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +97 -10
- package/plugins/runtime-modules/builder/clients/pages-header.js +7 -6
- package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +7 -4
- package/plugins/runtime-modules/builder/definition.d.ts +1 -1
- package/plugins/runtime-modules/builder/definition.js +0 -1
- package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +10 -4
- package/plugins/runtime-modules/builder/offered-page-catalog.js +35 -8
- package/plugins/runtime-modules/builder/page-meta-form.js +5 -2
- package/plugins/runtime-modules/builder/plugin-meta-labels.js +8 -0
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +4 -2
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +20 -13
- package/plugins/runtime-modules/builder/workspace-catalog-actions.js +8 -1
- package/plugins/runtime-modules/cdn/authoring-widgets.d.ts +3 -0
- package/plugins/runtime-modules/cdn/authoring-widgets.js +7 -0
- package/plugins/runtime-modules/cdn/authoring.d.ts +1 -0
- package/plugins/runtime-modules/cdn/authoring.js +8 -0
- package/plugins/runtime-modules/cdn/bytes.d.ts +5 -0
- package/plugins/runtime-modules/cdn/bytes.js +17 -0
- package/plugins/runtime-modules/cdn/client-data-providers.d.ts +7 -0
- package/plugins/runtime-modules/cdn/client-data-providers.js +9 -0
- package/plugins/runtime-modules/cdn/data-providers.d.ts +134 -0
- package/plugins/runtime-modules/cdn/data-providers.js +117 -0
- package/plugins/runtime-modules/cdn/definition.d.ts +140 -0
- package/plugins/runtime-modules/cdn/definition.js +23 -0
- package/plugins/runtime-modules/cdn/ids.d.ts +18 -0
- package/plugins/runtime-modules/cdn/ids.js +20 -0
- package/plugins/runtime-modules/cdn/module.d.ts +131 -0
- package/plugins/runtime-modules/cdn/module.js +4 -0
- package/plugins/runtime-modules/cdn/platform.d.ts +25 -0
- package/plugins/runtime-modules/cdn/platform.js +73 -0
- package/plugins/runtime-modules/cdn/presets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/presets.js +20 -0
- package/plugins/runtime-modules/cdn/server.d.ts +1 -0
- package/plugins/runtime-modules/cdn/server.js +14 -0
- package/plugins/runtime-modules/cdn/services/table.d.ts +11 -0
- package/plugins/runtime-modules/cdn/services/table.js +296 -0
- package/plugins/runtime-modules/cdn/services/upload.d.ts +20 -0
- package/plugins/runtime-modules/cdn/services/upload.js +146 -0
- package/plugins/runtime-modules/cdn/table-params.d.ts +10 -0
- package/plugins/runtime-modules/cdn/table-params.js +10 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.d.ts +95 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.js +156 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.d.ts +18 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.js +491 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.d.ts +12 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.js +138 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.d.ts +29 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.js +43 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.d.ts +24 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.js +1 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.d.ts +4 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.js +72 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.d.ts +3 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.js +7 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.d.ts +8 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.js +17 -0
- package/plugins/runtime-modules/cdn/widgets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/widgets.js +13 -0
- package/plugins/runtime-modules/client-authoring-providers/admin.d.ts +1 -1
- package/plugins/runtime-modules/client-authoring-providers/admin.js +6 -0
- package/plugins/runtime-modules/client-manifests/admin.js +11 -1
- package/plugins/runtime-modules/core/authoring-widgets.js +2 -1
- package/plugins/runtime-modules/core/messaging/label-defaults.d.ts +49 -0
- package/plugins/runtime-modules/core/messaging/label-defaults.js +48 -0
- package/plugins/runtime-modules/core/messaging/labels.d.ts +2 -28
- package/plugins/runtime-modules/core/messaging/labels.js +52 -23
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +3 -1
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/select-box/client.js +13 -4
- package/plugins/runtime-modules/core/widgets/select-box/config.js +1 -0
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/table/client.js +17 -8
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +1 -1143
- package/plugins/runtime-modules/core/widgets/table/config.js +144 -125
- package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.d.ts +2 -0
- package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.js +76 -0
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.d.ts +44 -1
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +28 -13
- package/plugins/runtime-modules/editor/definition.d.ts +1 -1
- package/plugins/runtime-modules/editor/definition.js +0 -1
- package/plugins/runtime-modules/editor/module.d.ts +1 -1
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +16 -8
- package/plugins/runtime-modules/public/definition.d.ts +1 -1
- package/plugins/runtime-modules/public/definition.js +0 -1
- package/plugins/runtime-modules/public/module.d.ts +1 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +109 -86
- package/plugins/runtime-modules/threads/controller/client.js +10 -12
- package/plugins/runtime-modules/threads/controller/definition.d.ts +6 -0
- package/plugins/runtime-modules/threads/controller/definition.js +17 -6
- package/styles/controls.css +49 -1
- package/styles/layout.css +3 -2
- package/types/calendar.d.ts +5 -0
- package/types/cms-plugins.d.ts +30 -10
- package/types/table-widget.d.ts +8 -2
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
import { PHI_TR_CTX_WEB_UI_LABEL } from "../../../../gateway/tr";
|
|
3
|
+
import { definePhiRuntimeModuleLabelSet, definePhiMessageLabel, getPhiLabelSet } from "../../../../gateway/label-set";
|
|
4
|
+
import { PHI_CDN_ADMIN_PAGE_PRESET_KEY, PHI_CDN_RUNTIME_MODULE_IDENTITY } from "../ids";
|
|
5
|
+
/** The words of the Admin page `CDN`, in English, the Module's source language. */
|
|
6
|
+
const PHI_ADMIN_CDN_PAGE_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_CDN_RUNTIME_MODULE_IDENTITY, {
|
|
7
|
+
key: `preset:${PHI_CDN_ADMIN_PAGE_PRESET_KEY}`,
|
|
8
|
+
ctx: PHI_TR_CTX_WEB_UI_LABEL,
|
|
9
|
+
labels: {
|
|
10
|
+
page_title: "CDN",
|
|
11
|
+
page_description: definePhiMessageLabel("Files published once under the Site's name and served from its CDN host."),
|
|
12
|
+
table_label: "CDN files",
|
|
13
|
+
column_name: "Name",
|
|
14
|
+
column_version: "Version",
|
|
15
|
+
column_file: "File",
|
|
16
|
+
column_size: "Size",
|
|
17
|
+
column_storage: "Storage",
|
|
18
|
+
column_storage_hint: definePhiMessageLabel("Copy: the CDN serves the bytes. Link: the source keeps them, and the Site sends visitors there."),
|
|
19
|
+
column_platform: "Platform",
|
|
20
|
+
column_sha256: "SHA-256",
|
|
21
|
+
column_sha256_hint: definePhiMessageLabel("Shortened here; copying the cell copies the whole checksum."),
|
|
22
|
+
column_state: "State",
|
|
23
|
+
column_origin: "Origin",
|
|
24
|
+
column_published: "Published",
|
|
25
|
+
storage_cdn: "Copy",
|
|
26
|
+
storage_link: "Link",
|
|
27
|
+
state_offered: "Offered",
|
|
28
|
+
state_withdrawn: "Withdrawn",
|
|
29
|
+
state_deleted: "Deleted",
|
|
30
|
+
origin_cli: "CLI",
|
|
31
|
+
origin_upload: "Upload",
|
|
32
|
+
origin_addon: "Add-on",
|
|
33
|
+
filter_state: "State",
|
|
34
|
+
filter_state_all: "All",
|
|
35
|
+
search_placeholder: "Search names and files",
|
|
36
|
+
empty_title: definePhiMessageLabel("No files published yet."),
|
|
37
|
+
empty_text: definePhiMessageLabel("Upload a file, or publish one with phis cdn publish."),
|
|
38
|
+
no_cdn: definePhiMessageLabel("This Site has no CDN yet. The operator attaches one on the server with phis cdn attach; then its files are listed here."),
|
|
39
|
+
footer: definePhiMessageLabel("%1 files of %2 total"),
|
|
40
|
+
action_upload: "Upload",
|
|
41
|
+
action_check: "Check",
|
|
42
|
+
action_view: "Details",
|
|
43
|
+
action_copy: "Copy address",
|
|
44
|
+
action_withdraw: "Withdraw",
|
|
45
|
+
action_delete: "Delete",
|
|
46
|
+
copied: definePhiMessageLabel("Address copied."),
|
|
47
|
+
copy_failed: definePhiMessageLabel("The browser did not allow copying the address."),
|
|
48
|
+
confirm_cancel: "Cancel",
|
|
49
|
+
withdraw_title: definePhiMessageLabel("Withdraw this file?"),
|
|
50
|
+
withdraw_text: definePhiMessageLabel("It is no longer offered: download pages stop listing it. The key stays taken, so nothing else can be published under it."),
|
|
51
|
+
withdraw_ok: "Withdraw",
|
|
52
|
+
delete_title: definePhiMessageLabel("Delete this file?"),
|
|
53
|
+
delete_text: definePhiMessageLabel("It is withdrawn and its bytes are removed from the CDN bucket. The key stays taken: no other file can ever be published under it. A cache may still serve the file until its copy expires."),
|
|
54
|
+
delete_link_note: definePhiMessageLabel("For a linked file no bytes are deleted: the source keeps them, and the entry is only withdrawn."),
|
|
55
|
+
delete_ok: "Delete",
|
|
56
|
+
upload_title: "Upload a file",
|
|
57
|
+
detail_title: "File details",
|
|
58
|
+
detail_key: "Key",
|
|
59
|
+
detail_url: "Address",
|
|
60
|
+
detail_source_url: "Source address",
|
|
61
|
+
detail_content_type: "Content type",
|
|
62
|
+
detail_size_bytes: "Size in bytes",
|
|
63
|
+
detail_addon: "Add-on",
|
|
64
|
+
detail_actor: "Uploaded by (user id)",
|
|
65
|
+
check_title: "Check bucket and catalogue",
|
|
66
|
+
check_table_label: "Check findings",
|
|
67
|
+
check_column_key: "Key",
|
|
68
|
+
check_column_finding: "Finding",
|
|
69
|
+
check_column_size: "Size in the bucket",
|
|
70
|
+
check_column_recorded: "Size recorded",
|
|
71
|
+
check_column_reason: "Why it cannot be adopted",
|
|
72
|
+
finding_unrecorded: "Not in the catalogue",
|
|
73
|
+
finding_missing: "Missing from the bucket",
|
|
74
|
+
finding_size_mismatch: "Size differs",
|
|
75
|
+
action_adopt: "Adopt",
|
|
76
|
+
check_empty: definePhiMessageLabel("Nothing to report."),
|
|
77
|
+
check_footer: definePhiMessageLabel("%1 objects in the bucket, %2 copied files in the catalogue."),
|
|
78
|
+
check_footer_consistent: definePhiMessageLabel("Bucket and catalogue agree: %1 objects, %2 copied files."),
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
export async function getPhiAdminCdnPageLabels(options) {
|
|
82
|
+
const labels = await getPhiLabelSet(options, PHI_ADMIN_CDN_PAGE_LABEL_SET);
|
|
83
|
+
return {
|
|
84
|
+
pageTitle: labels.page_title,
|
|
85
|
+
pageDescription: labels.page_description,
|
|
86
|
+
tableLabel: labels.table_label,
|
|
87
|
+
columns: {
|
|
88
|
+
name: labels.column_name,
|
|
89
|
+
version: labels.column_version,
|
|
90
|
+
file: labels.column_file,
|
|
91
|
+
size: labels.column_size,
|
|
92
|
+
storage: labels.column_storage,
|
|
93
|
+
storageHint: labels.column_storage_hint,
|
|
94
|
+
platform: labels.column_platform,
|
|
95
|
+
sha256: labels.column_sha256,
|
|
96
|
+
sha256Hint: labels.column_sha256_hint,
|
|
97
|
+
state: labels.column_state,
|
|
98
|
+
origin: labels.column_origin,
|
|
99
|
+
published: labels.column_published,
|
|
100
|
+
},
|
|
101
|
+
storage: { cdn: labels.storage_cdn, link: labels.storage_link },
|
|
102
|
+
states: { offered: labels.state_offered, withdrawn: labels.state_withdrawn, deleted: labels.state_deleted },
|
|
103
|
+
origins: { cli: labels.origin_cli, upload: labels.origin_upload, addon: labels.origin_addon },
|
|
104
|
+
filterState: labels.filter_state,
|
|
105
|
+
filterStateAll: labels.filter_state_all,
|
|
106
|
+
searchPlaceholder: labels.search_placeholder,
|
|
107
|
+
emptyTitle: labels.empty_title,
|
|
108
|
+
emptyText: labels.empty_text,
|
|
109
|
+
noCdn: labels.no_cdn,
|
|
110
|
+
footer: labels.footer,
|
|
111
|
+
actions: {
|
|
112
|
+
upload: labels.action_upload,
|
|
113
|
+
check: labels.action_check,
|
|
114
|
+
view: labels.action_view,
|
|
115
|
+
copy: labels.action_copy,
|
|
116
|
+
withdraw: labels.action_withdraw,
|
|
117
|
+
delete: labels.action_delete,
|
|
118
|
+
adopt: labels.action_adopt,
|
|
119
|
+
},
|
|
120
|
+
copied: labels.copied,
|
|
121
|
+
copyFailed: labels.copy_failed,
|
|
122
|
+
confirmCancel: labels.confirm_cancel,
|
|
123
|
+
withdraw: { title: labels.withdraw_title, text: labels.withdraw_text, ok: labels.withdraw_ok },
|
|
124
|
+
delete: { title: labels.delete_title, text: labels.delete_text, linkNote: labels.delete_link_note, ok: labels.delete_ok },
|
|
125
|
+
uploadTitle: labels.upload_title,
|
|
126
|
+
detail: {
|
|
127
|
+
title: labels.detail_title,
|
|
128
|
+
key: labels.detail_key,
|
|
129
|
+
url: labels.detail_url,
|
|
130
|
+
sourceUrl: labels.detail_source_url,
|
|
131
|
+
contentType: labels.detail_content_type,
|
|
132
|
+
sizeBytes: labels.detail_size_bytes,
|
|
133
|
+
addon: labels.detail_addon,
|
|
134
|
+
actor: labels.detail_actor,
|
|
135
|
+
},
|
|
136
|
+
check: {
|
|
137
|
+
title: labels.check_title,
|
|
138
|
+
tableLabel: labels.check_table_label,
|
|
139
|
+
columns: {
|
|
140
|
+
key: labels.check_column_key,
|
|
141
|
+
finding: labels.check_column_finding,
|
|
142
|
+
size: labels.check_column_size,
|
|
143
|
+
recorded: labels.check_column_recorded,
|
|
144
|
+
reason: labels.check_column_reason,
|
|
145
|
+
},
|
|
146
|
+
findings: {
|
|
147
|
+
unrecorded: labels.finding_unrecorded,
|
|
148
|
+
missing: labels.finding_missing,
|
|
149
|
+
"size-mismatch": labels.finding_size_mismatch,
|
|
150
|
+
},
|
|
151
|
+
empty: labels.check_empty,
|
|
152
|
+
footer: labels.check_footer,
|
|
153
|
+
footerConsistent: labels.check_footer_consistent,
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PhiCmsPageNode, PhiResolvedCmsPageTree } from "../../../../types/cms";
|
|
2
|
+
import type { PhiBlockRuntime } from "../../../../types";
|
|
3
|
+
/**
|
|
4
|
+
* The Admin page `CDN`: the catalogue as one Table, and three dialogs its actions open.
|
|
5
|
+
*
|
|
6
|
+
* - Upload (toolbar): the Module's upload Widget, which tells the Table to read again once a file is
|
|
7
|
+
* published.
|
|
8
|
+
* - Check (toolbar): a second Table on the same Provider, the `check` resource, which runs the check when
|
|
9
|
+
* the dialog opens (`remount`) and adopts what it can, row by row.
|
|
10
|
+
* - Details (row): the `record` Widget on the row, with the addresses in full.
|
|
11
|
+
*
|
|
12
|
+
* Copy address, Withdraw and Delete are the Provider's row actions; the two that change anything ask
|
|
13
|
+
* first. What any of them may do is Core's to decide, and Core refuses what a reader may not.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildPhiDefaultAdminCdnPageTree({ page, runtime, }: {
|
|
16
|
+
page: PhiCmsPageNode;
|
|
17
|
+
runtime: PhiBlockRuntime;
|
|
18
|
+
}): Promise<PhiResolvedCmsPageTree>;
|
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
import { createPhiPresetCmsInstanceIdMap } from "../../../../types/cms-instance-id";
|
|
2
|
+
import { PHI_CDN_ADMIN_PAGE_PRESET_KEY, PHI_CDN_RUNTIME_DATA_PROVIDER_KEYS, PHI_CDN_RUNTIME_MODULE_ID, PHI_CDN_TABLE_RESOURCE_KEYS, } from "../ids";
|
|
3
|
+
import { PHI_CMS_DEFAULT_SLOT_INDEX } from "../../../../constants/cms-layout-types";
|
|
4
|
+
import { PhiCmsFlags, PhiCmsPageType } from "../../../../constants/phi-cms";
|
|
5
|
+
import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
|
|
6
|
+
import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID } from "../../../../components/regions/presets/phi-base-page-layout";
|
|
7
|
+
import { createPhiSignalAddress, PHI_SIGNAL_VALUE_SCHEMAS } from "../../../../types/signals";
|
|
8
|
+
import { PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_WIDTH_SINGLE_COLUMN } from "../../../../helpers/cms-dialog";
|
|
9
|
+
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
10
|
+
import { getPhiAdminCdnPageLabels } from "./admin-cdn-label-set";
|
|
11
|
+
import { getPhiCdnUploadWidgetLabels } from "../widgets/upload/labels";
|
|
12
|
+
import { PHI_CDN_TABLE_PARAM_KEYS } from "../table-params";
|
|
13
|
+
const SYNTHETIC_ADMIN_CDN_REGION_IDS = {
|
|
14
|
+
regionContent: -443,
|
|
15
|
+
};
|
|
16
|
+
const PRESET = {
|
|
17
|
+
domain: "page",
|
|
18
|
+
ownerModuleId: PHI_CDN_RUNTIME_MODULE_ID,
|
|
19
|
+
presetKey: PHI_CDN_ADMIN_PAGE_PRESET_KEY,
|
|
20
|
+
};
|
|
21
|
+
const LAYOUT_IDS = createPhiPresetCmsInstanceIdMap(PRESET, ["layoutDetail", "layoutUpload", "layoutCheck"]);
|
|
22
|
+
const OVERLAY_IDS = createPhiPresetCmsInstanceIdMap(PRESET, ["overlayDetail", "overlayUpload", "overlayCheck"]);
|
|
23
|
+
const WIDGET_IDS = createPhiPresetCmsInstanceIdMap(PRESET, ["widgetTable", "widgetDetail", "widgetUpload", "widgetCheck"]);
|
|
24
|
+
/** The Table's announcement of one of its actions, to one receiver that decides by the action's key. */
|
|
25
|
+
function tableActionRoute(routeKey, receiverId) {
|
|
26
|
+
return {
|
|
27
|
+
routeKey,
|
|
28
|
+
capabilityId: "actionActivate",
|
|
29
|
+
scope: "page",
|
|
30
|
+
channel: "action",
|
|
31
|
+
action: "activate",
|
|
32
|
+
valueType: "json",
|
|
33
|
+
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableAction,
|
|
34
|
+
receiver: createPhiSignalAddress("cms", receiverId),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The Admin page `CDN`: the catalogue as one Table, and three dialogs its actions open.
|
|
39
|
+
*
|
|
40
|
+
* - Upload (toolbar): the Module's upload Widget, which tells the Table to read again once a file is
|
|
41
|
+
* published.
|
|
42
|
+
* - Check (toolbar): a second Table on the same Provider, the `check` resource, which runs the check when
|
|
43
|
+
* the dialog opens (`remount`) and adopts what it can, row by row.
|
|
44
|
+
* - Details (row): the `record` Widget on the row, with the addresses in full.
|
|
45
|
+
*
|
|
46
|
+
* Copy address, Withdraw and Delete are the Provider's row actions; the two that change anything ask
|
|
47
|
+
* first. What any of them may do is Core's to decide, and Core refuses what a reader may not.
|
|
48
|
+
*/
|
|
49
|
+
export async function buildPhiDefaultAdminCdnPageTree({ page, runtime, }) {
|
|
50
|
+
const translator = buildPhiWidgetLabelTranslatorOptions(runtime);
|
|
51
|
+
const [labels, uploadLabels] = await Promise.all([
|
|
52
|
+
getPhiAdminCdnPageLabels(translator),
|
|
53
|
+
getPhiCdnUploadWidgetLabels(translator),
|
|
54
|
+
]);
|
|
55
|
+
const tableAddress = createPhiSignalAddress("cms", WIDGET_IDS.widgetTable);
|
|
56
|
+
const platformNames = { ...uploadLabels.osNames, ...uploadLabels.archNames };
|
|
57
|
+
const stateColors = { offered: "success", withdrawn: "warning", deleted: "error" };
|
|
58
|
+
const storageColors = { cdn: "default", link: "processing" };
|
|
59
|
+
const originNames = { cli: labels.origins.cli, upload: labels.origins.upload, addon: labels.origins.addon };
|
|
60
|
+
const source = {
|
|
61
|
+
providerKey: PHI_CDN_RUNTIME_DATA_PROVIDER_KEYS.table,
|
|
62
|
+
resourceKey: PHI_CDN_TABLE_RESOURCE_KEYS.files,
|
|
63
|
+
params: {
|
|
64
|
+
[PHI_CDN_TABLE_PARAM_KEYS.noCdnText]: labels.noCdn,
|
|
65
|
+
[PHI_CDN_TABLE_PARAM_KEYS.copiedText]: labels.copied,
|
|
66
|
+
[PHI_CDN_TABLE_PARAM_KEYS.copyFailedText]: labels.copyFailed,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
const scaffold = buildPhiBasePageContentScaffold({
|
|
70
|
+
page,
|
|
71
|
+
regionId: SYNTHETIC_ADMIN_CDN_REGION_IDS.regionContent,
|
|
72
|
+
});
|
|
73
|
+
const nodes = createPhiCmsPresetNodes(page);
|
|
74
|
+
const upload = nodes.dialog({
|
|
75
|
+
id: OVERLAY_IDS.overlayUpload,
|
|
76
|
+
bodyLayoutNodeId: LAYOUT_IDS.layoutUpload,
|
|
77
|
+
sortOrder: 1,
|
|
78
|
+
label: "cdn upload modal",
|
|
79
|
+
body: { label: "cdn upload modal content" },
|
|
80
|
+
config: {
|
|
81
|
+
title: labels.uploadTitle,
|
|
82
|
+
size: { width: PHI_DIALOG_WIDTH_SINGLE_COLUMN },
|
|
83
|
+
// Closed, the upload stops and its session stays open: the same file picked again resumes it.
|
|
84
|
+
mountPolicy: "remount",
|
|
85
|
+
openActionKey: "upload",
|
|
86
|
+
signalRoutes: { listens: [{
|
|
87
|
+
routeKey: "admin-cdn-upload-modal-open",
|
|
88
|
+
capabilityId: "open",
|
|
89
|
+
scope: "page",
|
|
90
|
+
channel: "action",
|
|
91
|
+
action: "activate",
|
|
92
|
+
valueType: "json",
|
|
93
|
+
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableAction,
|
|
94
|
+
receiver: createPhiSignalAddress("cms", OVERLAY_IDS.overlayUpload),
|
|
95
|
+
}] },
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
const check = nodes.dialog({
|
|
99
|
+
id: OVERLAY_IDS.overlayCheck,
|
|
100
|
+
bodyLayoutNodeId: LAYOUT_IDS.layoutCheck,
|
|
101
|
+
sortOrder: 2,
|
|
102
|
+
label: "cdn check modal",
|
|
103
|
+
body: { label: "cdn check modal content" },
|
|
104
|
+
config: {
|
|
105
|
+
title: labels.check.title,
|
|
106
|
+
size: { width: 980 },
|
|
107
|
+
maxSize: { width: "90vw" },
|
|
108
|
+
// Every opening is a new check: the bucket is read when the Table in it mounts.
|
|
109
|
+
mountPolicy: "remount",
|
|
110
|
+
openActionKey: "check",
|
|
111
|
+
signalRoutes: { listens: [{
|
|
112
|
+
routeKey: "admin-cdn-check-modal-open",
|
|
113
|
+
capabilityId: "open",
|
|
114
|
+
scope: "page",
|
|
115
|
+
channel: "action",
|
|
116
|
+
action: "activate",
|
|
117
|
+
valueType: "json",
|
|
118
|
+
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableAction,
|
|
119
|
+
receiver: createPhiSignalAddress("cms", OVERLAY_IDS.overlayCheck),
|
|
120
|
+
}] },
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
return {
|
|
124
|
+
page: nodes.page({ pageType: PhiCmsPageType.Standard }),
|
|
125
|
+
pageMeta: {
|
|
126
|
+
title: { msgId: 0, source: "CDN", value: labels.pageTitle },
|
|
127
|
+
description: {
|
|
128
|
+
msgId: 0,
|
|
129
|
+
source: "Files published once under the Site's name and served from its CDN host.",
|
|
130
|
+
value: labels.pageDescription,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
overlays: [
|
|
134
|
+
nodes.overlay({
|
|
135
|
+
id: OVERLAY_IDS.overlayDetail,
|
|
136
|
+
overlayType: "modal",
|
|
137
|
+
bodyLayoutNodeId: LAYOUT_IDS.layoutDetail,
|
|
138
|
+
sortOrder: 0,
|
|
139
|
+
label: "cdn file detail modal",
|
|
140
|
+
config: {
|
|
141
|
+
title: labels.detail.title,
|
|
142
|
+
size: { width: 960 },
|
|
143
|
+
mountPolicy: "lazy-keep",
|
|
144
|
+
openActionKey: "view",
|
|
145
|
+
signalRoutes: {
|
|
146
|
+
emits: [{
|
|
147
|
+
routeKey: "admin-cdn-detail-modal-open-change",
|
|
148
|
+
capabilityId: "openChange",
|
|
149
|
+
scope: "page",
|
|
150
|
+
channel: "state",
|
|
151
|
+
action: "change",
|
|
152
|
+
valueType: "boolean",
|
|
153
|
+
receiver: createPhiSignalAddress("cms", WIDGET_IDS.widgetDetail),
|
|
154
|
+
}],
|
|
155
|
+
listens: [{
|
|
156
|
+
routeKey: "admin-cdn-detail-modal-open",
|
|
157
|
+
capabilityId: "open",
|
|
158
|
+
scope: "page",
|
|
159
|
+
channel: "action",
|
|
160
|
+
action: "activate",
|
|
161
|
+
valueType: "json",
|
|
162
|
+
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableAction,
|
|
163
|
+
receiver: createPhiSignalAddress("cms", OVERLAY_IDS.overlayDetail),
|
|
164
|
+
}],
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
}),
|
|
168
|
+
upload.overlay,
|
|
169
|
+
check.overlay,
|
|
170
|
+
],
|
|
171
|
+
regions: [scaffold.region],
|
|
172
|
+
layoutNodes: [
|
|
173
|
+
scaffold.layoutNode,
|
|
174
|
+
nodes.layout({
|
|
175
|
+
id: LAYOUT_IDS.layoutDetail,
|
|
176
|
+
parentLayoutNodeId: null,
|
|
177
|
+
creationPreset: { layoutKind: "verticalflex", preset: "panel" },
|
|
178
|
+
typeKey: "flex-vertical",
|
|
179
|
+
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
180
|
+
sortOrder: 0,
|
|
181
|
+
label: "cdn file detail modal content",
|
|
182
|
+
config: {
|
|
183
|
+
...PHI_DIALOG_BODY_CONFIG,
|
|
184
|
+
anchor: { horizontal: "left", vertical: "top" },
|
|
185
|
+
},
|
|
186
|
+
}),
|
|
187
|
+
...upload.layouts,
|
|
188
|
+
...check.layouts,
|
|
189
|
+
],
|
|
190
|
+
contentWidgets: [
|
|
191
|
+
nodes.widget({
|
|
192
|
+
id: WIDGET_IDS.widgetTable,
|
|
193
|
+
parentLayoutNodeId: PHI_BASE_PAGE_LAYOUT_NODE_ID,
|
|
194
|
+
typeKey: "table",
|
|
195
|
+
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
196
|
+
sortOrder: 0,
|
|
197
|
+
// The Module's Label Set, translated already.
|
|
198
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
199
|
+
label: labels.tableLabel,
|
|
200
|
+
config: {
|
|
201
|
+
source,
|
|
202
|
+
presentation: {
|
|
203
|
+
/*
|
|
204
|
+
* Auto, so every column is as wide as what stands in it and the file name takes the rest, as in
|
|
205
|
+
* the other staff Tables. A fixed layout held each column at a width chosen once: a version or
|
|
206
|
+
* a name longer than that was cut, a short one left its column half empty, and the sum ran past
|
|
207
|
+
* the page into a sideways scroll under the sticky actions.
|
|
208
|
+
*/
|
|
209
|
+
layout: { mode: "auto", overflowX: "auto" },
|
|
210
|
+
columns: [
|
|
211
|
+
{ key: "name", fieldKey: "name", title: labels.columns.name, sortable: true, sizing: { mode: "content" }, sticky: "left" },
|
|
212
|
+
{ key: "version", fieldKey: "version", title: labels.columns.version, sizing: { mode: "content" } },
|
|
213
|
+
{ key: "fileName", fieldKey: "fileName", title: labels.columns.file, sizing: { mode: "fill", minWidth: 200 } },
|
|
214
|
+
{ key: "size", fieldKey: "sizeLabel", title: labels.columns.size, align: "right", sizing: { mode: "content" } },
|
|
215
|
+
{
|
|
216
|
+
key: "storage",
|
|
217
|
+
fieldKey: "storage",
|
|
218
|
+
title: labels.columns.storage,
|
|
219
|
+
description: labels.columns.storageHint,
|
|
220
|
+
renderer: "badge",
|
|
221
|
+
valueMap: labels.storage,
|
|
222
|
+
tagColorMap: storageColors,
|
|
223
|
+
sizing: { mode: "content" },
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
key: "platform",
|
|
227
|
+
fieldKey: "platform",
|
|
228
|
+
title: labels.columns.platform,
|
|
229
|
+
renderer: "tags",
|
|
230
|
+
valueMap: platformNames,
|
|
231
|
+
/*
|
|
232
|
+
* Tags wrap where their column is narrower than them, and a `content` column is given no
|
|
233
|
+
* more than its narrowest: this one shares the rest with the file, never below "Windows x64".
|
|
234
|
+
*/
|
|
235
|
+
sizing: { mode: "fill", minWidth: 128 },
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
/*
|
|
239
|
+
* Hidden: a checksum is 64 characters without a place to break, and only a fixed layout may
|
|
240
|
+
* cut a column short. The file's details say it whole; the Builder can show it here.
|
|
241
|
+
*/
|
|
242
|
+
key: "sha256",
|
|
243
|
+
fieldKey: "sha256",
|
|
244
|
+
title: labels.columns.sha256,
|
|
245
|
+
description: labels.columns.sha256Hint,
|
|
246
|
+
renderer: "code",
|
|
247
|
+
hidden: true,
|
|
248
|
+
sizing: { mode: "content" },
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
key: "state",
|
|
252
|
+
fieldKey: "state",
|
|
253
|
+
title: labels.columns.state,
|
|
254
|
+
renderer: "badge",
|
|
255
|
+
valueMap: labels.states,
|
|
256
|
+
tagColorMap: stateColors,
|
|
257
|
+
sizing: { mode: "content" },
|
|
258
|
+
},
|
|
259
|
+
{ key: "origin", fieldKey: "origin", title: labels.columns.origin, valueMap: originNames, sizing: { mode: "content" } },
|
|
260
|
+
{ key: "publishedAt", fieldKey: "publishedAt", title: labels.columns.published, renderer: "datetime", sortable: true, sizing: { mode: "content" } },
|
|
261
|
+
],
|
|
262
|
+
emptyState: { title: labels.emptyTitle, description: labels.emptyText },
|
|
263
|
+
footer: {
|
|
264
|
+
template: labels.footer,
|
|
265
|
+
values: [
|
|
266
|
+
{ key: "rows", value: { source: "core", fieldKey: "pageRows" } },
|
|
267
|
+
{ key: "total", value: { source: "core", fieldKey: "totalRows" } },
|
|
268
|
+
],
|
|
269
|
+
},
|
|
270
|
+
controlSize: "small",
|
|
271
|
+
},
|
|
272
|
+
features: {
|
|
273
|
+
search: { enabled: true, placeholder: labels.searchPlaceholder, debounceMs: 250 },
|
|
274
|
+
filters: [{
|
|
275
|
+
key: "state",
|
|
276
|
+
type: "select",
|
|
277
|
+
label: labels.filterState,
|
|
278
|
+
defaultValue: "offered",
|
|
279
|
+
options: [
|
|
280
|
+
{ value: "offered", label: labels.states.offered },
|
|
281
|
+
{ value: "withdrawn", label: labels.states.withdrawn },
|
|
282
|
+
{ value: "deleted", label: labels.states.deleted },
|
|
283
|
+
{ value: "all", label: labels.filterStateAll },
|
|
284
|
+
],
|
|
285
|
+
}],
|
|
286
|
+
pagination: { enabled: true, pageSize: 50, pageSizes: [50, 100, 200] },
|
|
287
|
+
sorting: { mode: "single", defaultSorts: [{ key: "publishedAt", direction: "descending" }] },
|
|
288
|
+
tools: { mode: "self-contained", reload: true },
|
|
289
|
+
actions: {
|
|
290
|
+
toolbar: [
|
|
291
|
+
{ key: "upload", label: labels.actions.upload, icon: "upload", display: "icon", mode: "primary", execution: "signal" },
|
|
292
|
+
{ key: "check", label: labels.actions.check, icon: "safety-certificate", display: "icon", execution: "signal" },
|
|
293
|
+
],
|
|
294
|
+
row: [
|
|
295
|
+
{ key: "view", label: labels.actions.view, icon: "eye", display: "icon", execution: "signal" },
|
|
296
|
+
{ key: "copy-url", label: labels.actions.copy, icon: "copy", display: "icon", execution: "provider" },
|
|
297
|
+
{
|
|
298
|
+
key: "withdraw",
|
|
299
|
+
label: labels.actions.withdraw,
|
|
300
|
+
icon: "stop",
|
|
301
|
+
display: "icon",
|
|
302
|
+
mode: "danger",
|
|
303
|
+
execution: "provider",
|
|
304
|
+
confirm: {
|
|
305
|
+
title: labels.withdraw.title,
|
|
306
|
+
description: labels.withdraw.text,
|
|
307
|
+
okText: labels.withdraw.ok,
|
|
308
|
+
cancelText: labels.confirmCancel,
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
key: "delete",
|
|
313
|
+
label: labels.actions.delete,
|
|
314
|
+
icon: "delete",
|
|
315
|
+
display: "icon",
|
|
316
|
+
mode: "danger",
|
|
317
|
+
execution: "provider",
|
|
318
|
+
confirm: {
|
|
319
|
+
title: labels.delete.title,
|
|
320
|
+
description: labels.delete.text,
|
|
321
|
+
alert: { level: "info", title: labels.delete.linkNote },
|
|
322
|
+
okText: labels.delete.ok,
|
|
323
|
+
cancelText: labels.confirmCancel,
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
],
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
signalRoutes: {
|
|
330
|
+
/*
|
|
331
|
+
* One announcement, five listeners: each dialog decides by its `openActionKey`, the record by
|
|
332
|
+
* its own. Copy, Withdraw and Delete are the Provider's and go to nobody.
|
|
333
|
+
*/
|
|
334
|
+
emits: [
|
|
335
|
+
tableActionRoute("admin-cdn-table-view-detail", WIDGET_IDS.widgetDetail),
|
|
336
|
+
tableActionRoute("admin-cdn-table-open-detail", OVERLAY_IDS.overlayDetail),
|
|
337
|
+
tableActionRoute("admin-cdn-table-open-upload", OVERLAY_IDS.overlayUpload),
|
|
338
|
+
tableActionRoute("admin-cdn-table-open-check", OVERLAY_IDS.overlayCheck),
|
|
339
|
+
],
|
|
340
|
+
listens: [{
|
|
341
|
+
routeKey: "admin-cdn-table-reload",
|
|
342
|
+
capabilityId: "reload",
|
|
343
|
+
scope: "page",
|
|
344
|
+
channel: "reload",
|
|
345
|
+
action: "activate",
|
|
346
|
+
valueType: "none",
|
|
347
|
+
receiver: tableAddress,
|
|
348
|
+
}],
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
}),
|
|
352
|
+
nodes.widget({
|
|
353
|
+
id: WIDGET_IDS.widgetDetail,
|
|
354
|
+
parentLayoutNodeId: LAYOUT_IDS.layoutDetail,
|
|
355
|
+
typeKey: "record",
|
|
356
|
+
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
357
|
+
sortOrder: 0,
|
|
358
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
359
|
+
label: "cdn file record",
|
|
360
|
+
config: {
|
|
361
|
+
source: { ...source },
|
|
362
|
+
openActionKey: "view",
|
|
363
|
+
presentation: {
|
|
364
|
+
appearance: "grid",
|
|
365
|
+
columns: 2,
|
|
366
|
+
fields: [
|
|
367
|
+
{ key: "key", fieldKey: "key", label: labels.detail.key, renderer: "code", full: true },
|
|
368
|
+
{ key: "name", fieldKey: "name", label: labels.columns.name },
|
|
369
|
+
{ key: "version", fieldKey: "version", label: labels.columns.version },
|
|
370
|
+
{ key: "fileName", fieldKey: "fileName", label: labels.columns.file },
|
|
371
|
+
{ key: "size", fieldKey: "sizeLabel", label: labels.columns.size },
|
|
372
|
+
{ key: "sizeBytes", fieldKey: "sizeBytes", label: labels.detail.sizeBytes },
|
|
373
|
+
{ key: "contentType", fieldKey: "contentType", label: labels.detail.contentType, renderer: "code" },
|
|
374
|
+
{ key: "storage", fieldKey: "storage", label: labels.columns.storage, renderer: "badge", valueMap: labels.storage, tagColorMap: storageColors },
|
|
375
|
+
{ key: "platform", fieldKey: "platform", label: labels.columns.platform, renderer: "tags", valueMap: platformNames },
|
|
376
|
+
{ key: "state", fieldKey: "state", label: labels.columns.state, renderer: "badge", valueMap: labels.states, tagColorMap: stateColors },
|
|
377
|
+
{ key: "publishedAt", fieldKey: "publishedAt", label: labels.columns.published, renderer: "datetime" },
|
|
378
|
+
{ key: "origin", fieldKey: "origin", label: labels.columns.origin, valueMap: originNames },
|
|
379
|
+
{ key: "addonId", fieldKey: "addonId", label: labels.detail.addon },
|
|
380
|
+
{ key: "actorUserId", fieldKey: "actorUserId", label: labels.detail.actor },
|
|
381
|
+
{ key: "sha256", fieldKey: "sha256", label: labels.columns.sha256, renderer: "code", full: true },
|
|
382
|
+
{ key: "url", fieldKey: "url", label: labels.detail.url, renderer: "link", full: true },
|
|
383
|
+
{ key: "sourceUrl", fieldKey: "sourceUrl", label: labels.detail.sourceUrl, renderer: "link", full: true },
|
|
384
|
+
],
|
|
385
|
+
},
|
|
386
|
+
signalRoutes: {
|
|
387
|
+
listens: [{
|
|
388
|
+
routeKey: "admin-cdn-detail-record-open",
|
|
389
|
+
capabilityId: "recordOpen",
|
|
390
|
+
scope: "page",
|
|
391
|
+
channel: "action",
|
|
392
|
+
action: "activate",
|
|
393
|
+
valueType: "json",
|
|
394
|
+
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableAction,
|
|
395
|
+
receiver: createPhiSignalAddress("cms", WIDGET_IDS.widgetDetail),
|
|
396
|
+
}, {
|
|
397
|
+
routeKey: "admin-cdn-detail-modal-closed",
|
|
398
|
+
capabilityId: "close",
|
|
399
|
+
scope: "page",
|
|
400
|
+
channel: "state",
|
|
401
|
+
action: "change",
|
|
402
|
+
valueType: "boolean",
|
|
403
|
+
receiver: createPhiSignalAddress("cms", WIDGET_IDS.widgetDetail),
|
|
404
|
+
}],
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
}),
|
|
408
|
+
nodes.widget({
|
|
409
|
+
id: WIDGET_IDS.widgetUpload,
|
|
410
|
+
parentLayoutNodeId: LAYOUT_IDS.layoutUpload,
|
|
411
|
+
typeKey: "cdn-upload",
|
|
412
|
+
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
413
|
+
sortOrder: 0,
|
|
414
|
+
label: "cdn upload",
|
|
415
|
+
config: {
|
|
416
|
+
signalRoutes: {
|
|
417
|
+
// A published file is a new row: the listing reads itself again.
|
|
418
|
+
emits: [{
|
|
419
|
+
routeKey: "admin-cdn-upload-published",
|
|
420
|
+
capabilityId: "uploaded",
|
|
421
|
+
scope: "page",
|
|
422
|
+
channel: "reload",
|
|
423
|
+
action: "activate",
|
|
424
|
+
valueType: "none",
|
|
425
|
+
receiver: tableAddress,
|
|
426
|
+
}],
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
}),
|
|
430
|
+
nodes.widget({
|
|
431
|
+
id: WIDGET_IDS.widgetCheck,
|
|
432
|
+
parentLayoutNodeId: LAYOUT_IDS.layoutCheck,
|
|
433
|
+
typeKey: "table",
|
|
434
|
+
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
435
|
+
sortOrder: 0,
|
|
436
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
437
|
+
label: labels.check.tableLabel,
|
|
438
|
+
config: {
|
|
439
|
+
source: {
|
|
440
|
+
providerKey: PHI_CDN_RUNTIME_DATA_PROVIDER_KEYS.table,
|
|
441
|
+
resourceKey: PHI_CDN_TABLE_RESOURCE_KEYS.check,
|
|
442
|
+
params: { [PHI_CDN_TABLE_PARAM_KEYS.noCdnText]: labels.noCdn },
|
|
443
|
+
},
|
|
444
|
+
presentation: {
|
|
445
|
+
layout: { mode: "auto", overflowX: "auto" },
|
|
446
|
+
columns: [
|
|
447
|
+
{ key: "key", fieldKey: "key", title: labels.check.columns.key, renderer: "code", sizing: { mode: "fill", minWidth: 240 } },
|
|
448
|
+
{
|
|
449
|
+
key: "finding",
|
|
450
|
+
fieldKey: "finding",
|
|
451
|
+
title: labels.check.columns.finding,
|
|
452
|
+
renderer: "badge",
|
|
453
|
+
valueMap: labels.check.findings,
|
|
454
|
+
tagColorMap: { unrecorded: "warning", missing: "error", "size-mismatch": "error" },
|
|
455
|
+
sizing: { mode: "content" },
|
|
456
|
+
},
|
|
457
|
+
{ key: "size", fieldKey: "sizeLabel", title: labels.check.columns.size, align: "right", sizing: { mode: "content" } },
|
|
458
|
+
{ key: "recorded", fieldKey: "recordedLabel", title: labels.check.columns.recorded, align: "right", sizing: { mode: "content" } },
|
|
459
|
+
{ key: "reason", fieldKey: "reason", title: labels.check.columns.reason, sizing: { mode: "fill", minWidth: 160 } },
|
|
460
|
+
],
|
|
461
|
+
emptyState: { title: labels.check.empty },
|
|
462
|
+
footer: {
|
|
463
|
+
template: labels.check.footer,
|
|
464
|
+
values: [
|
|
465
|
+
{ key: "objects", value: { source: "provider", fieldKey: "objects" } },
|
|
466
|
+
{ key: "recorded", value: { source: "provider", fieldKey: "recorded" } },
|
|
467
|
+
],
|
|
468
|
+
variants: [{
|
|
469
|
+
when: { value: { source: "provider", fieldKey: "consistent" }, operator: "truthy" },
|
|
470
|
+
template: labels.check.footerConsistent,
|
|
471
|
+
values: [
|
|
472
|
+
{ key: "objects", value: { source: "provider", fieldKey: "objects" } },
|
|
473
|
+
{ key: "recorded", value: { source: "provider", fieldKey: "recorded" } },
|
|
474
|
+
],
|
|
475
|
+
}],
|
|
476
|
+
},
|
|
477
|
+
controlSize: "small",
|
|
478
|
+
},
|
|
479
|
+
features: {
|
|
480
|
+
pagination: { enabled: false },
|
|
481
|
+
sorting: { mode: "none" },
|
|
482
|
+
tools: { mode: "self-contained", reload: true },
|
|
483
|
+
actions: {
|
|
484
|
+
row: [{ key: "adopt", label: labels.actions.adopt, icon: "plus", display: "icon-label", execution: "provider" }],
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
}),
|
|
489
|
+
],
|
|
490
|
+
};
|
|
491
|
+
}
|