Files
f7_talk/lib/SetupCheck/BackgroundBlurLoading.php
glb_adm 01acfa3b40
Type checking / changes (push) Has been cancelled
Type checking / test (push) Has been cancelled
Type checking / typescript-summary (push) Has been cancelled
Node tests / changes (push) Has been cancelled
Node tests / test (push) Has been cancelled
Node tests / test-summary (push) Has been cancelled
UPSTREAM BASELINE: nextcloud/spreed v22.0.12 (без изменений)
Источник: https://github.com/nextcloud/spreed/archive/refs/tags/v22.0.12.tar.gz
С этого коммита ветка официального Nextcloud Talk отрезана (решение владельца 2026-07-06).
Все дальнейшие изменения — только наши; версии релизов: 22.0.12-f7.N.
2026-07-06 14:07:50 +00:00

70 lines
1.9 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Talk\SetupCheck;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\SetupCheck\CheckServerResponseTrait;
use OCP\SetupCheck\ISetupCheck;
use OCP\SetupCheck\SetupResult;
use Psr\Log\LoggerInterface;
/**
* Check whether the WASM URLs works
*/
class BackgroundBlurLoading implements ISetupCheck {
use CheckServerResponseTrait;
public function __construct(
protected IL10N $l10n,
protected IConfig $config,
protected IURLGenerator $urlGenerator,
protected IClientService $clientService,
protected LoggerInterface $logger,
) {
}
#[\Override]
public function getCategory(): string {
return 'talk';
}
#[\Override]
public function getName(): string {
return $this->l10n->t('Background blur');
}
#[\Override]
public function run(): SetupResult {
$url = $this->urlGenerator->linkTo('spreed', 'js/vision_wasm_internal.wasm');
$noResponse = true;
$responses = $this->runRequest('HEAD', $url);
foreach ($responses as $response) {
$noResponse = false;
if ($response->getStatusCode() === 200) {
return SetupResult::success();
}
}
if ($noResponse) {
return SetupResult::info(
$this->l10n->t('Could not check for WASM loading support. Please check manually if your web server serves `.wasm` files.') . "\n" . $this->serverConfigHelp(),
$this->urlGenerator->linkToDocs('admin-nginx'),
);
}
return SetupResult::warning(
$this->l10n->t('Your web server is not properly set up to deliver `.wasm` files. This is typically an issue with the Nginx configuration. For background blur it needs an adjustment to also deliver `.wasm` files. Compare your Nginx configuration to the recommended configuration in our documentation.'),
$this->urlGenerator->linkToDocs('admin-nginx'),
);
}
}