diff --git a/src/Application/Configs/IceHawkConfig.php b/src/Application/Configs/IceHawkConfig.php index ecc4adb..463d61c 100644 --- a/src/Application/Configs/IceHawkConfig.php +++ b/src/Application/Configs/IceHawkConfig.php @@ -58,12 +58,14 @@ private function buildReadRoutes() : void $quotedBaseUri = preg_quote( $baseUrl, '!' ); $this->readRoutes = [ - '^' . $quotedBaseUri . '/?$' => ServerSelectionRequestHandler::class, - '^' . $quotedBaseUri . '/server/(?\d+)/stats/?$' => ServerStatsRequestHandler::class, - '^' . $quotedBaseUri . '/server/(?\d+)(?:/database/(?\d+))?/?$' => ServerDetailsRequestHandler::class, - '^' . $quotedBaseUri . '/server/(?\d+)/database/(?\d+)/keys/?$' => AjaxSearchKeysRequestHandler::class, - '^' . $quotedBaseUri . '/server/(?\d+)/database/(?\d+)/keys/(?.+)/hash/(?.+)/?$' => AjaxKeyDetailsRequestHandler::class, - '^' . $quotedBaseUri . '/server/(?\d+)/database/(?\d+)/keys/(?.+)/?$' => AjaxKeyDetailsRequestHandler::class, + '^' . $quotedBaseUri . '/?$' => ServerSelectionRequestHandler::class, + '^' . $quotedBaseUri . '/server/(?\d+)/stats/?$' => ServerStatsRequestHandler::class, + '^' . $quotedBaseUri . '/server/(?\d+)(?:/database/(?\d+))?/?$' => ServerDetailsRequestHandler::class, + '^' . $quotedBaseUri . '/server/(?\d+)/database/(?\d+)/keys/?$' => AjaxSearchKeysRequestHandler::class, + '^' + . $quotedBaseUri + . '/server/(?\d+)/database/(?\d+)/keys/(?.+)/hash/(?.+)/?$' => AjaxKeyDetailsRequestHandler::class, + '^' . $quotedBaseUri . '/server/(?\d+)/database/(?\d+)/keys/(?.+)/?$' => AjaxKeyDetailsRequestHandler::class, ]; } } diff --git a/src/Application/ReadModel/Queries/FetchKeyInformationQuery.php b/src/Application/ReadModel/Queries/FetchKeyInformationQuery.php index 940ee9c..29bcddb 100644 --- a/src/Application/ReadModel/Queries/FetchKeyInformationQuery.php +++ b/src/Application/ReadModel/Queries/FetchKeyInformationQuery.php @@ -14,14 +14,14 @@ final class FetchKeyInformationQuery private $keyName; /** @var null|string */ - private $hashKey; + private $subKey; - public function __construct( string $serverKey, int $database, string $keyName, ?string $hashKey ) + public function __construct( string $serverKey, int $database, string $keyName, ?string $subKey ) { $this->serverKey = $serverKey; $this->database = $database; $this->keyName = $keyName; - $this->hashKey = $hashKey; + $this->subKey = $subKey; } public function getServerKey() : string @@ -39,8 +39,8 @@ public function getKeyName() : string return $this->keyName; } - public function getHashKey() : ?string + public function getSubKey() : ?string { - return $this->hashKey; + return $this->subKey; } } diff --git a/src/Application/ReadModel/QueryHandlers/FetchKeyInformationQueryHandler.php b/src/Application/ReadModel/QueryHandlers/FetchKeyInformationQueryHandler.php index 7dd3f88..bd72e4e 100644 --- a/src/Application/ReadModel/QueryHandlers/FetchKeyInformationQueryHandler.php +++ b/src/Application/ReadModel/QueryHandlers/FetchKeyInformationQueryHandler.php @@ -57,7 +57,7 @@ public function handle( FetchKeyInformationQuery $query ) : FetchKeyInformationR $keyInfo = $manager->getKeyInfoObject( $query->getKeyName() ); - $keyName = new KeyName( $query->getKeyName(), $query->getHashKey() ); + $keyName = new KeyName( $query->getKeyName(), $query->getSubKey() ); $keyData = $this->getKeyData( $manager, $keyInfo, $keyName ); $result = new FetchKeyInformationResult(); diff --git a/src/Application/Web/Server/Read/AjaxKeyDetailsRequestHandler.php b/src/Application/Web/Server/Read/AjaxKeyDetailsRequestHandler.php index 8f38e72..4d45bbe 100644 --- a/src/Application/Web/Server/Read/AjaxKeyDetailsRequestHandler.php +++ b/src/Application/Web/Server/Read/AjaxKeyDetailsRequestHandler.php @@ -23,14 +23,14 @@ public function handle( ProvidesReadRequestData $request ) $input = $request->getInput(); $serverKey = (string)$input->get( 'serverKey', '0' ); $key = base64_decode( (string)$input->get( 'keyName' ) ); - $hashKey = base64_decode( $input->get( 'hashKey', '' ) ); - if ( '' === $hashKey ) + $subKey = base64_decode( $input->get( 'subKey', '' ) ); + if ( '' === $subKey ) { - $hashKey = null; + $subKey = null; } $database = (int)$input->get( 'database', 0 ); - $query = new FetchKeyInformationQuery( $serverKey, $database, $key, $hashKey ); + $query = new FetchKeyInformationQuery( $serverKey, $database, $key, $subKey ); $result = (new FetchKeyInformationQueryHandler( $this->getEnv() ))->handle( $query ); if ( $result->failed() ) @@ -42,9 +42,9 @@ public function handle( ProvidesReadRequestData $request ) } $data = [ - 'keyData' => $result->getKeyData(), - 'keyInfo' => $result->getKeyInfo(), - 'hashKey' => $hashKey, + 'keyData' => $result->getKeyData(), + 'keyInfo' => $result->getKeyInfo(), + 'subKey' => $subKey, ]; (new TwigPage())->respond( 'Server/Read/Pages/Includes/KeyData.twig', $data ); diff --git a/src/Application/Web/Server/Read/Pages/Includes/KeyData.twig b/src/Application/Web/Server/Read/Pages/Includes/KeyData.twig index 16a0134..f0e7148 100644 --- a/src/Application/Web/Server/Read/Pages/Includes/KeyData.twig +++ b/src/Application/Web/Server/Read/Pages/Includes/KeyData.twig @@ -1,7 +1,7 @@