Socket
Socket
Sign inDemoInstall

@alchemydocs/template

Package Overview
Dependencies
6
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.3.1 to 2.3.2

2

dist/js/statuspage.js

@@ -1,1 +0,1 @@

!function(e){var t={};function n(o){if(t[o])return t[o].exports;var s=t[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(o,s,function(t){return e[t]}.bind(null,s));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=29)}({29:function(e,t,n){n(30);const o=n(31),s=n(32),a=n(33),c=n(34),d=n(36),i=document.querySelector(".sideaffix");i&&i.parentNode.removeChild(i),(()=>{const{baseUrl:e,metrics:t,pageId:n}=window.pluginConfig.statuspage;o(e);const i=()=>{window.StatusPage&&window.statusPageSummary?(()=>{const o=new StatusPage.page({page:n});s(),a(o),c(e,t),d(o)})():window.setTimeout(i,100)};i()})()},30:function(e,t,n){},31:function(e,t){e.exports=(e=>{const t=()=>{const n=document.getElementById("toc");if(!n)return void window.setTimeout(t,100);n.innerHTML="";const o=document.createElement("ul");o.classList.add("nav"),o.classList.add("level1"),n.appendChild(o);const s=document.createElement("li");o.appendChild(s);const a=document.createElement("a");a.id="subscribe-toggle",a.textContent="Subscribe to updates",a.setAttribute("href","#"),s.appendChild(a);const c=document.createElement("li");o.appendChild(c);const d=document.createElement("a");d.textContent="RSS Feed",d.setAttribute("href",`${e}/history.rss`),d.setAttribute("target","_blank"),c.appendChild(d)};t()})},32:function(e,t){e.exports=(()=>{const e=window.statusPageSummary;document.getElementById("page-status").textContent=e.status.description,document.getElementById("page-status").classList.add(e.status.indicator),e.components.forEach(e=>{const t=document.createElement("div");t.classList.add("component"),t.classList.add(e.status);const n=document.createElement("div");n.classList.add("component-title"),t.appendChild(n),n.appendChild(document.createTextNode(e.name));const o=document.createElement("div");o.classList.add("component-description"),o.textContent=e.description,n.appendChild(o);const s=document.createElement("div");s.classList.add("component-status"),s.textContent=(e=>e.charAt(0).toUpperCase()+e.slice(1))(e.status),t.appendChild(s),document.getElementById("components").appendChild(t)})})},33:function(e,t){e.exports=(e=>{e.incidents({success:e=>{e.incidents.forEach(e=>{const t=new Date(e.started_at).toLocaleString(),n=document.createElement("div");n.classList.add("incident");const o=document.createElement("h4");o.classList.add(e.impact),o.textContent=`${t} - ${e.name}`,n.appendChild(o),e.incident_updates.forEach(e=>{const t=new Date(e.created_at).toLocaleString(),o=document.createElement("div");o.classList.add("update");const s=document.createElement("strong");s.classList.add("update-title"),s.textContent=(e=>e.charAt(0).toUpperCase()+e.slice(1))(e.status),o.appendChild(s);const a=document.createElement("div");a.textContent=e.body;const c=document.createElement("div");c.classList.add("timestamp"),c.textContent=`Posted at: ${t}`,a.appendChild(c),o.appendChild(a),n.appendChild(o)}),document.getElementById("incidents").appendChild(n)})}})})},34:function(e,t,n){const o=n(35);e.exports=((e,t)=>{let n="day";const s=s=>{t.forEach(t=>{fetch(`${e}/metrics-display/${t}/${s}.json`).then(e=>e.json()).then(e=>{o(e,t,n=s)})})};s(n);const a=document.querySelectorAll(".timescales button");["day","week","month"].forEach(e=>{const t=document.getElementById(`chart-timescale-${e}`);t.addEventListener("click",()=>{[].forEach.call(a,e=>e.classList.remove("isActive")),t.classList.add("isActive"),s(e)})})})},35:function(e,t){const n={},o={},s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],a=document.getElementById("charts");e.exports=((e,t,c)=>{o[t]=e.metrics[0].data;const d=e.metrics[0].data.map(e=>e.timestamp),i=e.metrics[0].data.map(e=>e.value);if(n[t])return n[t].data.labels=d,n[t].data.datasets[0].data=i,void n[t].update();const r=document.createElement("div");r.classList.add("chart"),a.appendChild(r);const l=document.createElement("h3");l.textContent=e.metrics[0].metric.name,r.appendChild(l);const u=document.createElement("h3");u.classList.add("mean");const m=Math.round(e.metrics[0].summary.mean)+"ms";u.textContent=m,r.appendChild(u);const p=document.createElement("canvas");p.setAttribute("width",750),p.setAttribute("height",150),r.appendChild(p);const f=p.getContext("2d");n[t]=new Chart(f,{type:"line",data:{labels:d,datasets:[{data:i,borderWidth:2,borderColor:"#42b5c5",fill:!1,pointRadius:0,pointBackgroundColor:"#42b5c5",pointBorderColor:"#fff",pointBorderWidth:2,lineTension:.1}]},options:{legend:{display:!1},scales:{xAxes:[{gridLines:{display:!1},ticks:{fontColor:"#aaa",callback:(e,t)=>{let n=10;return"day"===c&&(n=5),t%n==0?e:""}},beforeTickToLabelConversion:e=>(e.ticks=e.ticks.map(e=>{const t=new Date(1e3*e);return"day"===c?t.toLocaleTimeString().slice(0,5):t.getDay()+" "+s[t.getMonth()]}),e)}],yAxes:[{beginAtZero:!1,gridLines:{drawBorder:!1},ticks:{fontColor:"#aaa"}}]},tooltips:{mode:"index",intersect:!1,callbacks:{title:e=>{const n=e[0].index,a=new Date(1e3*o[t][n].timestamp);return a.getDay()+" "+s[a.getMonth()]+" "+a.getFullYear()+" "+a.toLocaleTimeString().slice(0,5)},label:e=>e.value+"ms"}},hover:{mode:"index",intersect:!1}}})})},36:function(e,t){let n=!1;const o=document.getElementById("subscribe-modal"),s=()=>{o.style.display="none",n=!1};e.exports=(e=>{document.getElementById("subscribe-toggle").addEventListener("click",e=>{e.preventDefault(),o.style.display=n?"none":"block",n=!n}),document.getElementById("subscribe-modal-close").addEventListener("click",s);const t=document.getElementById("email-input"),a=document.getElementById("subscribe-status");document.getElementById("btn-subscribe").addEventListener("click",()=>{e.subscribe({subscriber:{email:t.value},success:e=>{if(e.errors)return a.classList.add("danger"),void(a.textContent=e.errors.join("\n"));a.textContent="Success! Check your inbox for a confirmation email."}})})})}});
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var s=t[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(o,s,function(t){return e[t]}.bind(null,s));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=29)}({29:function(e,t,n){n(30);const o=n(31),s=n(33),a=n(34),c=n(35),d=document.querySelector(".sideaffix");d&&d.parentNode.removeChild(d),(()=>{const{baseUrl:e,metrics:t,pageId:n}=window.pluginConfig.statuspage,d=()=>{window.StatusPage&&window.statusPageSummary?(()=>{const d=new StatusPage.page({page:n});o(d,e),s(),a(d),c(e,t)})():window.setTimeout(d,100)};d()})()},30:function(e,t,n){},31:function(e,t,n){const o=n(32);e.exports=((e,t)=>{const n=()=>{const s=document.getElementById("sidetoc");if(!s)return void window.setTimeout(n,100);const a=document.createElement("div");a.id="toc",a.classList.add("toc"),s.appendChild(a);const c=document.createElement("ul");c.classList.add("nav"),c.classList.add("level1"),a.appendChild(c);const d=document.createElement("li");c.appendChild(d);const i=document.createElement("a");i.id="subscribe-toggle",i.textContent="Subscribe to updates",i.setAttribute("href","#"),d.appendChild(i);const r=document.createElement("li");c.appendChild(r);const l=document.createElement("a");l.textContent="RSS Feed",l.setAttribute("href",`${t}/history.rss`),l.setAttribute("target","_blank"),r.appendChild(l),o(e)};n()})},32:function(e,t){let n=!1;const o=document.getElementById("subscribe-modal"),s=()=>{o.style.display="none",n=!1};e.exports=(e=>{document.getElementById("subscribe-toggle").addEventListener("click",e=>{e.preventDefault(),o.style.display=n?"none":"block",n=!n}),document.getElementById("subscribe-modal-close").addEventListener("click",s);const t=document.getElementById("email-input"),a=document.getElementById("subscribe-status");document.getElementById("btn-subscribe").addEventListener("click",()=>{e.subscribe({subscriber:{email:t.value},success:e=>{if(e.errors)return a.classList.add("danger"),void(a.textContent=e.errors.join("\n"));a.textContent="Success! Check your inbox for a confirmation email."}})})})},33:function(e,t){e.exports=(()=>{const e=window.statusPageSummary;document.getElementById("page-status").textContent=e.status.description,document.getElementById("page-status").classList.add(e.status.indicator),e.components.forEach(e=>{const t=document.createElement("div");t.classList.add("component"),t.classList.add(e.status);const n=document.createElement("div");n.classList.add("component-title"),t.appendChild(n),n.appendChild(document.createTextNode(e.name));const o=document.createElement("div");o.classList.add("component-description"),o.textContent=e.description,n.appendChild(o);const s=document.createElement("div");s.classList.add("component-status"),s.textContent=(e=>e.charAt(0).toUpperCase()+e.slice(1))(e.status),t.appendChild(s),document.getElementById("components").appendChild(t)})})},34:function(e,t){e.exports=(e=>{e.incidents({success:e=>{e.incidents.forEach(e=>{const t=new Date(e.started_at).toLocaleString(),n=document.createElement("div");n.classList.add("incident");const o=document.createElement("h4");o.classList.add(e.impact),o.textContent=`${t} - ${e.name}`,n.appendChild(o),e.incident_updates.forEach(e=>{const t=new Date(e.created_at).toLocaleString(),o=document.createElement("div");o.classList.add("update");const s=document.createElement("strong");s.classList.add("update-title"),s.textContent=(e=>e.charAt(0).toUpperCase()+e.slice(1))(e.status),o.appendChild(s);const a=document.createElement("div");a.textContent=e.body;const c=document.createElement("div");c.classList.add("timestamp"),c.textContent=`Posted at: ${t}`,a.appendChild(c),o.appendChild(a),n.appendChild(o)}),document.getElementById("incidents").appendChild(n)})}})})},35:function(e,t,n){const o=n(36);e.exports=((e,t)=>{let n="day";const s=s=>{t.forEach(t=>{fetch(`${e}/metrics-display/${t}/${s}.json`).then(e=>e.json()).then(e=>{o(e,t,n=s)})})};s(n);const a=document.querySelectorAll(".timescales button");["day","week","month"].forEach(e=>{const t=document.getElementById(`chart-timescale-${e}`);t.addEventListener("click",()=>{[].forEach.call(a,e=>e.classList.remove("isActive")),t.classList.add("isActive"),s(e)})})})},36:function(e,t){const n={},o={},s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],a=document.getElementById("charts");e.exports=((e,t,c)=>{o[t]=e.metrics[0].data;const d=e.metrics[0].data.map(e=>e.timestamp),i=e.metrics[0].data.map(e=>e.value);if(n[t])return n[t].data.labels=d,n[t].data.datasets[0].data=i,void n[t].update();const r=document.createElement("div");r.classList.add("chart"),a.appendChild(r);const l=document.createElement("h3");l.textContent=e.metrics[0].metric.name,r.appendChild(l);const u=document.createElement("h3");u.classList.add("mean");const m=Math.round(e.metrics[0].summary.mean)+"ms";u.textContent=m,r.appendChild(u);const p=document.createElement("canvas");p.setAttribute("width",750),p.setAttribute("height",150),r.appendChild(p);const f=p.getContext("2d");n[t]=new Chart(f,{type:"line",data:{labels:d,datasets:[{data:i,borderWidth:2,borderColor:"#42b5c5",fill:!1,pointRadius:0,pointBackgroundColor:"#42b5c5",pointBorderColor:"#fff",pointBorderWidth:2,lineTension:.1}]},options:{legend:{display:!1},scales:{xAxes:[{gridLines:{display:!1},ticks:{fontColor:"#aaa",callback:(e,t)=>{let n=10;return"day"===c&&(n=5),t%n==0?e:""}},beforeTickToLabelConversion:e=>(e.ticks=e.ticks.map(e=>{const t=new Date(1e3*e);return"day"===c?t.toLocaleTimeString().slice(0,5):t.getDay()+" "+s[t.getMonth()]}),e)}],yAxes:[{beginAtZero:!1,gridLines:{drawBorder:!1},ticks:{fontColor:"#aaa"}}]},tooltips:{mode:"index",intersect:!1,callbacks:{title:e=>{const n=e[0].index,a=new Date(1e3*o[t][n].timestamp);return a.getDay()+" "+s[a.getMonth()]+" "+a.getFullYear()+" "+a.toLocaleTimeString().slice(0,5)},label:e=>e.value+"ms"}},hover:{mode:"index",intersect:!1}}})})}});
{
"name": "@alchemydocs/template",
"version": "2.3.1",
"version": "2.3.2",
"description": "Default template for Alchemy",

@@ -5,0 +5,0 @@ "author": "Poq Commerce <dev@poqcommerce.com>",

@@ -7,3 +7,2 @@ require('../../scss/statuspage.scss');

const renderCharts = require('./charts');
const renderSubscribe = require('./subscribe');

@@ -21,11 +20,9 @@ // Prevent the flash of layout changing around the custom page

replaceToc(baseUrl);
const runStatusPage = () => {
const sp = new StatusPage.page({ page: pageId });
replaceToc(sp, baseUrl);
renderComponents();
renderIncidents(sp);
renderCharts(baseUrl, metrics);
renderSubscribe(sp);
};

@@ -32,0 +29,0 @@

@@ -0,10 +1,13 @@

const renderSubscribe = require('./subscribe');
/**
* Replace the TOC with a custom TOC
*
* @param {Object} sp StatusPage instance
* @param {string} baseUrl Status Page io Base URL
*/
const replaceToc = baseUrl => {
const replaceToc = (sp, baseUrl) => {
const checkToc = () => {
const toc = document.getElementById('toc');
if (!toc) {
const sidetoc = document.getElementById('sidetoc');
if (!sidetoc) {
window.setTimeout(checkToc, 100);

@@ -14,3 +17,6 @@ return;

toc.innerHTML = '';
const toc = document.createElement('div');
toc.id = 'toc';
toc.classList.add('toc');
sidetoc.appendChild(toc);

@@ -39,2 +45,4 @@ const ul = document.createElement('ul');

rssFeedItem.appendChild(rssFeedLink);
renderSubscribe(sp);
};

@@ -41,0 +49,0 @@ checkToc();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc