more managing and validation

This commit is contained in:
Robert Nasarek 2023-09-04 00:18:13 +02:00
parent 7605c9f2f4
commit bb4d5b65d5
9 changed files with 334 additions and 136 deletions

View file

@ -47,7 +47,8 @@ class WisskiCloudAccountManagerController extends ControllerBase {
*/
public function termsAndConditionsPage(): array {
$build = [
'#markup' => $this->t('Hello World!'),
'#theme' => 'terms_and_conditions_page',
'#date' => date('Y'),
];
return $build;
}
@ -64,17 +65,41 @@ class WisskiCloudAccountManagerController extends ControllerBase {
public function validationPage(string $validationCode): array {
$validationResponse = $this->wisskiCloudAccountManagerDaemonApiActions->validateAccount($validationCode);
$responseContents = json_decode($validationResponse->getBody()
$account = json_decode($validationResponse->getBody()
->getContents(), TRUE);
return [
'#theme' => 'wisski_cloud_account_manager_validation_page',
'#responseContents' => $responseContents,
'#account' => $account,
'#attached' => [
'library' => [
'wisski_cloud_account_manager/wisski_cloud_account_manager',
],
],
'#cache' => [
'max-age' => 0,
],
];
}
/**
* Page list the account statuses.
*
* @return array
* The page build array.
*/
public function accountManagingPage(): array {
$accounts = $this->wisskiCloudAccountManagerDaemonApiActions->getAccounts();
return [
'#theme' => 'wisski_cloud_account_manager_account_managing_page',
'#accounts' => $accounts,
'#attached' => [
'library' => [
'wisski_cloud_account_manager/wisski_cloud_account_manager',
],
],
'#cache' => [
'max-age' => 0,
],
];
}