chrome-devtools-frontend 1.0.1656897 → 1.0.1657855
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/.agents/skills/devtools-ux-writing-refactor/SKILL.md +125 -0
- package/.agents/skills/repro-flaky-tests/SKILL.md +53 -0
- package/AUTHORS +2 -0
- package/docs/get_the_code.md +6 -6
- package/front_end/Images/src/ads.svg +1 -0
- package/front_end/Tests.js +1 -1
- package/front_end/core/common/ResourceType.ts +19 -19
- package/front_end/core/common/Revealer.ts +15 -15
- package/front_end/core/common/SettingRegistration.ts +19 -19
- package/front_end/core/common/Settings.ts +0 -8
- package/front_end/core/host/Platform.ts +4 -0
- package/front_end/core/sdk/CSSMetadata.ts +121 -16
- package/front_end/core/sdk/CSSModel.ts +3 -0
- package/front_end/core/sdk/DOMModel.ts +37 -8
- package/front_end/core/sdk/DebuggerModel.ts +5 -4
- package/front_end/core/sdk/EmulationModel.ts +6 -4
- package/front_end/core/sdk/NetworkManager.ts +22 -17
- package/front_end/core/sdk/RuntimeModel.ts +1 -1
- package/front_end/core/sdk/TargetManager.ts +10 -0
- package/front_end/design_system_tokens.css +6 -0
- package/front_end/entrypoints/devtools_app/devtools_app.ts +1 -1
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +13 -4
- package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +23 -4
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +7 -6
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -11
- package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +1 -1
- package/front_end/entrypoints/main/GlobalAiButton.ts +29 -35
- package/front_end/entrypoints/main/MainImpl.ts +7 -34
- package/front_end/entrypoints/main/main-meta.ts +9 -9
- package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +7 -8
- package/front_end/entrypoints/node_app/app/NodeMain.ts +3 -3
- package/front_end/entrypoints/node_app/node_app.ts +7 -7
- package/front_end/foundation/Universe.ts +60 -1
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/protocol.ts +4 -0
- package/front_end/models/ai_assistance/AiUtils.ts +6 -6
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +8 -5
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +13 -15
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +6 -3
- package/front_end/models/bindings/FileUtils.ts +11 -12
- package/front_end/models/emulation/DeviceModeModel.ts +56 -37
- package/front_end/models/emulation/EmulatedDevices.ts +3 -3
- package/front_end/models/live-metrics/LiveMetrics.ts +47 -23
- package/front_end/models/project_settings/ProjectSettingsModel.ts +2 -37
- package/front_end/models/workspace/FileManager.ts +9 -6
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +23 -12
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +2 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +9 -1
- package/front_end/panels/application/BackgroundServiceView.ts +2 -1
- package/front_end/panels/application/IndexedDBViews.ts +52 -23
- package/front_end/panels/application/ServiceWorkersView.ts +9 -20
- package/front_end/panels/application/components/AdsView.ts +1 -1
- package/front_end/panels/application/components/StorageMetadataView.ts +7 -2
- package/front_end/panels/application/resourcesSidebar.css +5 -0
- package/front_end/panels/common/BadgeNotification.ts +1 -1
- package/front_end/panels/console/ConsoleContextSelector.ts +3 -3
- package/front_end/panels/console/ConsoleInsightTeaser.ts +2 -1
- package/front_end/panels/console/ConsolePinPane.ts +10 -10
- package/front_end/panels/console/ConsolePrompt.ts +4 -4
- package/front_end/panels/console/ConsoleSidebar.ts +7 -7
- package/front_end/panels/console/ConsoleView.ts +44 -43
- package/front_end/panels/console/ConsoleViewMessage.ts +40 -40
- package/front_end/panels/console/console-meta.ts +34 -34
- package/front_end/panels/coverage/CoverageView.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +19 -20
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +6 -8
- package/front_end/panels/developer_resources/developer_resources-meta.ts +2 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +253 -144
- package/front_end/panels/elements/ElementsTreeOutline.ts +3 -2
- package/front_end/panels/elements/components/AdornerManager.ts +1 -0
- package/front_end/panels/emulation/DeviceModeToolbar.ts +19 -19
- package/front_end/panels/explain/components/ConsoleInsight.ts +2 -1
- package/front_end/panels/media/EventDisplayTable.ts +2 -2
- package/front_end/panels/media/EventTimelineView.ts +4 -4
- package/front_end/panels/media/MainView.ts +4 -4
- package/front_end/panels/media/PlayerDetailView.ts +5 -5
- package/front_end/panels/media/PlayerListView.ts +1 -1
- package/front_end/panels/media/PlayerMessagesView.ts +12 -12
- package/front_end/panels/media/PlayerPropertiesView.ts +17 -17
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +13 -12
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +8 -7
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +6 -7
- package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +3 -2
- package/front_end/panels/network/NetworkLogView.ts +2 -1
- package/front_end/panels/network/NetworkWaterfallColumn.ts +1 -3
- package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
- package/front_end/panels/network/networkPanel.css +1 -0
- package/front_end/panels/network/networkTimingTable.css +1 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +2 -1
- package/front_end/panels/profiler/ProfileView.ts +2 -1
- package/front_end/panels/protocol_monitor/JSONEditor.ts +10 -10
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +28 -32
- package/front_end/panels/protocol_monitor/protocol_monitor-meta.ts +1 -1
- package/front_end/panels/recorder/RecorderController.ts +1 -0
- package/front_end/panels/recorder/RecorderEvents.ts +8 -0
- package/front_end/panels/settings/components/SyncSection.ts +2 -1
- package/front_end/panels/timeline/AppenderUtils.ts +12 -4
- package/front_end/panels/timeline/ThreadAppender.ts +3 -3
- package/front_end/panels/timeline/TimelinePanel.ts +5 -5
- package/front_end/panels/timeline/timelineFlameChartView.css +2 -1
- package/front_end/panels/webauthn/WebauthnPane.ts +10 -10
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/chromium/ahem/ahem.js +792 -0
- package/front_end/tsconfig.json +7 -1
- package/front_end/ui/components/dialogs/shortcutDialog.css +15 -12
- package/front_end/ui/legacy/ActionRegistration.ts +1 -1
- package/front_end/ui/legacy/InspectorView.ts +1 -1
- package/front_end/ui/legacy/Treeoutline.ts +15 -0
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +109 -23
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +5 -0
- package/front_end/ui/legacy/theme_support/ThemeSupport.ts +2 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +4 -0
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ import * as Common from '../../core/common/common.js';
|
|
|
6
6
|
import * as Host from '../../core/host/host.js';
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
8
|
import * as Platform from '../../core/platform/platform.js';
|
|
9
|
+
import * as Root from '../../core/root/root.js';
|
|
9
10
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
10
11
|
import type * as Protocol from '../../generated/protocol.js';
|
|
11
12
|
import * as EmulationModel from '../../models/emulation/emulation.js';
|
|
@@ -29,8 +30,6 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
29
30
|
|
|
30
31
|
const LIVE_METRICS_WORLD_NAME = 'DevTools Performance Metrics';
|
|
31
32
|
|
|
32
|
-
let liveMetricsInstance: LiveMetrics;
|
|
33
|
-
|
|
34
33
|
class InjectedScript {
|
|
35
34
|
static #injectedScript?: string;
|
|
36
35
|
static async get(): Promise<string> {
|
|
@@ -47,6 +46,7 @@ export type InteractionMap = Map<InteractionId, Interaction>;
|
|
|
47
46
|
|
|
48
47
|
export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements SDK.TargetManager.Observer {
|
|
49
48
|
#enabled = false;
|
|
49
|
+
#isCollectingMetrics = false;
|
|
50
50
|
#target?: SDK.Target.Target;
|
|
51
51
|
#scriptIdentifier?: Protocol.Page.ScriptIdentifier;
|
|
52
52
|
#lastResetContextId?: Protocol.Runtime.ExecutionContextId;
|
|
@@ -58,21 +58,24 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
58
58
|
#layoutShifts: LayoutShift[] = [];
|
|
59
59
|
#lastEmulationChangeTime?: number;
|
|
60
60
|
#mutex = new Common.Mutex.Mutex();
|
|
61
|
-
#
|
|
61
|
+
readonly #targetManager: SDK.TargetManager.TargetManager;
|
|
62
|
+
readonly #deviceModeModel: EmulationModel.DeviceModeModel.DeviceModeModel|null;
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
constructor(targetManager: SDK.TargetManager.TargetManager,
|
|
65
|
+
deviceModeModel: EmulationModel.DeviceModeModel.DeviceModeModel|null) {
|
|
64
66
|
super();
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
targetManager.
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
this.#targetManager = targetManager;
|
|
68
|
+
this.#deviceModeModel = deviceModeModel;
|
|
69
|
+
this.#targetManager.observeTargets(this, {scoped: true});
|
|
70
|
+
this.#targetManager.addModelListener(SDK.ResourceTreeModel.ResourceTreeModel,
|
|
71
|
+
SDK.ResourceTreeModel.Events.PrimaryPageChanged, this.#onPrimaryPageChanged,
|
|
72
|
+
this);
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
#onPrimaryPageChanged(
|
|
73
76
|
event: Common.EventTarget.EventTargetEvent<
|
|
74
77
|
{frame: SDK.ResourceTreeModel.ResourceTreeFrame, type: SDK.ResourceTreeModel.PrimaryPageChangeType}>): void {
|
|
75
|
-
const primaryTarget =
|
|
78
|
+
const primaryTarget = this.#targetManager.primaryPageTarget();
|
|
76
79
|
if (!primaryTarget) {
|
|
77
80
|
return;
|
|
78
81
|
}
|
|
@@ -86,19 +89,22 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
86
89
|
|
|
87
90
|
async #switchToTarget(newTarget: SDK.Target.Target): Promise<void> {
|
|
88
91
|
if (this.#target) {
|
|
89
|
-
await this
|
|
92
|
+
await this.#stopCollectingMetrics();
|
|
90
93
|
}
|
|
91
94
|
this.#target = newTarget;
|
|
92
|
-
await this
|
|
95
|
+
await this.#startCollectingMetrics();
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
static instance(opts: {forceNew?: boolean} = {forceNew: false}): LiveMetrics {
|
|
96
99
|
const {forceNew} = opts;
|
|
97
|
-
if (!
|
|
98
|
-
|
|
100
|
+
if (!Root.DevToolsContext.globalInstance().has(LiveMetrics) || forceNew) {
|
|
101
|
+
Root.DevToolsContext.globalInstance().set(
|
|
102
|
+
LiveMetrics,
|
|
103
|
+
new LiveMetrics(SDK.TargetManager.TargetManager.instance(),
|
|
104
|
+
EmulationModel.DeviceModeModel.DeviceModeModel.tryInstance()));
|
|
99
105
|
}
|
|
100
106
|
|
|
101
|
-
return
|
|
107
|
+
return Root.DevToolsContext.globalInstance().get(LiveMetrics);
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
get lcpValue(): LcpValue|undefined {
|
|
@@ -481,11 +487,11 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
481
487
|
|
|
482
488
|
async targetAdded(target: SDK.Target.Target): Promise<void> {
|
|
483
489
|
// Scoped observers can also receive events for OOPIFs and workers.
|
|
484
|
-
if (target !==
|
|
490
|
+
if (target !== this.#targetManager.primaryPageTarget()) {
|
|
485
491
|
return;
|
|
486
492
|
}
|
|
487
493
|
this.#target = target;
|
|
488
|
-
await this
|
|
494
|
+
await this.#startCollectingMetrics();
|
|
489
495
|
}
|
|
490
496
|
|
|
491
497
|
async targetRemoved(target: SDK.Target.Target): Promise<void> {
|
|
@@ -493,11 +499,29 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
493
499
|
if (target !== this.#target) {
|
|
494
500
|
return;
|
|
495
501
|
}
|
|
496
|
-
await this
|
|
502
|
+
await this.#stopCollectingMetrics();
|
|
497
503
|
this.#target = undefined;
|
|
498
504
|
}
|
|
499
505
|
|
|
500
506
|
async enable(): Promise<void> {
|
|
507
|
+
if (this.#enabled) {
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
this.#enabled = true;
|
|
511
|
+
if (this.#target) {
|
|
512
|
+
await this.#startCollectingMetrics();
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
async disable(): Promise<void> {
|
|
517
|
+
if (!this.#enabled) {
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
this.#enabled = false;
|
|
521
|
+
await this.#stopCollectingMetrics();
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
async #startCollectingMetrics(): Promise<void> {
|
|
501
525
|
if (Host.InspectorFrontendHost.isUnderTest()) {
|
|
502
526
|
// Enabling this impacts a lot of layout tests; we will work on fixing
|
|
503
527
|
// them but for now it is easier to not run this page in layout tests.
|
|
@@ -505,7 +529,7 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
505
529
|
return;
|
|
506
530
|
}
|
|
507
531
|
|
|
508
|
-
if (!this.#target || this.#enabled) {
|
|
532
|
+
if (!this.#target || !this.#enabled || this.#isCollectingMetrics) {
|
|
509
533
|
return;
|
|
510
534
|
}
|
|
511
535
|
|
|
@@ -556,11 +580,11 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
556
580
|
this.#deviceModeModel?.addEventListener(
|
|
557
581
|
EmulationModel.DeviceModeModel.Events.UPDATED, this.#onEmulationChanged, this);
|
|
558
582
|
|
|
559
|
-
this.#
|
|
583
|
+
this.#isCollectingMetrics = true;
|
|
560
584
|
}
|
|
561
585
|
|
|
562
|
-
async
|
|
563
|
-
if (!this.#target || !this.#
|
|
586
|
+
async #stopCollectingMetrics(): Promise<void> {
|
|
587
|
+
if (!this.#target || !this.#isCollectingMetrics) {
|
|
564
588
|
return;
|
|
565
589
|
}
|
|
566
590
|
|
|
@@ -594,7 +618,7 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
594
618
|
this.#deviceModeModel?.removeEventListener(
|
|
595
619
|
EmulationModel.DeviceModeModel.Events.UPDATED, this.#onEmulationChanged, this);
|
|
596
620
|
|
|
597
|
-
this.#
|
|
621
|
+
this.#isCollectingMetrics = false;
|
|
598
622
|
}
|
|
599
623
|
}
|
|
600
624
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as Platform from '../../core/platform/platform.js';
|
|
7
|
-
import * as Root from '../../core/root/root.js';
|
|
7
|
+
import type * as Root from '../../core/root/root.js';
|
|
8
8
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
9
9
|
|
|
10
10
|
/** The security origin for all DevTools (front-end) resources. */
|
|
@@ -127,42 +127,7 @@ export class ProjectSettingsModel extends Common.ObjectWrapper.ObjectWrapper<Eve
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
|
|
131
|
-
* Yields the `ProjectSettingsModel` singleton.
|
|
132
|
-
*
|
|
133
|
-
* @returns the singleton.
|
|
134
|
-
*/
|
|
135
|
-
static instance({forceNew, hostConfig, pageResourceLoader, targetManager}: {
|
|
136
|
-
forceNew: boolean|null,
|
|
137
|
-
hostConfig: Root.Runtime.HostConfig|null,
|
|
138
|
-
pageResourceLoader: SDK.PageResourceLoader.PageResourceLoader|null,
|
|
139
|
-
targetManager: SDK.TargetManager.TargetManager|null,
|
|
140
|
-
}): ProjectSettingsModel {
|
|
141
|
-
if (!Root.DevToolsContext.globalInstance().has(ProjectSettingsModel) || forceNew) {
|
|
142
|
-
if (!hostConfig || !pageResourceLoader || !targetManager) {
|
|
143
|
-
throw new Error(
|
|
144
|
-
'Unable to create ProjectSettingsModel: ' +
|
|
145
|
-
'hostConfig, pageResourceLoader, and targetManager must be provided');
|
|
146
|
-
}
|
|
147
|
-
Root.DevToolsContext.globalInstance().set(
|
|
148
|
-
ProjectSettingsModel,
|
|
149
|
-
new ProjectSettingsModel(hostConfig, pageResourceLoader, targetManager),
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
return Root.DevToolsContext.globalInstance().get(ProjectSettingsModel);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Clears the `ProjectSettingsModel` singleton (if any);
|
|
157
|
-
*/
|
|
158
|
-
static removeInstance(): void {
|
|
159
|
-
if (Root.DevToolsContext.globalInstance().has(ProjectSettingsModel)) {
|
|
160
|
-
Root.DevToolsContext.globalInstance().get(ProjectSettingsModel).#dispose();
|
|
161
|
-
Root.DevToolsContext.globalInstance().delete(ProjectSettingsModel);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
#dispose(): void {
|
|
130
|
+
disposeForTest(): void {
|
|
166
131
|
this.#targetManager.removeEventListener(
|
|
167
132
|
SDK.TargetManager.Events.INSPECTED_URL_CHANGED,
|
|
168
133
|
this.#inspectedURLChanged,
|
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as Host from '../../core/host/host.js';
|
|
7
7
|
import type * as Platform from '../../core/platform/platform.js';
|
|
8
|
+
import * as Root from '../../core/root/root.js';
|
|
8
9
|
import type * as TextUtils from '../text_utils/text_utils.js';
|
|
9
10
|
|
|
10
|
-
let fileManagerInstance: FileManager|null;
|
|
11
|
-
|
|
12
11
|
export interface SaveCallbackParam {
|
|
13
12
|
fileSystemPath?: Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.UrlString;
|
|
14
13
|
}
|
|
@@ -16,7 +15,7 @@ export interface SaveCallbackParam {
|
|
|
16
15
|
export class FileManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
17
16
|
readonly #saveCallbacks = new Map<
|
|
18
17
|
Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.UrlString, (arg0: SaveCallbackParam|null) => void>();
|
|
19
|
-
|
|
18
|
+
constructor() {
|
|
20
19
|
super();
|
|
21
20
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(
|
|
22
21
|
Host.InspectorFrontendHostAPI.Events.SavedURL, this.savedURL, this);
|
|
@@ -28,11 +27,15 @@ export class FileManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
28
27
|
|
|
29
28
|
static instance(opts: {forceNew: boolean|null} = {forceNew: null}): FileManager {
|
|
30
29
|
const {forceNew} = opts;
|
|
31
|
-
if (!
|
|
32
|
-
|
|
30
|
+
if (!Root.DevToolsContext.globalInstance().has(FileManager) || forceNew) {
|
|
31
|
+
Root.DevToolsContext.globalInstance().set(FileManager, new FileManager());
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
return
|
|
34
|
+
return Root.DevToolsContext.globalInstance().get(FileManager);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static removeInstance(): void {
|
|
38
|
+
Root.DevToolsContext.globalInstance().delete(FileManager);
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
/**
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as Host from '../../core/host/host.js';
|
|
7
|
+
import * as Root from '../../core/root/root.js';
|
|
7
8
|
import * as Diff from '../../third_party/diff/diff.js';
|
|
8
9
|
import * as FormatterModule from '../formatter/formatter.js';
|
|
9
10
|
import * as Persistence from '../persistence/persistence.js';
|
|
@@ -16,15 +17,23 @@ interface DiffResponse {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export class WorkspaceDiffImpl extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
19
|
-
readonly #persistence
|
|
20
|
+
readonly #persistence: Persistence.Persistence.PersistenceImpl;
|
|
21
|
+
readonly #networkPersistenceManager: Persistence.NetworkPersistenceManager.NetworkPersistenceManager;
|
|
20
22
|
readonly #diffs = new WeakMap<Workspace.UISourceCode.UISourceCode, UISourceCodeDiff>();
|
|
21
23
|
/** used in web tests */
|
|
22
24
|
private readonly loadingUISourceCodes =
|
|
23
25
|
new Map<Workspace.UISourceCode.UISourceCode, Promise<[string | null, string|null]>>();
|
|
24
26
|
readonly #modified = new Set<Workspace.UISourceCode.UISourceCode>();
|
|
25
27
|
|
|
26
|
-
constructor(
|
|
28
|
+
constructor(
|
|
29
|
+
workspace: Workspace.Workspace.WorkspaceImpl,
|
|
30
|
+
persistence: Persistence.Persistence.PersistenceImpl = Persistence.Persistence.PersistenceImpl.instance(),
|
|
31
|
+
networkPersistenceManager: Persistence.NetworkPersistenceManager.NetworkPersistenceManager =
|
|
32
|
+
Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance(),
|
|
33
|
+
) {
|
|
27
34
|
super();
|
|
35
|
+
this.#persistence = persistence;
|
|
36
|
+
this.#networkPersistenceManager = networkPersistenceManager;
|
|
28
37
|
workspace.addEventListener(Workspace.Workspace.Events.WorkingCopyChanged, this.#uiSourceCodeChanged, this);
|
|
29
38
|
workspace.addEventListener(Workspace.Workspace.Events.WorkingCopyCommitted, this.#uiSourceCodeChanged, this);
|
|
30
39
|
workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, this.#uiSourceCodeAdded, this);
|
|
@@ -54,7 +63,7 @@ export class WorkspaceDiffImpl extends Common.ObjectWrapper.ObjectWrapper<EventT
|
|
|
54
63
|
#uiSourceCodeDiff(uiSourceCode: Workspace.UISourceCode.UISourceCode): UISourceCodeDiff {
|
|
55
64
|
let diff = this.#diffs.get(uiSourceCode);
|
|
56
65
|
if (!diff) {
|
|
57
|
-
diff = new UISourceCodeDiff(uiSourceCode);
|
|
66
|
+
diff = new UISourceCodeDiff(uiSourceCode, this.#networkPersistenceManager);
|
|
58
67
|
this.#diffs.set(uiSourceCode, diff);
|
|
59
68
|
}
|
|
60
69
|
return diff;
|
|
@@ -195,12 +204,17 @@ export interface EventTypes {
|
|
|
195
204
|
|
|
196
205
|
export class UISourceCodeDiff extends Common.ObjectWrapper.ObjectWrapper<UISourceCodeDiffEventTypes> {
|
|
197
206
|
#uiSourceCode: Workspace.UISourceCode.UISourceCode;
|
|
207
|
+
readonly #networkPersistenceManager: Persistence.NetworkPersistenceManager.NetworkPersistenceManager;
|
|
198
208
|
#requestDiffPromise: Promise<DiffResponse|null>|null = null;
|
|
199
209
|
#pendingChanges: number|null = null;
|
|
200
210
|
dispose = false;
|
|
201
|
-
constructor(
|
|
211
|
+
constructor(
|
|
212
|
+
uiSourceCode: Workspace.UISourceCode.UISourceCode,
|
|
213
|
+
networkPersistenceManager: Persistence.NetworkPersistenceManager.NetworkPersistenceManager,
|
|
214
|
+
) {
|
|
202
215
|
super();
|
|
203
216
|
this.#uiSourceCode = uiSourceCode;
|
|
217
|
+
this.#networkPersistenceManager = networkPersistenceManager;
|
|
204
218
|
uiSourceCode.addEventListener(Workspace.UISourceCode.Events.WorkingCopyChanged, this.#uiSourceCodeChanged, this);
|
|
205
219
|
uiSourceCode.addEventListener(Workspace.UISourceCode.Events.WorkingCopyCommitted, this.#uiSourceCodeChanged, this);
|
|
206
220
|
}
|
|
@@ -233,9 +247,7 @@ export class UISourceCodeDiff extends Common.ObjectWrapper.ObjectWrapper<UISourc
|
|
|
233
247
|
}
|
|
234
248
|
|
|
235
249
|
async originalContent(): Promise<string|null> {
|
|
236
|
-
const originalNetworkContent =
|
|
237
|
-
Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance().originalContentForUISourceCode(
|
|
238
|
-
this.#uiSourceCode);
|
|
250
|
+
const originalNetworkContent = this.#networkPersistenceManager.originalContentForUISourceCode(this.#uiSourceCode);
|
|
239
251
|
if (originalNetworkContent) {
|
|
240
252
|
return await originalNetworkContent;
|
|
241
253
|
}
|
|
@@ -305,11 +317,10 @@ export interface UISourceCodeDiffEventTypes {
|
|
|
305
317
|
[UISourceCodeDiffEvents.DIFF_CHANGED]: void;
|
|
306
318
|
}
|
|
307
319
|
|
|
308
|
-
let workspaceDiffImplInstance: WorkspaceDiffImpl|null = null;
|
|
309
|
-
|
|
310
320
|
export function workspaceDiff({forceNew}: {forceNew?: boolean} = {}): WorkspaceDiffImpl {
|
|
311
|
-
if (!
|
|
312
|
-
|
|
321
|
+
if (!Root.DevToolsContext.globalInstance().has(WorkspaceDiffImpl) || forceNew) {
|
|
322
|
+
Root.DevToolsContext.globalInstance().set(WorkspaceDiffImpl,
|
|
323
|
+
new WorkspaceDiffImpl(Workspace.Workspace.WorkspaceImpl.instance()));
|
|
313
324
|
}
|
|
314
|
-
return
|
|
325
|
+
return Root.DevToolsContext.globalInstance().get(WorkspaceDiffImpl);
|
|
315
326
|
}
|
|
@@ -950,7 +950,8 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
950
950
|
|
|
951
951
|
#getAiAssistanceEnabledSetting(): Common.Settings.Setting<boolean>|undefined {
|
|
952
952
|
try {
|
|
953
|
-
return Common.Settings.moduleSetting('ai-assistance-enabled') as
|
|
953
|
+
return Common.Settings.Settings.instance().moduleSetting('ai-assistance-enabled') as
|
|
954
|
+
Common.Settings.Setting<boolean>;
|
|
954
955
|
} catch {
|
|
955
956
|
return;
|
|
956
957
|
}
|
|
@@ -115,6 +115,10 @@ const UIStrings = {
|
|
|
115
115
|
* @description Text in Application Panel Sidebar of the Application panel
|
|
116
116
|
*/
|
|
117
117
|
ads: 'Ads',
|
|
118
|
+
/**
|
|
119
|
+
* @description Tooltip for the experimental icon in the Ads panel
|
|
120
|
+
*/
|
|
121
|
+
experimental: 'Experimental',
|
|
118
122
|
/**
|
|
119
123
|
* @description Text in Application Panel Sidebar of the Application panel
|
|
120
124
|
*/
|
|
@@ -411,8 +415,12 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
|
|
|
411
415
|
|
|
412
416
|
if (Root.Runtime.hostConfig.devToolsAdsPanel?.enabled) {
|
|
413
417
|
const adsTreeElement = new ApplicationPanelTreeElement(panel, i18nString(UIStrings.ads), false, 'ads');
|
|
414
|
-
|
|
418
|
+
adsTreeElement.listItemElement.classList.add('ads-tree-element');
|
|
419
|
+
const icon = createIcon('ads');
|
|
415
420
|
adsTreeElement.setLeadingIcons([icon]);
|
|
421
|
+
const experimentIcon = createIcon('experiment', 'medium');
|
|
422
|
+
UI.Tooltip.Tooltip.install(experimentIcon, i18nString(UIStrings.experimental));
|
|
423
|
+
adsTreeElement.setTrailingIcons([experimentIcon]);
|
|
416
424
|
adsTreeElement.itemURL = 'ads://' as Platform.DevToolsPath.UrlString;
|
|
417
425
|
let adsView: ApplicationComponents.AdsView.AdsView;
|
|
418
426
|
adsTreeElement.onselect = (selectedByUser?: boolean): boolean => {
|
|
@@ -11,6 +11,7 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
11
11
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
12
12
|
import * as Protocol from '../../generated/protocol.js';
|
|
13
13
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
14
|
+
import * as Workspace from '../../models/workspace/workspace.js';
|
|
14
15
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
15
16
|
import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
|
|
16
17
|
// eslint-disable-next-line @devtools/es-modules-import
|
|
@@ -526,7 +527,7 @@ export class BackgroundServiceView extends UI.Widget.VBox {
|
|
|
526
527
|
private async saveToFile(): Promise<void> {
|
|
527
528
|
const fileName = `${this.serviceName}-${Platform.DateUtilities.toISO8601Compact(new Date())}.json` as
|
|
528
529
|
Platform.DevToolsPath.RawPathString;
|
|
529
|
-
const stream = new Bindings.FileUtils.FileOutputStream();
|
|
530
|
+
const stream = new Bindings.FileUtils.FileOutputStream(Workspace.FileManager.FileManager.instance());
|
|
530
531
|
|
|
531
532
|
const accepted = await stream.open(fileName);
|
|
532
533
|
if (!accepted) {
|
|
@@ -249,6 +249,13 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
249
249
|
private skipCount: number;
|
|
250
250
|
// Used in Web Tests
|
|
251
251
|
protected entries: Entry[];
|
|
252
|
+
#hasMore = false;
|
|
253
|
+
#selectedRowNumber = 0;
|
|
254
|
+
#needsRefreshVisible = false;
|
|
255
|
+
#clearButtonEnabled = true;
|
|
256
|
+
#metadata: ObjectStoreMetadata|null = null;
|
|
257
|
+
#lastRenderedEntries: Entry[]|null = null;
|
|
258
|
+
|
|
252
259
|
private objectStore!: ObjectStore;
|
|
253
260
|
private index!: Index|null;
|
|
254
261
|
private keyInput!: UI.Toolbar.ToolbarInput;
|
|
@@ -311,9 +318,9 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
311
318
|
|
|
312
319
|
this.pageSize = 50;
|
|
313
320
|
this.skipCount = 0;
|
|
321
|
+
this.entries = [];
|
|
314
322
|
|
|
315
323
|
this.update(objectStore, index);
|
|
316
|
-
this.entries = [];
|
|
317
324
|
}
|
|
318
325
|
|
|
319
326
|
private createDataGrid(): DataGrid.DataGrid.DataGridImpl<unknown> {
|
|
@@ -469,6 +476,9 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
469
476
|
this.dataGrid = this.createDataGrid();
|
|
470
477
|
this.dataGrid.setRowContextMenuCallback(this.populateContextMenu.bind(this));
|
|
471
478
|
this.dataGrid.asWidget().show(this.element);
|
|
479
|
+
if (this.summaryBarElement) {
|
|
480
|
+
this.element.appendChild(this.summaryBarElement);
|
|
481
|
+
}
|
|
472
482
|
|
|
473
483
|
this.skipCount = 0;
|
|
474
484
|
this.updateData(true);
|
|
@@ -490,9 +500,8 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
490
500
|
const key = this.parseKey(this.keyInput.value());
|
|
491
501
|
const pageSize = this.pageSize;
|
|
492
502
|
let skipCount: 0|number = this.skipCount;
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
this.clearButton.setEnabled(!this.isIndex);
|
|
503
|
+
const selected = this.dataGrid.selectedNode ? this.dataGrid.selectedNode.data['number'] : 0;
|
|
504
|
+
this.#selectedRowNumber = Math.max(selected, this.skipCount); // Page forward should select top entry
|
|
496
505
|
|
|
497
506
|
if (!force && this.lastKey === key && this.lastPageSize === pageSize && this.lastSkipCount === skipCount) {
|
|
498
507
|
return;
|
|
@@ -507,13 +516,10 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
507
516
|
this.lastSkipCount = skipCount;
|
|
508
517
|
|
|
509
518
|
function callback(this: IDBDataView, entries: Entry[], hasMore: boolean): void {
|
|
510
|
-
this.clear();
|
|
511
519
|
this.entries = entries;
|
|
512
|
-
this
|
|
513
|
-
this
|
|
514
|
-
this.
|
|
515
|
-
this.needsRefresh.setVisible(false);
|
|
516
|
-
this.updateToolbarEnablement();
|
|
520
|
+
this.#hasMore = hasMore;
|
|
521
|
+
this.#needsRefreshVisible = false;
|
|
522
|
+
this.performUpdate();
|
|
517
523
|
this.updatedDataForTests();
|
|
518
524
|
}
|
|
519
525
|
|
|
@@ -525,23 +531,30 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
525
531
|
this.model.loadObjectStoreData(this.databaseId, this.objectStore.name, idbKeyRange, skipCount, pageSize,
|
|
526
532
|
callback.bind(this));
|
|
527
533
|
}
|
|
528
|
-
void this.model.getMetadata(this.databaseId, this.objectStore).then(
|
|
534
|
+
void this.model.getMetadata(this.databaseId, this.objectStore).then(metadata => {
|
|
535
|
+
this.#metadata = metadata;
|
|
536
|
+
this.performUpdate();
|
|
537
|
+
});
|
|
529
538
|
}
|
|
530
539
|
|
|
531
|
-
private populateDataGrid(
|
|
540
|
+
private populateDataGrid(): void {
|
|
541
|
+
if (this.entries === this.#lastRenderedEntries) {
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
this.dataGrid.rootNode().removeChildren();
|
|
532
545
|
let selectedNode: IDBDataGridNode|null = null;
|
|
533
|
-
for (let i = 0; i < entries.length; ++i) {
|
|
546
|
+
for (let i = 0; i < this.entries.length; ++i) {
|
|
534
547
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
|
|
535
548
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
536
549
|
const data: any = {};
|
|
537
|
-
data['number'] = i + skipCount;
|
|
538
|
-
data['key'] = entries[i].key;
|
|
539
|
-
data['primary-key'] = entries[i].primaryKey;
|
|
540
|
-
data['value'] = entries[i].value;
|
|
550
|
+
data['number'] = i + this.skipCount;
|
|
551
|
+
data['key'] = this.entries[i].key;
|
|
552
|
+
data['primary-key'] = this.entries[i].primaryKey;
|
|
553
|
+
data['value'] = this.entries[i].value;
|
|
541
554
|
|
|
542
555
|
const node = new IDBDataGridNode(data);
|
|
543
556
|
this.dataGrid.rootNode().appendChild(node);
|
|
544
|
-
if (data['number'] <=
|
|
557
|
+
if (data['number'] <= this.#selectedRowNumber) {
|
|
545
558
|
selectedNode = node;
|
|
546
559
|
}
|
|
547
560
|
}
|
|
@@ -549,13 +562,15 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
549
562
|
if (selectedNode) {
|
|
550
563
|
selectedNode.select();
|
|
551
564
|
}
|
|
565
|
+
this.#lastRenderedEntries = this.entries;
|
|
552
566
|
}
|
|
553
567
|
|
|
554
|
-
private updateSummaryBar(
|
|
568
|
+
private updateSummaryBar(): void {
|
|
555
569
|
if (!this.summaryBarElement) {
|
|
556
570
|
this.summaryBarElement = this.element.createChild('div', 'object-store-summary-bar');
|
|
557
571
|
}
|
|
558
572
|
this.summaryBarElement.removeChildren();
|
|
573
|
+
const metadata = this.#metadata;
|
|
559
574
|
if (!metadata) {
|
|
560
575
|
return;
|
|
561
576
|
}
|
|
@@ -585,11 +600,13 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
585
600
|
i18nString(UIStrings.confirmClearObjectStore, {PH1: this.objectStore.name}),
|
|
586
601
|
this.element, {jslogContext: 'clear-object-store-confirmation'});
|
|
587
602
|
if (ok) {
|
|
588
|
-
this
|
|
603
|
+
this.#clearButtonEnabled = false;
|
|
604
|
+
this.performUpdate();
|
|
589
605
|
this.clearingObjectStore = true;
|
|
590
606
|
await this.model.clearObjectStore(this.databaseId, this.objectStore.name);
|
|
591
607
|
this.clearingObjectStore = false;
|
|
592
|
-
this
|
|
608
|
+
this.#clearButtonEnabled = true;
|
|
609
|
+
this.performUpdate();
|
|
593
610
|
this.updateData(true);
|
|
594
611
|
}
|
|
595
612
|
}
|
|
@@ -599,7 +616,8 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
599
616
|
if (this.clearingObjectStore) {
|
|
600
617
|
return;
|
|
601
618
|
}
|
|
602
|
-
this
|
|
619
|
+
this.#needsRefreshVisible = true;
|
|
620
|
+
this.performUpdate();
|
|
603
621
|
}
|
|
604
622
|
|
|
605
623
|
private async resolveArrayKey(key: SDK.RemoteObject.RemoteObject): Promise<IDBKeyValue> {
|
|
@@ -639,14 +657,25 @@ export class IDBDataView extends UI.View.SimpleView {
|
|
|
639
657
|
}
|
|
640
658
|
|
|
641
659
|
clear(): void {
|
|
642
|
-
this.dataGrid.rootNode().removeChildren();
|
|
643
660
|
this.entries = [];
|
|
661
|
+
this.performUpdate();
|
|
644
662
|
}
|
|
645
663
|
|
|
646
664
|
private updateToolbarEnablement(): void {
|
|
647
665
|
const empty = !this.dataGrid || this.dataGrid.rootNode().children.length === 0;
|
|
648
666
|
this.deleteSelectedButton.setEnabled(!empty && this.dataGrid.selectedNode !== null);
|
|
649
667
|
}
|
|
668
|
+
|
|
669
|
+
override performUpdate(): void {
|
|
670
|
+
this.populateDataGrid();
|
|
671
|
+
this.updateSummaryBar();
|
|
672
|
+
|
|
673
|
+
this.pageBackButton.setEnabled(this.skipCount > 0);
|
|
674
|
+
this.pageForwardButton.setEnabled(this.#hasMore);
|
|
675
|
+
this.needsRefresh.setVisible(this.#needsRefreshVisible);
|
|
676
|
+
this.clearButton.setEnabled(!this.isIndex && this.#clearButtonEnabled);
|
|
677
|
+
this.updateToolbarEnablement();
|
|
678
|
+
}
|
|
650
679
|
}
|
|
651
680
|
|
|
652
681
|
export class IDBDataGridNode extends DataGrid.DataGrid.DataGridNode<unknown> {
|
|
@@ -509,9 +509,12 @@ export class Section {
|
|
|
509
509
|
this.section.appendButtonToHeader(this.deleteButton);
|
|
510
510
|
|
|
511
511
|
// Preserve the order.
|
|
512
|
-
this.sourceField = this.
|
|
513
|
-
this.statusField = this.
|
|
514
|
-
this.clientsField = this.
|
|
512
|
+
this.sourceField = this.section.appendField(i18nString(UIStrings.source));
|
|
513
|
+
this.statusField = this.section.appendField(i18nString(UIStrings.status));
|
|
514
|
+
this.clientsField = this.section.appendField(i18nString(UIStrings.clients));
|
|
515
|
+
|
|
516
|
+
UI.DOMUtilities.appendStyle(this.section.getFieldElement(), serviceWorkersViewStyles,
|
|
517
|
+
serviceWorkerUpdateCycleViewStyles);
|
|
515
518
|
this.createSyncNotificationField(i18nString(UIStrings.pushString), this.pushNotificationDataSetting.get(),
|
|
516
519
|
i18nString(UIStrings.pushData), this.push.bind(this), 'push-message');
|
|
517
520
|
this.createSyncNotificationField(i18nString(UIStrings.syncString), this.syncTagNameSetting.get(),
|
|
@@ -528,7 +531,7 @@ export class Section {
|
|
|
528
531
|
|
|
529
532
|
private createSyncNotificationField(label: string, initialValue: string, placeholder: string,
|
|
530
533
|
callback: (arg0: string) => void, jslogContext: string): void {
|
|
531
|
-
const fieldElement = this.
|
|
534
|
+
const fieldElement = this.section.appendField(label);
|
|
532
535
|
|
|
533
536
|
// clang-format off
|
|
534
537
|
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
@@ -714,7 +717,7 @@ export class Section {
|
|
|
714
717
|
}
|
|
715
718
|
|
|
716
719
|
private createUpdateCycleField(): void {
|
|
717
|
-
this.updateCycleField = this.
|
|
720
|
+
this.updateCycleField = this.section.appendField(i18nString(UIStrings.updateCycle));
|
|
718
721
|
this.updateCycleField.appendChild(this.updateCycleView.tableElement);
|
|
719
722
|
}
|
|
720
723
|
|
|
@@ -725,7 +728,7 @@ export class Section {
|
|
|
725
728
|
if (active?.routerRules && active.routerRules.length > 0) {
|
|
726
729
|
// If there is at least one registered rule in the active version, append the router filed.
|
|
727
730
|
if (!this.routerField) {
|
|
728
|
-
this.routerField = this.
|
|
731
|
+
this.routerField = this.section.appendField(title);
|
|
729
732
|
}
|
|
730
733
|
if (!this.routerField.lastElementChild) {
|
|
731
734
|
this.routerView.show(this.routerField);
|
|
@@ -819,18 +822,4 @@ export class Section {
|
|
|
819
822
|
private stopButtonClicked(versionId: string): void {
|
|
820
823
|
void this.manager.stopWorker(versionId);
|
|
821
824
|
}
|
|
822
|
-
|
|
823
|
-
private wrapWidget(container: Element): HTMLElement {
|
|
824
|
-
const shadowRoot = UI.UIUtils.createShadowRootWithCoreStyles(container, {
|
|
825
|
-
cssFile: [
|
|
826
|
-
serviceWorkersViewStyles,
|
|
827
|
-
/* These styles are for the timing table in serviceWorkerUpdateCycleView but this is the widget that it is rendered
|
|
828
|
-
* inside so we are registering the files here. */
|
|
829
|
-
serviceWorkerUpdateCycleViewStyles,
|
|
830
|
-
],
|
|
831
|
-
});
|
|
832
|
-
const contentElement = document.createElement('div');
|
|
833
|
-
shadowRoot.appendChild(contentElement);
|
|
834
|
-
return contentElement;
|
|
835
|
-
}
|
|
836
825
|
}
|
|
@@ -80,7 +80,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
const formatCpu = (val: number): string => {
|
|
83
|
-
return i18n.TimeUtilities.
|
|
83
|
+
return i18n.TimeUtilities.millisToString(val);
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
const formatNetwork = (val: number): string => {
|
|
@@ -254,6 +254,9 @@ export class StorageMetadataView extends LegacyWrapper.LegacyWrapper.WrappableCo
|
|
|
254
254
|
${this.key(i18nString(UIStrings.bucketName))}
|
|
255
255
|
${this.value(renderBucketName())}`;
|
|
256
256
|
}
|
|
257
|
+
// If quota is 0, it means no custom quota limit has been set on the bucket.
|
|
258
|
+
// We do not render it here to avoid confusing the user (who might interpret
|
|
259
|
+
// a 0 quota as a full bucket/0 capacity rather than sharing the default origin limit).
|
|
257
260
|
// clang-format off
|
|
258
261
|
return html`
|
|
259
262
|
${this.key(i18nString(UIStrings.bucketName))}
|
|
@@ -262,8 +265,10 @@ export class StorageMetadataView extends LegacyWrapper.LegacyWrapper.WrappableCo
|
|
|
262
265
|
${this.value(persistent ? i18nString(UIStrings.yes) : i18nString(UIStrings.no))}
|
|
263
266
|
${this.key(i18nString(UIStrings.durability))}
|
|
264
267
|
${this.value(durability)}
|
|
265
|
-
${
|
|
266
|
-
|
|
268
|
+
${quota !== 0 ? html`
|
|
269
|
+
${this.key(i18nString(UIStrings.quota))}
|
|
270
|
+
${this.value(i18n.ByteUtilities.bytesToString(quota))}
|
|
271
|
+
` : nothing}
|
|
267
272
|
${this.key(i18nString(UIStrings.expiration))}
|
|
268
273
|
${this.value(this.#getExpirationString())}`;
|
|
269
274
|
}
|