fixes
This commit is contained in:
parent
4351f55225
commit
21c1401859
6 changed files with 38 additions and 7 deletions
|
@ -304,6 +304,7 @@ class ItemController extends Controller
|
|||
|
||||
// basic details
|
||||
$output['icon'] = $app_details->icon();
|
||||
$output['name'] = $app_details->name;
|
||||
$output['iconview'] = $app_details->iconView();
|
||||
$output['colour'] = $app_details->defaultColour();
|
||||
$output['class'] = $appclass;
|
||||
|
@ -357,7 +358,7 @@ class ItemController extends Controller
|
|||
SupportedApps::saveApp($app, $application);
|
||||
} else {
|
||||
// check if there has been an update for this app
|
||||
$localapp = $localapps->where('name', $app->name)->first();
|
||||
$localapp = $localapps->where('appid', $app->appid)->first();
|
||||
if($localapp) {
|
||||
if($localapp->sha !== $app->sha) {
|
||||
SupportedApps::getFiles($app);
|
||||
|
|
|
@ -75,14 +75,14 @@ abstract class SupportedApps
|
|||
{
|
||||
$list_url = 'https://apps.heimdall.site/list';
|
||||
$client = new Client(['http_errors' => false, 'timeout' => 15, 'connect_timeout' => 15]);
|
||||
return $client->request($this->method, $list_url);
|
||||
return $client->request('GET', $list_url);
|
||||
}
|
||||
|
||||
public static function getFiles($app)
|
||||
{
|
||||
$zipurl = $app->files;
|
||||
$client = new Client(['http_errors' => false, 'timeout' => 60, 'connect_timeout' => 15]);
|
||||
$res = $client->request($this->method, $zipurl);
|
||||
$res = $client->request('GET', $zipurl);
|
||||
|
||||
if(!file_exists(app_path('SupportedApps'))) {
|
||||
mkdir(app_path('SupportedApps'), 0777, true);
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
<div class="input">
|
||||
<label>{{ __('app.apps.colour') }} *</label>
|
||||
{!! Form::text('colour', null, array('placeholder' => __('app.apps.hex'),'class' => 'form-control color-picker')) !!}
|
||||
{!! Form::text('colour', null, array('placeholder' => __('app.apps.hex'), 'id' => 'appcolour', 'class' => 'form-control color-picker set-bg-elem')) !!}
|
||||
</div>
|
||||
|
||||
<div class="input">
|
||||
|
@ -74,7 +74,7 @@
|
|||
</div>
|
||||
|
||||
|
||||
<div class="input">
|
||||
<div id="tile-preview" class="input">
|
||||
@include('items.preview')
|
||||
</div>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
$item = $item ?? new App\Item;
|
||||
?>
|
||||
<section class="item-container" data-id="">
|
||||
<div class="item" style="background-color: {{ $item->colour ?? '#222' }}">
|
||||
<div class="item set-bg-elem" style="background-color: {{ $item->colour ?? '#222' }}">
|
||||
@if(isset($item->icon) && !empty($item->icon))
|
||||
<img class="app-icon" src="{{ asset('/storage/'.$item->icon) }}" />
|
||||
@else
|
||||
|
|
|
@ -5,19 +5,33 @@
|
|||
var elem = $('.color-picker')[0];
|
||||
var hueb = new Huebee( elem, {
|
||||
// options
|
||||
setBGColor: '.set-bg-elem'
|
||||
});
|
||||
|
||||
hueb.on( 'change', function( color, hue, sat, lum ) {
|
||||
$.get('{{ route('titlecolour') }}', {color}, function(data) {
|
||||
$('#tile-preview .title').removeClass("black white");
|
||||
$('#tile-preview .link').removeClass("black white");
|
||||
$('#tile-preview .title').addClass(data);
|
||||
$('#tile-preview .link').addClass(data);
|
||||
});
|
||||
})
|
||||
|
||||
var availableTags = @json(App\Application::all()->pluck('name'));
|
||||
|
||||
$( "#appname" ).autocomplete({
|
||||
source: availableTags,
|
||||
select: function( event, ui ) {
|
||||
$.post('/appload', { app: ui.item.value }, function(data) {
|
||||
$.post('{{ route('appload') }}', { app: ui.item.value }, function(data) {
|
||||
// Main details
|
||||
$('#appimage').html("<img src='"+data.iconview+"' /><input type='hidden' name='icon' value='"+data.icon+"' />");
|
||||
$('input[name=colour]').val(data.colour);
|
||||
$('select[name=class]').val(data.class);
|
||||
hueb.setColor( data.colour );
|
||||
$('input[name=pinned]').prop('checked', true);
|
||||
// Preview details
|
||||
$('#tile-preview .app-icon').attr('src', data.iconview);
|
||||
$('#tile-preview .title').html(data.name);
|
||||
if(data.config != null) {
|
||||
$.get('/view/'+data.config, function(getdata) {
|
||||
$('#sapconfig').html(getdata).show();
|
||||
|
@ -26,6 +40,12 @@
|
|||
}, "json");
|
||||
}
|
||||
});
|
||||
$('#appname').on('keyup change', function(e) {
|
||||
$('#tile-preview .title').html($(this).val());
|
||||
})
|
||||
$('#appcolour').on('change', function(e) {
|
||||
$('#tile-preview .item').css('backgroundColor', $(this).val());
|
||||
})
|
||||
|
||||
$('.tags').select2();
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|
@ -43,6 +45,14 @@ Route::get('view/{name_view}', function ($name_view) {
|
|||
return view('SupportedApps::'.$name_view);
|
||||
});
|
||||
|
||||
Route::get('titlecolour', function (Request $request) {
|
||||
$color = $request->input('color');
|
||||
if($color) {
|
||||
return title_color($color);
|
||||
};
|
||||
|
||||
})->name('titlecolour');
|
||||
|
||||
Route::resource('users', 'UserController');
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue