32 Commits

Author SHA1 Message Date
f59e1d59df Merge branch 'master' into production 2024-06-25 20:55:43 -03:00
bb01401e0c chore: updating composer and npm packages 2024-06-25 20:52:45 -03:00
3dddb712c0 chore: upgrade to Laravel 10 2024-05-11 10:56:57 -03:00
781ef5ab6c Merge branch 'master' into production 2023-07-18 20:03:00 -03:00
618d91d23b chore: updating assets 2023-07-18 19:57:08 -03:00
ab6c2f2922 Merge branch 'master' into production 2023-03-15 19:36:15 -03:00
720da5a8d1 chore: updating npm/composer 2023-03-15 19:34:52 -03:00
22713fcbef Merge branch 'master' into production 2022-12-03 00:52:03 -03:00
3299047fb8 chore: update npm and composer 2022-12-03 00:51:21 -03:00
8d5e55e74e Merge branch 'master' into production 2022-11-17 21:31:09 -03:00
df08525010 feat: auto update passed time 2022-11-17 21:30:43 -03:00
cf4e70c7ac Merge branch 'master' into production 2022-11-16 19:32:59 -03:00
6bc94d0ec8 build: js assets 2022-11-16 19:32:41 -03:00
a067904b81 Merge branch 'master' into production 2022-11-16 19:28:18 -03:00
3bf111a868 Merge branch 'master' into production 2022-11-13 21:12:13 -03:00
082e12051e Merge branch 'master' into production 2022-11-13 21:05:23 -03:00
2cfec55c36 Merge branch 'master' into production 2022-11-13 16:20:19 -03:00
125a40d351 Merge branch 'master' into production 2022-11-10 00:02:25 -03:00
332ed47805 Merge branch 'master' into production 2022-09-05 18:57:49 -03:00
b3c00d388d Merge branch 'master' into production 2022-04-24 17:17:22 -03:00
740c66cd52 Merge branch 'master' into production 2022-02-24 00:17:56 -03:00
b5da2f5fe9 Merge branch 'master' into production 2022-02-24 00:03:02 -03:00
a8201ff2b4 build: update composer and npm 2022-02-24 00:01:00 -03:00
ab117ec74c Merge branch 'master' into production 2021-10-12 22:39:37 -03:00
b6eeef7e62 Merge branch 'master' into production 2021-06-12 12:09:53 -03:00
4d8b5aba6a Merge branch 'master' into production 2021-05-29 19:58:24 -03:00
21646ac2fd Merge branch 'master' into production 2021-05-29 16:00:30 -03:00
7e47708c4b Merge branch 'master' into production 2021-05-20 21:06:52 -03:00
54a44946cd Merge branch 'master' into production 2021-05-02 11:23:02 -03:00
f01b516ca9 chore: fix composer.lock version in production branch 2021-04-21 07:44:29 -03:00
a699738aa8 Merge branch 'master' into production 2021-04-21 07:29:32 -03:00
51ec05f5de chore: update composer packages 2021-04-20 10:59:21 -03:00
14 changed files with 2532 additions and 6427 deletions

View File

@@ -51,7 +51,7 @@ class Kernel extends HttpKernel
* *
* @var array * @var array
*/ */
protected $routeMiddleware = [ protected $middlewareAliases = [
'auth' => \App\Http\Middleware\Authenticate::class, 'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,

View File

@@ -22,7 +22,6 @@ class AuthServiceProvider extends ServiceProvider
*/ */
public function boot() public function boot()
{ {
$this->registerPolicies();
// //
} }

View File

@@ -6,11 +6,11 @@
"type": "project", "type": "project",
"require": { "require": {
"php": "^8.0.2", "php": "^8.0.2",
"inertiajs/inertia-laravel": "^0.6.3", "inertiajs/inertia-laravel": "^0.6.11",
"laravel/framework": "^9.19.0", "laravel/framework": "^10.0",
"laravel/ui": "^4.0",
"laravel/helpers": "^1.4", "laravel/helpers": "^1.4",
"laravel/tinker": "^2.4.1", "laravel/tinker": "^2.4.1",
"laravel/ui": "^3.0",
"pusher/pusher-php-server": "^7.2" "pusher/pusher-php-server": "^7.2"
}, },
"require-dev": { "require-dev": {
@@ -18,11 +18,11 @@
"filp/whoops": "^2.0", "filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4", "fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0", "mockery/mockery": "^1.0",
"nunomaduro/collision": "^6.1", "nunomaduro/collision": "^7.0",
"nunomaduro/larastan": "^0.7.4", "nunomaduro/larastan": "^2.9.5",
"nunomaduro/phpinsights": "*", "nunomaduro/phpinsights": "*",
"phpstan/phpstan": "^0.12.85", "phpstan/phpstan": "^1.10.66",
"phpunit/phpunit": "^9.0" "phpunit/phpunit": "^10.0"
}, },
"autoload": { "autoload": {
"classmap": [ "classmap": [
@@ -64,6 +64,6 @@
"dealerdirect/phpcodesniffer-composer-installer": true "dealerdirect/phpcodesniffer-composer-installer": true
} }
}, },
"minimum-stability": "dev", "minimum-stability": "stable",
"prefer-stable": true "prefer-stable": true
} }

4510
composer.lock generated

File diff suppressed because it is too large Load Diff

4295
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -19,5 +19,8 @@
"sass": "^1.56.1", "sass": "^1.56.1",
"sass-loader": "^8.0.2", "sass-loader": "^8.0.2",
"vite": "^3.2.3" "vite": "^3.2.3"
},
"dependencies": {
"moment": "^2.29.4"
} }
} }

File diff suppressed because one or more lines are too long

48
public/build/assets/app.4993c47e.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{ {
"resources/js/app.js": { "resources/js/app.js": {
"file": "assets/app.0299f74e.js", "file": "assets/app.4993c47e.js",
"src": "resources/js/app.js", "src": "resources/js/app.js",
"isEntry": true "isEntry": true
}, },

27
resources/js/app.js vendored
View File

@@ -6,6 +6,7 @@
*/ */
import './bootstrap'; import './bootstrap';
import moment from "moment";
// window.Vue = require('vue'); // window.Vue = require('vue');
@@ -21,6 +22,18 @@ import './bootstrap';
// el: '#app' // el: '#app'
// }); // });
function updateTime() {
var dates = document.getElementsByClassName("takenItemDate");
for (let i = 0; i < dates.length; i++) {
let time = dates.item(i).innerText;
let fromNow = moment(time).fromNow();
let id = "itemPassedTime_" + dates.item(i).id;
document.getElementById(id).innerText = fromNow;
}
}
updateTime();
setInterval(updateTime, 1 * 60 * 1000);
function setFaviconNumber(number) { function setFaviconNumber(number) {
var canvas = document.createElement('canvas'), var canvas = document.createElement('canvas'),
@@ -45,3 +58,17 @@ function setFaviconNumber(number) {
usedItems = document.getElementById("usedItems").innerText; usedItems = document.getElementById("usedItems").innerText;
setFaviconNumber(usedItems); setFaviconNumber(usedItems);
/**
* Source:
* https://www.designcise.com/web/tutorial/how-to-detect-if-the-browser-tab-is-active-or-not-using-javascript
*/
document.addEventListener('visibilitychange', function (event) {
if (document.hidden) {
console.log('not visible');
} else {
updateTime();
}
});

View File

@@ -1,6 +1,7 @@
@if ($item->used_by == \Auth::id()) @if ($item->used_by == \Auth::id())
<form action="/take" method="POST" class="form-inline"> <form action="/take" method="POST" class="form-inline">
<em class="pr-sm-2 ml-auto">{{\Carbon\Carbon::parse($item->updated_at)->diffForHumans()}}</em> <em id="itemPassedTime_{{$item->id}}" class="pr-sm-2 ml-auto">{{\Carbon\Carbon::parse($item->updated_at)->diffForHumans()}}</em>
<div hidden class="takenItemDate" id="{{$item->id}}">{{\Carbon\Carbon::parse($item->updated_at)->format('Y-m-d\TH:i:s.uP')}}</div>
<div class="w-100 d-xm-block d-sm-none"></div> <div class="w-100 d-xm-block d-sm-none"></div>
{{ csrf_field() }} {{ csrf_field() }}
@method('DELETE') @method('DELETE')
@@ -16,8 +17,9 @@
@if ($item->waiting_user_id && $item->waiting_user_id != \Auth::id()) @if ($item->waiting_user_id && $item->waiting_user_id != \Auth::id())
<strong>> {{str_limit($users[$item->waiting_user_id], 15, '...')}}</strong> <strong>> {{str_limit($users[$item->waiting_user_id], 15, '...')}}</strong>
@endif @endif
<small>({{$item->updated_at->diffForHumans()}})</small> <small id="itemPassedTime_{{$item->id}}">({{$item->updated_at->diffForHumans()}})</small>
</em> </em>
<div hidden class="takenItemDate" id="{{$item->id}}">{{$item->updated_at->format('Y-m-d\TH:i:s.uP')}}</div>
<div class="w-100 d-xm-block d-sm-none"></div> <div class="w-100 d-xm-block d-sm-none"></div>
{{ csrf_field() }} {{ csrf_field() }}
<input type="hidden" name="item" value="{{$item->id}}"> <input type="hidden" name="item" value="{{$item->id}}">

View File

@@ -1 +1,2 @@
ssh homestead -t "cd code/Bruno\ Fontes/shareit; bash --login" echo "Homestead password is: vagrant"
ssh homestead -t "cd shareit; bash --login"

View File

@@ -1,6 +1,7 @@
#!/bin/zsh #!/bin/zsh
export VAGRANT_CWD=/home/bruno/development/Homestead/ export VAGRANT_CWD=/home/bruno/development/Homestead/
vagrant up vagrant up
#builtin cd ~/development/laravelHomestead && /usr/bin/vagrant up && builtin cd - eval $DEV_BROWSER http://shareit.test \
#~/Apps/firefox/firefox-bin http://shareit.test https://mailtrap.io/inboxes/455614/messages \
#~/Apps/firefox/firefox-bin https://mailtrap.io/inboxes/455614/messages https://dashboard.pusher.com/apps/1505830/console \
&

View File

@@ -1 +1 @@
ssh homestead -t 'cd shareit; php7.3 /usr/local/bin/composer update; npm update; echo; echo -n "Press enter to exit..."; read' ssh homestead -t 'cd shareit; /usr/local/bin/composer update; npm update; echo; echo -n "Press enter to exit..."; read'