@yuebai008/cli
Version:
Command line interface for rapid qg-minigame development
1 lines • 1.74 kB
JavaScript
import*as i18n from"../../core/i18n/i18n.js";import*as IssuesManager from"../../models/issues_manager/issues_manager.js";import*as Host from"../../core/host/host.js";import{AffectedResourcesView}from"./AffectedResourcesView.js";const UIStrings={nRequests:"{n, plural, =1 {# request} other {# requests}}",requestC:"Request",parentFrame:"Parent Frame",blockedResource:"Blocked Resource"},str_=i18n.i18n.registerUIStrings("panels/issues/AffectedBlockedByResponseView.ts",UIStrings),i18nString=i18n.i18n.getLocalizedString.bind(void 0,str_);export class AffectedBlockedByResponseView extends AffectedResourcesView{#e(e){const s=document.createElement("tr");this.appendColumnTitle(s,i18nString(UIStrings.requestC)),this.appendColumnTitle(s,i18nString(UIStrings.parentFrame)),this.appendColumnTitle(s,i18nString(UIStrings.blockedResource)),this.affectedResources.appendChild(s);let t=0;for(const s of e)this.#s(s),t++;this.updateAffectedResourceCount(t)}getResourceNameWithCount(e){return i18nString(UIStrings.nRequests,{n:e})}#s(e){const s=document.createElement("tr");s.classList.add("affected-resource-row");const t=this.createRequestCell(e.request,{additionalOnClickAction(){Host.userMetrics.issuesPanelResourceOpened(IssuesManager.Issue.IssueCategory.CrossOriginEmbedderPolicy,"Request")}});if(s.appendChild(t),e.parentFrame){const t=this.createFrameCell(e.parentFrame.frameId,this.issue.getCategory());s.appendChild(t)}else s.appendChild(document.createElement("td"));if(e.blockedFrame){const t=this.createFrameCell(e.blockedFrame.frameId,this.issue.getCategory());s.appendChild(t)}else s.appendChild(document.createElement("td"));this.affectedResources.appendChild(s)}update(){this.clear(),this.#e(this.issue.getBlockedByResponseDetails())}}