Skip to content

Commit e65854c

Browse files
committed
Merge branch 'feature/vuejs' into feature/vue-serverview
2 parents e0d67ff + ee9a347 commit e65854c

35 files changed

+827
-192
lines changed

.env.dusk

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
APP_ENV=local
2+
APP_DEBUG=false
3+
APP_KEY=NDWgIKKi9ovNK1PXZpzfNVSBdfCXGb5i
4+
APP_JWT_KEY=test1234
5+
APP_TIMEZONE=America/Los_Angeles
6+
APP_URL=http://pterodactyl.local
7+
8+
CACHE_DRIVER=file
9+
SESSION_DRIVER=file
10+
11+
HASHIDS_SALT=IqRr0g82tCTeuyxGs8RV
12+
HASHIDS_LENGTH=8
13+
14+
MAIL_DRIVER=log
15+
MAIL_FROM=support@pterodactyl.io
16+
QUEUE_DRIVER=array
17+
18+
APP_SERVICE_AUTHOR=testing@pterodactyl.io
19+
MAIL_FROM_NAME="Pterodactyl Panel"
20+
RECAPTCHA_ENABLED=false
21+
22+
DB_CONNECTION=testing
23+
TESTING_DB_HOST=services.pterodactyl.local
24+
TESTING_DB_DATABASE=panel_test
25+
TESTING_DB_USERNAME=panel_test
26+
TESTING_DB_PASSWORD=Test1234

app/Http/Controllers/Base/DashboardController.php

Lines changed: 0 additions & 54 deletions
This file was deleted.

app/Transformers/Api/Client/StatsTransformer.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace Pterodactyl\Transformers\Api\Client;
44

55
use Pterodactyl\Models\Server;
6+
use GuzzleHttp\Exception\RequestException;
7+
use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException;
68
use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface;
79

810
class StatsTransformer extends BaseClientTransformer
@@ -36,6 +38,8 @@ public function getResourceName(): string
3638
*
3739
* @param \Pterodactyl\Models\Server $model
3840
* @return array
41+
*
42+
* @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException
3943
*/
4044
public function transform(Server $model)
4145
{
@@ -61,7 +65,10 @@ public function transform(Server $model)
6165
'disk' => [
6266
'current' => round(object_get($object, 'proc.disk.used', 0)),
6367
'limit' => floatval($model->disk),
68+
'io' => $model->io,
6469
],
70+
'installed' => $model->installed === 1,
71+
'suspended' => (bool) $model->suspended,
6572
];
6673
}
6774

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"filp/whoops": "^2.1",
4949
"friendsofphp/php-cs-fixer": "^2.11.1",
5050
"fzaninotto/faker": "^1.6",
51+
"laravel/dusk": "^3.0",
5152
"martinlindhe/laravel-vue-i18n-generator": "^0.1.28",
5253
"mockery/mockery": "^1.0",
5354
"nunomaduro/collision": "^2.0",
@@ -68,6 +69,7 @@
6869
},
6970
"autoload-dev": {
7071
"psr-4": {
72+
"Pterodactyl\\Tests\\Browser\\": "tests/Browser",
7173
"Pterodactyl\\Tests\\Integration\\": "tests/Integration",
7274
"Tests\\": "tests/"
7375
}

composer.lock

Lines changed: 122 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const babel = require('gulp-babel');
22
const concat = require('gulp-concat');
33
const cssmin = require('gulp-cssmin');
44
const del = require('del');
5+
const exec = require('child_process').exec;
56
const gulp = require('gulp');
67
const gulpif = require('gulp-if');
78
const postcss = require('gulp-postcss');
@@ -85,6 +86,32 @@ function watch() {
8586
}, scripts));
8687
}
8788

89+
/**
90+
* Generate the language files to be consumed by front end.
91+
*
92+
* @returns {Promise<any>}
93+
*/
94+
function i18n() {
95+
return new Promise((resolve, reject) => {
96+
exec('php artisan vue-i18n:generate', {}, (err, stdout, stderr) => {
97+
return err ? reject(err) : resolve({ stdout, stderr });
98+
})
99+
})
100+
}
101+
102+
/**
103+
* Generate the routes file to be used in Vue files.
104+
*
105+
* @returns {Promise<any>}
106+
*/
107+
function routes() {
108+
return new Promise((resolve, reject) => {
109+
exec('php artisan ziggy:generate resources/assets/scripts/helpers/ziggy.js', {}, (err, stdout, stderr) => {
110+
return err ? reject(err) : resolve({ stdout, stderr });
111+
});
112+
})
113+
}
114+
88115
/**
89116
* Cleanup unused versions of hashed assets.
90117
*/
@@ -93,9 +120,12 @@ function clean() {
93120
}
94121

95122
exports.clean = clean;
123+
exports.i18n = i18n;
124+
exports.routes = routes;
96125
exports.styles = styles;
97126
exports.scripts = scripts;
98127
exports.watch = watch;
99128

129+
gulp.task('components', gulp.parallel(i18n, routes));
100130
gulp.task('scripts', gulp.series(clean, scripts));
101-
gulp.task('default', gulp.series(clean, styles, scripts));
131+
gulp.task('default', gulp.series(clean, i18n, routes, styles, scripts));

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"jquery": "^3.3.1",
3131
"jwt-decode": "^2.2.0",
3232
"lodash": "^4.17.5",
33+
"luxon": "^1.2.1",
3334
"postcss": "^6.0.21",
3435
"postcss-import": "^11.1.0",
3536
"postcss-preset-env": "^3.4.0",
@@ -42,6 +43,7 @@
4243
"vue": "^2.5.7",
4344
"vue-axios": "^2.1.1",
4445
"vue-devtools": "^3.1.9",
46+
"vue-feather-icons": "^4.7.1",
4547
"vue-loader": "^14.2.2",
4648
"vue-mc": "^0.2.4",
4749
"vue-router": "^3.0.1",
@@ -58,6 +60,7 @@
5860
"build:filemanager": "./node_modules/babel-cli/bin/babel.js public/themes/pterodactyl/js/frontend/files/src --source-maps --out-file public/themes/pterodactyl/js/frontend/files/filemanager.min.js",
5961
"watch": "./node_modules/gulp-cli/bin/gulp.js watch",
6062
"build": "./node_modules/gulp-cli/bin/gulp.js default",
63+
"build:components": "./node_modules/gulp-cli/bin/gulp.js components",
6164
"build:styles": "./node_modules/gulp-cli/bin/gulp.js styles",
6265
"build:scripts": "./node_modules/gulp-cli/bin/gulp.js scripts"
6366
}

phpunit.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
processIsolation="false"
1111
stopOnFailure="false">
1212
<testsuites>
13+
<testsuite name="Browser">
14+
<directory suffix="Test.php">./tests/Browser/Processes</directory>
15+
</testsuite>
1316
<testsuite name="Integration">
1417
<directory suffix="Test.php">./tests/Integration</directory>
1518
</testsuite>

resources/assets/scripts/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ try {
1717
*/
1818

1919
window.axios = require('axios');
20-
2120
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
21+
window.axios.defaults.headers.common['Accept'] = 'application/json';
2222
window.axios.defaults.headers.common['Authorization'] = 'Bearer ' + localStorage.token || '';
2323

2424
if (typeof phpdebugbar !== 'undefined') {

0 commit comments

Comments
 (0)