<commit_before>
    // [class.bg-success]="response.ok"
    // [class.bg-info]="response.status >=300 || response.status < 400"
    // [class.bg-warning]="response.status >=400 || response.status < 500"
    // [class.bg-danger]="response.status >=500"

import { Component, Input } from '@angular/core';
import { TemplateProvider } from '../../services/template.provider';

@Component({
  selector: 'http-status-label',
  template: TemplateProvider.getTemplate('http-status-label') || `
    <span class="label"
         [class.label-info]="isSuccess()"
         [class.label-success]="isRedirect()"
         [class.label-warning]="isClientError()"
         [class.label-danger]="isServerError()">{{status}} <span class="badge">{{statusCode}}</span></span>
  `,
  styles: [
      '.label { padding-top: 0.4em; }',
  ]
})

export class HttpStatusLabelComponent {
  @Input() statusCode: number;
  @Input() status: String;

  constructor() {

  }

  isSuccess(): boolean {
    return this.statusCode >= 200 && this.statusCode < 300;
  }

  isRedirect(): boolean {
    return this.statusCode >= 300 && this.statusCode < 400;
  }

  isClientError(): boolean {
    return this.statusCode >= 400 && this.statusCode < 500;<commit_msg>fixes color for http status label<commit_after>
    // [class.bg-success]="response.ok"
    // [class.bg-info]="response.status >=300 || response.status < 400"
    // [class.bg-warning]="response.status >=400 || response.status < 500"
    // [class.bg-danger]="response.status >=500"

import { Component, Input } from '@angular/core';
import { TemplateProvider } from '../../services/template.provider';

@Component({
  selector: 'http-status-label',
  template: TemplateProvider.getTemplate('http-status-label') || `
    <span class="label"
         [class.label-success]="isSuccess()"
         [class.label-info]="isRedirect()"
         [class.label-warning]="isClientError()"
         [class.label-danger]="isServerError()">{{status}} <span class="badge">{{statusCode}}</span></span>
  `,
  styles: [
      '.label { padding-top: 0.4em; }',
  ]
})

export class HttpStatusLabelComponent {
  @Input() statusCode: number;
  @Input() status: String;

  constructor() {

  }

  isSuccess(): boolean {
    return this.statusCode >= 200 && this.statusCode < 300;
  }

  isRedirect(): boolean {
    return this.statusCode >= 300 && this.statusCode < 400;
  }

  isClientError(): boolean {
    return this.statusCode >= 400 && this.statusCode < 500;
{'fraction_non_alphanumeric': 0.1847649918962723, 'fraction_numerical': 0.028363047001620744, 'mean_word_length': 3.521978021978022, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7485291', 'n_tokens_mistral': 839, 'n_tokens_neox': 751, 'n_words': 142}