Compare commits

...

13 Commits

Author SHA1 Message Date
Kode
ac7446ffe6 update version 2018-11-14 18:14:23 +00:00
Kode
e45d3ca6ec remove apps 2018-11-14 18:10:55 +00:00
Chris
603550a453 autofocus password 2018-11-13 12:38:19 +00:00
Kode
4463ef4a9a add right to livestats 2018-11-10 21:37:21 +00:00
Kode
49b8dc0079 Update version number 2018-11-10 18:05:19 +00:00
Kode
ab83c3a551 Small changes
Copy icon if missing on new app add.
Change order of create symlink and load apps
2018-11-09 23:07:01 +00:00
Chris
98c6093674 Check url isn't missing when testing 2018-11-07 11:24:26 +00:00
Chris
e1f51521bf Update version 2018-11-07 08:57:18 +00:00
Chris
e85bc98dcc Fix ProcessJobs not working if folder is empty but table isn't 2018-11-07 08:54:00 +00:00
Chris
4ba52baa5c Remove old code from tags form 2018-11-06 15:44:09 +00:00
Chris
a82077b4de Update version 2018-11-06 15:15:55 +00:00
Chris
b8f04f3d11 Fix preview and config not retaining values 2018-11-06 14:52:45 +00:00
Chris
e91f65f833 Ignore copy errors 2018-11-06 11:53:25 +00:00
13 changed files with 98 additions and 35 deletions

View File

@@ -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;
}

View File

@@ -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()) {

View File

@@ -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);
}

View File

@@ -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)
{

View File

@@ -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;

View File

@@ -14,7 +14,7 @@ return [
*/
'name' => env('APP_NAME', 'Heimdall'),
'version' => '2.1.8',
'version' => '2.1.12',
/*
|--------------------------------------------------------------------------

22
public/css/app.css vendored
View File

@@ -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;

View File

@@ -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"
}
}

View File

@@ -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;
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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");
}
}

View File

@@ -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>