mirror of
https://codeberg.org/vlw/vlw.se.git
synced 2025-09-14 13:23:41 +02:00
wip: 2024-06-19T13:31:53+0200 (1718796713)
This commit is contained in:
parent
608f775f24
commit
3b20f94e69
46 changed files with 2454 additions and 46 deletions
|
@ -1,8 +1,11 @@
|
||||||
[vlwdb]
|
[connect]
|
||||||
mariadb_host = ""
|
host = ""
|
||||||
mariadb_user = ""
|
user = ""
|
||||||
mariadb_pass = ""
|
pass = ""
|
||||||
mariadb_db = ""
|
|
||||||
|
[databases]
|
||||||
|
vlw = ""
|
||||||
|
battlestation = ""
|
||||||
|
|
||||||
[github]
|
[github]
|
||||||
api_key = ""
|
api_key = ""
|
||||||
|
|
63
api/endpoints/battlestation/GET.php
Normal file
63
api/endpoints/battlestation/GET.php
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Reflect\Path;
|
||||||
|
use Reflect\Response;
|
||||||
|
use ReflectRules\Type;
|
||||||
|
use ReflectRules\Rules;
|
||||||
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\Config\ConfigModel;
|
||||||
|
|
||||||
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/Config.php");
|
||||||
|
|
||||||
|
class GET_Battlestation extends VLWdb {
|
||||||
|
protected Ruleset $ruleset;
|
||||||
|
|
||||||
|
private array $query;
|
||||||
|
private array $results = [];
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->ruleset = new Ruleset(strict: true);
|
||||||
|
|
||||||
|
$this->ruleset->GET([
|
||||||
|
(new Rules(ConfigModel::REF_MB_ID->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(parent::UUID_LENGTH)
|
||||||
|
->max(parent::UUID_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(ConfigModel::FRIENDLY_NAME->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
||||||
|
]);
|
||||||
|
|
||||||
|
parent::__construct(Databases::BATTLESTATION, $this->ruleset);
|
||||||
|
|
||||||
|
// Use a copy of search parameters
|
||||||
|
$this->query = $_GET;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_config(): array {
|
||||||
|
return $this->results = $this->db
|
||||||
|
->for(ConfigModel::TABLE)
|
||||||
|
->where($this->query)
|
||||||
|
->order([ConfigModel::DATE_BUILT->value => "DESC"])
|
||||||
|
->select(ConfigModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function main(): Response {
|
||||||
|
// Set properties as "searchable"
|
||||||
|
parent::make_wildcard_search(ConfigModel::FRIENDLY_NAME->value, $this->query);
|
||||||
|
|
||||||
|
$this->get_config();
|
||||||
|
|
||||||
|
// Return 404 Not Found if response array is empty
|
||||||
|
return new Response($this->results, $this->results ? 200 : 404);
|
||||||
|
}
|
||||||
|
}
|
100
api/endpoints/battlestation/chassis/GET.php
Normal file
100
api/endpoints/battlestation/chassis/GET.php
Normal file
|
@ -0,0 +1,100 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Reflect\Path;
|
||||||
|
use Reflect\Response;
|
||||||
|
use ReflectRules\Type;
|
||||||
|
use ReflectRules\Rules;
|
||||||
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\ChassisModel;
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\Config\ChassisMbModel;
|
||||||
|
|
||||||
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Chassis.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/ChassisMb.php");
|
||||||
|
|
||||||
|
class GET_BattlestationChassis extends VLWdb {
|
||||||
|
private const REL_MOTHERBOARDS = "motherboards";
|
||||||
|
|
||||||
|
protected Ruleset $ruleset;
|
||||||
|
|
||||||
|
private array $query;
|
||||||
|
private array $results = [];
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->ruleset = new Ruleset(strict: true);
|
||||||
|
|
||||||
|
$this->ruleset->GET([
|
||||||
|
(new Rules(ChassisModel::ID->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(parent::UUID_LENGTH)
|
||||||
|
->max(parent::UUID_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(ChassisModel::VENDOR_NAME->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(ChassisModel::VENDOR_MODEL->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(ChassisModel::STORAGE_TWOINCHFIVE->value))
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->type(Type::NULL)
|
||||||
|
->min(0)
|
||||||
|
->max(parent::MYSQL_TINYINT_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(ChassisModel::STORAGE_THREEINCHFIVE->value))
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->type(Type::NULL)
|
||||||
|
->min(0)
|
||||||
|
->max(parent::MYSQL_TINYINT_MAX_LENGTH)
|
||||||
|
]);
|
||||||
|
|
||||||
|
parent::__construct(Databases::BATTLESTATION, $this->ruleset);
|
||||||
|
|
||||||
|
// Use a copy of search parameters
|
||||||
|
$this->query = $_GET;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_motherboards(): void {
|
||||||
|
foreach ($this->results as &$result) {
|
||||||
|
// Get motherboard id from relationship by chassis id
|
||||||
|
$result[self::REL_MOTHERBOARDS] = $this->db
|
||||||
|
->for(ChassisMbModel::TABLE)
|
||||||
|
->where([ChassisMbModel::REF_CHASSIS_ID->value => $result[ChassisModel::ID->value]])
|
||||||
|
->select(ChassisMbModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_chassis(): array {
|
||||||
|
return $this->results = $this->db
|
||||||
|
->for(ChassisModel::TABLE)
|
||||||
|
->where($this->query)
|
||||||
|
->order([ChassisModel::DATE_AQUIRED->value => "DESC"])
|
||||||
|
->select(ChassisModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function main(): Response {
|
||||||
|
// Set properties as "searchable"
|
||||||
|
parent::make_wildcard_search(ChassisModel::VENDOR_NAME->value, $this->query);
|
||||||
|
parent::make_wildcard_search(ChassisModel::VENDOR_MODEL->value, $this->query);
|
||||||
|
|
||||||
|
// Get hardware
|
||||||
|
$this->get_chassis();
|
||||||
|
|
||||||
|
// Resolve hardware relationships
|
||||||
|
$this->get_motherboards();
|
||||||
|
|
||||||
|
// Return 404 Not Found if response array is empty
|
||||||
|
return new Response($this->results, $this->results ? 200 : 404);
|
||||||
|
}
|
||||||
|
}
|
105
api/endpoints/battlestation/coolers/GET.php
Normal file
105
api/endpoints/battlestation/coolers/GET.php
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Reflect\Path;
|
||||||
|
use Reflect\Response;
|
||||||
|
use ReflectRules\Type;
|
||||||
|
use ReflectRules\Rules;
|
||||||
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\{
|
||||||
|
CoolerModel
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\Config\MbCpuCoolerModel;
|
||||||
|
|
||||||
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Coolers.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/MbCpuCooler.php");
|
||||||
|
|
||||||
|
class GET_BattlestationCoolers extends VLWdb {
|
||||||
|
private const REL_MOTHERBOARDS = "motherboards";
|
||||||
|
|
||||||
|
protected Ruleset $ruleset;
|
||||||
|
|
||||||
|
private array $query;
|
||||||
|
private array $results = [];
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->ruleset = new Ruleset(strict: true);
|
||||||
|
|
||||||
|
$this->ruleset->GET([
|
||||||
|
(new Rules(CoolerModel::ID->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(parent::UUID_LENGTH)
|
||||||
|
->max(parent::UUID_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(CoolerModel::TYPE_LIQUID->value))
|
||||||
|
->type(Type::BOOLEAN),
|
||||||
|
|
||||||
|
(new Rules(CoolerModel::SIZE_FAN->value))
|
||||||
|
->type(Type::NULL)
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_INTR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(CoolerModel::SIZE_RADIATOR->value))
|
||||||
|
->type(Type::NULL)
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_INTR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(CoolerModel::VENDOR_NAME->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(CoolerModel::VENDOR_MODEL->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
||||||
|
]);
|
||||||
|
|
||||||
|
parent::__construct(Databases::BATTLESTATION, $this->ruleset);
|
||||||
|
|
||||||
|
// Use a copy of search parameters
|
||||||
|
$this->query = $_GET;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_motherboards(): void {
|
||||||
|
foreach ($this->results as &$result) {
|
||||||
|
// Get motherboard id from relationship by chassis id
|
||||||
|
$result[self::REL_MOTHERBOARDS] = $this->db
|
||||||
|
->for(MbCoolerModel::TABLE)
|
||||||
|
->where([MbCoolerModel::REF_COOLER_ID->value => $result[CoolerModel::ID->value]])
|
||||||
|
->select(MbCoolerModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_coolers(): array {
|
||||||
|
return $this->results = $this->db
|
||||||
|
->for(CoolerModel::TABLE)
|
||||||
|
->where($this->query)
|
||||||
|
->order([CoolerModel::DATE_AQUIRED->value => "DESC"])
|
||||||
|
->select(CoolerModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function main(): Response {
|
||||||
|
// Set properties as "searchable"
|
||||||
|
parent::make_wildcard_search(CoolerModel::VENDOR_NAME->value, $this->query);
|
||||||
|
parent::make_wildcard_search(CoolerModel::VENDOR_MODEL->value, $this->query);
|
||||||
|
|
||||||
|
// Get hardware
|
||||||
|
$this->get_coolers();
|
||||||
|
|
||||||
|
// Resolve hardware relationships
|
||||||
|
$this->get_motherboards();
|
||||||
|
|
||||||
|
// Return 404 Not Found if response array is empty
|
||||||
|
return new Response($this->results, $this->results ? 200 : 404);
|
||||||
|
}
|
||||||
|
}
|
114
api/endpoints/battlestation/cpu/GET.php
Normal file
114
api/endpoints/battlestation/cpu/GET.php
Normal file
|
@ -0,0 +1,114 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Reflect\Path;
|
||||||
|
use Reflect\Response;
|
||||||
|
use ReflectRules\Type;
|
||||||
|
use ReflectRules\Rules;
|
||||||
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\{
|
||||||
|
CpuModel,
|
||||||
|
ClassEnum
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\Config\MbCpuCoolerModel;
|
||||||
|
|
||||||
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Cpu.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/MbCpuCooler.php");
|
||||||
|
|
||||||
|
class GET_BattlestationCpu extends VLWdb {
|
||||||
|
private const REL_MOTHERBOARDS = "motherboards";
|
||||||
|
|
||||||
|
protected Ruleset $ruleset;
|
||||||
|
|
||||||
|
private array $query;
|
||||||
|
private array $results = [];
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->ruleset = new Ruleset(strict: true);
|
||||||
|
|
||||||
|
$this->ruleset->GET([
|
||||||
|
(new Rules(CpuModel::ID->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(parent::UUID_LENGTH)
|
||||||
|
->max(parent::UUID_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(CpuModel::CLOCK_BASE->value))
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->min(1),
|
||||||
|
|
||||||
|
(new Rules(CpuModel::CLOCK_TURBO->value))
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->min(1),
|
||||||
|
|
||||||
|
(new Rules(CpuModel::CORE_COUNT_PERFORMANCE->value))
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_TINYINT_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(CpuModel::CORE_COUNT_EFFICIENCY->value))
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_TINYINT_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(CpuModel::CORE_THREADS->value))
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_TINYINT_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(CpuModel::VENDOR_NAME->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(CpuModel::VENDOR_MODEL->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
||||||
|
]);
|
||||||
|
|
||||||
|
parent::__construct(Databases::BATTLESTATION, $this->ruleset);
|
||||||
|
|
||||||
|
// Use a copy of search parameters
|
||||||
|
$this->query = $_GET;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_motherboards(): void {
|
||||||
|
foreach ($this->results as &$result) {
|
||||||
|
// Get motherboard id from relationship by chassis id
|
||||||
|
$result[self::REL_MOTHERBOARDS] = $this->db
|
||||||
|
->for(MbCpuCoolerModel::TABLE)
|
||||||
|
->where([MbCpuCoolerModel::REF_CPU_ID->value => $result[CpuModel::ID->value]])
|
||||||
|
->select(MbCpuCoolerModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_cpu(): array {
|
||||||
|
return $this->results = $this->db
|
||||||
|
->for(CpuModel::TABLE)
|
||||||
|
->where($this->query)
|
||||||
|
->order([CpuModel::DATE_AQUIRED->value => "DESC"])
|
||||||
|
->select(CpuModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function main(): Response {
|
||||||
|
// Set properties as "searchable"
|
||||||
|
parent::make_wildcard_search(CpuModel::VENDOR_NAME->value, $this->query);
|
||||||
|
parent::make_wildcard_search(CpuModel::VENDOR_MODEL->value, $this->query);
|
||||||
|
|
||||||
|
// Get hardware
|
||||||
|
$this->get_cpu();
|
||||||
|
|
||||||
|
// Resolve hardware relationships
|
||||||
|
$this->get_motherboards();
|
||||||
|
|
||||||
|
// Return 404 Not Found if response array is empty
|
||||||
|
return new Response($this->results, $this->results ? 200 : 404);
|
||||||
|
}
|
||||||
|
}
|
112
api/endpoints/battlestation/dram/GET.php
Normal file
112
api/endpoints/battlestation/dram/GET.php
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Reflect\Path;
|
||||||
|
use Reflect\Response;
|
||||||
|
use ReflectRules\Type;
|
||||||
|
use ReflectRules\Rules;
|
||||||
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\{
|
||||||
|
DramModel,
|
||||||
|
DramFormfactorEnum,
|
||||||
|
DramTechnologyEnum
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\Config\MbDramModel;
|
||||||
|
|
||||||
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Dram.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/MbDram.php");
|
||||||
|
|
||||||
|
class GET_BattlestationDram extends VLWdb {
|
||||||
|
private const REL_MOTHERBOARDS = "motherboards";
|
||||||
|
|
||||||
|
protected Ruleset $ruleset;
|
||||||
|
|
||||||
|
private array $query;
|
||||||
|
private array $results = [];
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->ruleset = new Ruleset(strict: true);
|
||||||
|
|
||||||
|
$this->ruleset->GET([
|
||||||
|
(new Rules(DramModel::ID->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(parent::UUID_LENGTH)
|
||||||
|
->max(parent::UUID_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(DramModel::CAPACITY->value))
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->min(1),
|
||||||
|
|
||||||
|
(new Rules(DramModel::SPEED->value))
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->min(1),
|
||||||
|
|
||||||
|
(new Rules(DramModel::FORMFACTOR->value))
|
||||||
|
->type(Type::ENUM, DramFormfactorEnum::names()),
|
||||||
|
|
||||||
|
(new Rules(DramModel::TECHNOLOGY->value))
|
||||||
|
->type(Type::ENUM, DramTechnologyEnum::names()),
|
||||||
|
|
||||||
|
(new Rules(DramModel::ECC->value))
|
||||||
|
->type(Type::BOOLEAN),
|
||||||
|
|
||||||
|
(new Rules(DramModel::BUFFERED->value))
|
||||||
|
->type(Type::BOOLEAN),
|
||||||
|
|
||||||
|
(new Rules(DramModel::VENDOR_NAME->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(DramModel::VENDOR_MODEL->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
||||||
|
]);
|
||||||
|
|
||||||
|
parent::__construct(Databases::BATTLESTATION, $this->ruleset);
|
||||||
|
|
||||||
|
// Use a copy of search parameters
|
||||||
|
$this->query = $_GET;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_motherboards(): void {
|
||||||
|
foreach ($this->results as &$result) {
|
||||||
|
// Get motherboard id from relationship by chassis id
|
||||||
|
$result[self::REL_MOTHERBOARDS] = $this->db
|
||||||
|
->for(MbDramModel::TABLE)
|
||||||
|
->where([MbDramModel::REF_DRAM_ID->value => $result[DramModel::ID->value]])
|
||||||
|
->select(MbDramModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_dram(): array {
|
||||||
|
return $this->results = $this->db
|
||||||
|
->for(DramModel::TABLE)
|
||||||
|
->where($this->query)
|
||||||
|
->order([DramModel::DATE_AQUIRED->value => "DESC"])
|
||||||
|
->select(DramModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function main(): Response {
|
||||||
|
// Set properties as "searchable"
|
||||||
|
parent::make_wildcard_search(DramModel::VENDOR_NAME->value, $this->query);
|
||||||
|
parent::make_wildcard_search(DramModel::VENDOR_MODEL->value, $this->query);
|
||||||
|
|
||||||
|
// Get hardware
|
||||||
|
$this->get_dram();
|
||||||
|
|
||||||
|
// Resolve hardware relationships
|
||||||
|
$this->get_motherboards();
|
||||||
|
|
||||||
|
// Return 404 Not Found if response array is empty
|
||||||
|
return new Response($this->results, $this->results ? 200 : 404);
|
||||||
|
}
|
||||||
|
}
|
104
api/endpoints/battlestation/gpu/GET.php
Normal file
104
api/endpoints/battlestation/gpu/GET.php
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Reflect\Path;
|
||||||
|
use Reflect\Response;
|
||||||
|
use ReflectRules\Type;
|
||||||
|
use ReflectRules\Rules;
|
||||||
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\GpuModel;
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\Config\MbGpuModel;
|
||||||
|
|
||||||
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Gpu.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/MbGpu.php");
|
||||||
|
|
||||||
|
class GET_BattlestationGpu extends VLWdb {
|
||||||
|
private const REL_MOTHERBOARDS = "motherboards";
|
||||||
|
|
||||||
|
protected Ruleset $ruleset;
|
||||||
|
|
||||||
|
private array $query;
|
||||||
|
private array $results = [];
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->ruleset = new Ruleset(strict: true);
|
||||||
|
|
||||||
|
$this->ruleset->GET([
|
||||||
|
(new Rules(GpuModel::ID->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(parent::UUID_LENGTH)
|
||||||
|
->max(parent::UUID_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(GpuModel::MEMORY->value))
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->min(1),
|
||||||
|
|
||||||
|
(new Rules(GpuModel::VENDOR_NAME->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(GpuModel::VENDOR_MODEL->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(GpuModel::VENDOR_CHIP_NAME->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(GpuModel::VENDOR_CHIP_MODEL->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
||||||
|
]);
|
||||||
|
|
||||||
|
parent::__construct(Databases::BATTLESTATION, $this->ruleset);
|
||||||
|
|
||||||
|
// Use a copy of search parameters
|
||||||
|
$this->query = $_GET;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_motherboards(): void {
|
||||||
|
foreach ($this->results as &$result) {
|
||||||
|
// Get motherboard id from relationship by chassis id
|
||||||
|
$result[self::REL_MOTHERBOARDS] = $this->db
|
||||||
|
->for(MbGpuModel::TABLE)
|
||||||
|
->where([MbGpuModel::REF_GPU_ID->value => $result[GpuModel::ID->value]])
|
||||||
|
->select(MbGpuModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_gpu(): array {
|
||||||
|
return $this->results = $this->db
|
||||||
|
->for(GpuModel::TABLE)
|
||||||
|
->where($this->query)
|
||||||
|
->order([GpuModel::DATE_AQUIRED->value => "DESC"])
|
||||||
|
->select(GpuModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function main(): Response {
|
||||||
|
// Set properties as "searchable"
|
||||||
|
parent::make_wildcard_search(GpuModel::VENDOR_NAME->value, $this->query);
|
||||||
|
parent::make_wildcard_search(GpuModel::VENDOR_MODEL->value, $this->query);
|
||||||
|
parent::make_wildcard_search(GpuModel::VENDOR_CHIP_NAME->value, $this->query);
|
||||||
|
parent::make_wildcard_search(GpuModel::VENDOR_CHIP_MODEL->value, $this->query);
|
||||||
|
|
||||||
|
// Get hardware
|
||||||
|
$this->get_gpu();
|
||||||
|
|
||||||
|
// Resolve hardware relationships
|
||||||
|
$this->get_motherboards();
|
||||||
|
|
||||||
|
// Return 404 Not Found if response array is empty
|
||||||
|
return new Response($this->results, $this->results ? 200 : 404);
|
||||||
|
}
|
||||||
|
}
|
191
api/endpoints/battlestation/mb/GET.php
Normal file
191
api/endpoints/battlestation/mb/GET.php
Normal file
|
@ -0,0 +1,191 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Reflect\Path;
|
||||||
|
use Reflect\Response;
|
||||||
|
use ReflectRules\Type;
|
||||||
|
use ReflectRules\Rules;
|
||||||
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\{
|
||||||
|
MbModel,
|
||||||
|
MbFormfactorEnum
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\Config\{
|
||||||
|
MbGpuModel,
|
||||||
|
MbPsuModel,
|
||||||
|
MbDramModel,
|
||||||
|
MbStorageModel,
|
||||||
|
ChassisMbModel,
|
||||||
|
MbCpuCoolerModel
|
||||||
|
};
|
||||||
|
|
||||||
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Mb.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/MbPsu.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/MbGpu.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/MbDram.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/MbStorage.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/ChassisMb.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/MbCpuCooler.php");
|
||||||
|
|
||||||
|
class GET_BattlestationMb extends VLWdb {
|
||||||
|
private const REL_CPU = "cpus";
|
||||||
|
private const REL_PSU = "psus";
|
||||||
|
private const REL_GPU = "gpus";
|
||||||
|
private const REL_DRAM = "dram";
|
||||||
|
private const REL_STORAGE = "storage";
|
||||||
|
private const REL_CHASSIS = "chassis";
|
||||||
|
|
||||||
|
protected Ruleset $ruleset;
|
||||||
|
|
||||||
|
private array $query;
|
||||||
|
private array $results = [];
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->ruleset = new Ruleset(strict: true);
|
||||||
|
|
||||||
|
$this->ruleset->GET([
|
||||||
|
(new Rules(MbModel::ID->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(parent::UUID_LENGTH)
|
||||||
|
->max(parent::UUID_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(MbModel::FORMFACTOR->value))
|
||||||
|
->type(Type::ENUM, MbFormfactorEnum::names()),
|
||||||
|
|
||||||
|
(new Rules(MbModel::VENDOR_NAME->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(MbModel::VENDOR_MODEL->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(MbModel::NETWORK_ETHERNET->value))
|
||||||
|
->type(Type::NULL)
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(MbModel::NETWORK_WLAN->value))
|
||||||
|
->type(Type::NULL)
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(MbModel::NETWORK_BLUETOOTH->value))
|
||||||
|
->type(Type::NULL)
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
||||||
|
]);
|
||||||
|
|
||||||
|
parent::__construct(Databases::BATTLESTATION, $this->ruleset);
|
||||||
|
|
||||||
|
// Use a copy of search parameters
|
||||||
|
$this->query = $_GET;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_chassis(): void {
|
||||||
|
foreach ($this->results as &$result) {
|
||||||
|
// Get motherboard id from relationship by chassis id
|
||||||
|
$result[self::REL_CHASSIS] = $this->db
|
||||||
|
->for(ChassisMbModel::TABLE)
|
||||||
|
->where([ChassisMbModel::REF_MB_ID->value => $result[MbModel::ID->value]])
|
||||||
|
->select(ChassisMbModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_psu(): void {
|
||||||
|
foreach ($this->results as &$result) {
|
||||||
|
// Get motherboard id from relationship by chassis id
|
||||||
|
$result[self::REL_PSU] = $this->db
|
||||||
|
->for(MbPsuModel::TABLE)
|
||||||
|
->where([MbPsuModel::REF_MB_ID->value => $result[MbModel::ID->value]])
|
||||||
|
->select(MbPsuModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_cpu(): void {
|
||||||
|
foreach ($this->results as &$result) {
|
||||||
|
// Get motherboard id from relationship by chassis id
|
||||||
|
$result[self::REL_CPU] = $this->db
|
||||||
|
->for(MbCpuCoolerModel::TABLE)
|
||||||
|
->where([MbCpuCoolerModel::REF_MB_ID->value => $result[MbModel::ID->value]])
|
||||||
|
->select(MbCpuCoolerModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_gpu(): void {
|
||||||
|
foreach ($this->results as &$result) {
|
||||||
|
// Get motherboard id from relationship by chassis id
|
||||||
|
$result[self::REL_GPU] = $this->db
|
||||||
|
->for(MbGpuModel::TABLE)
|
||||||
|
->where([MbGpuModel::REF_MB_ID->value => $result[MbModel::ID->value]])
|
||||||
|
->select(MbGpuModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_dram(): void {
|
||||||
|
foreach ($this->results as &$result) {
|
||||||
|
// Get motherboard id from relationship by chassis id
|
||||||
|
$result[self::REL_DRAM] = $this->db
|
||||||
|
->for(MbDramModel::TABLE)
|
||||||
|
->where([MbDramModel::REF_MB_ID->value => $result[MbModel::ID->value]])
|
||||||
|
->select(MbDramModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_storage(): void {
|
||||||
|
foreach ($this->results as &$result) {
|
||||||
|
// Get motherboard id from relationship by chassis id
|
||||||
|
$result[self::REL_STORAGE] = $this->db
|
||||||
|
->for(MbStorageModel::TABLE)
|
||||||
|
->where([MbStorageModel::REF_MB_ID->value => $result[MbModel::ID->value]])
|
||||||
|
->select(MbStorageModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----
|
||||||
|
|
||||||
|
private function get_motherboards(): array {
|
||||||
|
return $this->results = $this->db
|
||||||
|
->for(MbModel::TABLE)
|
||||||
|
->where($this->query)
|
||||||
|
->order([MbModel::DATE_AQUIRED->value => "DESC"])
|
||||||
|
->select(MbModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function main(): Response {
|
||||||
|
// Set properties as "searchable"
|
||||||
|
parent::make_wildcard_search(MbModel::VENDOR_NAME->value, $this->query);
|
||||||
|
parent::make_wildcard_search(MbModel::VENDOR_MODEL->value, $this->query);
|
||||||
|
|
||||||
|
// Get hardware
|
||||||
|
$this->get_motherboards();
|
||||||
|
|
||||||
|
// Resolve hardware relationships
|
||||||
|
$this->get_chassis();
|
||||||
|
$this->get_cpu();
|
||||||
|
$this->get_psu();
|
||||||
|
$this->get_gpu();
|
||||||
|
$this->get_dram();
|
||||||
|
$this->get_storage();
|
||||||
|
|
||||||
|
// Return 404 Not Found if response array is empty
|
||||||
|
return new Response($this->results, $this->results ? 200 : 404);
|
||||||
|
}
|
||||||
|
}
|
99
api/endpoints/battlestation/psu/GET.php
Normal file
99
api/endpoints/battlestation/psu/GET.php
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Reflect\Path;
|
||||||
|
use Reflect\Response;
|
||||||
|
use ReflectRules\Type;
|
||||||
|
use ReflectRules\Rules;
|
||||||
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\{
|
||||||
|
PsuModel,
|
||||||
|
EightyplusRatingEnum
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\Config\MbPsuModel;
|
||||||
|
|
||||||
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Psu.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/MbPsu.php");
|
||||||
|
|
||||||
|
class GET_BattlestationPsu extends VLWdb {
|
||||||
|
private const REL_MOTHERBOARDS = "motherboards";
|
||||||
|
|
||||||
|
protected Ruleset $ruleset;
|
||||||
|
|
||||||
|
private array $query;
|
||||||
|
private array $results = [];
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->ruleset = new Ruleset(strict: true);
|
||||||
|
|
||||||
|
$this->ruleset->GET([
|
||||||
|
(new Rules(PsuModel::ID->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(parent::UUID_LENGTH)
|
||||||
|
->max(parent::UUID_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(PsuModel::POWER->value))
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_INT_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(PsuModel::EIGHTYPLUS_RATING->value))
|
||||||
|
->type(Type::ENUM, EightyplusRatingEnum::names()),
|
||||||
|
|
||||||
|
(new Rules(PsuModel::VENDOR_NAME->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(PsuModel::VENDOR_MODEL->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
||||||
|
]);
|
||||||
|
|
||||||
|
parent::__construct(Databases::BATTLESTATION, $this->ruleset);
|
||||||
|
|
||||||
|
// Use a copy of search parameters
|
||||||
|
$this->query = $_GET;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_motherboards(): void {
|
||||||
|
foreach ($this->results as &$result) {
|
||||||
|
// Get motherboard id from relationship by chassis id
|
||||||
|
$result[self::REL_MOTHERBOARDS] = $this->db
|
||||||
|
->for(MbPsuModel::TABLE)
|
||||||
|
->where([MbPsuModel::REF_PSU_ID->value => $result[PsuModel::ID->value]])
|
||||||
|
->select(MbPsuModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_psu(): array {
|
||||||
|
return $this->results = $this->db
|
||||||
|
->for(PsuModel::TABLE)
|
||||||
|
->where($this->query)
|
||||||
|
->order([PsuModel::DATE_AQUIRED->value => "DESC"])
|
||||||
|
->select(PsuModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function main(): Response {
|
||||||
|
// Set properties as "searchable"
|
||||||
|
parent::make_wildcard_search(PsuModel::VENDOR_NAME->value, $this->query);
|
||||||
|
parent::make_wildcard_search(PsuModel::VENDOR_MODEL->value, $this->query);
|
||||||
|
|
||||||
|
// Get hardware
|
||||||
|
$this->get_psu();
|
||||||
|
|
||||||
|
// Resolve hardware relationships
|
||||||
|
$this->get_motherboards();
|
||||||
|
|
||||||
|
// Return 404 Not Found if response array is empty
|
||||||
|
return new Response($this->results, $this->results ? 200 : 404);
|
||||||
|
}
|
||||||
|
}
|
107
api/endpoints/battlestation/storage/GET.php
Normal file
107
api/endpoints/battlestation/storage/GET.php
Normal file
|
@ -0,0 +1,107 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Reflect\Path;
|
||||||
|
use Reflect\Response;
|
||||||
|
use ReflectRules\Type;
|
||||||
|
use ReflectRules\Rules;
|
||||||
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\{
|
||||||
|
StorageModel,
|
||||||
|
StorageDiskTypeEnum,
|
||||||
|
StorageDiskInterfaceEnum,
|
||||||
|
StorageDiskFormfactorEnum
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\Config\MbStorageModel;
|
||||||
|
|
||||||
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Storage.php");
|
||||||
|
require_once Path::root("src/databases/models/Battlestation/Config/MbStorage.php");
|
||||||
|
|
||||||
|
class GET_BattlestationStorage extends VLWdb {
|
||||||
|
private const REL_MOTHERBOARDS = "motherboards";
|
||||||
|
|
||||||
|
protected Ruleset $ruleset;
|
||||||
|
|
||||||
|
private array $query;
|
||||||
|
private array $results = [];
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->ruleset = new Ruleset(strict: true);
|
||||||
|
|
||||||
|
$this->ruleset->GET([
|
||||||
|
(new Rules(StorageModel::ID->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(parent::UUID_LENGTH)
|
||||||
|
->max(parent::UUID_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(StorageModel::DISK_TYPE->value))
|
||||||
|
->type(Type::ENUM, StorageDiskTypeEnum::names()),
|
||||||
|
|
||||||
|
(new Rules(StorageModel::DISK_SIZE->value))
|
||||||
|
->type(Type::NUMBER)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_INT_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(StorageModel::DISK_INTERFACE->value))
|
||||||
|
->type(Type::ENUM, StorageDiskInterfaceEnum::names()),
|
||||||
|
|
||||||
|
(new Rules(StorageModel::DISK_FORMFACTOR->value))
|
||||||
|
->type(Type::ENUM, StorageDiskFormfactorEnum::names()),
|
||||||
|
|
||||||
|
(new Rules(StorageModel::VENDOR_NAME->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH),
|
||||||
|
|
||||||
|
(new Rules(StorageModel::VENDOR_MODEL->value))
|
||||||
|
->type(Type::STRING)
|
||||||
|
->min(1)
|
||||||
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
||||||
|
]);
|
||||||
|
|
||||||
|
parent::__construct(Databases::BATTLESTATION, $this->ruleset);
|
||||||
|
|
||||||
|
// Use a copy of search parameters
|
||||||
|
$this->query = $_GET;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_motherboards(): void {
|
||||||
|
foreach ($this->results as &$result) {
|
||||||
|
// Get motherboard id from relationship by chassis id
|
||||||
|
$result[self::REL_MOTHERBOARDS] = $this->db
|
||||||
|
->for(MbStorageModel::TABLE)
|
||||||
|
->where([MbStorageModel::REF_STORAGE_ID->value => $result[StorageModel::ID->value]])
|
||||||
|
->select(MbStorageModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function get_storage(): array {
|
||||||
|
return $this->results = $this->db
|
||||||
|
->for(StorageModel::TABLE)
|
||||||
|
->where($this->query)
|
||||||
|
->order([StorageModel::DATE_AQUIRED->value => "DESC"])
|
||||||
|
->select(StorageModel::values())
|
||||||
|
->fetch_all(MYSQLI_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function main(): Response {
|
||||||
|
// Set properties as "searchable"
|
||||||
|
parent::make_wildcard_search(StorageModel::VENDOR_NAME->value, $this->query);
|
||||||
|
parent::make_wildcard_search(StorageModel::VENDOR_MODEL->value, $this->query);
|
||||||
|
|
||||||
|
// Get hardware
|
||||||
|
$this->get_storage();
|
||||||
|
|
||||||
|
// Resolve hardware relationships
|
||||||
|
$this->get_motherboards();
|
||||||
|
|
||||||
|
// Return 404 Not Found if response array is empty
|
||||||
|
return new Response($this->results, $this->results ? 200 : 404);
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,7 +6,10 @@
|
||||||
use ReflectRules\Rules;
|
use ReflectRules\Rules;
|
||||||
use ReflectRules\Ruleset;
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Messages\MessagesModel;
|
use VLW\API\Databases\VLWdb\Models\Messages\MessagesModel;
|
||||||
|
|
||||||
require_once Path::root("src/databases/VLWdb.php");
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
@ -31,7 +34,7 @@
|
||||||
->max(parent::MYSQL_TEXT_MAX_LENGTH)
|
->max(parent::MYSQL_TEXT_MAX_LENGTH)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
parent::__construct($this->ruleset);
|
parent::__construct(Databases::VLW, $this->ruleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function main(): Response {
|
public function main(): Response {
|
||||||
|
|
|
@ -9,7 +9,10 @@
|
||||||
|
|
||||||
use VLW\API\Endpoints;
|
use VLW\API\Endpoints;
|
||||||
|
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Work\WorkModel;
|
use VLW\API\Databases\VLWdb\Models\Work\WorkModel;
|
||||||
|
|
||||||
require_once Path::root("src/Endpoints.php");
|
require_once Path::root("src/Endpoints.php");
|
||||||
|
@ -32,7 +35,7 @@
|
||||||
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
parent::__construct($this->ruleset);
|
parent::__construct(Databases::VLW, $this->ruleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function search_work(): Response {
|
private function search_work(): Response {
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
use ReflectRules\Ruleset;
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
use const VLW\API\RESP_DELETE_OK;
|
use const VLW\API\RESP_DELETE_OK;
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Work\WorkModel;
|
use VLW\API\Databases\VLWdb\Models\Work\WorkModel;
|
||||||
|
|
||||||
require_once Path::root("src/Endpoints.php");
|
require_once Path::root("src/Endpoints.php");
|
||||||
|
@ -45,15 +48,15 @@
|
||||||
(new Rules(WorkModel::DATE_MODIFIED->value))
|
(new Rules(WorkModel::DATE_MODIFIED->value))
|
||||||
->type(Type::NUMBER)
|
->type(Type::NUMBER)
|
||||||
->min(1)
|
->min(1)
|
||||||
->max(parent::MYSQL_INT_MAX_LENGHT),
|
->max(parent::MYSQL_INT_MAX_LENGTH),
|
||||||
|
|
||||||
(new Rules(WorkModel::DATE_CREATED->value))
|
(new Rules(WorkModel::DATE_CREATED->value))
|
||||||
->type(Type::NUMBER)
|
->type(Type::NUMBER)
|
||||||
->min(1)
|
->min(1)
|
||||||
->max(parent::MYSQL_INT_MAX_LENGHT)
|
->max(parent::MYSQL_INT_MAX_LENGTH)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
parent::__construct($this->ruleset);
|
parent::__construct(Databases::VLW, $this->ruleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function main(): Response {
|
public function main(): Response {
|
||||||
|
|
|
@ -6,7 +6,10 @@
|
||||||
use ReflectRules\Rules;
|
use ReflectRules\Rules;
|
||||||
use ReflectRules\Ruleset;
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Work\WorkModel;
|
use VLW\API\Databases\VLWdb\Models\Work\WorkModel;
|
||||||
|
|
||||||
require_once Path::root("src/databases/VLWdb.php");
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
@ -43,15 +46,15 @@
|
||||||
(new Rules(WorkModel::DATE_MODIFIED->value))
|
(new Rules(WorkModel::DATE_MODIFIED->value))
|
||||||
->type(Type::NUMBER)
|
->type(Type::NUMBER)
|
||||||
->min(1)
|
->min(1)
|
||||||
->max(parent::MYSQL_INT_MAX_LENGHT),
|
->max(parent::MYSQL_INT_MAX_LENGTH),
|
||||||
|
|
||||||
(new Rules(WorkModel::DATE_CREATED->value))
|
(new Rules(WorkModel::DATE_CREATED->value))
|
||||||
->type(Type::NUMBER)
|
->type(Type::NUMBER)
|
||||||
->min(1)
|
->min(1)
|
||||||
->max(parent::MYSQL_INT_MAX_LENGHT)
|
->max(parent::MYSQL_INT_MAX_LENGTH)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
parent::__construct($this->ruleset);
|
parent::__construct(Databases::VLW, $this->ruleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function main(): Response {
|
public function main(): Response {
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
use ReflectRules\Ruleset;
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
use VLW\API\Endpoints;
|
use VLW\API\Endpoints;
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Work\{
|
use VLW\API\Databases\VLWdb\Models\Work\{
|
||||||
WorkModel,
|
WorkModel,
|
||||||
WorkPermalinksModel
|
WorkPermalinksModel
|
||||||
|
@ -53,13 +56,13 @@
|
||||||
(new Rules(WorkModel::DATE_MODIFIED->value))
|
(new Rules(WorkModel::DATE_MODIFIED->value))
|
||||||
->type(Type::NUMBER)
|
->type(Type::NUMBER)
|
||||||
->min(1)
|
->min(1)
|
||||||
->max(parent::MYSQL_INT_MAX_LENGHT)
|
->max(parent::MYSQL_INT_MAX_LENGTH)
|
||||||
->default(time()),
|
->default(time()),
|
||||||
|
|
||||||
(new Rules(WorkModel::DATE_CREATED->value))
|
(new Rules(WorkModel::DATE_CREATED->value))
|
||||||
->type(Type::NUMBER)
|
->type(Type::NUMBER)
|
||||||
->min(1)
|
->min(1)
|
||||||
->max(parent::MYSQL_INT_MAX_LENGHT)
|
->max(parent::MYSQL_INT_MAX_LENGTH)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
use ReflectRules\Ruleset;
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
use VLW\API\Endpoints;
|
use VLW\API\Endpoints;
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Work\{
|
use VLW\API\Databases\VLWdb\Models\Work\{
|
||||||
WorkModel,
|
WorkModel,
|
||||||
WorkPermalinksModel
|
WorkPermalinksModel
|
||||||
|
@ -49,11 +52,11 @@
|
||||||
(new Rules(WorkModel::DATE_CREATED->value))
|
(new Rules(WorkModel::DATE_CREATED->value))
|
||||||
->type(Type::NUMBER)
|
->type(Type::NUMBER)
|
||||||
->min(1)
|
->min(1)
|
||||||
->max(parent::MYSQL_INT_MAX_LENGHT)
|
->max(parent::MYSQL_INT_MAX_LENGTH)
|
||||||
->default(time())
|
->default(time())
|
||||||
]);
|
]);
|
||||||
|
|
||||||
parent::__construct($this->ruleset);
|
parent::__construct(Databases::VLW, $this->ruleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate a slug URL from string
|
// Generate a slug URL from string
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
use ReflectRules\Ruleset;
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
use const VLW\API\RESP_DELETE_OK;
|
use const VLW\API\RESP_DELETE_OK;
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Work\WorkActionsModel;
|
use VLW\API\Databases\VLWdb\Models\Work\WorkActionsModel;
|
||||||
|
|
||||||
require_once Path::root("src/databases/VLWdb.php");
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
|
|
@ -6,7 +6,10 @@
|
||||||
use ReflectRules\Rules;
|
use ReflectRules\Rules;
|
||||||
use ReflectRules\Ruleset;
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Work\WorkActionsModel;
|
use VLW\API\Databases\VLWdb\Models\Work\WorkActionsModel;
|
||||||
|
|
||||||
require_once Path::root("src/databases/VLWdb.php");
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
@ -25,7 +28,7 @@
|
||||||
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
parent::__construct($this->ruleset);
|
parent::__construct(Databases::VLW, $this->ruleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function main(): Response {
|
public function main(): Response {
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
use ReflectRules\Ruleset;
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
use VLW\API\Endpoints;
|
use VLW\API\Endpoints;
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Work\{
|
use VLW\API\Databases\VLWdb\Models\Work\{
|
||||||
WorkModel,
|
WorkModel,
|
||||||
WorkActionsModel
|
WorkActionsModel
|
||||||
|
@ -54,7 +57,7 @@
|
||||||
->default(false)
|
->default(false)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
parent::__construct($this->ruleset);
|
parent::__construct(Databases::VLW, $this->ruleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function get_entity(): Response {
|
private static function get_entity(): Response {
|
||||||
|
|
|
@ -6,7 +6,10 @@
|
||||||
use ReflectRules\Rules;
|
use ReflectRules\Rules;
|
||||||
use ReflectRules\Ruleset;
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Work\WorkPermalinksModel;
|
use VLW\API\Databases\VLWdb\Models\Work\WorkPermalinksModel;
|
||||||
|
|
||||||
require_once Path::root("src/databases/VLWdb.php");
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
@ -30,7 +33,7 @@
|
||||||
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
->max(parent::MYSQL_VARCHAR_MAX_LENGTH)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
parent::__construct($this->ruleset);
|
parent::__construct(Databases::VLW, $this->ruleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function main(): Response {
|
public function main(): Response {
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
use ReflectRules\Rules;
|
use ReflectRules\Rules;
|
||||||
use ReflectRules\Ruleset;
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Work\WorkPermalinksModel;
|
use VLW\API\Databases\VLWdb\Models\Work\WorkPermalinksModel;
|
||||||
|
|
||||||
require_once Path::root("src/databases/VLWdb.php");
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
@ -35,11 +38,11 @@
|
||||||
(new Rules(WorkPermalinksModel::DATE_CREATED->value))
|
(new Rules(WorkPermalinksModel::DATE_CREATED->value))
|
||||||
->type(Type::NUMBER)
|
->type(Type::NUMBER)
|
||||||
->min(1)
|
->min(1)
|
||||||
->max(parent::MYSQL_INT_MAX_LENGHT)
|
->max(parent::MYSQL_INT_MAX_LENGTH)
|
||||||
->default(time())
|
->default(time())
|
||||||
]);
|
]);
|
||||||
|
|
||||||
parent::__construct($this->ruleset);
|
parent::__construct(Databases::VLW, $this->ruleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function get_entity(): Response {
|
private static function get_entity(): Response {
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
use ReflectRules\Ruleset;
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
use const VLW\API\RESP_DELETE_OK;
|
use const VLW\API\RESP_DELETE_OK;
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Work\WorkTagsModel;
|
use VLW\API\Databases\VLWdb\Models\Work\WorkTagsModel;
|
||||||
|
|
||||||
require_once Path::root("src/databases/VLWdb.php");
|
require_once Path::root("src/databases/VLWdb.php");
|
||||||
|
@ -28,7 +31,7 @@
|
||||||
->type(Type::ENUM, WorkTagsNameEnum::names())
|
->type(Type::ENUM, WorkTagsNameEnum::names())
|
||||||
]);
|
]);
|
||||||
|
|
||||||
parent::__construct($this->ruleset);
|
parent::__construct(Databases::VLW, $this->ruleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function main(): Response {
|
public function main(): Response {
|
||||||
|
|
|
@ -6,7 +6,10 @@
|
||||||
use ReflectRules\Rules;
|
use ReflectRules\Rules;
|
||||||
use ReflectRules\Ruleset;
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Work\{
|
use VLW\API\Databases\VLWdb\Models\Work\{
|
||||||
WorkTagsModel,
|
WorkTagsModel,
|
||||||
WorkTagsNameEnum
|
WorkTagsNameEnum
|
||||||
|
@ -30,7 +33,7 @@
|
||||||
->type(Type::ENUM, WorkTagsNameEnum::names())
|
->type(Type::ENUM, WorkTagsNameEnum::names())
|
||||||
]);
|
]);
|
||||||
|
|
||||||
parent::__construct($this->ruleset);
|
parent::__construct(Databases::VLW, $this->ruleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function main(): Response {
|
public function main(): Response {
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
use ReflectRules\Ruleset;
|
use ReflectRules\Ruleset;
|
||||||
|
|
||||||
use VLW\API\Endpoints;
|
use VLW\API\Endpoints;
|
||||||
use VLW\API\Databases\VLWdb\VLWdb;
|
use VLW\API\Databases\VLWdb\{
|
||||||
|
VLWdb,
|
||||||
|
Databases
|
||||||
|
};
|
||||||
use VLW\API\Databases\VLWdb\Models\Work\{
|
use VLW\API\Databases\VLWdb\Models\Work\{
|
||||||
WorkModel,
|
WorkModel,
|
||||||
WorkTagsModel,
|
WorkTagsModel,
|
||||||
|
@ -37,7 +40,7 @@
|
||||||
->type(Type::ENUM, WorkTagsNameEnum::names())
|
->type(Type::ENUM, WorkTagsNameEnum::names())
|
||||||
]);
|
]);
|
||||||
|
|
||||||
parent::__construct($this->ruleset);
|
parent::__construct(Databases::VLW, $this->ruleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function get_entity(): Response {
|
private static function get_entity(): Response {
|
||||||
|
|
|
@ -14,4 +14,14 @@
|
||||||
case WORK = "/work";
|
case WORK = "/work";
|
||||||
case WORK_TAGS = "/work/tags";
|
case WORK_TAGS = "/work/tags";
|
||||||
case WORK_ACTIONS = "/work/actions";
|
case WORK_ACTIONS = "/work/actions";
|
||||||
|
|
||||||
|
case BATTLESTATION = "/battlestation";
|
||||||
|
case BATTLESTATION_MB = "/battlestation/mb";
|
||||||
|
case BATTLESTATION_CPU = "/battlestation/cpu";
|
||||||
|
case BATTLESTATION_GPU = "/battlestation/gpu";
|
||||||
|
case BATTLESTATION_PSU = "/battlestation/psu";
|
||||||
|
case BATTLESTATION_DRAM = "/battlestation/dram";
|
||||||
|
case BATTLESTATION_STORAGE = "/battlestation/storage";
|
||||||
|
case BATTLESTATION_COOLERS = "/battlestation/coolers";
|
||||||
|
case BATTLESTATION_CHASSIS = "/battlestation/chassis";
|
||||||
}
|
}
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
namespace VLW\API\Databases\VLWdb;
|
namespace VLW\API\Databases\VLWdb;
|
||||||
|
|
||||||
use Reflect\ENV;
|
|
||||||
use Reflect\Path;
|
use Reflect\Path;
|
||||||
use Reflect\Request;
|
use Reflect\Request;
|
||||||
use Reflect\Response;
|
use Reflect\Response;
|
||||||
|
@ -10,25 +9,31 @@
|
||||||
|
|
||||||
use libmysqldriver\MySQL;
|
use libmysqldriver\MySQL;
|
||||||
|
|
||||||
|
enum Databases: string {
|
||||||
|
case VLW = "vlw";
|
||||||
|
case BATTLESTATION = "battlestation";
|
||||||
|
}
|
||||||
|
|
||||||
class VLWdb {
|
class VLWdb {
|
||||||
const UUID_LENGTH = 36;
|
const UUID_LENGTH = 36;
|
||||||
|
|
||||||
|
const MYSQL_INT_MAX_LENGTH = 2147483647;
|
||||||
const MYSQL_TEXT_MAX_LENGTH = 65538;
|
const MYSQL_TEXT_MAX_LENGTH = 65538;
|
||||||
const MYSQL_VARCHAR_MAX_LENGTH = 255;
|
const MYSQL_VARCHAR_MAX_LENGTH = 255;
|
||||||
const MYSQL_INT_MAX_LENGHT = 2147483647;
|
const MYSQL_TINYINT_MAX_LENGTH = 255;
|
||||||
|
|
||||||
protected readonly MySQL $db;
|
protected readonly MySQL $db;
|
||||||
|
|
||||||
public function __construct(Ruleset $ruleset) {
|
public function __construct(Databases $database, Ruleset $ruleset) {
|
||||||
// Validate provided Ruleset before attempting to connect to the database
|
// Validate provided Ruleset before attempting to connect to the database
|
||||||
self::eval_ruleset_or_exit($ruleset);
|
self::eval_ruleset_or_exit($ruleset);
|
||||||
|
|
||||||
// Create new MariaDB connection
|
// Create new MariaDB connection
|
||||||
$this->db = new MySQL(
|
$this->db = new MySQL(
|
||||||
$_ENV["vlwdb"]["mariadb_host"],
|
$_ENV["connect"]["host"],
|
||||||
$_ENV["vlwdb"]["mariadb_user"],
|
$_ENV["connect"]["user"],
|
||||||
$_ENV["vlwdb"]["mariadb_pass"],
|
$_ENV["connect"]["pass"],
|
||||||
$_ENV["vlwdb"]["mariadb_db"],
|
$_ENV["databases"][$database->value],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +60,22 @@
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mutate the value by array key $property_name into a libmysqldriver\MySQL custom operator
|
||||||
|
// https://github.com/VictorWesterlund/php-libmysqldriver?tab=readme-ov-file#define-custom-operators
|
||||||
|
public static function make_wildcard_search(string $property_name, array &$filters): array {
|
||||||
|
// Bail out if property name is not set in filters array or if its value is null
|
||||||
|
if (!array_key_exists($property_name, $filters) || $filers[$property_name] !== null) {
|
||||||
|
return $filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mutate filter value into a custom operator array
|
||||||
|
$filters[$property_name] = [
|
||||||
|
"LIKE" => "%{$filters[$property_name]}%"
|
||||||
|
];
|
||||||
|
|
||||||
|
return $filters;
|
||||||
|
}
|
||||||
|
|
||||||
// Bail out if provided ReflectRules\Ruleset is invalid
|
// Bail out if provided ReflectRules\Ruleset is invalid
|
||||||
private static function eval_ruleset_or_exit(Ruleset $ruleset): ?Response {
|
private static function eval_ruleset_or_exit(Ruleset $ruleset): ?Response {
|
||||||
return !$ruleset->is_valid() ? new Response($ruleset->get_errors(), 422) : null;
|
return !$ruleset->is_valid() ? new Response($ruleset->get_errors(), 422) : null;
|
||||||
|
|
19
api/src/databases/models/Battlestation/Chassis.php
Normal file
19
api/src/databases/models/Battlestation/Chassis.php
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum ChassisModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "chassis";
|
||||||
|
|
||||||
|
case ID = "id";
|
||||||
|
case VENDOR_NAME = "vendor_name";
|
||||||
|
case VENDOR_MODEL = "vendor_model";
|
||||||
|
case STORAGE_TWOINCHFIVE = "storage_2i5hi";
|
||||||
|
case STORAGE_THREEINCHFIVE = "storage_3i5hi";
|
||||||
|
case DATE_AQUIRED = "date_aquired";
|
||||||
|
case DATE_RETIRED = "date_retired";
|
||||||
|
}
|
14
api/src/databases/models/Battlestation/Config/ChassisMb.php
Normal file
14
api/src/databases/models/Battlestation/Config/ChassisMb.php
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation\Config;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum ChassisMbModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "config_chassis_mb";
|
||||||
|
|
||||||
|
case REF_CHASSIS_ID = "ref_chassis_id";
|
||||||
|
case REF_MB_ID = "ref_mb_id";
|
||||||
|
}
|
15
api/src/databases/models/Battlestation/Config/Config.php
Normal file
15
api/src/databases/models/Battlestation/Config/Config.php
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation\Config;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum ConfigModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "config";
|
||||||
|
|
||||||
|
case REF_MB_ID = "ref_mb_id";
|
||||||
|
case FRIENDLY_NAME = "friendly_name";
|
||||||
|
case DATE_BUILT = "date_built";
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation\Config;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum SocketTypeEnum {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
case SLOTTED;
|
||||||
|
case INTEGRATED;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum MbCpuCoolerModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "config_mb_cpu_cooler";
|
||||||
|
|
||||||
|
case REF_MB_ID = "ref_mb_id";
|
||||||
|
case REF_CPU_ID = "ref_cpu_id";
|
||||||
|
case REF_COOLER_ID = "ref_cooler_id";
|
||||||
|
case SOCKET = "socket";
|
||||||
|
case SOCKET_TYPE = "socket_type";
|
||||||
|
}
|
23
api/src/databases/models/Battlestation/Config/MbDram.php
Normal file
23
api/src/databases/models/Battlestation/Config/MbDram.php
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation\Config;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum SocketTypeModel {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
case SLOTTED;
|
||||||
|
case INTEGRATED;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum MbDramModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "config_mb_dram";
|
||||||
|
|
||||||
|
case REF_MB_ID = "ref_mb_id";
|
||||||
|
case REF_DRAM_ID = "ref_dram_id";
|
||||||
|
case SOCKET = "socket";
|
||||||
|
case SOCKET_TYPE = "socket_type";
|
||||||
|
}
|
14
api/src/databases/models/Battlestation/Config/MbGpu.php
Normal file
14
api/src/databases/models/Battlestation/Config/MbGpu.php
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation\Config;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum MbGpuModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "config_mb_gpu";
|
||||||
|
|
||||||
|
case REF_MB_ID = "ref_mb_id";
|
||||||
|
case REF_GPU_ID = "ref_gpu_id";
|
||||||
|
}
|
14
api/src/databases/models/Battlestation/Config/MbPsu.php
Normal file
14
api/src/databases/models/Battlestation/Config/MbPsu.php
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation\Config;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum MbPsuModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "config_mb_psu";
|
||||||
|
|
||||||
|
case REF_MB_ID = "ref_mb_id";
|
||||||
|
case REF_PSU_ID = "ref_psu_id";
|
||||||
|
}
|
25
api/src/databases/models/Battlestation/Config/MbStorage.php
Normal file
25
api/src/databases/models/Battlestation/Config/MbStorage.php
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation\Config;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum MbStorageSlotFormfactorEnum: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
case TWODOTFIVE = "2.5";
|
||||||
|
case THREEDOTFIVE = "3.5";
|
||||||
|
case MDOTTWO = "M.2";
|
||||||
|
case EXTERNAL = "EXTERNAL";
|
||||||
|
}
|
||||||
|
|
||||||
|
enum MbStorageModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "config_mb_storage";
|
||||||
|
|
||||||
|
case REF_MB_ID = "ref_mb_id";
|
||||||
|
case REF_STORAGE_ID = "ref_storage_id";
|
||||||
|
case INTERFACE = "interface";
|
||||||
|
case SLOT_FORMFACTOR = "slot_formfactor";
|
||||||
|
}
|
16
api/src/databases/models/Battlestation/Coolers.php
Normal file
16
api/src/databases/models/Battlestation/Coolers.php
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation;
|
||||||
|
|
||||||
|
enum CoolersModel: string {
|
||||||
|
const TABLE = "coolers";
|
||||||
|
|
||||||
|
case ID = "id";
|
||||||
|
case TYPE_LIQUID = "type_liquid";
|
||||||
|
case SIZE_FAN = "size_fan";
|
||||||
|
case SIZE_RADIATOR = "size_radiator";
|
||||||
|
case VENDOR_NAME = "vendor_name";
|
||||||
|
case VENDOR_MODEL = "vendor_model";
|
||||||
|
case DATE_AQUIRED = "date_aquired";
|
||||||
|
case DATE_RETIRED = "date_retired";
|
||||||
|
}
|
31
api/src/databases/models/Battlestation/Cpu.php
Normal file
31
api/src/databases/models/Battlestation/Cpu.php
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum ClassEnum {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
case DESKTOP;
|
||||||
|
case LAPTOP;
|
||||||
|
case SERVER;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum CpuModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "cpu";
|
||||||
|
|
||||||
|
case ID = "id";
|
||||||
|
case CPU_CLASS = "class";
|
||||||
|
case CLOCK_BASE = "clock_base";
|
||||||
|
case CLOCK_TURBO = "clock_turbo";
|
||||||
|
case CORE_COUNT_PERFORMANCE = "core_count_performance";
|
||||||
|
case CORE_COUNT_EFFICIENCY = "core_count_efficiency";
|
||||||
|
case CORE_THREADS = "core_threads";
|
||||||
|
case VENDOR_NAME = "vendor_name";
|
||||||
|
case VENDOR_MODEL = "vendor_model";
|
||||||
|
case DATE_AQUIRED = "date_aquired";
|
||||||
|
case DATE_RETIRED = "date_retired";
|
||||||
|
}
|
37
api/src/databases/models/Battlestation/Dram.php
Normal file
37
api/src/databases/models/Battlestation/Dram.php
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum DramFormfactorEnum {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
case DIMM;
|
||||||
|
case SODIMM;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum DramTechnologyEnum {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
case DDR4;
|
||||||
|
case DDR5;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum DramModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "dram";
|
||||||
|
|
||||||
|
case ID = "id";
|
||||||
|
case CAPACITY = "capacity";
|
||||||
|
case SPEED = "speed";
|
||||||
|
case FORMFACTOR = "formfactor";
|
||||||
|
case TECHNOLOGY = "technology";
|
||||||
|
case ECC = "ecc";
|
||||||
|
case BUFFERED = "buffered";
|
||||||
|
case VENDOR_NAME = "vendor_name";
|
||||||
|
case VENDOR_MODEL = "vendor_model";
|
||||||
|
case DATE_AQUIRED = "date_aquired";
|
||||||
|
case DATE_RETIRED = "date_retired";
|
||||||
|
}
|
20
api/src/databases/models/Battlestation/Gpu.php
Normal file
20
api/src/databases/models/Battlestation/Gpu.php
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum GpuModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "gpu";
|
||||||
|
|
||||||
|
case ID = "id";
|
||||||
|
case MEMORY = "memory";
|
||||||
|
case VENDOR_NAME = "vendor_name";
|
||||||
|
case VENDOR_MODEL = "vendor_model";
|
||||||
|
case VENDOR_CHIP_NAME = "vendor_chip_name";
|
||||||
|
case VENDOR_CHIP_MODEL = "vendor_chip_model";
|
||||||
|
case DATE_AQUIRED = "date_aquired";
|
||||||
|
case DATE_RETIRED = "date_retired";
|
||||||
|
}
|
30
api/src/databases/models/Battlestation/Mb.php
Normal file
30
api/src/databases/models/Battlestation/Mb.php
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum MbFormfactorEnum {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
case ATX;
|
||||||
|
case MTX;
|
||||||
|
case ITX;
|
||||||
|
case LAPTOP;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum MbModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "mb";
|
||||||
|
|
||||||
|
case ID = "id";
|
||||||
|
case FORMFACTOR = "formfactor";
|
||||||
|
case VENDOR_NAME = "vendor_name";
|
||||||
|
case VENDOR_MODEL = "vendor_model";
|
||||||
|
case NETWORK_ETHERNET = "network_ethernet";
|
||||||
|
case NETWORK_WLAN = "network_wlan";
|
||||||
|
case NETWORK_BLUETOOTH = "network_bluetooth";
|
||||||
|
case DATE_AQUIRED = "date_aquired";
|
||||||
|
case DATE_RETIRED = "date_retired";
|
||||||
|
}
|
31
api/src/databases/models/Battlestation/Psu.php
Normal file
31
api/src/databases/models/Battlestation/Psu.php
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum EightyplusRatingEnum {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
case BASE;
|
||||||
|
case BRONZE;
|
||||||
|
case SILVER;
|
||||||
|
case GOLD;
|
||||||
|
case PLATINUM;
|
||||||
|
case TITANIUM;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum PsuModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "psu";
|
||||||
|
|
||||||
|
case ID = "id";
|
||||||
|
case POWER = "power";
|
||||||
|
case VENDOR_NAME = "vendor_name";
|
||||||
|
case VENDOR_MODEL = "vendor_model";
|
||||||
|
case TYPE_MODULAR = "type_modular";
|
||||||
|
case EIGHTYPLUS_RATING = "80plus_rating";
|
||||||
|
case DATE_AQUIRED = "date_aquired";
|
||||||
|
case DATE_RETIRED = "date_retired";
|
||||||
|
}
|
45
api/src/databases/models/Battlestation/Storage.php
Normal file
45
api/src/databases/models/Battlestation/Storage.php
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace VLW\API\Databases\VLWdb\Models\Battlestation;
|
||||||
|
|
||||||
|
use victorwesterlund\xEnum;
|
||||||
|
|
||||||
|
enum StorageDiskTypeEnum {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
case SSD;
|
||||||
|
case HDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum StorageDiskInterfaceEnum {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
case SATA;
|
||||||
|
case NVME;
|
||||||
|
case USB;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum StorageDiskFormfactorEnum{
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
case TWODOTFIVE;
|
||||||
|
case THREEDOTFIVE;
|
||||||
|
case MDOTTWO;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum StorageModel: string {
|
||||||
|
use xEnum;
|
||||||
|
|
||||||
|
const TABLE = "storage";
|
||||||
|
|
||||||
|
case ID = "id";
|
||||||
|
case DISK_TYPE = "disk_type";
|
||||||
|
case DISK_SIZE = "disk_size";
|
||||||
|
case DISK_SECTORS = "disk_sectors";
|
||||||
|
case DISK_INTERFACE = "disk_interface";
|
||||||
|
case DISK_FORMFACTOR = "disk_formfactor";
|
||||||
|
case VENDOR_NAME = "vendor_name";
|
||||||
|
case VENDOR_MODEL = "vendor_model";
|
||||||
|
case DATE_AQUIRED = "date_aquired";
|
||||||
|
case DATE_RETIRED = "date_retired";
|
||||||
|
}
|
252
assets/css/pages/about/battlestation.css
Normal file
252
assets/css/pages/about/battlestation.css
Normal file
|
@ -0,0 +1,252 @@
|
||||||
|
/* # Overrides */
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--primer-color-accent: 148, 255, 21;
|
||||||
|
--color-accent: rgb(var(--primer-color-accent));
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: var(--padding);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* # Content */
|
||||||
|
|
||||||
|
/* ## Heading */
|
||||||
|
|
||||||
|
section.heading h1::before,
|
||||||
|
section.heading h1::after {
|
||||||
|
opacity: .4;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.heading h1::before {
|
||||||
|
content: "“";
|
||||||
|
}
|
||||||
|
|
||||||
|
section.heading h1::after {
|
||||||
|
content: "”";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ## Config */
|
||||||
|
|
||||||
|
section.config {
|
||||||
|
position: relative;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 300px 1fr;
|
||||||
|
gap: calc(var(--padding) * 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config:nth-child(4n+1) {
|
||||||
|
grid-template-columns: 1fr 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config:nth-child(4n+1) > svg {
|
||||||
|
order: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ### PC */
|
||||||
|
|
||||||
|
section.config > svg {
|
||||||
|
position: sticky;
|
||||||
|
top: calc(var(--running-size) + var(--padding));
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config > svg :is(rect, path) {
|
||||||
|
transition: 300ms;
|
||||||
|
stroke: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config > svg.active :is(rect, path),
|
||||||
|
section.config > svg:hover :is(rect, path) {
|
||||||
|
opacity: .4;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config > svg g.active rect,
|
||||||
|
section.config > svg g.active path,
|
||||||
|
section.config > svg g:not(.group):hover rect,
|
||||||
|
section.config > svg g:not(.group):hover path {
|
||||||
|
opacity: 1;
|
||||||
|
stroke: var(--color-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config > svg g.active rect,
|
||||||
|
section.config > svg g:not(.group):hover rect {
|
||||||
|
filter: drop-shadow(0 0 10px rgba(var(--primer-color-accent), .4));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #### Case */
|
||||||
|
|
||||||
|
section.config g.case:not(:hover, .active) :is(rect, path) {
|
||||||
|
opacity: .2;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config > svg g.active path,
|
||||||
|
section.config > svg g:not(.group):hover path {
|
||||||
|
fill: var(--color-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #### Motherboard */
|
||||||
|
|
||||||
|
section.config > svg .mb .chips {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #### Active states */
|
||||||
|
|
||||||
|
section.config > svg g:not(.group) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config[data-dram="1"] > svg g.drams g.dram:nth-child(1),
|
||||||
|
section.config[data-dram="2"] > svg g.drams g.dram:nth-child(3n+1),
|
||||||
|
section.config[data-dram="3"] > svg g.drams g.dram:nth-child(-n+3),
|
||||||
|
section.config[data-dram="4"] > svg g.drams g.dram,
|
||||||
|
|
||||||
|
section.config[data-drives-mdottwo="1"] > svg g.mdottwo g.drive:nth-child(1),
|
||||||
|
section.config[data-drives-mdottwo="2"] > svg g.mdottwo g.drive:nth-child(-n+2),
|
||||||
|
section.config[data-drives-mdottwo="3"] > svg g.mdottwo g.drive:nth-child(-n+3),
|
||||||
|
|
||||||
|
section.config[data-drives-twodotfive="1"] > svg g.twodotfive g.drive:nth-child(1),
|
||||||
|
section.config[data-drives-twodotfive="2"] > svg g.twodotfive g.drive:nth-child(-n+2),
|
||||||
|
section.config[data-drives-twodotfive="3"] > svg g.twodotfive g.drive:nth-child(-n+3),
|
||||||
|
|
||||||
|
section.config[data-drives-threedotfive="1"] > svg g.threedotfive g.drive:nth-child(1),
|
||||||
|
section.config[data-drives-threedotfive="2"] > svg g.threedotfive g.drive:nth-child(-n+2),
|
||||||
|
section.config[data-drives-threedotfive="3"] > svg g.threedotfive g.drive:nth-child(-n+3),
|
||||||
|
|
||||||
|
section.config[data-mb="1"] > svg g.mb,
|
||||||
|
section.config[data-psu="1"] > svg g.psu,
|
||||||
|
section.config[data-gpu="1"] > svg g.gpu,
|
||||||
|
section.config[data-cpu="1"] > svg g.cpu,
|
||||||
|
section.config[data-case="1"] > svg g.case {
|
||||||
|
display: initial;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ## Specs */
|
||||||
|
|
||||||
|
section.config .specs {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: calc(var(--padding) / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs :is(.spec, .group) {
|
||||||
|
--border-width: 4px;
|
||||||
|
|
||||||
|
transition: 300ms background-color, 300ms border-color, 500ms box-shadow;
|
||||||
|
padding: calc(var(--padding) - var(--border-width));
|
||||||
|
border: solid var(--border-width) transparent;
|
||||||
|
background-color: rgba(255, 255, 255, .03);
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs :is(.spec, .group) * {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ### Spec */
|
||||||
|
|
||||||
|
section.config .specs .spec {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .spec:hover {
|
||||||
|
border-color: rgba(255, 255, 255, .05);
|
||||||
|
background-color: rgba(255, 255, 255, .1);
|
||||||
|
box-shadow: 0 0 30px 10px rgba(255, 255, 255, .05);
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .spec.active {
|
||||||
|
border-color: var(--color-accent);
|
||||||
|
background-color: rgba(var(--primer-color-accent), .1);
|
||||||
|
box-shadow: 0 0 30px 10px rgba(var(--primer-color-accent), .05);
|
||||||
|
cursor: initial;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .spec h3 {
|
||||||
|
color: rgba(255, 255, 255, .3);
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .spec span {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .spec > div {
|
||||||
|
display: none;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
gap: calc(var(--padding) / 2);
|
||||||
|
margin-top: var(--padding);
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .spec.active > div {
|
||||||
|
display: grid;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .spec > div label {
|
||||||
|
color: var(--color-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .spec > svg {
|
||||||
|
display: none;
|
||||||
|
height: calc(var(--padding) / 2);
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: calc(var(--padding) / 2);
|
||||||
|
fill: var(--color-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ### Group */
|
||||||
|
|
||||||
|
section.config .specs .group {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .group.active {
|
||||||
|
background-color: rgba(255, 255, 255, .2);
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .group:hover {
|
||||||
|
background-color: rgba(255, 255, 255, .1);
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .group.active:hover {
|
||||||
|
background-color: rgba(255, 255, 255, .3);
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .group > svg {
|
||||||
|
transition: 300ms transform;
|
||||||
|
fill: var(--color-accent);
|
||||||
|
height: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .group.active > svg {
|
||||||
|
transform: rotateX(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #### Collection */
|
||||||
|
|
||||||
|
section.config .specs .collection {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config .specs .group.active + .collection {
|
||||||
|
display: contents;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* # Size quries */
|
||||||
|
|
||||||
|
@media (max-width: 700px) {
|
||||||
|
section.config,
|
||||||
|
section.config:nth-child(4n+1) {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
section.config > svg {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
65
assets/js/pages/about/battlestation.js
Normal file
65
assets/js/pages/about/battlestation.js
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
new vv.Interactions("battlestation", {
|
||||||
|
toggleGroup: (event) => {
|
||||||
|
// Collapse self if already active and current target
|
||||||
|
if (event.target.classList.contains("active")) {
|
||||||
|
return event.target.classList.remove("active");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Collapse all and open current target
|
||||||
|
[...event.target.closest(".specs").querySelectorAll(".group")].forEach(element => element.classList.remove("active"));
|
||||||
|
event.target.classList.add("active");
|
||||||
|
},
|
||||||
|
setSpecActive: (event) => {
|
||||||
|
event.target.classList.add("active");
|
||||||
|
|
||||||
|
event.target.addEventListener("mouseleave", () => event.target.classList.remove("active"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Bind hover listeners for components in the SVGs
|
||||||
|
[...document.querySelectorAll("section.config g:not(.group)")].forEach(element => {
|
||||||
|
element.addEventListener("mouseenter", () => {
|
||||||
|
// Find an element in the most adjacent speclist and highlighit it
|
||||||
|
const target = element.closest("section.config").querySelector(`.spec[data-target="${element.dataset.target}"]`);
|
||||||
|
// Spec item is part of a collection, we need to expand the group if that is the case
|
||||||
|
const collection = target.closest(".collection") ?? null;
|
||||||
|
// Don't close the group after hove ends
|
||||||
|
let closeGroupOnLeave = false;
|
||||||
|
|
||||||
|
target.classList.add("active");
|
||||||
|
|
||||||
|
if (collection) {
|
||||||
|
// Close the group on leave if the group wasn't active before hovering
|
||||||
|
closeGroupOnLeave = !collection.previousElementSibling.classList.contains("active");
|
||||||
|
|
||||||
|
collection.previousElementSibling.classList.add("active");
|
||||||
|
}
|
||||||
|
|
||||||
|
//window.scrollTo(0, target.offsetTop);
|
||||||
|
|
||||||
|
// Bind hover leave listener
|
||||||
|
element.addEventListener("mouseleave", () => {
|
||||||
|
target.classList.remove("active");
|
||||||
|
|
||||||
|
if (closeGroupOnLeave) {
|
||||||
|
collection.previousElementSibling.classList.remove("active");
|
||||||
|
}
|
||||||
|
}, { once: true });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Bind event listeners for components in the spec lists
|
||||||
|
[...document.querySelectorAll("section.config .spec:not(.group)")].forEach(element => {
|
||||||
|
element.addEventListener("mouseenter", () => {
|
||||||
|
const svgTarget = element.closest("section.config").querySelector(`svg`);
|
||||||
|
const target = svgTarget.querySelector(`svg g[data-target="${element.dataset.target}"]`);
|
||||||
|
|
||||||
|
svgTarget.classList.add("active");
|
||||||
|
target.classList.add("active");
|
||||||
|
|
||||||
|
element.addEventListener("mouseleave", () => {
|
||||||
|
svgTarget.classList.remove("active");
|
||||||
|
target.classList.remove("active");
|
||||||
|
}, { once: true });
|
||||||
|
});
|
||||||
|
});
|
173
assets/media/battlestation.svg
Normal file
173
assets/media/battlestation.svg
Normal file
|
@ -0,0 +1,173 @@
|
||||||
|
<svg viewBox="0 0 236 288" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<mask fill="#fff" id="a"><path d="M19 269a1 1 0 0 1-1-1v-11a1 1 0 0 1 1-1v13Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="b"><path d="M87 241a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1v-7Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="c"><path d="M87 251a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1v-7Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="d"><path d="M179 272.051c0-.58.471-1.051 1.051-1.051h8.898c.58 0 1.051.471 1.051 1.051h-11Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="e"><path d="M191 272.051c0-.58.471-1.051 1.051-1.051h2.898c.58 0 1.051.471 1.051 1.051h-5Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="f"><path d="M179 257.333c0-.58.471-1.051 1.051-1.051h8.898c.58 0 1.051.471 1.051 1.051h-11Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="g"><path d="M191 257.333c0-.58.471-1.051 1.051-1.051h2.898c.58 0 1.051.471 1.051 1.051h-5Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="h"><path d="M179 242.615c0-.58.471-1.051 1.051-1.051h8.898c.58 0 1.051.471 1.051 1.051h-11Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="i"><path d="M191 242.615c0-.58.471-1.051 1.051-1.051h2.898c.58 0 1.051.471 1.051 1.051h-5Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="j"><path d="M133 257.333c0-.58.471-1.051 1.051-1.051h8.898c.58 0 1.051.471 1.051 1.051h-11Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="k"><path d="M145 257.333c0-.58.471-1.051 1.051-1.051h2.898c.58 0 1.051.471 1.051 1.051h-5Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="l"><path d="M133 242.615c0-.58.471-1.051 1.051-1.051h8.898c.58 0 1.051.471 1.051 1.051h-11Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="m"><path d="M145 242.615c0-.58.471-1.051 1.051-1.051h2.898c.58 0 1.051.471 1.051 1.051h-5Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="n"><path d="M133 272.051c0-.58.471-1.051 1.051-1.051h8.898c.58 0 1.051.471 1.051 1.051h-11Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="o"><path d="M145 272.051c0-.58.471-1.051 1.051-1.051h2.898c.58 0 1.051.471 1.051 1.051h-5Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="p"><path d="M186 40a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1h-11Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="q"><path d="M198 40a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1h-5Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="r"><path d="M186 51a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1h-11Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="s"><path d="M198 51a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1h-5Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="t"><path d="M186 62a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1h-11Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="u"><path d="M198 62a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1h-5Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="v"><path d="M186 73a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1h-11Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="w"><path d="M198 73a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1h-5Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="x"><path d="M129.535 123.781h-1.082a.453.453 0 0 1 0-.906h1.082v.906Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="y"><path d="M129.535 115.625h-1.082a.453.453 0 0 1 0-.906h1.082v.906Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="z"><path d="M129.535 121.969H129a1 1 0 0 1-1-1v-3.438a1 1 0 0 1 1-1h.535v5.438Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="A"><path d="M92.535 123.781h-1.082a.453.453 0 0 1 0-.906h1.082v.906Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="B"><path d="M92.535 115.625h-1.082a.453.453 0 0 1 0-.906h1.082v.906Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="C"><path d="M92.535 121.969H92a1 1 0 0 1-1-1v-3.438a1 1 0 0 1 1-1h.535v5.438Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="D"><path d="M68 143v-2a1 1 0 0 1 1-1h29a1 1 0 0 1 1 1v2H68Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="E"><path d="M101 143v-2a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v2h-3Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="F"><path d="M64 143v-2a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v2h-3Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="G"><path d="M55.535 123.781h-1.082a.453.453 0 0 1 0-.906h1.082v.906Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="H"><path d="M55.535 115.625h-1.082a.453.453 0 0 1 0-.906h1.082v.906Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="I"><path d="M55.535 121.969H55a1 1 0 0 1-1-1v-3.438a1 1 0 0 1 1-1h.535v5.438Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="J"><path d="M76 38h1a1 1 0 0 1 1 1v33a1 1 0 0 1-1 1h-1V38Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="K"><path d="M76 76h1a1 1 0 0 1 1 1v22a1 1 0 0 1-1 1h-1V76Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="L"><path d="M60 38h1a1 1 0 0 1 1 1v33a1 1 0 0 1-1 1h-1V38Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="M"><path d="M60 76h1a1 1 0 0 1 1 1v22a1 1 0 0 1-1 1h-1V76Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="N"><path d="M137 100h-1a1 1 0 0 1-1-1V66a1 1 0 0 1 1-1h1v35Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="O"><path d="M137 62h-1a1 1 0 0 1-1-1V39a1 1 0 0 1 1-1h1v24Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="P"><path d="M155 100h-1a1 1 0 0 1-1-1V66a1 1 0 0 1 1-1h1v35Z"></path></mask>
|
||||||
|
<mask fill="#fff" id="Q"><path d="M155 62h-1a1 1 0 0 1-1-1V39a1 1 0 0 1 1-1h1v24Z"></path></mask>
|
||||||
|
<g data-target="case" data-index="1" class="case">
|
||||||
|
<rect height="278" rx="3" stroke="#fff" stroke-width="6" width="230" x="3" y="7"></rect>
|
||||||
|
<path d="M20.639 216.906a2 2 0 0 1 1.674-.906h192.14a2 2 0 0 1 1.756 1.043l2.18 4c.726 1.333-.239 2.957-1.756 2.957H19.697c-1.589 0-2.543-1.764-1.674-3.094l2.616-4ZM5.451.793A2 2 0 0 1 7.046 0h222.808a2 2 0 0 1 1.692.934l2.521 4c.84 1.331-.118 3.066-1.692 3.066H4.021C2.369 8 1.429 6.11 2.425 4.793l3.026-4Z" fill="#fff"></path>
|
||||||
|
</g>
|
||||||
|
<g data-target="psu" class="psu">
|
||||||
|
<path d="M20 268v-11h-4v11h4Zm-3-12v13h4v-13h-4Zm3 1a1 1 0 0 1-1 1v-4a3 3 0 0 0-3 3h4Zm-1 10a1 1 0 0 1 1 1h-4a3 3 0 0 0 3 3v-4Z" fill="#fff" mask="url(#a)"></path>
|
||||||
|
<path d="M86 242v5h4v-5h-4Zm3 6v-7h-4v7h4Zm-3-1a1 1 0 0 1 1-1v4a3 3 0 0 0 3-3h-4Zm1-4a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Z" fill="#fff" mask="url(#b)"></path>
|
||||||
|
<path d="M86 252v5h4v-5h-4Zm3 6v-7h-4v7h4Zm-3-1a1 1 0 0 1 1-1v4a3 3 0 0 0 3-3h-4Zm1-4a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Z" fill="#fff" mask="url(#c)"></path>
|
||||||
|
<rect height="38" rx="3.5" stroke="#fff" stroke-width="3" width="65" x="20.5" y="234.5"></rect>
|
||||||
|
</g>
|
||||||
|
<g class="group drives threedotfive">
|
||||||
|
<g data-target="drive" class="drive">
|
||||||
|
<rect height="9.564" rx="2" stroke="#fff" stroke-width="2" width="41" x="176" y="263.436"></rect>
|
||||||
|
<path d="M180.051 273h8.898v-4h-8.898v4Zm9.949-2.949h-11v4h11v-4ZM188.949 273a.95.95 0 0 1-.949-.949h4a3.051 3.051 0 0 0-3.051-3.051v4Zm-8.898-4a3.051 3.051 0 0 0-3.051 3.051h4a.95.95 0 0 1-.949.949v-4Z" fill="#fff" mask="url(#d)"></path>
|
||||||
|
<path d="M192.051 273h2.898v-4h-2.898v4Zm3.949-2.949h-5v4h5v-4ZM194.949 273a.95.95 0 0 1-.949-.949h4a3.051 3.051 0 0 0-3.051-3.051v4Zm-2.898-4a3.051 3.051 0 0 0-3.051 3.051h4a.95.95 0 0 1-.949.949v-4Z" fill="#fff" mask="url(#e)"></path>
|
||||||
|
</g>
|
||||||
|
<g data-target="drive" class="drive">
|
||||||
|
<rect height="9.564" rx="2" stroke="#fff" stroke-width="2" width="41" x="176" y="248.718"></rect>
|
||||||
|
<path d="M192.051 258.282h2.898v-4h-2.898v4Zm3.949-2.949h-5v4h5v-4Zm-1.051 2.949a.95.95 0 0 1-.949-.949h4a3.051 3.051 0 0 0-3.051-3.051v4Zm-2.898-4a3.051 3.051 0 0 0-3.051 3.051h4a.95.95 0 0 1-.949.949v-4Z" fill="#fff" mask="url(#g)"></path>
|
||||||
|
<path d="M180.051 258.282h8.898v-4h-8.898v4Zm9.949-2.949h-11v4h11v-4Zm-1.051 2.949a.95.95 0 0 1-.949-.949h4a3.051 3.051 0 0 0-3.051-3.051v4Zm-8.898-4a3.051 3.051 0 0 0-3.051 3.051h4a.95.95 0 0 1-.949.949v-4Z" fill="#fff" mask="url(#f)"></path>
|
||||||
|
</g>
|
||||||
|
<g data-target="drive" class="drive">
|
||||||
|
<rect height="9.564" rx="2" stroke="#fff" stroke-width="2" width="41" x="176" y="234"></rect>
|
||||||
|
<path d="M192.051 243.564h2.898v-4h-2.898v4Zm3.949-2.949h-5v4h5v-4Zm-1.051 2.949a.95.95 0 0 1-.949-.949h4a3.051 3.051 0 0 0-3.051-3.051v4Zm-2.898-4a3.051 3.051 0 0 0-3.051 3.051h4a.95.95 0 0 1-.949.949v-4Z" fill="#fff" mask="url(#i)"></path>
|
||||||
|
<path d="M180.051 243.564h8.898v-4h-8.898v4Zm9.949-2.949h-11v4h11v-4Zm-1.051 2.949a.95.95 0 0 1-.949-.949h4a3.051 3.051 0 0 0-3.051-3.051v4Zm-8.898-4a3.051 3.051 0 0 0-3.051 3.051h4a.95.95 0 0 1-.949.949v-4Z" fill="#fff" mask="url(#h)"></path>
|
||||||
|
</g>
|
||||||
|
<g data-target="drive" class="drive">
|
||||||
|
<rect height="9.564" rx="2" stroke="#fff" stroke-width="2" width="41" x="130" y="248.718"></rect>
|
||||||
|
<path d="M134.051 258.282h8.898v-4h-8.898v4Zm9.949-2.949h-11v4h11v-4Zm-1.051 2.949a.95.95 0 0 1-.949-.949h4a3.051 3.051 0 0 0-3.051-3.051v4Zm-8.898-4a3.051 3.051 0 0 0-3.051 3.051h4a.95.95 0 0 1-.949.949v-4Z" fill="#fff" mask="url(#j)"></path>
|
||||||
|
<path d="M146.051 258.282h2.898v-4h-2.898v4Zm3.949-2.949h-5v4h5v-4Zm-1.051 2.949a.95.95 0 0 1-.949-.949h4a3.051 3.051 0 0 0-3.051-3.051v4Zm-2.898-4a3.051 3.051 0 0 0-3.051 3.051h4a.95.95 0 0 1-.949.949v-4Z" fill="#fff" mask="url(#k)"></path>
|
||||||
|
</g>
|
||||||
|
<g data-target="drive" class="drive">
|
||||||
|
<rect height="9.564" rx="2" stroke="#fff" stroke-width="2" width="41" x="130" y="234"></rect>
|
||||||
|
<path d="M134.051 243.564h8.898v-4h-8.898v4Zm9.949-2.949h-11v4h11v-4Zm-1.051 2.949a.95.95 0 0 1-.949-.949h4a3.051 3.051 0 0 0-3.051-3.051v4Zm-8.898-4a3.051 3.051 0 0 0-3.051 3.051h4a.95.95 0 0 1-.949.949v-4Z" fill="#fff" mask="url(#l)"></path>
|
||||||
|
<path d="M146.051 243.564h2.898v-4h-2.898v4Zm3.949-2.949h-5v4h5v-4Zm-1.051 2.949a.95.95 0 0 1-.949-.949h4a3.051 3.051 0 0 0-3.051-3.051v4Zm-2.898-4a3.051 3.051 0 0 0-3.051 3.051h4a.95.95 0 0 1-.949.949v-4Z" fill="#fff" mask="url(#m)"></path>
|
||||||
|
</g>
|
||||||
|
<g data-target="drive" class="drive">
|
||||||
|
<rect height="9.564" rx="2" stroke="#fff" stroke-width="2" width="41" x="130" y="263.436"></rect>
|
||||||
|
<path d="M134.051 273h8.898v-4h-8.898v4Zm9.949-2.949h-11v4h11v-4ZM142.949 273a.95.95 0 0 1-.949-.949h4a3.051 3.051 0 0 0-3.051-3.051v4Zm-8.898-4a3.051 3.051 0 0 0-3.051 3.051h4a.95.95 0 0 1-.949.949v-4Z" fill="#fff" mask="url(#n)"></path>
|
||||||
|
<path d="M146.051 273h2.898v-4h-2.898v4Zm3.949-2.949h-5v4h5v-4ZM148.949 273a.95.95 0 0 1-.949-.949h4a3.051 3.051 0 0 0-3.051-3.051v4Zm-2.898-4a3.051 3.051 0 0 0-3.051 3.051h4a.95.95 0 0 1-.949.949v-4Z" fill="#fff" mask="url(#o)"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g class="group drives twodotfive">
|
||||||
|
<g data-target="drive" class="drive">
|
||||||
|
<rect height="5" rx="2" stroke="#fff" stroke-width="2" width="41" x="183" y="36"></rect>
|
||||||
|
<path d="M187 41h9v-4h-9v4Zm10-3h-11v4h11v-4Zm-1 3a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Zm-9-4a3 3 0 0 0-3 3h4a1 1 0 0 1-1 1v-4Z" fill="#fff" mask="url(#p)"></path>
|
||||||
|
<path d="M199 41h3v-4h-3v4Zm4-3h-5v4h5v-4Zm-1 3a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Zm-3-4a3 3 0 0 0-3 3h4a1 1 0 0 1-1 1v-4Z" fill="#fff" mask="url(#q)"></path>
|
||||||
|
</g>
|
||||||
|
<g data-target="drive" class="drive">
|
||||||
|
<rect height="5" rx="2" stroke="#fff" stroke-width="2" width="41" x="183" y="47"></rect>
|
||||||
|
<path d="M187 52h9v-4h-9v4Zm10-3h-11v4h11v-4Zm-1 3a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Zm-9-4a3 3 0 0 0-3 3h4a1 1 0 0 1-1 1v-4Z" fill="#fff" mask="url(#r)"></path>
|
||||||
|
<path d="M199 52h3v-4h-3v4Zm4-3h-5v4h5v-4Zm-1 3a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Zm-3-4a3 3 0 0 0-3 3h4a1 1 0 0 1-1 1v-4Z" fill="#fff" mask="url(#s)"></path>
|
||||||
|
</g>
|
||||||
|
<g data-target="drive" class="drive">
|
||||||
|
<rect height="5" rx="2" stroke="#fff" stroke-width="2" width="41" x="183" y="58"></rect>
|
||||||
|
<path d="M187 63h9v-4h-9v4Zm10-3h-11v4h11v-4Zm-1 3a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Zm-9-4a3 3 0 0 0-3 3h4a1 1 0 0 1-1 1v-4Z" fill="#fff" mask="url(#t)"></path>
|
||||||
|
<path d="M199 63h3v-4h-3v4Zm4-3h-5v4h5v-4Zm-1 3a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Zm-3-4a3 3 0 0 0-3 3h4a1 1 0 0 1-1 1v-4Z" fill="#fff" mask="url(#u)"></path>
|
||||||
|
</g>
|
||||||
|
<g data-target="drive" class="drive">
|
||||||
|
<rect height="5" rx="2" stroke="#fff" stroke-width="2" width="41" x="183" y="69"></rect>
|
||||||
|
<path d="M187 74h9v-4h-9v4Zm10-3h-11v4h11v-4Zm-1 3a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Zm-9-4a3 3 0 0 0-3 3h4a1 1 0 0 1-1 1v-4Z" fill="#fff" mask="url(#v)"></path>
|
||||||
|
<path d="M199 74h3v-4h-3v4Zm4-3h-5v4h5v-4Zm-1 3a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Zm-3-4a3 3 0 0 0-3 3h4a1 1 0 0 1-1 1v-4Z" fill="#fff" mask="url(#w)"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g data-target="mb" class="mb">
|
||||||
|
<rect height="176" rx="3.5" stroke="#fff" stroke-width="3" width="152" x="22.5" y="25.5"></rect>
|
||||||
|
<path d="m31.19 123.309-.01.007-7.32 5.782c-1.968 1.554-4.86.153-4.86-2.354V42a3 3 0 0 1 3-3h15a3 3 0 0 1 3 3v73.048c0 .931-.432 1.81-1.17 2.377l-7.64 5.884Z" fill="#fff"></path>
|
||||||
|
<path d="m31.19 123.309-.01.007-7.32 5.782c-1.968 1.554-4.86.153-4.86-2.354V42a3 3 0 0 1 3-3h15a3 3 0 0 1 3 3v73.048c0 .931-.432 1.81-1.17 2.377l-7.64 5.884Z" stroke="#fff" stroke-width="2"></path>
|
||||||
|
<g class="chips">
|
||||||
|
<rect fill="#fff" height="13" rx="2" width="13" x="23" y="44"></rect>
|
||||||
|
<rect fill="#fff" height="13" rx="2" width="13" x="23" y="61"></rect>
|
||||||
|
<rect fill="#fff" height="13" rx="2" width="13" x="23" y="78"></rect>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g class="group drives mdottwo">
|
||||||
|
<g data-target="drive" class="drive">
|
||||||
|
<path d="M129.535 123.781v2h2v-2h-2Zm0-.906h2v-2h-2v2Zm0-1.094h-1.082v4h1.082v-4Zm-1.082 3.094h1.082v-4h-1.082v4Zm-.918-2v.906h4v-.906h-4Zm2.465.453c0 .854-.693 1.547-1.547 1.547v-4a2.453 2.453 0 0 0-2.453 2.453h4Zm-1.547-1.547c.854 0 1.547.693 1.547 1.547h-4a2.453 2.453 0 0 0 2.453 2.453v-4Z" fill="#fff" mask="url(#x)"></path>
|
||||||
|
<path d="M129.535 115.625v2h2v-2h-2Zm0-.906h2v-2h-2v2Zm0-1.094h-1.082v4h1.082v-4Zm-1.082 3.094h1.082v-4h-1.082v4Zm-.918-2v.906h4v-.906h-4Zm2.465.453c0 .854-.693 1.547-1.547 1.547v-4a2.453 2.453 0 0 0-2.453 2.453h4Zm-1.547-1.547c.854 0 1.547.693 1.547 1.547h-4a2.453 2.453 0 0 0 2.453 2.453v-4Z" fill="#fff" mask="url(#y)"></path>
|
||||||
|
<path d="M129.535 121.969v2h2v-2h-2Zm0-5.438h2v-2h-2v2Zm0 3.438H129v4h.535v-4Zm.465 1v-3.438h-4v3.438h4Zm-1-2.438h.535v-4H129v4Zm-1.465-2v5.438h4v-5.438h-4Zm2.465 1a1 1 0 0 1-1 1v-4a3 3 0 0 0-3 3h4Zm-1 2.438a1 1 0 0 1 1 1h-4a3 3 0 0 0 3 3v-4Z" fill="#fff" mask="url(#z)"></path>
|
||||||
|
<rect height="12.5" rx="2" stroke="#fff" stroke-width="2" width="29.465" x="130.535" y="113"></rect>
|
||||||
|
</g>
|
||||||
|
<g data-target="drive" class="drive">
|
||||||
|
<path d="M92.535 123.781v2h2v-2h-2Zm0-.906h2v-2h-2v2Zm0-1.094h-1.082v4h1.082v-4Zm-1.082 3.094h1.082v-4h-1.082v4Zm-.918-2v.906h4v-.906h-4Zm2.465.453c0 .854-.693 1.547-1.547 1.547v-4A2.453 2.453 0 0 0 89 123.328h4Zm-1.547-1.547c.854 0 1.547.693 1.547 1.547h-4a2.453 2.453 0 0 0 2.453 2.453v-4Z" fill="#fff" mask="url(#A)"></path>
|
||||||
|
<path d="M92.535 115.625v2h2v-2h-2Zm0-.906h2v-2h-2v2Zm0-1.094h-1.082v4h1.082v-4Zm-1.082 3.094h1.082v-4h-1.082v4Zm-.918-2v.906h4v-.906h-4Zm2.465.453c0 .854-.693 1.547-1.547 1.547v-4A2.453 2.453 0 0 0 89 115.172h4Zm-1.547-1.547c.854 0 1.547.693 1.547 1.547h-4a2.453 2.453 0 0 0 2.453 2.453v-4Z" fill="#fff" mask="url(#B)"></path>
|
||||||
|
<path d="M92.535 121.969v2h2v-2h-2Zm0-5.438h2v-2h-2v2Zm0 3.438H92v4h.535v-4Zm.465 1v-3.438h-4v3.438h4Zm-1-2.438h.535v-4H92v4Zm-1.465-2v5.438h4v-5.438h-4Zm2.465 1a1 1 0 0 1-1 1v-4a3 3 0 0 0-3 3h4Zm-1 2.438a1 1 0 0 1 1 1h-4a3 3 0 0 0 3 3v-4Z" fill="#fff" mask="url(#C)"></path>
|
||||||
|
<rect height="12.5" rx="2" stroke="#fff" stroke-width="2" width="29.465" x="93.535" y="113"></rect>
|
||||||
|
</g>
|
||||||
|
<g data-target="drive" class="drive">
|
||||||
|
<path d="M55.535 123.781v2h2v-2h-2Zm0-.906h2v-2h-2v2Zm0-1.094h-1.082v4h1.082v-4Zm-1.082 3.094h1.082v-4h-1.082v4Zm-.918-2v.906h4v-.906h-4Zm2.465.453c0 .854-.693 1.547-1.547 1.547v-4A2.453 2.453 0 0 0 52 123.328h4Zm-1.547-1.547c.854 0 1.547.693 1.547 1.547h-4a2.453 2.453 0 0 0 2.453 2.453v-4Z" fill="#fff" mask="url(#G)"></path>
|
||||||
|
<path d="M55.535 115.625v2h2v-2h-2Zm0-.906h2v-2h-2v2Zm0-1.094h-1.082v4h1.082v-4Zm-1.082 3.094h1.082v-4h-1.082v4Zm-.918-2v.906h4v-.906h-4Zm2.465.453c0 .854-.693 1.547-1.547 1.547v-4A2.453 2.453 0 0 0 52 115.172h4Zm-1.547-1.547c.854 0 1.547.693 1.547 1.547h-4a2.453 2.453 0 0 0 2.453 2.453v-4Z" fill="#fff" mask="url(#H)"></path>
|
||||||
|
<path d="M55.535 121.969v2h2v-2h-2Zm0-5.438h2v-2h-2v2Zm0 3.438H55v4h.535v-4Zm.465 1v-3.438h-4v3.438h4Zm-1-2.438h.535v-4H55v4Zm-1.465-2v5.438h4v-5.438h-4Zm2.465 1a1 1 0 0 1-1 1v-4a3 3 0 0 0-3 3h4Zm-1 2.438a1 1 0 0 1 1 1h-4a3 3 0 0 0 3 3v-4Z" fill="#fff" mask="url(#I)"></path>
|
||||||
|
<rect height="12.5" rx="2" stroke="#fff" stroke-width="2" width="29.465" x="56.535" y="113"></rect>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g data-target="gpu" class="gpu">
|
||||||
|
<path d="M59 148h86" stroke="#fff" stroke-linecap="round"></path>
|
||||||
|
<path d="M59.5 136a1.5 1.5 0 0 0-3 0h3Zm0 8v-8h-3v8h3Z" fill="#fff"></path>
|
||||||
|
<path d="M68 143v-2a1 1 0 0 1 1-1h29a1 1 0 0 1 1 1v2H68Z" mask="url(#D)" stroke="#fff" stroke-width="3"></path>
|
||||||
|
<path d="M101 143v-2a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v2h-3Z" mask="url(#E)" stroke="#fff" stroke-width="3"></path>
|
||||||
|
<path d="M64 143v-2a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v2h-3Z" mask="url(#F)" stroke="#fff" stroke-width="3"></path>
|
||||||
|
<path d="M55 147a3 3 0 0 1 3-3h88a3 3 0 0 1 3 3v.525c0 .237-.028.473-.083.703l-2.764 11.474a3.001 3.001 0 0 1-2.917 2.298H58a3 3 0 0 1-3-3v-12Z" stroke="#fff" stroke-width="2"></path>
|
||||||
|
</g>
|
||||||
|
<g class="group drams">
|
||||||
|
<g data-target="dram" class="dram">
|
||||||
|
<path d="M60 38v-2h-2v2h2Zm0 35h-2v2h2v-2Zm0-33h1v-4h-1v4Zm0-1v33h4V39h-4Zm1 32h-1v4h1v-4Zm1 2V38h-4v35h4Zm-2-1a1 1 0 0 1 1-1v4a3 3 0 0 0 3-3h-4Zm1-32a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Z" fill="#fff" mask="url(#L)"></path>
|
||||||
|
<path d="M60 76v-2h-2v2h2Zm0 24h-2v2h2v-2Zm0-22h1v-4h-1v4Zm0-1v22h4V77h-4Zm1 21h-1v4h1v-4Zm1 2V76h-4v24h4Zm-2-1a1 1 0 0 1 1-1v4a3 3 0 0 0 3-3h-4Zm1-21a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Z" fill="#fff" mask="url(#M)"></path>
|
||||||
|
<rect height="66" rx="2" stroke="#fff" stroke-width="2" width="4" x="55" y="36"></rect>
|
||||||
|
</g>
|
||||||
|
<g data-target="dram" class="dram">
|
||||||
|
<path d="M76 38v-2h-2v2h2Zm0 35h-2v2h2v-2Zm0-33h1v-4h-1v4Zm0-1v33h4V39h-4Zm1 32h-1v4h1v-4Zm1 2V38h-4v35h4Zm-2-1a1 1 0 0 1 1-1v4a3 3 0 0 0 3-3h-4Zm1-32a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Z" fill="#fff" mask="url(#J)"></path>
|
||||||
|
<path d="M76 76v-2h-2v2h2Zm0 24h-2v2h2v-2Zm0-22h1v-4h-1v4Zm0-1v22h4V77h-4Zm1 21h-1v4h1v-4Zm1 2V76h-4v24h4Zm-2-1a1 1 0 0 1 1-1v4a3 3 0 0 0 3-3h-4Zm1-21a1 1 0 0 1-1-1h4a3 3 0 0 0-3-3v4Z" fill="#fff" mask="url(#K)"></path>
|
||||||
|
<rect height="66" rx="2" stroke="#fff" stroke-width="2" width="4" x="71" y="36"></rect>
|
||||||
|
</g>
|
||||||
|
<g data-target="dram" class="dram">
|
||||||
|
<path d="M137 100v2h2v-2h-2Zm0-35h2v-2h-2v2Zm0 33h-1v4h1v-4Zm0 1V66h-4v33h4Zm-1-32h1v-4h-1v4Zm-1-2v35h4V65h-4Zm2 1a1 1 0 0 1-1 1v-4a3 3 0 0 0-3 3h4Zm-1 32a1 1 0 0 1 1 1h-4a3 3 0 0 0 3 3v-4Z" fill="#fff" mask="url(#N)"></path>
|
||||||
|
<path d="M137 62v2h2v-2h-2Zm0-24h2v-2h-2v2Zm0 22h-1v4h1v-4Zm0 1V39h-4v22h4Zm-1-21h1v-4h-1v4Zm-1-2v24h4V38h-4Zm2 1a1 1 0 0 1-1 1v-4a3 3 0 0 0-3 3h4Zm-1 21a1 1 0 0 1 1 1h-4a3 3 0 0 0 3 3v-4Z" fill="#fff" mask="url(#O)"></path>
|
||||||
|
<rect height="66" rx="2" stroke="#fff" stroke-width="2" transform="rotate(180 142 102)" width="4" x="142" y="102"></rect>
|
||||||
|
</g>
|
||||||
|
<g data-target="dram" class="dram">
|
||||||
|
<path d="M155 100v2h2v-2h-2Zm0-35h2v-2h-2v2Zm0 33h-1v4h1v-4Zm0 1V66h-4v33h4Zm-1-32h1v-4h-1v4Zm-1-2v35h4V65h-4Zm2 1a1 1 0 0 1-1 1v-4a3 3 0 0 0-3 3h4Zm-1 32a1 1 0 0 1 1 1h-4a3 3 0 0 0 3 3v-4Z" fill="#fff" mask="url(#P)"></path>
|
||||||
|
<path d="M155 62v2h2v-2h-2Zm0-24h2v-2h-2v2Zm0 22h-1v4h1v-4Zm0 1V39h-4v22h4Zm-1-21h1v-4h-1v4Zm-1-2v24h4V38h-4Zm2 1a1 1 0 0 1-1 1v-4a3 3 0 0 0-3 3h4Zm-1 21a1 1 0 0 1 1 1h-4a3 3 0 0 0 3 3v-4Z" fill="#fff" mask="url(#Q)"></path>
|
||||||
|
<rect height="66" rx="2" stroke="#fff" stroke-width="2" transform="rotate(180 160 102)" width="4" x="160" y="102"></rect>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g data-target="cpu" class="cpu">
|
||||||
|
<path d="M98 56a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1h-3ZM113 56a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1h-3ZM103 56a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1h-3ZM108 56a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1h-3ZM116 82a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1h3ZM101 82a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1h3ZM111 82a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1h3ZM106 82a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1h3ZM120 60a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1v-3ZM120 75a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1v-3ZM120 65a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1v-3ZM120 70a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1v-3ZM94 78a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1v3ZM94 63a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1v3ZM94 73a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1v3ZM94 68a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1v3Z" fill="#fff"></path>
|
||||||
|
<rect height="24" rx="3" stroke="#fff" stroke-width="2" width="24" x="95" y="57"></rect>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 19 KiB |
1
assets/media/icons/chevron.svg
Normal file
1
assets/media/icons/chevron.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg viewBox="0 0 312.18 152.001" xmlns="http://www.w3.org/2000/svg"><path d="m19.103 4.236 5.437 7.562a215.65 215.65 0 0 0 11.606 14.734c4.112 4.78 8.525 9.75 13.24 14.91A643.27 643.27 0 0 0 64.179 57.08a1509.61 1509.61 0 0 1 15.053 15.625c4.889 5.15 9.675 10.23 14.36 15.244a1648.08 1648.08 0 0 0 12.473 13.22c3.63 3.8 7.285 7.54 10.96 11.22 3.675 3.68 7.78 7.36 12.312 11.042 4.532 3.68 10.04 3.274 16.528-1.218a837.572 837.572 0 0 1 19.524-13.121c6.53-4.256 13.5-8.91 20.908-13.963a729.564 729.564 0 0 1 22.985-15.04 1103.004 1103.004 0 0 0 23.69-15.314 3566.955 3566.955 0 0 0 22.447-15.034c7.085-4.787 13.383-9.222 18.892-13.303 5.51-4.081 10.35-8.025 14.522-11.832 4.17-3.807 6.824-6.125 7.957-6.955 1.133-.83 2.155-1.429 3.064-1.796a8.925 8.925 0 0 1 2.83-.637 8.942 8.942 0 0 1 7.64 3.493 8.91 8.91 0 0 1 1.372 2.557 8.91 8.91 0 0 1 .483 2.861 8.93 8.93 0 0 1-.457 2.866 8.922 8.922 0 0 1-1.347 2.57 8.914 8.914 0 0 1-2.098 2.004c-9.96 6.823-20.293-9.408-9.301-15.303a8.912 8.912 0 0 1 2.745-.938 8.887 8.887 0 0 1 2.902-.013 8.9 8.9 0 0 1 2.754.914 8.897 8.897 0 0 1 2.317 1.746 8.945 8.945 0 0 1 2.283 8.085 8.92 8.92 0 0 1-1.062 2.7 8.9 8.9 0 0 1-1.87 2.22c-.584.643-1.192.983-1.98 1.27-.578.21-3.308 2.007-8.19 5.388a1895.168 1895.168 0 0 0-15.812 11.078 1795.774 1795.774 0 0 0-18.88 13.568 42964.591 42964.591 0 0 0-21.98 16.004 3571.069 3571.069 0 0 1-22.598 16.332 428.796 428.796 0 0 0-21.553 16.505 2795.242 2795.242 0 0 1-19.513 15.812c-5.98 4.797-12.405 9.663-19.275 14.598-6.87 4.935-12.732 8.165-17.59 9.69-4.855 1.525-9.255.802-13.2-2.17-3.942-2.973-8.19-6.72-12.74-11.244-4.55-4.524-8.65-8.753-12.3-12.686a487.255 487.255 0 0 1-10.551-11.743c-3.385-3.895-7.414-8.303-12.085-13.223-4.672-4.92-9.44-9.848-14.304-14.785a537.556 537.556 0 0 0-15.602-15.182 625.139 625.139 0 0 1-15.953-15.461 501.356 501.356 0 0 1-14.654-15.352c-4.671-5.11-8.886-10.14-12.644-15.086-3.758-4.947-5.847-7.791-6.268-8.534a10.558 10.558 0 0 1-1.367-4.863A10.48 10.48 0 0 1 .23 8.361a10.516 10.516 0 0 1 2.2-4.546A10.54 10.54 0 0 1 6.496.813a10.531 10.531 0 0 1 7.48-.241 10.524 10.524 0 0 1 4.248 2.733z"/></svg>
|
After Width: | Height: | Size: 2.1 KiB |
488
pages/about/battlestation.php
Normal file
488
pages/about/battlestation.php
Normal file
|
@ -0,0 +1,488 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Vegvisir\Path;
|
||||||
|
|
||||||
|
use VLW\Client\API;
|
||||||
|
use VLW\API\Endpoints;
|
||||||
|
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\{
|
||||||
|
MbModel,
|
||||||
|
CpuModel,
|
||||||
|
GpuModel,
|
||||||
|
PsuModel,
|
||||||
|
DramModel,
|
||||||
|
StorageModel,
|
||||||
|
ChassisModel
|
||||||
|
};
|
||||||
|
use VLW\API\Databases\VLWdb\Models\Battlestation\Config\{
|
||||||
|
MbPsuModel,
|
||||||
|
MbGpuModel,
|
||||||
|
MbDramModel,
|
||||||
|
ConfigModel,
|
||||||
|
MbStorageModel,
|
||||||
|
ChassisMbModel,
|
||||||
|
MbCpuCoolerModel,
|
||||||
|
MbStorageSlotFormfactorEnum
|
||||||
|
};
|
||||||
|
|
||||||
|
require_once Path::root("src/client/API.php");
|
||||||
|
require_once Path::root("api/src/Endpoints.php");
|
||||||
|
|
||||||
|
// Load hardware database models
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Mb.php");
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Cpu.php");
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Gpu.php");
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Psu.php");
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Dram.php");
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Storage.php");
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Chassis.php");
|
||||||
|
|
||||||
|
// Load hardware config database models
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Config/MbPsu.php");
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Config/MbGpu.php");
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Config/MbDram.php");
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Config/Config.php");
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Config/MbStorage.php");
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Config/ChassisMb.php");
|
||||||
|
require_once Path::root("api/src/databases/models/Battlestation/Config/MbCpuCooler.php");
|
||||||
|
|
||||||
|
const GIGA = 0x3B9ACA00;
|
||||||
|
const MEGA = 0xF4240;
|
||||||
|
|
||||||
|
// Connect to VLW API
|
||||||
|
$api = new API();
|
||||||
|
|
||||||
|
$config = $api->call(Endpoints::BATTLESTATION->value)->get();
|
||||||
|
|
||||||
|
?>
|
||||||
|
<style><?= VV::css("pages/about/battlestation") ?></style>
|
||||||
|
<?php if ($config->ok): ?>
|
||||||
|
<?php foreach ($config->json() as $config): ?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Get motherboard details by ref_mb_id from config
|
||||||
|
$motherboard = $api->call(Endpoints::BATTLESTATION_MB->value)->params([
|
||||||
|
MbModel::ID->value => $config[ChassisMbModel::REF_MB_ID->value]
|
||||||
|
])->get()->json()[0];
|
||||||
|
|
||||||
|
$test = true;
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section class="heading">
|
||||||
|
<h1><?= $config[ConfigModel::FRIENDLY_NAME->value] ?? "Lucious" ?></h1>
|
||||||
|
<p>This rig was built: <?= date(API::DATE_FORMAT, $config[ConfigModel::DATE_BUILT->value]) ?></p>
|
||||||
|
</section>
|
||||||
|
<section class="config"
|
||||||
|
data-mb="1"
|
||||||
|
data-cpu="<?= count($motherboard["cpus"]) ?>"
|
||||||
|
data-psu="<?= count($motherboard["psus"]) ?>"
|
||||||
|
data-gpu="<?= count($motherboard["gpus"]) ?>"
|
||||||
|
data-dram="<?= count($motherboard["dram"]) ?>"
|
||||||
|
data-case="<?= count($motherboard["chassis"]) ?>"
|
||||||
|
data-drives-mdottwo="<?= count(array_keys(array_column($motherboard["storage"], MbStorageModel::SLOT_FORMFACTOR->value), MbStorageSlotFormfactorEnum::MDOTTWO->value)) ?>"
|
||||||
|
data-drives-twodotfive="<?= count(array_keys(array_column($motherboard["storage"], MbStorageModel::SLOT_FORMFACTOR->value), MbStorageSlotFormfactorEnum::TWODOTFIVE->value)) ?>"
|
||||||
|
data-drives-threedotfive="<?= count(array_keys(array_column($motherboard["storage"], MbStorageModel::SLOT_FORMFACTOR->value), MbStorageSlotFormfactorEnum::THREEDOTFIVE->value)) ?>"
|
||||||
|
>
|
||||||
|
<?= VV::media("battlestation.svg") ?>
|
||||||
|
<div class="specs">
|
||||||
|
|
||||||
|
<?php // Show motherboard details ?>
|
||||||
|
<?php if ($motherboard): ?>
|
||||||
|
<div vv="battlestation" vv-call="setSpecActive" data-target="mb" class="spec">
|
||||||
|
<p>Motherboard</p>
|
||||||
|
<h3><?= $motherboard[MbModel::VENDOR_NAME->value] ?> <span><?= $motherboard[MbModel::VENDOR_MODEL->value] ?></span></h3>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<label>Formfactor</label>
|
||||||
|
<p><?= $motherboard[MbModel::FORMFACTOR->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Brand name</label>
|
||||||
|
<p><?= $motherboard[MbModel::VENDOR_NAME->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Brand model</label>
|
||||||
|
<p><?= $motherboard[MbModel::VENDOR_MODEL->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>LAN</label>
|
||||||
|
<p><?= $motherboard[MbModel::NETWORK_ETHERNET->value] ?? "No LAN" ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>WLAN</label>
|
||||||
|
<p><?= $motherboard[MbModel::NETWORK_WLAN->value] ?? "No WLAN" ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Bluetooth</label>
|
||||||
|
<p><?= $motherboard[MbModel::NETWORK_BLUETOOTH->value] ?? "No Bluetooth" ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Aquired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $motherboard[MbModel::DATE_AQUIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if ($motherboard[MbModel::DATE_RETIRED->value]): ?>
|
||||||
|
<div>
|
||||||
|
<label>Retired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $motherboard[MbModel::DATE_RETIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php // List all cases (lol) ?>
|
||||||
|
<?php foreach ($motherboard["chassis"] as $mb_chassis): ?>
|
||||||
|
|
||||||
|
<?php // Get case details from endpoint by id ?>
|
||||||
|
<?php $case = $api->call(Endpoints::BATTLESTATION_CHASSIS->value)->params([
|
||||||
|
ChassisModel::ID->value => $mb_chassis[ChassisMbModel::REF_CHASSIS_ID->value]
|
||||||
|
])->get()->json()[0]; ?>
|
||||||
|
|
||||||
|
<div vv="battlestation" vv-call="setSpecActive" data-target="case" class="spec">
|
||||||
|
<p>Case</p>
|
||||||
|
<h3><?= $case[ChassisModel::VENDOR_NAME->value] ?> <span><?= $case[ChassisModel::VENDOR_MODEL->value] ?></span></h3>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<label>Brand name</label>
|
||||||
|
<p><?= $case[ChassisModel::VENDOR_NAME->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Brand model</label>
|
||||||
|
<p><?= $case[ChassisModel::VENDOR_MODEL->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Nº 2.5" slots</label>
|
||||||
|
<p><?= $case[ChassisModel::STORAGE_TWOINCHFIVE->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Nº 3.5" slots</label>
|
||||||
|
<p><?= $case[ChassisModel::STORAGE_THREEINCHFIVE->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Aquired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $case[ChassisModel::DATE_AQUIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if ($motherboard[MbModel::DATE_RETIRED->value]): ?>
|
||||||
|
<div>
|
||||||
|
<label>Retired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $case[ChassisModel::DATE_RETIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<?php // List all CPUs ?>
|
||||||
|
<?php foreach ($motherboard["cpus"] as $mb_cpu): ?>
|
||||||
|
|
||||||
|
<?php // Get case details from endpoint by id ?>
|
||||||
|
<?php $cpu = $api->call(Endpoints::BATTLESTATION_CPU->value)->params([
|
||||||
|
CpuModel::ID->value => $mb_cpu[MbCpuCoolerModel::REF_CPU_ID->value]
|
||||||
|
])->get()->json()[0]; ?>
|
||||||
|
|
||||||
|
<div vv="battlestation" vv-call="setSpecActive" data-target="cpu" class="spec">
|
||||||
|
<p>CPU</p>
|
||||||
|
<h3><?= $cpu[CpuModel::VENDOR_NAME->value] ?> <span><?= $cpu[CpuModel::VENDOR_MODEL->value] ?></span></h3>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<label>Brand name</label>
|
||||||
|
<p><?= $cpu[CpuModel::VENDOR_NAME->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Brand model</label>
|
||||||
|
<p><?= $cpu[CpuModel::VENDOR_MODEL->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Class</label>
|
||||||
|
<p><?= $cpu[CpuModel::CPU_CLASS->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Base Clockspeed</label>
|
||||||
|
<p><?= $cpu[CpuModel::CLOCK_BASE->value] / GIGA ?>GHz</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Turbo Clockspeed</label>
|
||||||
|
<p><?= $cpu[CpuModel::CLOCK_TURBO->value] / GIGA ?>GHz</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Nº cores (P/E)</label>
|
||||||
|
<p><?= $cpu[CpuModel::CORE_COUNT_PERFORMANCE->value] + $cpu[CpuModel::CORE_COUNT_EFFICIENCY->value] ?> (<?= $cpu[CpuModel::CORE_COUNT_PERFORMANCE->value] ?>/<?= $cpu[CpuModel::CORE_COUNT_EFFICIENCY->value] ?>)</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Nº total threads</label>
|
||||||
|
<p><?= $cpu[CpuModel::CORE_THREADS->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Aquired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $cpu[CpuModel::DATE_AQUIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if ($motherboard[MbModel::DATE_RETIRED->value]): ?>
|
||||||
|
<div>
|
||||||
|
<label>Retired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $cpu[CpuModel::DATE_RETIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<label>In motherboard slot number</label>
|
||||||
|
<p><?= $mb_cpu[MbCpuCoolerModel::SOCKET->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Motherboard slot type</label>
|
||||||
|
<p><?= $mb_cpu[MbCpuCoolerModel::SOCKET_TYPE->value] ?></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<?php // List all GPUs ?>
|
||||||
|
<?php foreach ($motherboard["gpus"] as $mb_gpu): ?>
|
||||||
|
|
||||||
|
<?php // Get case details from endpoint by id ?>
|
||||||
|
<?php $gpu = $api->call(Endpoints::BATTLESTATION_GPU->value)->params([
|
||||||
|
GpuModel::ID->value => $mb_gpu[MbGpuModel::REF_GPU_ID->value]
|
||||||
|
])->get()->json()[0]; ?>
|
||||||
|
|
||||||
|
<div vv="battlestation" vv-call="setSpecActive" data-target="gpu" class="spec">
|
||||||
|
<p>GPU</p>
|
||||||
|
<h3><?= $gpu[GpuModel::VENDOR_NAME->value] ?> <span><?= $gpu[GpuModel::VENDOR_CHIP_MODEL->value] ?></span></h3>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<label>Chip brand name</label>
|
||||||
|
<p><?= $gpu[GpuModel::VENDOR_CHIP_NAME->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Chip brand model</label>
|
||||||
|
<p><?= $gpu[GpuModel::VENDOR_CHIP_MODEL->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>VRAM</label>
|
||||||
|
<p><?= $gpu[GpuModel::MEMORY->value] / GIGA ?>GB</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Brand name</label>
|
||||||
|
<p><?= $gpu[GpuModel::VENDOR_NAME->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Brand model</label>
|
||||||
|
<p><?= $gpu[GpuModel::VENDOR_MODEL->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Aquired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $gpu[GpuModel::DATE_AQUIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if ($motherboard[MbModel::DATE_RETIRED->value]): ?>
|
||||||
|
<div>
|
||||||
|
<label>Retired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $gpu[GpuModel::DATE_RETIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<?php // List all PSUs ?>
|
||||||
|
<?php foreach ($motherboard["psus"] as $mb_psu): ?>
|
||||||
|
|
||||||
|
<?php // Get case details from endpoint by id ?>
|
||||||
|
<?php $psu = $api->call(Endpoints::BATTLESTATION_PSU->value)->params([
|
||||||
|
PsuModel::ID->value => $mb_psu[MbPsuModel::REF_PSU_ID->value]
|
||||||
|
])->get()->json()[0]; ?>
|
||||||
|
|
||||||
|
<div vv="battlestation" vv-call="setSpecActive" data-target="psu" class="spec">
|
||||||
|
<p>PSU</p>
|
||||||
|
<h3><?= $psu[PsuModel::VENDOR_NAME->value] ?> <span><?= $psu[PsuModel::VENDOR_MODEL->value] ?></span> <span><?= $psu[PsuModel::POWER->value] ?>W</span></h3>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<label>Power</label>
|
||||||
|
<p><?= $psu[PsuModel::POWER->value] ?>W</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Brand name</label>
|
||||||
|
<p><?= $psu[PsuModel::VENDOR_NAME->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Brand model</label>
|
||||||
|
<p><?= $psu[PsuModel::VENDOR_MODEL->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Is modular?</label>
|
||||||
|
<p><?= $psu[PsuModel::TYPE_MODULAR->value] === "TRUE" ? "Yes" : "No" ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>80+ Rating</label>
|
||||||
|
<p><?= $psu[PsuModel::EIGHTYPLUS_RATING->value] ?? "None" ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Aquired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $psu[PsuModel::DATE_AQUIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if ($motherboard[MbModel::DATE_RETIRED->value]): ?>
|
||||||
|
<div>
|
||||||
|
<label>Retired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $psu[PsuModel::DATE_RETIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<div vv="battlestation" vv-call="toggleGroup" class="group">
|
||||||
|
<p>DRAM</p>
|
||||||
|
<?= VV::media("icons/chevron.svg") ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="collection">
|
||||||
|
<?php // List all DRAM ?>
|
||||||
|
<?php foreach ($motherboard["dram"] as $mb_dram): ?>
|
||||||
|
|
||||||
|
<?php // Get case details from endpoint by id ?>
|
||||||
|
<?php $dram = $api->call(Endpoints::BATTLESTATION_DRAM->value)->params([
|
||||||
|
DramModel::ID->value => $mb_dram[MbDramModel::REF_DRAM_ID->value]
|
||||||
|
])->get()->json()[0]; ?>
|
||||||
|
|
||||||
|
<div vv="battlestation" vv-call="setSpecActive" data-target="dram" class="spec">
|
||||||
|
<p>DRAM - <?= $dram[DramModel::TECHNOLOGY->value] ?></p>
|
||||||
|
<h3><?= $dram[DramModel::VENDOR_NAME->value] ?>
|
||||||
|
<span><?= $dram[DramModel::CAPACITY->value] / GIGA ?>GB</span>
|
||||||
|
<span><?= $dram[DramModel::SPEED->value] / MEGA ?>MHz</span>
|
||||||
|
</h3>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<label>Capacity</label>
|
||||||
|
<p><?= $dram[DramModel::CAPACITY->value] / GIGA ?>GB</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Speed</label>
|
||||||
|
<p><?= $dram[DramModel::SPEED->value] / MEGA ?>MHz</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Brand name</label>
|
||||||
|
<p><?= $dram[DramModel::VENDOR_NAME->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Brand model</label>
|
||||||
|
<p><?= $dram[DramModel::VENDOR_MODEL->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Formfactor</label>
|
||||||
|
<p><?= $dram[DramModel::FORMFACTOR->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Technology</label>
|
||||||
|
<p><?= $dram[DramModel::TECHNOLOGY->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Is ECC?</label>
|
||||||
|
<p><?= $dram[DramModel::ECC->value] === "TRUE" ? "Yes" : "No" ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Is buffered?</label>
|
||||||
|
<p><?= $dram[DramModel::BUFFERED->value] === "TRUE" ? "Yes" : "No" ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Aquired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $dram[DramModel::DATE_AQUIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if ($motherboard[MbModel::DATE_RETIRED->value]): ?>
|
||||||
|
<div>
|
||||||
|
<label>Retired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $dram[DramModel::DATE_RETIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<label>In motherboard slot number</label>
|
||||||
|
<p><?= $mb_dram[MbDramModel::SOCKET->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Motherboard slot type</label>
|
||||||
|
<p><?= $mb_dram[MbDramModel::SOCKET_TYPE->value] ?></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div vv="battlestation" vv-call="toggleGroup" class="group">
|
||||||
|
<p>Storage</p>
|
||||||
|
<?= VV::media("icons/chevron.svg") ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="collection">
|
||||||
|
<?php // List all storage ?>
|
||||||
|
<?php foreach ($motherboard["storage"] as $mb_storage): ?>
|
||||||
|
|
||||||
|
<?php // Get case details from endpoint by id ?>
|
||||||
|
<?php $storage = $api->call(Endpoints::BATTLESTATION_STORAGE->value)->params([
|
||||||
|
StorageModel::ID->value => $mb_storage[MbStorageModel::REF_STORAGE_ID->value]
|
||||||
|
])->get()->json()[0]; ?>
|
||||||
|
|
||||||
|
<div vv="battlestation" vv-call="setSpecActive" data-target="drive" class="spec">
|
||||||
|
<p><?= $storage[StorageModel::DISK_FORMFACTOR->value] ?> <?= $storage[StorageModel::DISK_TYPE->value] ?></p>
|
||||||
|
<h3>
|
||||||
|
<?= $storage[StorageModel::VENDOR_NAME->value] ?>
|
||||||
|
<span><?= floor($storage[StorageModel::DISK_SIZE->value] / GIGA) ?>GB</span>
|
||||||
|
</h3>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<label>Type</label>
|
||||||
|
<p><?= $storage[StorageModel::DISK_TYPE->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Capacity</label>
|
||||||
|
<p><?= floor($storage[StorageModel::DISK_SIZE->value] / GIGA) ?>GB</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Interface</label>
|
||||||
|
<p><?= $storage[StorageModel::DISK_INTERFACE->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Formfactor</label>
|
||||||
|
<p><?= $storage[StorageModel::DISK_FORMFACTOR->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Brand name</label>
|
||||||
|
<p><?= $storage[StorageModel::VENDOR_NAME->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Brand model</label>
|
||||||
|
<p><?= $storage[StorageModel::VENDOR_MODEL->value] ?></p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Aquired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $storage[StorageModel::DATE_AQUIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if ($motherboard[MbModel::DATE_RETIRED->value]): ?>
|
||||||
|
<div>
|
||||||
|
<label>Retired</label>
|
||||||
|
<p><?= date(API::DATE_FORMAT, $storage[StorageModel::DATE_RETIRED->value]) ?></p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<label>Attatched via interface</label>
|
||||||
|
<p><?= $mb_storage[MbStorageModel::INTERFACE->value] ?></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<script><?= VV::js("pages/about/battlestation") ?></script>
|
Loading…
Add table
Reference in a new issue