原文
').appendTo('.regional') $('.components-container').appendTo('.regional') // Global services layout $('
').prependTo('.components-section')
$('').appendTo('.global')
$('.components-container').clone().appendTo('.global')
// build layout table for global services with three rows
var global_containers = $('.global > .components-container').find('.component-container');
global_containers.each(function(){
if($(this).find('.status-red').length || $(this).find('.status-yellow').length || $(this).find('.status-orange').length || $(this).find('.status-blue').length){
$(this).prependTo('.global > .components-container');
}
if($(this).find('.child-components-container').length){
$(this).remove();
}
});
$(function() {
$('.components-container').toggleClass('one-column').toggleClass('three-columns')
});
// build layout table for regional services
var regional_containers = $('.regional > .components-container').find('.component-container');
regional_containers.each(function(){
if($(this).find('.status-red').length || $(this).find('.status-yellow').length || $(this).find('.status-orange').length || $(this).find('.status-blue').length){
$(this).find('.child-components-container > .component-inner-container').each(function(){
if(!$(this).hasClass('status-green')) {
this.style.setProperty('background-color', 'rgba(243, 245, 249, 0.97)','important');
this.style.setProperty('margin-bottom', '0','important');
}
});
$(this).prependTo('.regional > .components-container');
}
if($(this).find('.child-components-container').length == 0){
$(this).remove();
}
})
// remove uptime
$(function() {
$('.components-section > .components-uptime-link').remove();
});
// tooltips for status images in incident header
$(function() {
$('.icon-indicator.investigating').attr('title','Investigating');
$('.icon-indicator.identified').attr('title','Issue Identified');
$('.icon-indicator.monitoring').attr('title','Monitoring');
$('.icon-indicator.maintenance').attr('title','Maintenance');
});
// add aria-labels
$(function() {
$('.fa-check').attr('aria-label','Operational');
$('.fa-minus-square').attr('aria-label','Degraded Performance');
$('.fa-exclamation-triangle').attr('aria-label','Partial Outage');
$('.fa-times').attr('aria-label','Major Outage');
$('.fa-wrench').attr('aria-label','Maintenance');
$('.component-statuses-legend').attr('aria-label','Statuses Legend');
$('.container > .logo > img').attr('alt','DigitalOcean logo');
});
// spacer to visually separate main page legend
$(function() {
$('
').prependTo('.container > .components-section > .component-statuses-legend'); }); // add legend to history page $(function() { if ($('[data-react-class=HistoryIndex]').length) { $('
').insertAfter('.pagination'); } }); // Filter button UX improvements function resetSelection() { $("input:checkbox").each(function() { if(this.checked == true) { this.click(); } }); } $(function() { if ($('[data-react-class=HistoryIndex]').length) { window.addEventListener('click', function(e) { if($(event.target).closest('.grouped-items-selector').length === 0 && $(event.target).closest('.component-selector').length === 0 && $(event.target).closest('.cc-window').length === 0 ){ if ($('.grouped-items-selector').length) { $('.component-selector > span').click(); e.stopImmediatePropagation(); } } else { if ($('.grouped-items-selector').length && !$('#reset-selection').length) { $('
').prependTo('.container > .components-section > .component-statuses-legend'); }); // add legend to history page $(function() { if ($('[data-react-class=HistoryIndex]').length) { $('
').insertAfter('.pagination'); } }); // Filter button UX improvements function resetSelection() { $("input:checkbox").each(function() { if(this.checked == true) { this.click(); } }); } $(function() { if ($('[data-react-class=HistoryIndex]').length) { window.addEventListener('click', function(e) { if($(event.target).closest('.grouped-items-selector').length === 0 && $(event.target).closest('.component-selector').length === 0 && $(event.target).closest('.cc-window').length === 0 ){ if ($('.grouped-items-selector').length) { $('.component-selector > span').click(); e.stopImmediatePropagation(); } } else { if ($('.grouped-items-selector').length && !$('#reset-selection').length) { $('
- Clear selection
').prependTo('.grouped-items-selector'); $('#reset-selection').click(resetSelection); e.stopImmediatePropagation(); } } }); } }); $(function() { $('* Note: Incidents before May 10th, 2023 were backfilled and don\'t support the filter feature.').prependTo('.months-container'); }); $(function() { if (/Android|iPhone/i.test(navigator.userAgent)) { $( '.component-container' ).each(function () { this.style.setProperty( 'width', '95%', 'important' ); }); } }); // Shorten header incident describtions function revealTruncated (incidentID) { let truncateDivName = "#truncate_" + incidentID; let expandLinkDivName = "#expand_" + incidentID; let truncateLink = " [less] " $(truncateDivName).css('display','inline'); $(expandLinkDivName).insertAfter(truncateDivName) $(expandLinkDivName).html(truncateLink); } function hideTruncated (incidentID) { let truncateDivName = "#truncate_" + incidentID; let expandLinkDivName = "#expand_" + incidentID; let truncateLink = " [...] " $(truncateDivName).css('display','None'); $(expandLinkDivName).insertBefore(truncateDivName) $(expandLinkDivName).html(truncateLink); } $('.update > span.whitespace-pre-wrap').each(function() { let textLength = $(this).text().split(/\s+/).length; if (textLength > 81){ // get incident ID let incidentUrl = $(this).closest('.unresolved-incident').find('a')[0]; let incidentID = (String(incidentUrl)).split("incidents/")[1]; let firstPart = $(this).html().split(/\s+/).slice(0,80).join(' '); let secondPart = '' + $(this).html().split(/\s+/).slice(80,textLength).join(' ') + '
'; let expandLink = "" $(this).html(firstPart + expandLink + secondPart); } });