Search is not available for this dataset
repo
stringlengths
2
152
file
stringlengths
15
239
code
stringlengths
0
58.4M
file_length
int64
0
58.4M
avg_line_length
float64
0
1.81M
max_line_length
int64
0
12.7M
extension_type
stringclasses
364 values
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/ng-bootstrap-form-validation/cd-form-control.directive.spec.ts
/** * MIT License * * Copyright (c) 2017 Kevin Kipp * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modi...
1,524
39.131579
81
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/ng-bootstrap-form-validation/cd-form-control.directive.ts
/** * MIT License * * Copyright (c) 2017 Kevin Kipp * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modi...
2,670
31.180723
88
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/ng-bootstrap-form-validation/cd-form-group.directive.spec.ts
/** * MIT License * * Copyright (c) 2017 Kevin Kipp * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modi...
1,521
39.052632
81
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/ng-bootstrap-form-validation/cd-form-group.directive.ts
/** * MIT License * * Copyright (c) 2017 Kevin Kipp * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modi...
2,346
29.480519
81
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/ng-bootstrap-form-validation/cd-form-validation.directive.spec.ts
/** * MIT License * * Copyright (c) 2017 Kevin Kipp * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modi...
1,476
40.027778
81
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/ng-bootstrap-form-validation/cd-form-validation.directive.ts
/** * MIT License * * Copyright (c) 2017 Kevin Kipp * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modi...
2,276
35.142857
85
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/cell-template.enum.ts
export enum CellTemplate { bold = 'bold', sparkline = 'sparkline', perSecond = 'perSecond', checkIcon = 'checkIcon', routerLink = 'routerLink', // Display the cell with an executing state. The state can be set to the `cdExecuting` // attribute of table rows. // It supports an optional custom configurati...
1,839
29.666667
117
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/components.enum.ts
export enum Components { auth = 'Login', cephfs = 'CephFS', rbd = 'RBD', pool = 'Pool', osd = 'OSD', role = 'Role', user = 'User' }
146
13.7
24
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/dashboard-promqls.enum.ts
export enum Promqls { USEDCAPACITY = 'ceph_cluster_total_used_bytes', IPS = 'sum(rate(ceph_osd_op_w_in_bytes[$interval]))', OPS = 'sum(rate(ceph_osd_op_r_out_bytes[$interval]))', READLATENCY = 'avg_over_time(ceph_osd_apply_latency_ms[$interval])', WRITELATENCY = 'avg_over_time(ceph_osd_commit_latency_ms[$inte...
536
47.818182
72
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/health-color.enum.ts
export enum HealthColor { HEALTH_ERR = 'health-color-error', HEALTH_WARN = 'health-color-warning', HEALTH_OK = 'health-color-healthy' }
142
22.833333
39
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/health-icon.enum.ts
export enum HealthIcon { HEALTH_ERR = 'fa fa-exclamation-circle', HEALTH_WARN = 'fa fa-exclamation-triangle', HEALTH_OK = 'fa fa-check-circle' }
151
24.333333
45
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/health-label.enum.ts
export enum HealthLabel { HEALTH_ERR = 'error', HEALTH_WARN = 'warning', HEALTH_OK = 'ok' }
98
15.5
26
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/icons.enum.ts
export enum Icons { /* Icons for Symbol */ add = 'fa fa-plus', // Create, Add addCircle = 'fa fa-plus-circle', // Plus with Circle minusCircle = 'fa fa-minus-circle', // Minus with Circle edit = 'fa fa-pencil', // Edit, Edit Mode, Rename destroy = 'fa fa-times', // Destroy, Remove, Delete destroyCircle = ...
3,997
43.422222
76
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/notification-type.enum.ts
export enum NotificationType { error, info, success }
60
9.166667
30
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/unix_errno.enum.ts
// http://www.virtsync.com/c-error-codes-include-errno export enum UnixErrno { EEXIST = 17 // File exists }
110
21.2
54
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/view-cache-status.enum.ts
export enum ViewCacheStatus { ValueOk = 0, ValueStale = 1, ValueNone = 2, ValueException = 3 }
103
13.857143
29
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-form-builder.spec.ts
import { Validators } from '@angular/forms'; import { CdFormBuilder } from './cd-form-builder'; import { CdFormGroup } from './cd-form-group'; describe('cd-form-builder', () => { let service: CdFormBuilder; beforeEach(() => { service = new CdFormBuilder(); }); it('should be created', () => { expect(...
845
23.882353
53
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-form-builder.ts
import { Injectable } from '@angular/core'; import { AbstractControlOptions, FormBuilder } from '@angular/forms'; import { CdFormGroup } from './cd-form-group'; /** * CdFormBuilder extends FormBuilder to create an CdFormGroup based form. */ @Injectable({ providedIn: 'root' }) export class CdFormBuilder extends Fo...
591
27.190476
79
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-form-group.spec.ts
import { AbstractControl, FormControl, FormGroup, NgForm } from '@angular/forms'; import { CdFormGroup } from './cd-form-group'; describe('CdFormGroup', () => { let form: CdFormGroup; const createTestForm = (controlName: string, value: any): FormGroup => new FormGroup({ [controlName]: new FormControl(v...
6,011
31.497297
96
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-form-group.ts
import { AbstractControl, AbstractControlOptions, AsyncValidatorFn, FormGroup, NgForm, ValidatorFn } from '@angular/forms'; /** * CdFormGroup extends FormGroup with a few new methods that will help form development. */ export class CdFormGroup extends FormGroup { constructor( public controls: { [ke...
2,027
25.684211
93
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-form.spec.ts
import { CdForm, LoadingStatus } from './cd-form'; describe('CdForm', () => { let form: CdForm; beforeEach(() => { form = new CdForm(); }); describe('loading', () => { it('should start in loading state', () => { expect(form.loading).toBe(LoadingStatus.Loading); }); it('should change to...
863
25.181818
69
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-form.ts
export enum LoadingStatus { Loading, Ready, Error, None } export class CdForm { loading = LoadingStatus.Loading; loadingStart() { this.loading = LoadingStatus.Loading; } loadingReady() { this.loading = LoadingStatus.Ready; } loadingError() { this.loading = LoadingStatus.Error; } ...
382
13.185185
41
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.spec.ts
import { fakeAsync, tick } from '@angular/core/testing'; import { FormControl, Validators } from '@angular/forms'; import _ from 'lodash'; import { of as observableOf } from 'rxjs'; import { RgwBucketService } from '~/app/shared/api/rgw-bucket.service'; import { CdFormGroup } from '~/app/shared/forms/cd-form-group'; ...
27,741
29.586549
143
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.ts
import { AbstractControl, AsyncValidatorFn, ValidationErrors, ValidatorFn, Validators } from '@angular/forms'; import _ from 'lodash'; import { Observable, of as observableOf, timer as observableTimer } from 'rxjs'; import { map, switchMapTo, take } from 'rxjs/operators'; import { RgwBucketService } from '~...
22,558
35.800979
121
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/crud-form.component.html
<div class="cd-col-form"> <div class="card pb-0" *ngIf="formUISchema$ | async as formUISchema"> <div i18n="form title" class="card-header">{{ formUISchema.title }}</div> <form *ngIf="formUISchema.uiSchema" [formGroup]="form" (ngSubmit)="submit(model, formUISchema.taskInfo)"...
1,007
37.769231
88
html
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/crud-form.component.spec.ts
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ToastrModule, ToastrService } from 'ngx-toastr'; import { configureTestBed } from '~/testing/unit-test-helper'; import { CdDatePipe } from '~/app/shared/pipes/cd-date.pipe...
1,323
29.790698
84
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/crud-form.component.ts
import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { DataGatewayService } from '~/app/shared/services/data-gateway.service'; import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; import { FinishedTask } from '~/app/shared/models...
3,480
32.152381
85
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/crud-form.model.ts
import { FormlyFieldConfig } from '@ngx-formly/core'; export interface CrudTaskInfo { metadataFields: string[]; message: string; } export interface JsonFormUISchema { title: string; controlSchema: FormlyFieldConfig[]; uiSchema: any; taskInfo: CrudTaskInfo; methodType: string; model: any; }
309
18.375
53
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/helpers.ts
import { ValidatorFn } from '@angular/forms'; import { FormlyFieldConfig } from '@ngx-formly/core'; import { forEach } from 'lodash'; import { formlyAsyncFileValidator } from './validators/file-validator'; import { formlyAsyncJsonValidator } from './validators/json-validator'; import { formlyRgwRoleNameValidator, forml...
1,339
31.682927
96
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-array-type/formly-array-type.component.html
<div class="mb-3"> <legend *ngIf="props.label" class="cd-header mt-1" i18n>{{ props.label }}</legend> <p *ngIf="props.description" i18n>{{ props.description }}</p> <div *ngFor="let field of field.fieldGroup; let i = index" class="d-flex"> <formly-field class="col" ...
1,251
28.116279
75
html
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-array-type/formly-array-type.component.spec.ts
import { Component } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormGroup } from '@angular/forms'; import { FormlyFieldConfig, FormlyModule } from '@ngx-formly/core'; import { FormlyArrayTypeComponent } from './formly-array-type.component'; @Component({ templat...
1,276
26.170213
91
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-array-type/formly-array-type.component.ts
/** Copyright 2021 Formly. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at https://github.com/ngx-formly/ngx-formly/blob/main/LICENSE */ import { Component, OnInit } from '@angular/core'; import { FieldArrayType } from '@ngx-formly/core...
1,031
28.485714
101
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-file-type/formly-file-type-accessor.ts
import { Directive } from '@angular/core'; import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms'; @Directive({ // eslint-disable-next-line selector: 'input[type=file]', // eslint-disable-next-line host: { '(change)': 'onChange($event.target.files)', '(input)': 'onChange($event.target....
826
26.566667
94
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-file-type/formly-file-type.component.html
<input type="file" [formControl]="formControl" [formlyAttributes]="field" />
98
18.8
34
html
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-file-type/formly-file-type.component.spec.ts
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormControl } from '@angular/forms'; import { FormlyModule } from '@ngx-formly/core'; import { FormlyFileTypeComponent } from './formly-file-type.component'; describe('FormlyFileTypeComponent', () => { let component: FormlyFileTypeComponent...
1,043
24.463415
71
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-file-type/formly-file-type.component.ts
import { Component } from '@angular/core'; import { FieldType } from '@ngx-formly/core'; @Component({ selector: 'cd-formly-file-type', templateUrl: './formly-file-type.component.html', styleUrls: ['./formly-file-type.component.scss'] }) export class FormlyFileTypeComponent extends FieldType {}
302
29.3
57
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-type/formly-input-type.component.html
<input [formControl]="formControl" [formlyAttributes]="field" class="form-control col-form-input"/>
114
27.75
44
html
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-type/formly-input-type.component.spec.ts
import { Component } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormGroup } from '@angular/forms'; import { FormlyFieldConfig, FormlyModule } from '@ngx-formly/core'; import { FormlyInputTypeComponent } from './formly-input-type.component'; @Component({ templat...
1,277
25.625
91
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-type/formly-input-type.component.ts
import { Component } from '@angular/core'; import { FieldType, FieldTypeConfig } from '@ngx-formly/core'; @Component({ selector: 'cd-formly-input-type', templateUrl: './formly-input-type.component.html', styleUrls: ['./formly-input-type.component.scss'] }) export class FormlyInputTypeComponent extends FieldType<...
340
33.1
75
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-wrapper/formly-input-wrapper.component.html
<ng-template #labelTemplate> <div class="d-flex align-items-center"> <label *ngIf="props.label && props.hideLabel !== true" [attr.for]="id" class="form-label"> {{ props.label }} <span *ngIf="props.required && props.hideRequiredMarker !== true" aria-hidden="true">*</sp...
1,209
30.842105
75
html
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-wrapper/formly-input-wrapper.component.spec.ts
import { Component } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormGroup } from '@angular/forms'; import { FormlyFieldConfig, FormlyModule } from '@ngx-formly/core'; import { FormlyInputWrapperComponent } from './formly-input-wrapper.component'; @Component({ t...
1,292
25.9375
91
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-wrapper/formly-input-wrapper.component.ts
import { Component } from '@angular/core'; import { FieldWrapper } from '@ngx-formly/core'; import { getFieldState } from '../helpers'; @Component({ selector: 'cd-formly-input-wrapper', templateUrl: './formly-input-wrapper.component.html', styleUrls: ['./formly-input-wrapper.component.scss'] }) export class Form...
483
29.25
63
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-object-type/formly-object-type.component.html
<div class="mb-3"> <legend *ngIf="props.label" class="cd-col-form-label" i18n>{{ props.label }}</legend> <p *ngIf="props.description" i18n>{{ props.description }}</p> <div class="alert alert-danger" role="alert" *ngIf="showError && formControl.errors"> <formly-validation...
567
30.555556
75
html
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-object-type/formly-object-type.component.spec.ts
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormlyObjectTypeComponent } from './formly-object-type.component'; import { FormlyFieldConfig, FormlyModule } from '@ngx-formly/core'; import { Component } from '@angular/core'; import { FormGroup } from '@angular/forms'; @Component({ templ...
1,296
26.020833
91
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-object-type/formly-object-type.component.ts
/** Copyright 2021 Formly. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at https://github.com/ngx-formly/ngx-formly/blob/main/LICENSE */ import { Component } from '@angular/core'; import { FieldType } from '@ngx-formly/core'; @Componen...
852
36.086957
101
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-textarea-type/formly-textarea-type.component.html
<textarea #textArea [formControl]="formControl" [cols]="props.cols" [rows]="props.rows" class="form-control" [class.is-invalid]="showError" [formlyAttributes]="field" (change)="onChange()"> </textarea>
272
26.3
40
html
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-textarea-type/formly-textarea-type.component.spec.ts
import { Component } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormGroup } from '@angular/forms'; import { FormlyFieldConfig, FormlyModule } from '@ngx-formly/core'; import { FormlyTextareaTypeComponent } from './formly-textarea-type.component'; @Component({ t...
1,307
26.25
91
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-textarea-type/formly-textarea-type.component.ts
import { Component, ViewChild, ElementRef } from '@angular/core'; import { FieldType, FieldTypeConfig } from '@ngx-formly/core'; @Component({ selector: 'cd-formly-textarea-type', templateUrl: './formly-textarea-type.component.html', styleUrls: ['./formly-textarea-type.component.scss'] }) export class FormlyTexta...
915
34.230769
77
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/validators/file-validator.ts
import { AbstractControl } from '@angular/forms'; export function formlyAsyncFileValidator(control: AbstractControl): Promise<any> { return new Promise((resolve, _reject) => { if (control.value instanceof FileList) { control.value; let file = control.value[0]; if (file.size > 4096) { re...
426
25.6875
82
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/validators/json-validator.ts
import { AbstractControl } from '@angular/forms'; export function formlyAsyncJsonValidator(control: AbstractControl): Promise<any> { return new Promise((resolve, _reject) => { try { JSON.parse(control.value); resolve(null); } catch (e) { resolve({ json: true }); } }); }
306
22.615385
82
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/validators/rgw-role-validator.ts
import { AbstractControl } from '@angular/forms'; export function formlyRgwRolePath(control: AbstractControl): Promise<any> { return new Promise((resolve, _reject) => { if (control.value.match('^((\u002F)|(\u002F[\u0021-\u007E]+\u002F))$')) { resolve(null); } resolve({ rgwRolePath: true }); }); }...
579
28
84
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/helpers/helpers.module.ts
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; @NgModule({ declarations: [], imports: [CommonModule] }) export class HelpersModule {}
182
19.333333
47
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/helpers/prometheus-list-helper.ts
import { Directive, OnInit } from '@angular/core'; import { PrometheusService } from '~/app/shared/api/prometheus.service'; import { ListWithDetails } from '~/app/shared/classes/list-with-details.class'; @Directive() // tslint:disable-next-line: directive-class-suffix export class PrometheusListHelper extends ListWit...
757
29.32
79
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/alertmanager-silence.ts
import { PrometheusRule } from './prometheus-alerts'; export class AlertmanagerSilenceMatcher { name: string; value: any; isRegex: boolean; } export class AlertmanagerSilenceMatcherMatch { status: string; cssClass: string; } export class AlertmanagerSilence { id?: string; matchers: AlertmanagerSilenceM...
565
19.962963
53
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/breadcrumbs.ts
/* The MIT License Copyright (c) 2017 (null) McNull https://github.com/McNull Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, ...
2,179
35.333333
78
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-details.ts
export interface DashboardDetails { fsid?: string; orchestrator?: string; cephVersion?: string; }
104
16.5
35
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-form-modal-field-config.ts
import { ValidatorFn } from '@angular/forms'; export class CdFormModalFieldConfig { // --- Generic field properties --- name: string; // 'binary' will use cdDimlessBinary directive on input element // 'select' will use select element type: 'number' | 'text' | 'binary' | 'select' | 'select-badges'; label?: ...
825
24.030303
66
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-notification.spec.ts
import { NotificationType } from '../enum/notification-type.enum'; import { CdNotification, CdNotificationConfig } from './cd-notification'; describe('cd-notification classes', () => { const expectObject = (something: object, expected: object) => { Object.keys(expected).forEach((key) => expect(something[key]).to...
2,771
27.875
92
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-notification.ts
import { IndividualConfig } from 'ngx-toastr'; import { Icons } from '../enum/icons.enum'; import { NotificationType } from '../enum/notification-type.enum'; export class CdNotificationConfig { applicationClass: string; isFinishedTask = false; private classes = { Ceph: 'ceph-icon', Prometheus: 'prometh...
1,675
31.862745
89
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-pwd-expiration-settings.ts
export class CdPwdExpirationSettings { pwdExpirationSpan = 0; pwdExpirationWarning1: number; pwdExpirationWarning2: number; constructor(settings: { [key: string]: any }) { this.pwdExpirationSpan = settings.user_pwd_expiration_span; this.pwdExpirationWarning1 = settings.user_pwd_expiration_warning_1; ...
397
32.166667
72
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-pwd-policy-settings.ts
export class CdPwdPolicySettings { pwdPolicyEnabled: boolean; pwdPolicyMinLength: number; pwdPolicyCheckLengthEnabled: boolean; pwdPolicyCheckOldpwdEnabled: boolean; pwdPolicyCheckUsernameEnabled: boolean; pwdPolicyCheckExclusionListEnabled: boolean; pwdPolicyCheckRepetitiveCharsEnabled: boolean; pwdPol...
1,213
49.583333
99
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-action.ts
import { CdTableSelection } from './cd-table-selection'; export class CdTableAction { // It's possible to assign a string // or a function that returns the link if it has to be dynamic // or none if it's not needed routerLink?: string | Function; preserveFragment? = false; // This is the function that wi...
1,596
34.488889
90
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-column-filter.ts
import { CdTableColumn } from './cd-table-column'; export interface CdTableColumnFilter { column: CdTableColumn; options: { raw: string; formatted: string }[]; // possible options of a filter value?: { raw: string; formatted: string }; // selected option }
264
32.125
80
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-column-filters-change.ts
import { TableColumnProp } from '@swimlane/ngx-datatable'; export interface CdTableColumnFiltersChange { /** * Applied filters. */ filters: { name: string; prop: TableColumnProp; value: { raw: string; formatted: string }; }[]; /** * Filtered data. */ data: any[]; /** * Filtered...
357
14.565217
58
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-column.ts
import { TableColumn, TableColumnProp } from '@swimlane/ngx-datatable'; import { CellTemplate } from '../enum/cell-template.enum'; export interface CdTableColumn extends TableColumn { cellTransformation?: CellTemplate; isHidden?: boolean; prop: TableColumnProp; // Enforces properties to get sortable columns c...
1,200
29.794872
85
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-fetch-data-context.ts
import { HttpParams } from '@angular/common/http'; import { PageInfo } from './cd-table-paging'; export class CdTableFetchDataContext { errorConfig = { resetData: true, // Force data table to show no data displayError: true // Show an error panel above the data table }; /** * The function that shoul...
1,199
22.076923
69
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-paging.ts
export const PAGE_LIMIT = 10; export class PageInfo { // Total number of rows in a table count: number; // Current page (current row = offset x limit or pageSize) offset = 0; // Max. number of rows fetched from the server limit: number = PAGE_LIMIT; /* pageSize and limit can be decoupled if hybrid s...
601
27.666667
75
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-selection.ts
export class CdTableSelection { private _selected: any[] = []; hasMultiSelection: boolean; hasSingleSelection: boolean; hasSelection: boolean; constructor(rows?: any[]) { if (rows) { this._selected = rows; } this.update(); } /** * Recalculate the variables based on the current numbe...
903
18.652174
58
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-user-config.ts
import { SortPropDir } from '@swimlane/ngx-datatable'; import { CdTableColumn } from './cd-table-column'; export interface CdUserConfig { limit?: number; offset?: number; search?: string; sorts?: SortPropDir[]; columns?: CdTableColumn[]; }
252
20.083333
54
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cephfs-directory-models.ts
import { TreeStatus } from '@swimlane/ngx-datatable'; export class CephfsSnapshot { name: string; path: string; created: string; } export class CephfsQuotas { max_bytes?: number; max_files?: number; } export class CephfsDir { name: string; path: string; quotas: CephfsQuotas; snapshots: CephfsSnapsh...
403
17.363636
56
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/chart-tooltip.ts
import { ElementRef } from '@angular/core'; export class ChartTooltip { tooltipEl: any; chartEl: any; getStyleLeft: Function; getStyleTop: Function; customColors: Record<string, any> = { backgroundColor: undefined, borderColor: undefined }; checkOffset = false; /** * Creates an instance of ...
3,623
30.241379
98
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/configuration.ts
export enum RbdConfigurationSourceField { global = 0, pool = 1, image = 2 } export enum RbdConfigurationType { bps, iops, milliseconds } /** * This configuration can also be set on a pool level. */ export interface RbdConfigurationEntry { name: string; source: RbdConfigurationSourceField; value: a...
1,008
21.931818
99
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/credentials.ts
export class Credentials { username: string; password: string; }
69
13
26
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/crud-table-metadata.ts
import { CdTableColumn } from '~/app/shared/models/cd-table-column'; import { CdTableAction } from './cd-table-action'; class Table { columns: CdTableColumn[]; columnMode: string; toolHeader: boolean; selectionType: string; } export class CrudMetadata { table: Table; permissions: string[]; actions: CdTa...
370
19.611111
68
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/crush-node.ts
export class CrushNode { id: number; name: string; type: string; type_id: number; // For nodes with leafs (Buckets) children?: number[]; // Holds node id's of children // For non root nodes pool_weights?: object; // For leafs (Devices) device_class?: string; crush_weight?: number; exists?: numbe...
394
20.944444
53
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/crush-rule.ts
import { CrushStep } from './crush-step'; export class CrushRule { usable_size?: number; rule_id: number; type: number; rule_name: string; steps: CrushStep[]; } export class CrushRuleConfig { root: string; // The name of the node under which data should be placed. name: string; failure_domain: string;...
463
26.294118
94
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/crush-step.ts
export class CrushStep { op: string; item_name?: string; item?: number; type?: string; num?: number; }
113
13.25
24
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/daemon.interface.ts
export interface Daemon { nodename: string; container_id: string; container_image_id: string; container_image_name: string; daemon_id: string; daemon_type: string; version: string; status: number; status_desc: string; last_refresh: Date; }
260
19.076923
31
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/devices.ts
/** * Fields returned by the back-end. */ export interface CephDevice { devid: string; location: { host: string; dev: string }[]; daemons: string[]; life_expectancy_min?: string; life_expectancy_max?: string; life_expectancy_stamp?: string; life_expectancy_enabled?: boolean; } /** * Fields added by th...
694
25.730769
98
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/erasure-code-profile.ts
export class ErasureCodeProfile { name: string; plugin: string; k?: number; m?: number; c?: number; l?: number; d?: number; packetsize?: number; technique?: string; scalar_mds?: 'jerasure' | 'isa' | 'shec'; 'crush-root'?: string; 'crush-locality'?: string; 'crush-failure-domain'?: string; 'c...
375
19.888889
43
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/executing-task.ts
import { Task } from './task'; export class ExecutingTask extends Task { begin_time: number; progress: number; }
118
16
41
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/finished-task.ts
import { Task } from './task'; import { TaskException } from './task-exception'; export class FinishedTask extends Task { begin_time: string; end_time: string; exception: TaskException; latency: number; progress: number; ret_value: any; success: boolean; duration: number; errorMessage: string; }
317
18.875
49
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/flag.ts
export class Flag { code: 'noout' | 'noin' | 'nodown' | 'noup'; name: string; description: string; value: boolean; clusterWide: boolean; indeterminate: boolean; }
175
18.555556
45
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/image-spec.ts
export class ImageSpec { static fromString(imageSpec: string) { const imageSpecSplited = imageSpec.split('/'); const poolName = imageSpecSplited[0]; const namespace = imageSpecSplited.length >= 3 ? imageSpecSplited[1] : null; const imageName = imageSpecSplited.length >= 3 ? imageSpecSplited[2] : imag...
788
29.346154
95
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/inventory-device-type.model.ts
import { InventoryDevice } from '~/app/ceph/cluster/inventory/inventory-devices/inventory-device.model'; export interface InventoryDeviceType { type: string; capacity: number; devices: InventoryDevice[]; canSelect: boolean; totalDevices: number; }
259
25
104
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/login-response.ts
export class LoginResponse { username: string; permissions: object; pwdExpirationDate: number; sso: boolean; pwdUpdateRequired: boolean; }
149
17.75
29
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/mirroring-summary.ts
export interface MirroringSummary { content_data?: any; site_name?: any; status?: any; }
95
15
35
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/orchestrator.enum.ts
export enum OrchestratorFeature { HOST_LIST = 'get_hosts', HOST_ADD = 'add_host', HOST_REMOVE = 'remove_host', HOST_LABEL_ADD = 'add_host_label', HOST_LABEL_REMOVE = 'remove_host_label', HOST_MAINTENANCE_ENTER = 'enter_host_maintenance', HOST_MAINTENANCE_EXIT = 'exit_host_maintenance', HOST_FACTS = 'get...
751
27.923077
52
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/orchestrator.interface.ts
export interface OrchestratorStatus { available: boolean; message: string; features: { [feature: string]: { available: boolean; }; }; }
158
14.9
37
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/osd-deployment-options.ts
export enum OsdDeploymentOptions { COST_CAPACITY = 'cost_capacity', THROUGHPUT = 'throughput_optimized', IOPS = 'iops_optimized' } export interface DeploymentOption { name: OsdDeploymentOptions; title: string; desc: string; capacity: number; available: boolean; hdd_used: number; used: number; nvm...
513
19.56
52
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/osd-settings.ts
export class OsdSettings { nearfull_ratio: number; full_ratio: number; }
77
14.6
26
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/permission.spec.ts
import { Permissions } from './permissions'; describe('cd-notification classes', () => { it('should show empty permissions', () => { expect(new Permissions({})).toEqual({ cephfs: { create: false, delete: false, read: false, update: false }, configOpt: { create: false, delete: false, read: false, upda...
3,533
55.095238
81
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/permissions.ts
export class Permission { read: boolean; create: boolean; update: boolean; delete: boolean; constructor(serverPermission: Array<string> = []) { ['read', 'create', 'update', 'delete'].forEach( (permission) => (this[permission] = serverPermission.includes(permission)) ); } } export class Permi...
1,747
33.27451
80
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/pool-form-info.ts
import { CrushNode } from './crush-node'; import { CrushRule } from './crush-rule'; import { ErasureCodeProfile } from './erasure-code-profile'; export class PoolFormInfo { pool_names: string[]; osd_count: number; is_all_bluestore: boolean; bluestore_compression_algorithm: string; compression_algorithms: str...
677
31.285714
60
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/prometheus-alerts.ts
export class PrometheusAlertLabels { alertname: string; instance: string; job: string; severity: string; } class Annotations { description: string; summary: string; } class CommonAlertmanagerAlert { labels: PrometheusAlertLabels; annotations: Annotations; startsAt: string; // Date string endsAt: s...
1,894
21.034884
76
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/service.interface.ts
export interface CephServiceStatus { container_image_id: string; container_image_name: string; size: number; running: number; last_refresh: Date; created: Date; } // This will become handy when creating arbitrary services export interface CephServiceSpec { service_name: string; service_type: string; ...
1,138
21.333333
58
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/smart.ts
export interface SmartAttribute { flags: { auto_keep: boolean; error_rate: boolean; event_count: boolean; performance: boolean; prefailure: boolean; string: string; updated_online: boolean; value: number; }; id: number; name: string; raw: { string: string; value: number }; th...
6,914
26.224409
82
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/summary.model.ts
import { ExecutingTask } from './executing-task'; import { FinishedTask } from './finished-task'; export class Summary { executing_tasks?: ExecutingTask[]; filesystems?: any[]; finished_tasks?: FinishedTask[]; have_mon_connection?: boolean; health_status?: string; mgr_host?: string; mgr_id?: string; rb...
382
22.9375
49
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/task-exception.ts
import { Task } from './task'; export class TaskException { status: number; code: number; component: string; detail: string; task: Task; }
150
14.1
30
ts
null
ceph-main/src/pybind/mgr/dashboard/frontend/src/app/shared/models/task.ts
export class Task { constructor(name?: string, metadata?: object) { this.name = name; this.metadata = metadata; } name: string; metadata: object; description: string; }
188
16.181818
49
ts