mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
traffic fix
drag preview styling
This commit is contained in:
@@ -7,6 +7,4 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Traffic extends Model
|
||||
{
|
||||
protected $fillable = ['user_id', 'upload', 'download'];
|
||||
|
||||
protected $primaryKey = null;
|
||||
}
|
||||
|
||||
12
app/User.php
12
app/User.php
@@ -260,7 +260,10 @@ class User extends Authenticatable
|
||||
*/
|
||||
public function record_upload($file_size)
|
||||
{
|
||||
$record = Traffic::whereMonth('created_at', '=', Carbon::now()->month)
|
||||
$now = Carbon::now();
|
||||
|
||||
$record = Traffic::whereYear('created_at', '=', $now->year)
|
||||
->whereMonth('created_at', '=', $now->month)
|
||||
->firstOrCreate([
|
||||
'user_id' => $this->id,
|
||||
]);
|
||||
@@ -269,7 +272,7 @@ class User extends Authenticatable
|
||||
'upload' => $record->upload + $file_size
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Record user download filesize
|
||||
*
|
||||
@@ -277,7 +280,10 @@ class User extends Authenticatable
|
||||
*/
|
||||
public function record_download($file_size)
|
||||
{
|
||||
$record = Traffic::whereMonth('created_at', '=', Carbon::now()->month)
|
||||
$now = Carbon::now();
|
||||
|
||||
$record = Traffic::whereYear('created_at', '=', $now->year)
|
||||
->whereMonth('created_at', '=', $now->month)
|
||||
->firstOrCreate([
|
||||
'user_id' => $this->id,
|
||||
]);
|
||||
|
||||
@@ -14,6 +14,7 @@ class CreateTrafficTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('traffic', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->bigInteger('user_id');
|
||||
$table->bigInteger('upload')->default(0);
|
||||
$table->bigInteger('download')->default(0);
|
||||
@@ -28,6 +29,6 @@ class CreateTrafficTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('traffics');
|
||||
Schema::dropIfExists('traffic');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,10 +53,8 @@ import {mapGetters} from 'vuex'
|
||||
pointer-events: none;
|
||||
padding: 10px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 5px 10px -6px rgba(26, 36, 55, 0.15);
|
||||
background:$light_background;
|
||||
|
||||
|
||||
box-shadow: 0 7px 25px 1px rgba(0, 0, 0, 0.12);
|
||||
background:white;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
|
||||
6
resources/js/main.js
vendored
6
resources/js/main.js
vendored
@@ -100,7 +100,7 @@ var vueFileManager = new Vue({
|
||||
|
||||
document.addEventListener('drag', (event) => {
|
||||
let multiSelect = document.getElementById('multi-select-ui')
|
||||
multiSelect.style.top = event.clientY +25 + 'px'
|
||||
multiSelect.style.left = event.clientX - 50 + 'px'
|
||||
|
||||
multiSelect.style.top = event.clientY + 20 + 'px'
|
||||
multiSelect.style.left = event.clientX + 'px'
|
||||
|
||||
},false)
|
||||
|
||||
Reference in New Issue
Block a user