@@ 43-63 (lines=21) @@ | ||
40 | } |
|
41 | } |
|
42 | ||
43 | public function testConnectionAction(Request $request) |
|
44 | { |
|
45 | $this->isGrantedOr403('SHOW', $this->find($request)); |
|
46 | ||
47 | $config = $this->getConfiguration(); |
|
48 | /** @var Machine $machine */ |
|
49 | $machine = $this->findOr404($request); |
|
50 | ||
51 | $test = $this->domainManager->connectionTest($machine); |
|
52 | ||
53 | $view = $this |
|
54 | ->view() |
|
55 | ->setTemplate($config->getTemplate('connection_test.html')) |
|
56 | ->setData(array( |
|
57 | $config->getResourceName() => $machine, |
|
58 | 'test' => $test, |
|
59 | )) |
|
60 | ; |
|
61 | ||
62 | return $this->handleView($view); |
|
63 | } |
|
64 | } |
|
65 |
@@ 71-94 (lines=24) @@ | ||
68 | return $this->redirectHandler->redirectToReferer(); |
|
69 | } |
|
70 | ||
71 | public function logsAction(Request $request) |
|
72 | { |
|
73 | $this->isGrantedOr403('ADMIN', $this->find($request)); |
|
74 | ||
75 | $config = $this->getConfiguration(); |
|
76 | $server = $this->findOr404($request); |
|
77 | ||
78 | $logs = $this->domainManager->getServerLogs($server); |
|
79 | ||
80 | if ($logs === null) { |
|
81 | return $this->redirectHandler->redirectToReferer(); |
|
82 | } |
|
83 | ||
84 | $view = $this |
|
85 | ->view() |
|
86 | ->setTemplate($config->getTemplate('logs.html')) |
|
87 | ->setData(array( |
|
88 | $config->getResourceName() => $server, |
|
89 | 'logs' => $logs |
|
90 | )) |
|
91 | ; |
|
92 | ||
93 | return $this->handleView($view); |
|
94 | } |
|
95 | ||
96 | public function rconAction(Request $request) |
|
97 | { |