mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-27 14:54:42 +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
|
class Traffic extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = ['user_id', 'upload', 'download'];
|
protected $fillable = ['user_id', 'upload', 'download'];
|
||||||
|
|
||||||
protected $primaryKey = null;
|
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-3
@@ -260,7 +260,10 @@ class User extends Authenticatable
|
|||||||
*/
|
*/
|
||||||
public function record_upload($file_size)
|
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([
|
->firstOrCreate([
|
||||||
'user_id' => $this->id,
|
'user_id' => $this->id,
|
||||||
]);
|
]);
|
||||||
@@ -269,7 +272,7 @@ class User extends Authenticatable
|
|||||||
'upload' => $record->upload + $file_size
|
'upload' => $record->upload + $file_size
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Record user download filesize
|
* Record user download filesize
|
||||||
*
|
*
|
||||||
@@ -277,7 +280,10 @@ class User extends Authenticatable
|
|||||||
*/
|
*/
|
||||||
public function record_download($file_size)
|
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([
|
->firstOrCreate([
|
||||||
'user_id' => $this->id,
|
'user_id' => $this->id,
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ class CreateTrafficTable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('traffic', function (Blueprint $table) {
|
Schema::create('traffic', function (Blueprint $table) {
|
||||||
|
$table->bigIncrements('id');
|
||||||
$table->bigInteger('user_id');
|
$table->bigInteger('user_id');
|
||||||
$table->bigInteger('upload')->default(0);
|
$table->bigInteger('upload')->default(0);
|
||||||
$table->bigInteger('download')->default(0);
|
$table->bigInteger('download')->default(0);
|
||||||
@@ -28,6 +29,6 @@ class CreateTrafficTable extends Migration
|
|||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('traffics');
|
Schema::dropIfExists('traffic');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,10 +53,8 @@ import {mapGetters} from 'vuex'
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
box-shadow: 0 5px 10px -6px rgba(26, 36, 55, 0.15);
|
box-shadow: 0 7px 25px 1px rgba(0, 0, 0, 0.12);
|
||||||
background:$light_background;
|
background:white;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
|
|||||||
Vendored
+3
-3
@@ -100,7 +100,7 @@ var vueFileManager = new Vue({
|
|||||||
|
|
||||||
document.addEventListener('drag', (event) => {
|
document.addEventListener('drag', (event) => {
|
||||||
let multiSelect = document.getElementById('multi-select-ui')
|
let multiSelect = document.getElementById('multi-select-ui')
|
||||||
multiSelect.style.top = event.clientY +25 + 'px'
|
multiSelect.style.top = event.clientY + 20 + 'px'
|
||||||
multiSelect.style.left = event.clientX - 50 + 'px'
|
multiSelect.style.left = event.clientX + 'px'
|
||||||
|
|
||||||
},false)
|
},false)
|
||||||
|
|||||||
Reference in New Issue
Block a user