mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 01:39:37 +02:00
Merge branch 'release/7.3.x' into develop
This commit is contained in:
commit
050461528c
6 changed files with 55 additions and 33 deletions
|
@ -13,23 +13,27 @@
|
||||||
<form novalidate [formGroup]="form" (ngSubmit)="processRegistration()">
|
<form novalidate [formGroup]="form" (ngSubmit)="processRegistration()">
|
||||||
<div class="modal-body mb-3">
|
<div class="modal-body mb-3">
|
||||||
|
|
||||||
<my-alert i18n *ngIf="!registration.emailVerified" type="warning">
|
|
||||||
Registration email has not been verified. Email delivery has been disabled by default.
|
|
||||||
</my-alert>
|
|
||||||
|
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<ng-container *ngIf="isAccept()">
|
<ng-container *ngIf="isAccept()">
|
||||||
<p i18n>
|
<p i18n>
|
||||||
<strong>Accepting</strong> <em>{{ registration.username }}</em> registration will create the account and channel.
|
<strong>Accepting</strong> <em>{{ registration.username }}</em> registration will create the account and channel.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p *ngIf="isEmailEnabled()" i18n [ngClass]="{ 'text-decoration-line-through': isPreventEmailDeliveryChecked() }">
|
@if (isEmailEnabled()) {
|
||||||
An email will be sent to <em>{{ registration.email }}</em> explaining its account has been created with the moderation response you'll write below.
|
@if (!registration.emailVerified) {
|
||||||
</p>
|
<my-alert i18n type="warning">
|
||||||
|
Registration email has not been verified. Email delivery has been disabled by default.
|
||||||
<my-alert *ngIf="!isEmailEnabled()" type="warning" i18n>
|
</my-alert>
|
||||||
Emails are not enabled on this instance so PeerTube won't be able to send an email to <em>{{ registration.email }}</em> explaining its account has been created.
|
} @else {
|
||||||
</my-alert>
|
<p i18n [ngClass]="{ 'text-decoration-line-through': isPreventEmailDeliveryChecked() }">
|
||||||
|
An email will be sent to <em>{{ registration.email }}</em> explaining its account has been created with the moderation response you'll write below.
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
} @else {
|
||||||
|
<my-alert type="warning" i18n>
|
||||||
|
Emails are not enabled on this instance so PeerTube won't be able to send an email to <em>{{ registration.email }}</em> explaining its account has been created.
|
||||||
|
</my-alert>
|
||||||
|
}
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngIf="isReject()">
|
<ng-container *ngIf="isReject()">
|
||||||
|
@ -58,7 +62,7 @@
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<my-peertube-checkbox
|
<my-peertube-checkbox
|
||||||
inputName="preventEmailDelivery" formControlName="preventEmailDelivery" [disabled]="!isEmailEnabled()"
|
inputName="preventEmailDelivery" formControlName="preventEmailDelivery"
|
||||||
i18n-labelText labelText="Prevent email from being sent to the user"
|
i18n-labelText labelText="Prevent email from being sent to the user"
|
||||||
></my-peertube-checkbox>
|
></my-peertube-checkbox>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { NgClass, NgIf } from '@angular/common'
|
import { CommonModule, NgClass } from '@angular/common'
|
||||||
import { Component, OnInit, inject, output, viewChild } from '@angular/core'
|
import { Component, OnInit, inject, output, viewChild } from '@angular/core'
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
|
||||||
import { Notifier, ServerService } from '@app/core'
|
import { Notifier, ServerService } from '@app/core'
|
||||||
|
@ -16,7 +16,7 @@ import { REGISTRATION_MODERATION_RESPONSE_VALIDATOR } from './process-registrati
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-process-registration-modal',
|
selector: 'my-process-registration-modal',
|
||||||
templateUrl: './process-registration-modal.component.html',
|
templateUrl: './process-registration-modal.component.html',
|
||||||
imports: [ NgIf, GlobalIconComponent, FormsModule, ReactiveFormsModule, NgClass, PeertubeCheckboxComponent, AlertComponent ]
|
imports: [ CommonModule, GlobalIconComponent, FormsModule, ReactiveFormsModule, PeertubeCheckboxComponent, AlertComponent ]
|
||||||
})
|
})
|
||||||
export class ProcessRegistrationModalComponent extends FormReactive implements OnInit {
|
export class ProcessRegistrationModalComponent extends FormReactive implements OnInit {
|
||||||
protected formReactiveService = inject(FormReactiveService)
|
protected formReactiveService = inject(FormReactiveService)
|
||||||
|
@ -53,6 +53,12 @@ export class ProcessRegistrationModalComponent extends FormReactive implements O
|
||||||
this.processMode = mode
|
this.processMode = mode
|
||||||
this.registration = registration
|
this.registration = registration
|
||||||
|
|
||||||
|
if (this.registration.emailVerified !== true || !this.isEmailEnabled()) {
|
||||||
|
this.form.get('preventEmailDelivery').disable()
|
||||||
|
} else {
|
||||||
|
this.form.get('preventEmailDelivery').enable()
|
||||||
|
}
|
||||||
|
|
||||||
this.form.patchValue({
|
this.form.patchValue({
|
||||||
preventEmailDelivery: !this.isEmailEnabled() || registration.emailVerified !== true
|
preventEmailDelivery: !this.isEmailEnabled() || registration.emailVerified !== true
|
||||||
})
|
})
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td *ngIf="table.isColumnDisplayed('privacy')">
|
<td *ngIf="table.isColumnDisplayed('privacy')">
|
||||||
<div class="d-flex flex-wrap gap-1">
|
<div class="pt-badges-container">
|
||||||
<my-privacy-badge [video]="video"></my-privacy-badge>
|
<my-privacy-badge [video]="video"></my-privacy-badge>
|
||||||
|
|
||||||
<span *ngIf="video.blacklisted" class="pt-badge badge-red" i18n [ngbTooltip]="video.blacklistedReason">Blocked</span>
|
<span *ngIf="video.blacklisted" class="pt-badge badge-red" i18n [ngbTooltip]="video.blacklistedReason">Blocked</span>
|
||||||
|
|
|
@ -45,6 +45,8 @@ export type TableQueryParams = {
|
||||||
sortOrder?: number
|
sortOrder?: number
|
||||||
sortField?: string
|
sortField?: string
|
||||||
search?: string
|
search?: string
|
||||||
|
|
||||||
|
state?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TableColumnInfo<ColumnName> = {
|
export type TableColumnInfo<ColumnName> = {
|
||||||
|
@ -250,7 +252,7 @@ export class TableComponent<Data, ColumnName = string, QueryParams extends Table
|
||||||
if (sort) this.sort = sort
|
if (sort) this.sort = sort
|
||||||
|
|
||||||
this.resetPagination()
|
this.resetPagination()
|
||||||
this.updateUrl()
|
this.updateUrl({ reset: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
private resetPagination () {
|
private resetPagination () {
|
||||||
|
@ -379,7 +381,11 @@ export class TableComponent<Data, ColumnName = string, QueryParams extends Table
|
||||||
this.loadData()
|
this.loadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateUrl () {
|
private updateUrl (options: {
|
||||||
|
reset?: boolean
|
||||||
|
} = {}) {
|
||||||
|
const { reset = false } = options
|
||||||
|
|
||||||
const newParams: TableQueryParams = {
|
const newParams: TableQueryParams = {
|
||||||
...this.route.snapshot.queryParams,
|
...this.route.snapshot.queryParams,
|
||||||
...this.customUpdateUrl()(),
|
...this.customUpdateUrl()(),
|
||||||
|
@ -391,6 +397,12 @@ export class TableComponent<Data, ColumnName = string, QueryParams extends Table
|
||||||
sortField: this.sort.field
|
sortField: this.sort.field
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (reset) {
|
||||||
|
const baseState = this.route.snapshot.queryParams.state || 0
|
||||||
|
|
||||||
|
newParams.state = +baseState + 1
|
||||||
|
}
|
||||||
|
|
||||||
debugLogger('Update URL', { newParams })
|
debugLogger('Update URL', { newParams })
|
||||||
|
|
||||||
this.peertubeRouter.silentNavigate([ '.' ], newParams, this.route)
|
this.peertubeRouter.silentNavigate([ '.' ], newParams, this.route)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
@use '_icons' as *;
|
@use "_icons" as *;
|
||||||
@use '_variables' as *;
|
@use "_variables" as *;
|
||||||
@use '_mixins' as *;
|
@use "_mixins" as *;
|
||||||
@use '_button-mixins' as *;
|
@use "_button-mixins" as *;
|
||||||
|
|
||||||
// Badge color variables
|
// Badge color variables
|
||||||
$badge-red-light: #ffcdd2;
|
$badge-red-light: #ffcdd2;
|
||||||
|
@ -109,7 +109,7 @@ $badge-grey-dark: #2D3448;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-bs-theme=dark] {
|
[data-bs-theme="dark"] {
|
||||||
.pt-badge {
|
.pt-badge {
|
||||||
&.badge-banned,
|
&.badge-banned,
|
||||||
&.badge-danger,
|
&.badge-danger,
|
||||||
|
@ -152,3 +152,10 @@ $badge-grey-dark: #2D3448;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pt-badges-container {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: flex-end;
|
||||||
|
gap: 0.25rem;
|
||||||
|
}
|
||||||
|
|
|
@ -171,14 +171,9 @@ export class NodeJSObserversBuilder {
|
||||||
private buildActiveResourcesObserver () {
|
private buildActiveResourcesObserver () {
|
||||||
if (typeof (process as any).getActiveResourcesInfo !== 'function') return
|
if (typeof (process as any).getActiveResourcesInfo !== 'function') return
|
||||||
|
|
||||||
const grouped = this.meter.createObservableCounter('nodejs_active_resources', {
|
this.meter.createObservableGauge('nodejs_active_resources_total', {
|
||||||
description: 'Number of active resources that are currently keeping the event loop alive, grouped by async resource type.'
|
description: 'Number of active resources that are currently keeping the event loop alive, grouped by async resource type.'
|
||||||
})
|
}).addCallback(observableResult => {
|
||||||
const total = this.meter.createObservableCounter('nodejs_active_resources_total', {
|
|
||||||
description: 'Total number of active resources.'
|
|
||||||
})
|
|
||||||
|
|
||||||
this.meter.addBatchObservableCallback(observableResult => {
|
|
||||||
const resources = (process as any).getActiveResourcesInfo()
|
const resources = (process as any).getActiveResourcesInfo()
|
||||||
|
|
||||||
const data = {}
|
const data = {}
|
||||||
|
@ -192,10 +187,8 @@ export class NodeJSObserversBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const type of Object.keys(data)) {
|
for (const type of Object.keys(data)) {
|
||||||
observableResult.observe(grouped, data[type], { type })
|
observableResult.observe(data[type], { type })
|
||||||
}
|
}
|
||||||
|
})
|
||||||
observableResult.observe(total, resources.length)
|
|
||||||
}, [ grouped, total ])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue