1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-02 17:29:29 +02:00

Merge branch 'release/7.3.x' into develop

This commit is contained in:
Chocobozzz 2025-09-15 15:06:33 +02:00
commit 050461528c
No known key found for this signature in database
GPG key ID: 583A612D890159BE
6 changed files with 55 additions and 33 deletions

View file

@ -13,23 +13,27 @@
<form novalidate [formGroup]="form" (ngSubmit)="processRegistration()">
<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">
<ng-container *ngIf="isAccept()">
<p i18n>
<strong>Accepting</strong>&nbsp;<em>{{ registration.username }}</em> registration will create the account and channel.
</p>
<p *ngIf="isEmailEnabled()" 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>
<my-alert *ngIf="!isEmailEnabled()" 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>
@if (isEmailEnabled()) {
@if (!registration.emailVerified) {
<my-alert i18n type="warning">
Registration email has not been verified. Email delivery has been disabled by default.
</my-alert>
} @else {
<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 *ngIf="isReject()">
@ -58,7 +62,7 @@
<div class="form-group">
<my-peertube-checkbox
inputName="preventEmailDelivery" formControlName="preventEmailDelivery" [disabled]="!isEmailEnabled()"
inputName="preventEmailDelivery" formControlName="preventEmailDelivery"
i18n-labelText labelText="Prevent email from being sent to the user"
></my-peertube-checkbox>
</div>

View file

@ -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 { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { Notifier, ServerService } from '@app/core'
@ -16,7 +16,7 @@ import { REGISTRATION_MODERATION_RESPONSE_VALIDATOR } from './process-registrati
@Component({
selector: 'my-process-registration-modal',
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 {
protected formReactiveService = inject(FormReactiveService)
@ -53,6 +53,12 @@ export class ProcessRegistrationModalComponent extends FormReactive implements O
this.processMode = mode
this.registration = registration
if (this.registration.emailVerified !== true || !this.isEmailEnabled()) {
this.form.get('preventEmailDelivery').disable()
} else {
this.form.get('preventEmailDelivery').enable()
}
this.form.patchValue({
preventEmailDelivery: !this.isEmailEnabled() || registration.emailVerified !== true
})

View file

@ -63,7 +63,7 @@
</td>
<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>
<span *ngIf="video.blacklisted" class="pt-badge badge-red" i18n [ngbTooltip]="video.blacklistedReason">Blocked</span>

View file

@ -45,6 +45,8 @@ export type TableQueryParams = {
sortOrder?: number
sortField?: string
search?: string
state?: number
}
export type TableColumnInfo<ColumnName> = {
@ -250,7 +252,7 @@ export class TableComponent<Data, ColumnName = string, QueryParams extends Table
if (sort) this.sort = sort
this.resetPagination()
this.updateUrl()
this.updateUrl({ reset: true })
}
private resetPagination () {
@ -379,7 +381,11 @@ export class TableComponent<Data, ColumnName = string, QueryParams extends Table
this.loadData()
}
private updateUrl () {
private updateUrl (options: {
reset?: boolean
} = {}) {
const { reset = false } = options
const newParams: TableQueryParams = {
...this.route.snapshot.queryParams,
...this.customUpdateUrl()(),
@ -391,6 +397,12 @@ export class TableComponent<Data, ColumnName = string, QueryParams extends Table
sortField: this.sort.field
}
if (reset) {
const baseState = this.route.snapshot.queryParams.state || 0
newParams.state = +baseState + 1
}
debugLogger('Update URL', { newParams })
this.peertubeRouter.silentNavigate([ '.' ], newParams, this.route)

View file

@ -1,7 +1,7 @@
@use '_icons' as *;
@use '_variables' as *;
@use '_mixins' as *;
@use '_button-mixins' as *;
@use "_icons" as *;
@use "_variables" as *;
@use "_mixins" as *;
@use "_button-mixins" as *;
// Badge color variables
$badge-red-light: #ffcdd2;
@ -109,7 +109,7 @@ $badge-grey-dark: #2D3448;
}
}
[data-bs-theme=dark] {
[data-bs-theme="dark"] {
.pt-badge {
&.badge-banned,
&.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;
}

View file

@ -171,14 +171,9 @@ export class NodeJSObserversBuilder {
private buildActiveResourcesObserver () {
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.'
})
const total = this.meter.createObservableCounter('nodejs_active_resources_total', {
description: 'Total number of active resources.'
})
this.meter.addBatchObservableCallback(observableResult => {
}).addCallback(observableResult => {
const resources = (process as any).getActiveResourcesInfo()
const data = {}
@ -192,10 +187,8 @@ export class NodeJSObserversBuilder {
}
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 ])
})
}
}