Skip to content

Commit 3d2278b

Browse files
committed
Add subuser list and new subuser views
Holy 🐄 translations are annoying to implement for these views.
1 parent 994588c commit 3d2278b

File tree

6 files changed

+668
-1
lines changed

6 files changed

+668
-1
lines changed

app/Http/Controllers/Server/SubuserController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function getIndex(Request $request, $uuid)
5555
return view('server.users.index', [
5656
'server' => $server,
5757
'node' => Models\Node::find($server->node),
58-
'subusers' => Models\Subuser::select('subusers.*', 'users.email as a_userEmail')
58+
'subusers' => Models\Subuser::select('subusers.*', 'users.email', 'users.username')
5959
->join('users', 'users.id', '=', 'subusers.user_id')
6060
->where('server_id', $server->id)
6161
->get(),

public/themes/pterodactyl/css/pterodactyl.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,11 @@ td.has-progress {
113113
color: #cccccc;
114114
height: 0;
115115
}
116+
117+
.box-header > .form-group {
118+
margin-bottom: 0;
119+
}
120+
121+
.box-header > .form-group > div > p.small {
122+
margin: 0;
123+
}

resources/lang/en/server.php

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,166 @@
66
'header' => 'Server Console',
77
'header_sub' => 'Control your server in real time.',
88
],
9+
'users' => [
10+
'header' => 'Manage Users',
11+
'header_sub' => 'Control who can access your server.',
12+
'configure' => 'Configure Permissions',
13+
'list' => 'Accounts with Access',
14+
'add' => 'Add New Subuser',
15+
'new' => [
16+
'header' => 'Add New User',
17+
'header_sub' => 'Add a new user with permissions to this server.',
18+
'email' => 'Email Address',
19+
'email_help' => 'Enter the email address for the user you wish to invite to manage this server.',
20+
'power_header' => 'Power Management',
21+
'file_header' => 'File Management',
22+
'subuser_header' => 'Subuser Management',
23+
'server_header' => 'Server Management',
24+
'task_header' => 'Task Management',
25+
'sftp_header' => 'SFTP Management',
26+
'db_header' => 'Database Management',
27+
'start' => [
28+
'title' => 'Start Server',
29+
'description' => 'Allows user to start the server.',
30+
],
31+
'stop' => [
32+
'title' => 'Stop Server',
33+
'description' => 'Allows user to stop the server.',
34+
],
35+
'restart' => [
36+
'title' => 'Stop Server',
37+
'description' => 'Allows user to restart the server.',
38+
],
39+
'kill' => [
40+
'title' => 'Stop Server',
41+
'description' => 'Allows user to kill the server process.',
42+
],
43+
'command' => [
44+
'title' => 'Send Console Command',
45+
'description' => 'Allows sending a command from the console. If the user does not have stop or restart permissions they cannot send the application\'s stop command.',
46+
],
47+
'list_files' => [
48+
'title' => 'List Files',
49+
'description' => 'Allows user to list all files and folders on the server but not view file contents.',
50+
],
51+
'edit_files' => [
52+
'title' => 'Edit Files',
53+
'description' => 'Allows user to open a file for viewing only.',
54+
],
55+
'save_files' => [
56+
'title' => 'Save Files',
57+
'description' => 'Allows user to save modified file contents.',
58+
],
59+
'move_files' => [
60+
'title' => 'Rename & Move Files',
61+
'description' => 'Allows user to move and rename files and folders on the filesystem.',
62+
],
63+
'copy_files' => [
64+
'title' => 'Copy Files',
65+
'description' => 'Allows user to copy files and folders on the filesystem.',
66+
],
67+
'compress_files' => [
68+
'title' => 'Compress Files',
69+
'description' => 'Allows user to make archives of files and folders on the system.',
70+
],
71+
'decompress_files' => [
72+
'title' => 'Decompress Files',
73+
'description' => 'Allows user to decompress .zip and .tar(.gz) archives.',
74+
],
75+
'create_files' => [
76+
'title' => 'Create Files',
77+
'description' => 'Allows user to create a new file within the panel.',
78+
],
79+
'upload_files' => [
80+
'title' => 'Upload Files',
81+
'description' => 'Allows user to upload files through the file manager.',
82+
],
83+
'delete_files' => [
84+
'title' => 'Delete Files',
85+
'description' => 'Allows user to delete files from the system.',
86+
],
87+
'download_files' => [
88+
'title' => 'Download Files',
89+
'description' => 'Allows user to download files. If a user is given this permission they can download and view file contents even if that permission is not assigned on the panel.',
90+
],
91+
'list_subusers' => [
92+
'title' => 'List Subusers',
93+
'description' => 'Allows user to view a listing of all subusers assigned to the server.',
94+
],
95+
'view_subuser' => [
96+
'title' => 'View Subuser',
97+
'description' => 'Allows user to view permissions assigned to subusers.',
98+
],
99+
'edit_subuser' => [
100+
'title' => 'Edit Subuser',
101+
'description' => 'Allows a user to edit permissions assigned to other subusers.',
102+
],
103+
'create_subuser' => [
104+
'title' => 'Create Subuser',
105+
'description' => 'Allows user to create additional subusers on the server.',
106+
],
107+
'delete_subuser' => [
108+
'title' => 'Delete Subuser',
109+
'description' => 'Allows a user to delete other subusers on the server.',
110+
],
111+
'set_connection' => [
112+
'title' => 'Set Default Connection',
113+
'description' => 'Allows user to set the default connection used for a server as well as view avaliable ports.',
114+
],
115+
'view_startup' => [
116+
'title' => 'View Startup Command',
117+
'description' => 'Allows user to view the startup command and associated variables for a server.',
118+
],
119+
'edit_startup' => [
120+
'title' => 'Edit Startup Command',
121+
'description' => 'Allows a user to modify startup variables for a server.',
122+
],
123+
'list_tasks' => [
124+
'title' => 'List Tasks',
125+
'description' => 'Allows a user to list all tasks (enabled and disabled) on a server.',
126+
],
127+
'view_task' => [
128+
'title' => 'View Task',
129+
'description' => 'Allows a user to view a specific task\'s details.',
130+
],
131+
'toggle_task' => [
132+
'title' => 'Toggle Task',
133+
'description' => 'Allows a user to toggle a task on or off.',
134+
],
135+
'queue_task' => [
136+
'title' => 'Queue Task',
137+
'description' => 'Allows a user to queue a task to run on next cycle.',
138+
],
139+
'create_task' => [
140+
'title' => 'Create Task',
141+
'description' => 'Allows a user to create new tasks.',
142+
],
143+
'delete_task' => [
144+
'title' => 'Delete Task',
145+
'description' => 'Allows a user to delete a task.',
146+
],
147+
'view_sftp' => [
148+
'title' => 'View SFTP Details',
149+
'description' => 'Allows user to view the server\'s SFTP information but not the password.',
150+
],
151+
'view_sftp_password' => [
152+
'title' => 'View SFTP Password',
153+
'description' => 'Allows user to view the SFTP password for the server.',
154+
],
155+
'reset_sftp' => [
156+
'title' => 'Reset SFTP Password',
157+
'description' => 'Allows user to change the SFTP password for the server.',
158+
],
159+
'view_databases' => [
160+
'title' => 'View Database Details',
161+
'description' => 'Allows user to view all databases associated with this server including the usernames and passwords for the databases.',
162+
],
163+
'reset_db_password' => [
164+
'title' => 'Reset Database Password',
165+
'description' => 'Allows a user to reset passwords for databases.',
166+
],
167+
],
168+
],
9169
'files' => [
10170
'header' => 'File Manager',
11171
'header_sub' => 'Manage all of your files directly from the web.',

resources/lang/en/strings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@
5050
'make_primary' => 'Make Primary',
5151
'none' => 'None',
5252
'cancel' => 'Cancel',
53+
'created_at' => 'Created At',
5354
];
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
2+
3+
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
4+
{{-- of this software and associated documentation files (the "Software"), to deal --}}
5+
{{-- in the Software without restriction, including without limitation the rights --}}
6+
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
7+
{{-- copies of the Software, and to permit persons to whom the Software is --}}
8+
{{-- furnished to do so, subject to the following conditions: --}}
9+
10+
{{-- The above copyright notice and this permission notice shall be included in all --}}
11+
{{-- copies or substantial portions of the Software. --}}
12+
13+
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
14+
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
15+
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
16+
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
17+
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
18+
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
19+
{{-- SOFTWARE. --}}
20+
@extends('layouts.master')
21+
22+
@section('title')
23+
@lang('server.users.header')
24+
@endsection
25+
26+
@section('content-header')
27+
<h1>@lang('server.users.header')<small>@lang('server.users.header_sub')</small></h1>
28+
<ol class="breadcrumb">
29+
<li><a href="{{ route('index') }}">@lang('strings.home')</a></li>
30+
<li><a href="{{ route('server.index', $server->uuidShort) }}">{{ $server->name }}</a></li>
31+
<li class="active">@lang('navigation.server.subusers')</li>
32+
</ol>
33+
@endsection
34+
35+
@section('content')
36+
<div class="row">
37+
<div class="col-xs-12">
38+
<div class="box">
39+
<div class="box-header with-border">
40+
<h3 class="box-title">@lang('server.users.list')</h3>
41+
</div>
42+
<div class="box-body table-responsive no-padding">
43+
<table class="table table-hover">
44+
<tbody>
45+
<tr>
46+
<th></th>
47+
<th>@lang('strings.username')</th>
48+
<th>@lang('strings.email')</th>
49+
<th class="hidden-xs">@lang('strings.created_at')</th>
50+
@can('view-subuser', $server)<th></th>@endcan
51+
@can('delete-subuser', $server)<th></th>@endcan
52+
</tr>
53+
@foreach($subusers as $user)
54+
<tr>
55+
<td class="text-center middle"><img class="img-circle" src="https://www.gravatar.com/avatar/{{ md5($user->email) }}?s=128" style="height:20px;" alt="User Image"></td>
56+
<td class="middle">{{ $user->username }}
57+
<td class="middle"><code>{{ $user->email }}</code></td>
58+
<td class="middle hidden-xs">{{ $user->created_at }}</td>
59+
@can('view-subuser', $server)
60+
<td class="text-center middle">
61+
<a href="{{ route('server.subusers.view', ['server' => $server->uuidShort, 'id' => md5($user->id)]) }}">
62+
<button class="btn btn-xs btn-primary">@lang('server.users.configure')</button>
63+
</a>
64+
</td>
65+
@endcan
66+
@can('delete-subuser', $server)
67+
<td class="text-center middle">
68+
<a href="#/delete/{{ md5($user->id) }}" data-action="delete" data-id="{{ md5($user->id) }}">
69+
<button class="btn btn-xs btn-danger"><i class="fa fa-trash-o"></i></button>
70+
</a>
71+
</td>
72+
@endcan
73+
</tr>
74+
@endforeach
75+
</tbody>
76+
</table>
77+
</div>
78+
@can('create-subuser', $server)
79+
<div class="box-footer with-border">
80+
<a href="{{ route('server.subusers.new', $server->uuidShort) }}"><button class="btn btn-sm btn-success pull-right">@lang('server.users.add')</button></a>
81+
</div>
82+
@endcan
83+
</div>
84+
</div>
85+
</div>
86+
@endsection

0 commit comments

Comments
 (0)