Stage two
This commit is contained in:
parent
7cc4d269d9
commit
b2e48949cc
12 changed files with 21749 additions and 329 deletions
5
package-lock.json
generated
5
package-lock.json
generated
|
@ -11773,6 +11773,11 @@
|
|||
"jquery-mousewheel": "~3.1.13"
|
||||
}
|
||||
},
|
||||
"select2-bootstrap-theme": {
|
||||
"version": "0.1.0-beta.10",
|
||||
"resolved": "https://registry.npmjs.org/select2-bootstrap-theme/-/select2-bootstrap-theme-0.1.0-beta.10.tgz",
|
||||
"integrity": "sha1-uUJuz8A79KI152oTI3dXQxBGmsA="
|
||||
},
|
||||
"selfsigned": {
|
||||
"version": "1.10.3",
|
||||
"resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.3.tgz",
|
||||
|
|
|
@ -22,6 +22,12 @@
|
|||
"dependencies": {
|
||||
"huebee": "^2.0.0",
|
||||
"normalize.css": "^3.0.3",
|
||||
"select2": "^4.0.6-rc.1"
|
||||
"select2": "^4.0.6-rc.1",
|
||||
"select2-bootstrap-theme": "0.1.0-beta.10"
|
||||
},
|
||||
"standard": {
|
||||
"globals": [
|
||||
"$"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
21680
public/js/app.js
vendored
21680
public/js/app.js
vendored
File diff suppressed because it is too large
Load diff
2
public/mix-manifest.json
generated
2
public/mix-manifest.json
generated
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"/js/app.js": "/js/app.js?id=c549dcaca8cb144629a6",
|
||||
"/js/app.js": "/js/app.js?id=8de65b5d43dafe542bef",
|
||||
"/css/app.css": "/css/app.css?id=f49e3b104353d57ec9ed",
|
||||
"/js/vendor.js": "/js/vendor.js?id=ff934af2c14acea01420",
|
||||
"/js/manifest.js": "/js/manifest.js?id=360cf4a2ac3af2c3da19"
|
||||
|
|
|
@ -1,72 +1,68 @@
|
|||
/**
|
||||
* First we will load all of this project's JavaScript dependencies which
|
||||
* includes Vue and other libraries. It is a great starting point when
|
||||
* building robust, powerful web applications using Vue and Laravel.
|
||||
*/
|
||||
|
||||
require('./bootstrap')
|
||||
|
||||
// jQuery & jQuery UI
|
||||
import $ from 'jquery';
|
||||
window.$ = window.jQuery = $;
|
||||
import 'jquery-ui/ui/widgets/autocomplete.js';
|
||||
import 'jquery-ui/ui/widgets/sortable.js';
|
||||
import 'select2/dist/js/select2.js';
|
||||
import 'jquery-ui/ui/widgets/autocomplete.js'
|
||||
import 'jquery-ui/ui/widgets/sortable.js'
|
||||
import 'select2/dist/js/select2.js'
|
||||
|
||||
// Huebee
|
||||
import Huebee from 'huebee';
|
||||
window.Huebee = Huebee;
|
||||
$.when($.ready).then(function () {
|
||||
if ($('.message-container').length) {
|
||||
setTimeout(
|
||||
function () {
|
||||
$('.message-container').fadeOut()
|
||||
}, 3500)
|
||||
}
|
||||
|
||||
if ($('.livestats-container').length) {
|
||||
$('.livestats-container').each(function (index) {
|
||||
var id = $(this).data('id')
|
||||
var dataonly = $(this).data('dataonly')
|
||||
var increaseby = (dataonly === 1) ? 20000 : 1000
|
||||
var container = $(this)
|
||||
var maxTimer = 30000
|
||||
var timer = 5000;
|
||||
(function worker () {
|
||||
$.ajax({
|
||||
url: '/get_stats/' + id,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
container.html(data.html)
|
||||
if (data.status === 'active') timer = increaseby
|
||||
else {
|
||||
if (timer < maxTimer) timer += 2000
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
// Schedule the next request when the current one's complete
|
||||
setTimeout(worker, timer)
|
||||
}
|
||||
})
|
||||
})()
|
||||
})
|
||||
}
|
||||
|
||||
function readURL (input) {
|
||||
if (input.files && input.files[0]) {
|
||||
var reader = new FileReader()
|
||||
|
||||
$.when( $.ready ).then(function() {
|
||||
reader.onload = function (e) {
|
||||
$('#appimage img').attr('src', e.target.result)
|
||||
}
|
||||
|
||||
if($('.message-container').length) {
|
||||
setTimeout(
|
||||
function()
|
||||
{
|
||||
$('.message-container').fadeOut();
|
||||
}, 3500);
|
||||
reader.readAsDataURL(input.files[0])
|
||||
}
|
||||
}
|
||||
|
||||
if($('.livestats-container').length) {
|
||||
$('.livestats-container').each(function(index){
|
||||
var id = $(this).data('id');
|
||||
var dataonly = $(this).data('dataonly');
|
||||
var increaseby = (dataonly == 1) ? 20000 : 1000;
|
||||
var container = $(this);
|
||||
var max_timer = 30000;
|
||||
var timer = 5000;
|
||||
(function worker() {
|
||||
$.ajax({
|
||||
url: '/get_stats/'+id,
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
container.html(data.html);
|
||||
if(data.status == 'active') timer = increaseby;
|
||||
else {
|
||||
if(timer < max_timer) timer += 2000;
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
// Schedule the next request when the current one's complete
|
||||
setTimeout(worker, timer);
|
||||
}
|
||||
});
|
||||
})();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function readURL(input) {
|
||||
|
||||
if (input.files && input.files[0]) {
|
||||
var reader = new FileReader();
|
||||
|
||||
reader.onload = function(e) {
|
||||
$('#appimage img').attr('src', e.target.result);
|
||||
};
|
||||
|
||||
reader.readAsDataURL(input.files[0]);
|
||||
}
|
||||
}
|
||||
|
||||
$('#upload').change(function() {
|
||||
readURL(this);
|
||||
});
|
||||
/*$(".droppable").droppable({
|
||||
$('#upload').change(function () {
|
||||
readURL(this)
|
||||
})
|
||||
/* $(".droppable").droppable({
|
||||
tolerance: "intersect",
|
||||
drop: function( event, ui ) {
|
||||
var tag = $( this ).data('id');
|
||||
|
@ -81,82 +77,103 @@ $.when( $.ready ).then(function() {
|
|||
});
|
||||
|
||||
}
|
||||
});*/
|
||||
}); */
|
||||
|
||||
$( '#sortable' ).sortable({
|
||||
stop: function (event, ui) {
|
||||
var idsInOrder = $('#sortable').sortable('toArray', {
|
||||
attribute: 'data-id'
|
||||
});
|
||||
$.post(
|
||||
'/order',
|
||||
{ order:idsInOrder }
|
||||
);
|
||||
$('#sortable').sortable({
|
||||
stop: function (event, ui) {
|
||||
var idsInOrder = $('#sortable').sortable('toArray', {
|
||||
attribute: 'data-id'
|
||||
})
|
||||
$.post(
|
||||
'/order',
|
||||
{ order: idsInOrder }
|
||||
)
|
||||
}
|
||||
|
||||
})
|
||||
$('#sortable').sortable('disable')
|
||||
|
||||
$('#app').on('click', '#config-button', function (e) {
|
||||
e.preventDefault()
|
||||
var app = $('#app')
|
||||
var active = (app.hasClass('header'))
|
||||
app.toggleClass('header')
|
||||
if (active) {
|
||||
$('.add-item').hide()
|
||||
$('.item-edit').hide()
|
||||
$('#app').removeClass('sidebar')
|
||||
$('#sortable').sortable('disable')
|
||||
} else {
|
||||
$('#sortable').sortable('enable')
|
||||
setTimeout(function () {
|
||||
$('.add-item').fadeIn()
|
||||
$('.item-edit').fadeIn()
|
||||
}, 350)
|
||||
}
|
||||
}).on('click', '#add-item, #pin-item', function (e) {
|
||||
e.preventDefault()
|
||||
var app = $('#app')
|
||||
var active = (app.hasClass('sidebar'))
|
||||
app.toggleClass('sidebar')
|
||||
}).on('click', '.close-sidenav', function (e) {
|
||||
e.preventDefault()
|
||||
var app = $('#app')
|
||||
app.removeClass('sidebar')
|
||||
}).on('click', '#test_config', function (e) {
|
||||
e.preventDefault()
|
||||
var apiUrl = $('#create input[name=url]').val()
|
||||
|
||||
var overrideUrl = $('#create input[name="config[override_url]"').val()
|
||||
if (overrideUrl.length && overrideUrl !== '') {
|
||||
apiUrl = overrideUrl
|
||||
}
|
||||
|
||||
var data = {}
|
||||
data['url'] = apiUrl
|
||||
$('input.config-item').each(function (index) {
|
||||
var config = $(this).data('config')
|
||||
data[config] = $(this).val()
|
||||
})
|
||||
|
||||
$.post('/test_config', { data: data }, function (data) {
|
||||
alert(data)
|
||||
})
|
||||
})
|
||||
$('#pinlist').on('click', 'a', function (e) {
|
||||
e.preventDefault()
|
||||
var current = $(this)
|
||||
var id = current.data('id')
|
||||
$.get('items/pintoggle/' + id + '/true', function (data) {
|
||||
var inner = $(data).filter('#sortable').html()
|
||||
$('#sortable').html(inner)
|
||||
current.toggleClass('active')
|
||||
})
|
||||
})
|
||||
|
||||
var elem = $('.color-picker')[0]
|
||||
var hueb = new Huebee(elem, {
|
||||
// options
|
||||
})
|
||||
|
||||
$('#appname').autocomplete({
|
||||
source: availableApps,
|
||||
select: function (event, ui) {
|
||||
$.post('/appload', { app: ui.item.value }, function (data) {
|
||||
$('#appimage').html("<img src='/storage/" + data.icon + "' /><input type='hidden' name='icon' value='" + data.icon + "' />")
|
||||
$('input[name=colour]').val(data.colour)
|
||||
hueb.setColor(data.colour)
|
||||
$('input[name=pinned]').prop('checked', true)
|
||||
if (data.config !== null) {
|
||||
$.get('/view/' + data.config, function (getdata) {
|
||||
$('#sapconfig').html(getdata).show()
|
||||
})
|
||||
}
|
||||
}, 'json')
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
$('#sortable').sortable('disable');
|
||||
|
||||
|
||||
$('#app').on('click', '#config-button', function(e) {
|
||||
e.preventDefault();
|
||||
var app = $('#app');
|
||||
var active = (app.hasClass('header'));
|
||||
app.toggleClass('header');
|
||||
if(active) {
|
||||
$('.add-item').hide();
|
||||
$('.item-edit').hide();
|
||||
$('#app').removeClass('sidebar');
|
||||
$('#sortable').sortable('disable');
|
||||
} else {
|
||||
$('#sortable').sortable('enable');
|
||||
setTimeout(function() {
|
||||
$('.add-item').fadeIn();
|
||||
$('.item-edit').fadeIn();
|
||||
}, 350);
|
||||
|
||||
}
|
||||
}).on('click', '#add-item, #pin-item', function(e) {
|
||||
e.preventDefault();
|
||||
var app = $('#app');
|
||||
var active = (app.hasClass('sidebar'));
|
||||
app.toggleClass('sidebar');
|
||||
|
||||
}).on('click', '.close-sidenav', function(e) {
|
||||
e.preventDefault();
|
||||
var app = $('#app');
|
||||
app.removeClass('sidebar');
|
||||
|
||||
}).on('click', '#test_config', function(e) {
|
||||
e.preventDefault();
|
||||
var apiurl = $('#create input[name=url]').val();
|
||||
|
||||
var override_url = $('#create input[name="config[override_url]"]').val();
|
||||
if(override_url.length && override_url != '') {
|
||||
apiurl = override_url;
|
||||
}
|
||||
|
||||
var data = {};
|
||||
data['url'] = apiurl;
|
||||
$('input.config-item').each(function(index){
|
||||
var config = $(this).data('config');
|
||||
data[config] = $(this).val();
|
||||
});
|
||||
|
||||
$.post('/test_config', { data: data }, function(data) {
|
||||
alert(data);
|
||||
});
|
||||
|
||||
});
|
||||
$('#pinlist').on('click', 'a', function(e) {
|
||||
e.preventDefault();
|
||||
var current = $(this);
|
||||
var id = current.data('id');
|
||||
$.get('items/pintoggle/'+id+'/true', function(data) {
|
||||
var inner = $(data).filter('#sortable').html();
|
||||
$('#sortable').html(inner);
|
||||
current.toggleClass('active');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
$('.tags').select2()
|
||||
// $('.tags').select2({
|
||||
// theme: 'bootstrap'
|
||||
// })
|
||||
})
|
||||
|
|
1
resources/assets/js/bootstrap.js
vendored
1
resources/assets/js/bootstrap.js
vendored
|
@ -1,4 +1,3 @@
|
|||
|
||||
window._ = require('lodash');
|
||||
|
||||
/**
|
||||
|
|
3
resources/assets/sass/app.scss
vendored
3
resources/assets/sass/app.scss
vendored
|
@ -23,6 +23,7 @@
|
|||
|
||||
@import "select2";
|
||||
// @import "~select2/dist/css/select2.css";
|
||||
// @import "~select2-bootstrap-theme/dist/select2-bootstrap.css";
|
||||
|
||||
// jQuery UU
|
||||
// @import '~jquery-ui/themes/base/all.css';
|
||||
|
@ -33,4 +34,4 @@
|
|||
@import '~jquery-ui/themes/base/theme.css';
|
||||
|
||||
// Override
|
||||
@import 'override';
|
||||
// @import 'override';
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<meta name="theme-color" content="#ffffff">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<link rel="stylesheet" href="{{ mix('css/app.css') }}" type="text/css" />
|
||||
|
||||
</head>
|
||||
|
@ -40,7 +41,7 @@
|
|||
$active = ((bool)$app->pinned === true) ? 'active' : '';
|
||||
?>
|
||||
<li>{{ $app->title }}<a class="{{ $active }}" data-id="{{ $app->id }}" href="{{ route('items.pintoggle', [$app->id], false) }}"><i class="fas fa-thumbtack"></i></a></li>
|
||||
|
||||
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
|
@ -71,13 +72,13 @@
|
|||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@yield('content')
|
||||
<div id="config-buttons">
|
||||
@if(Route::is('dash') || Route::is('tags.show'))
|
||||
<a id="config-button" class="config" href=""><i class="fas fa-exchange"></i></a>
|
||||
@endif
|
||||
|
||||
|
||||
<a id="dash" class="config" href="{{ route('dash', [], false) }}"><i class="fas fa-th"></i></a>
|
||||
<a id="items" class="config" href="{{ route('items.index', [], false) }}"><i class="fas fa-list"></i></a>
|
||||
<a id="folder" class="config" href="{{ route('tags.index', [], false) }}"><i class="fas fa-tag"></i></a>
|
||||
|
@ -87,15 +88,11 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
{{-- <script src="//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> --}}
|
||||
{{-- <script>!window.jQuery && document.write('<script src="/js/jquery-3.3.1.min.js"><\/script>')</script> --}}
|
||||
{{-- <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> --}}
|
||||
{{-- <script src="/js/app.js?v=2"></script> --}}
|
||||
{{-- <script src="{{ mix('js/app.js') }}"></script> --}}
|
||||
|
||||
<script src="{{ mix('js/manifest.js') }}"></script>
|
||||
<script src="{{ mix('js/vendor.js') }}"></script>
|
||||
<script src="{{ mix('js/app.js') }}"></script>
|
||||
@yield('scripts')
|
||||
|
||||
|
||||
@stack('scripts')
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
{!! Form::close() !!}
|
||||
|
||||
@endsection
|
||||
@section('scripts')
|
||||
|
||||
@push('scripts')
|
||||
@include('items.scripts')
|
||||
@endsection
|
||||
@endpush
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
{!! Form::close() !!}
|
||||
|
||||
@endsection
|
||||
@section('scripts')
|
||||
|
||||
@push('scripts')
|
||||
@include('items.scripts')
|
||||
@endsection
|
||||
@endpush
|
||||
|
|
|
@ -1,38 +1,3 @@
|
|||
{{-- <script src="{{ mix('js/app.js') }}"></script> --}}
|
||||
<script>
|
||||
$( function() {
|
||||
|
||||
var elem = $('.color-picker')[0];
|
||||
var hueb = new Huebee( elem, {
|
||||
// options
|
||||
});
|
||||
|
||||
var availableTags = [
|
||||
<?php
|
||||
$supported = App\Item::supportedOptions();
|
||||
foreach($supported as $sapp) {
|
||||
echo '"'.$sapp.'",';
|
||||
}
|
||||
?>
|
||||
];
|
||||
$( "#appname" ).autocomplete({
|
||||
source: availableTags,
|
||||
select: function( event, ui ) {
|
||||
$.post('/appload', { app: ui.item.value }, function(data) {
|
||||
$('#appimage').html("<img src='/storage/"+data.icon+"' /><input type='hidden' name='icon' value='"+data.icon+"' />");
|
||||
$('input[name=colour]').val(data.colour);
|
||||
hueb.setColor( data.colour );
|
||||
$('input[name=pinned]').prop('checked', true);
|
||||
if(data.config != null) {
|
||||
$.get('/view/'+data.config, function(getdata) {
|
||||
$('#sapconfig').html(getdata).show();
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
|
||||
$('.tags').select2();
|
||||
|
||||
});
|
||||
var availableApps = @json($supported = App\Item::supportedOptions())
|
||||
</script>
|
||||
|
|
24
webpack.mix.js
vendored
24
webpack.mix.js
vendored
|
@ -1,4 +1,4 @@
|
|||
let mix = require('laravel-mix');
|
||||
let mix = require('laravel-mix')
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -11,12 +11,16 @@ let mix = require('laravel-mix');
|
|||
|
|
||||
*/
|
||||
|
||||
mix.extract([
|
||||
'huebee',
|
||||
'jquery',
|
||||
'jquery-ui',
|
||||
'select2'
|
||||
])
|
||||
.js('resources/assets/js/app.js', 'public/js')
|
||||
.sass('resources/assets/sass/app.scss', 'public/css')
|
||||
.version();
|
||||
mix
|
||||
.autoload({
|
||||
huebee: ['Huebee'] // only one
|
||||
})
|
||||
.extract([
|
||||
'huebee',
|
||||
'jquery',
|
||||
'jquery-ui',
|
||||
'select2'
|
||||
])
|
||||
.js('resources/assets/js/app.js', 'public/js')
|
||||
.sass('resources/assets/sass/app.scss', 'public/css')
|
||||
.version()
|
||||
|
|
Loading…
Add table
Reference in a new issue