Skip to content

Commit c1a078b

Browse files
committed
Add support for node management actions using new services
1 parent 4391def commit c1a078b

33 files changed

+1375
-745
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/*
3+
* Pterodactyl - Panel
4+
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
25+
namespace Pterodactyl\Contracts\Repository\Daemon;
26+
27+
interface ConfigurationRepositoryInterface extends BaseRepositoryInterface
28+
{
29+
/**
30+
* Update the configuration details for the specified node using data from the database.
31+
*
32+
* @param array $overrides
33+
* @return \Psr\Http\Message\ResponseInterface
34+
*/
35+
public function update(array $overrides = []);
36+
}

app/Contracts/Repository/NodeRepositoryInterface.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,52 @@
2828

2929
interface NodeRepositoryInterface extends RepositoryInterface, SearchableInterface
3030
{
31+
/**
32+
* Return the usage stats for a single node.
33+
*
34+
* @param int $id
35+
* @return array
36+
*/
37+
public function getUsageStats($id);
38+
39+
/**
40+
* Return all available nodes with a searchable interface.
41+
*
42+
* @param int $count
43+
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
44+
*/
45+
public function getNodeListingData($count = 25);
46+
47+
/**
48+
* Return a single node with location and server information.
49+
*
50+
* @param int $id
51+
* @return mixed
52+
*
53+
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
54+
*/
55+
public function getSingleNode($id);
56+
57+
/**
58+
* Return a node with all of the associated allocations and servers that are attached to said allocations.
59+
*
60+
* @param int $id
61+
* @return mixed
62+
*
63+
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
64+
*/
65+
public function getNodeAllocations($id);
66+
67+
/**
68+
* Return a node with all of the servers attached to that node.
69+
*
70+
* @param int $id
71+
* @return mixed
72+
*
73+
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
74+
*/
75+
public function getNodeServers($id);
76+
3177
/**
3278
* Return a collection of nodes beloning to a specific location for use on frontend display.
3379
*

app/Contracts/Repository/RepositoryInterface.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ public function findWhere(array $fields);
116116
*/
117117
public function findFirstWhere(array $fields);
118118

119+
/**
120+
* Return a count of records matching the passed arguments.
121+
*
122+
* @param array $fields
123+
* @return int
124+
*/
125+
public function findCountWhere(array $fields);
126+
119127
/**
120128
* Update a given ID with the passed array of fields.
121129
*

app/Http/Controllers/Admin/DatabaseController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public function create(DatabaseHostFormRequest $request)
132132
* @return \Illuminate\Http\RedirectResponse
133133
*
134134
* @throws \Pterodactyl\Exceptions\DisplayException
135+
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
135136
*/
136137
public function update(DatabaseHostFormRequest $request, DatabaseHost $host)
137138
{

0 commit comments

Comments
 (0)