/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
$form = new Form(new PersonalAccessToken());
$form->editing(function ($form) {
$form->model()->makeVisible('token');
});
$form->text('tokenable_type', __('Tokenable type'));
$form->text('tokenable_id', __('Tokenable id'));
$form->text('name', __('Name'));
$form->text('token', __('Token'));
// $form->display('abilities', __('Abilities'));
$form->datetime('last_used_at', __('Last used at'));
$form->datetime('created_at', __('Created at'));
$form->datetime('updated_at', __('Updated at'));
return $form;
}
function audioPlayerButtons() {
$player_back = $('#player-back');
$player_next = $('#player-next');
$player_random = $('#player-random');
$player_pause = $('#player-pause');
$player_play = $('#player-play');
$player_volume = $('#player-volume');
audio.addEventListener('onended', function () {
track_index += 1;
setTrack();
});
$player_back.click(function (e) {
if ((track_index - 1) < 0) {
track_index = audioPlayerList.length - 1;
setTrack();
audio.play();
return;
}
track_index -= 1;
setTrack();
});
$player_next.click(function (e) {
if ((track_index + 1) > audioPlayerList.length) {
track_index = 0;
setTrack();
audio.play();
return;
}
track_index += 1;
setTrack();
});
$player_pause.click(function (e) {
audio.pause();
});
$player_play.click(function (e) {
audio.play();
});
$player_volume.change(function (e) {
audio.volume = $player_volume.val() / 100;
});
}
function setTrack() {
first_audio_track = audioPlayerList[0];
track_index = 0;
audio.src = audio_path + first_audio_track.file;
$current_track_name_ui.text(first_audio_track.filename);
if (first_audio_track.youtube) {
$current_track_link_ui.show();
$current_track_link_ui.attr('href', first_audio_track.youtube);
} else {
$current_track_link_ui.hide();
}
}
function initializeAudioPlayer() {
audio_path = '/storage/tracks/kimberannie/';
audio = new Audio();
$current_track_name_ui = $('.kimberly-radio .track .running p');
$current_track_link_ui = $('.kimberly-radio .track .running a');
if (audioPlayerList.length === 0) return;
audioPlayerButtons();
setTrack();
}
initializeAudioPlayer();
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12 mb-3">
<div class="card">
<div class="card-header">{{ __('servers.' . $title) }}</div>
<div class="card-body">
<div id="servers">
<servers-component :langs-prop="'{{ base64_encode(json_encode($langs)) }}'" :servers-prop="'{{ base64_encode(json_encode($servers, JSON_NUMERIC_CHECK)) }}'"></servers-component>
</div>
{{ $servers->links() }}
</div>
</div>
</div>
</div>
</div>
@endsection
<?php $sjson = json_encode($servers); ?>
<servers-component :servers="{{ $sjson }}"></servers-component>
const child_process = require('child_process');
const ch = child_process.spawn('test.bat', [], {
shell: true,
})
ch.stdout.on('data', (data) => {
console.log(`Stdout: ${data}`);
});
ch.stderr.on('data', (data) => {
//console.log(`Stderr: ${data}`);
});
ch.on('close', (code) => {
//console.log(`Code: ${code}`);
});
ch.on('error', (err) => {
//console.log(`Error: ${err}`);
});