mirror of
https://github.com/linuxserver/Heimdall.git
synced 2026-02-25 06:00:32 +09:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac7446ffe6 | ||
|
|
e45d3ca6ec | ||
|
|
603550a453 | ||
|
|
4463ef4a9a | ||
|
|
49b8dc0079 | ||
|
|
ab83c3a551 | ||
|
|
98c6093674 | ||
|
|
e1f51521bf | ||
|
|
e85bc98dcc | ||
|
|
4ba52baa5c | ||
|
|
a82077b4de | ||
|
|
b8f04f3d11 | ||
|
|
e91f65f833 |
@@ -13,6 +13,14 @@ class Application extends Model
|
||||
//
|
||||
public function icon()
|
||||
{
|
||||
if(!file_exists(storage_path('app/public/'.$this->icon))) {
|
||||
$img_src = app_path('SupportedApps/'.$this->name.'/'.str_replace('icons/', '', $this->icon));
|
||||
$img_dest = storage_path('app/public/'.$this->icon);
|
||||
//die("i: ".$img_src);
|
||||
@copy($img_src, $img_dest);
|
||||
}
|
||||
|
||||
|
||||
return $this->icon;
|
||||
}
|
||||
|
||||
|
||||
14
app/Item.php
14
app/Item.php
@@ -124,6 +124,14 @@ class Item extends Model
|
||||
}
|
||||
}
|
||||
|
||||
public static function nameFromClass($class)
|
||||
{
|
||||
$explode = explode('\\', $class);
|
||||
$name = end($explode);
|
||||
|
||||
return $name;
|
||||
}
|
||||
|
||||
public function scopeOfType($query, $type)
|
||||
{
|
||||
switch($type) {
|
||||
@@ -148,6 +156,12 @@ class Item extends Model
|
||||
return (bool)($app instanceof \App\EnhancedApps);
|
||||
}
|
||||
|
||||
public static function isEnhanced($class)
|
||||
{
|
||||
$app = new $class;
|
||||
return (bool)($app instanceof \App\EnhancedApps);
|
||||
}
|
||||
|
||||
public function enabled()
|
||||
{
|
||||
if($this->enhanced()) {
|
||||
|
||||
@@ -34,11 +34,15 @@ class ProcessApps implements ShouldQueue
|
||||
$localapps = Application::all();
|
||||
$list = json_decode(SupportedApps::getList()->getBody());
|
||||
$validapps = [];
|
||||
|
||||
foreach($list->apps as $app) {
|
||||
$validapps[] = $app->appid;
|
||||
$localapp = $localapps->where('appid', $app->appid)->first();
|
||||
|
||||
$application = ($localapp) ? $localapp : new Application;
|
||||
|
||||
if(!file_exists(app_path('SupportedApps/'.className($app->name)))) {
|
||||
SupportedApps::getFiles($app);
|
||||
$application = new Application;
|
||||
SupportedApps::saveApp($app, $application);
|
||||
} else {
|
||||
// check if there has been an update for this app
|
||||
@@ -46,11 +50,10 @@ class ProcessApps implements ShouldQueue
|
||||
if($localapp) {
|
||||
if($localapp->sha !== $app->sha) {
|
||||
SupportedApps::getFiles($app);
|
||||
SupportedApps::saveApp($app, $localapp);
|
||||
SupportedApps::saveApp($app, $application);
|
||||
}
|
||||
} else {
|
||||
SupportedApps::getFiles($app);
|
||||
$application = new Application;
|
||||
SupportedApps::saveApp($app, $application);
|
||||
|
||||
}
|
||||
|
||||
@@ -47,6 +47,11 @@ class AppServiceProvider extends ServiceProvider
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!is_file(public_path('storage'))) {
|
||||
Artisan::call('storage:link');
|
||||
\Session::put('current_user', null);
|
||||
}
|
||||
|
||||
$applications = Application::all();
|
||||
if($applications->count() <= 0) {
|
||||
@@ -58,11 +63,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
}
|
||||
|
||||
if(!is_file(public_path('storage'))) {
|
||||
Artisan::call('storage:link');
|
||||
\Session::put('current_user', null);
|
||||
}
|
||||
|
||||
// User specific settings need to go here as session isn't available at this point in the app
|
||||
view()->composer('*', function ($view)
|
||||
{
|
||||
|
||||
@@ -13,6 +13,13 @@ abstract class SupportedApps
|
||||
|
||||
public function appTest($url, $attrs = [], $overridevars=false)
|
||||
{
|
||||
if(empty($this->config->url)) {
|
||||
return (object)[
|
||||
'code' => 404,
|
||||
'status' => 'No URL has been specified',
|
||||
'response' => 'No URL has been specified',
|
||||
];
|
||||
}
|
||||
$res = $this->execute($url, $attrs);
|
||||
if($res == null) {
|
||||
return (object)[
|
||||
@@ -136,14 +143,14 @@ abstract class SupportedApps
|
||||
|
||||
public static function saveApp($details, $app)
|
||||
{
|
||||
if(!file_exists(public_path('storage/icons'))) {
|
||||
mkdir(public_path('storage/icons'), 0777, true);
|
||||
if(!file_exists(storage_path('app/public/icons'))) {
|
||||
mkdir(storage_path('app/public/icons'), 0777, true);
|
||||
}
|
||||
|
||||
$img_src = app_path('SupportedApps/'.className($details->name).'/'.$details->icon);
|
||||
$img_dest = storage_path('app/public/icons/'.$details->icon);
|
||||
//die("i: ".$img_src);
|
||||
copy($img_src, $img_dest);
|
||||
@copy($img_src, $img_dest);
|
||||
|
||||
$app->appid = $details->appid;
|
||||
$app->name = $details->name;
|
||||
|
||||
@@ -14,7 +14,7 @@ return [
|
||||
*/
|
||||
|
||||
'name' => env('APP_NAME', 'Heimdall'),
|
||||
'version' => '2.1.8',
|
||||
'version' => '2.1.12',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
22
public/css/app.css
vendored
22
public/css/app.css
vendored
@@ -1274,12 +1274,6 @@ hr {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.livestats-container .livestats li {
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.livestats-container .livestats span {
|
||||
display: block;
|
||||
text-transform: uppercase;
|
||||
@@ -1311,6 +1305,22 @@ hr {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.livestats-container .livestats li {
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.livestats-container .livestats li.right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.livestats-container .livestats li.right span {
|
||||
-webkit-box-pack: end;
|
||||
-ms-flex-pack: end;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.livestats-container .livestats.flexcolumn {
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: normal;
|
||||
|
||||
4
public/mix-manifest.json
generated
4
public/mix-manifest.json
generated
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"/css/app.css": "/css/app.css?id=476a34b0b53427a036fd",
|
||||
"/css/app.css": "/css/app.css?id=fc4d028f7cc679d5b7bf",
|
||||
"/js/app.js": "/js/app.js?id=8dc4a6ea723d0df7469d"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -866,11 +866,6 @@ hr {
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
|
||||
li {
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
line-height: 1;
|
||||
}
|
||||
span {
|
||||
display: block;
|
||||
text-transform: uppercase;
|
||||
@@ -893,6 +888,18 @@ hr {
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
li {
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
line-height: 1;
|
||||
&.right {
|
||||
text-align: right;
|
||||
span {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.flexcolumn {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ $user = \App\User::currentUser();
|
||||
<img class="user-img" src="{{ asset('/img/heimdall-icon-small.png') }}" />
|
||||
@endif
|
||||
{{ $user->username }}
|
||||
<input id="password" type="password" class="form-control" name="password" required>
|
||||
<input id="password" type="password" class="form-control" name="password" autofocus required>
|
||||
<button type="submit" class="btn btn-primary">Login</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -81,13 +81,23 @@
|
||||
|
||||
|
||||
@if(isset($item) && $item->enhanced())
|
||||
|
||||
<div id="sapconfig" style="display: block;">
|
||||
@if(isset($item))
|
||||
@include('SupportedApps::'.$item->getconfig()->name.'.config')
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@elseif(old('class') && App\Item::isEnhanced(old('class')))
|
||||
|
||||
<div id="sapconfig" style="display: block;">
|
||||
@include('SupportedApps::'.App\Item::nameFromClass(old('class')).'.config')
|
||||
</div>
|
||||
|
||||
@else
|
||||
|
||||
<div id="sapconfig"></div>
|
||||
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
@@ -26,6 +26,12 @@
|
||||
appload(appvalue);
|
||||
}
|
||||
});
|
||||
// initial load
|
||||
$('#tile-preview .title').html($('#appname').val());
|
||||
$('#tile-preview .item').css('backgroundColor', $('#appcolour').val());
|
||||
$('#tile-preview .app-icon').attr('src', $('#appimage img').attr('src'));
|
||||
|
||||
// Updates
|
||||
$('#appname').on('keyup change', function(e) {
|
||||
$('#tile-preview .title').html($(this).val());
|
||||
})
|
||||
@@ -39,7 +45,10 @@
|
||||
$('.tags').select2();
|
||||
|
||||
function appload(appvalue) {
|
||||
$.post('{{ route('appload') }}', { app: appvalue }, function(data) {
|
||||
if(appvalue == 'None') {
|
||||
$('#sapconfig').html('').hide();
|
||||
} else {
|
||||
$.post('{{ route('appload') }}', { app: appvalue }, function(data) {
|
||||
// Main details
|
||||
$('#appimage').html("<img src='"+data.iconview+"' /><input type='hidden' name='icon' value='"+data.icon+"' />");
|
||||
$('input[name=colour]').val(data.colour);
|
||||
@@ -53,8 +62,11 @@
|
||||
$.get('/view/'+data.config, function(getdata) {
|
||||
$('#sapconfig').html(getdata).show();
|
||||
});
|
||||
} else {
|
||||
$('#sapconfig').html('').hide();
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -52,15 +52,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(isset($item) && isset($item->config->view))
|
||||
<div id="sapconfig" style="display: block;">
|
||||
@if(isset($item))
|
||||
@include('supportedapps.'.$item->config->view)
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
<div id="sapconfig"></div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
Reference in New Issue
Block a user