-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
1,431 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class DropboxLog extends Model | ||
{ | ||
use HasFactory; | ||
|
||
protected $guarded = ['id']; | ||
static public $availableActivities = ['replacement', 'deployment', 'inspection']; | ||
|
||
public function station() | ||
{ | ||
return $this->belongsTo('App\Models\Dropbox'); | ||
} | ||
|
||
public function children() | ||
{ | ||
return $this->hasMany('App\Models\DropboxLog', 'parent_id'); | ||
} | ||
|
||
public function parent() | ||
{ | ||
return $this->belongsTo('App\Models\DropboxLog', 'parent_id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php | ||
|
||
namespace App\Policies; | ||
|
||
use App\Models\DropboxLog; | ||
use App\Models\User; | ||
use Illuminate\Auth\Access\HandlesAuthorization; | ||
|
||
class DropboxLogPolicy | ||
{ | ||
use HandlesAuthorization; | ||
|
||
/** | ||
* Determine whether the user can view any models. | ||
* | ||
* @param \App\Models\User $user | ||
* @return mixed | ||
*/ | ||
public function viewAny(User $user) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Determine whether the user can view the model. | ||
* | ||
* @param \App\Models\User $user | ||
* @param \App\Models\DropboxLog $dropboxLog | ||
* @return mixed | ||
*/ | ||
public function view(User $user, DropboxLog $dropboxLog) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Determine whether the user can create models. | ||
* | ||
* @param \App\Models\User $user | ||
* @return mixed | ||
*/ | ||
public function create(User $user) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Determine whether the user can update the model. | ||
* | ||
* @param \App\Models\User $user | ||
* @param \App\Models\DropboxLog $dropboxLog | ||
* @return mixed | ||
*/ | ||
public function update(User $user, DropboxLog $dropboxLog) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Determine whether the user can delete the model. | ||
* | ||
* @param \App\Models\User $user | ||
* @param \App\Models\DropboxLog $dropboxLog | ||
* @return mixed | ||
*/ | ||
public function delete(User $user, DropboxLog $dropboxLog) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Determine whether the user can restore the model. | ||
* | ||
* @param \App\Models\User $user | ||
* @param \App\Models\DropboxLog $dropboxLog | ||
* @return mixed | ||
*/ | ||
public function restore(User $user, DropboxLog $dropboxLog) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Determine whether the user can permanently delete the model. | ||
* | ||
* @param \App\Models\User $user | ||
* @param \App\Models\DropboxLog $dropboxLog | ||
* @return mixed | ||
*/ | ||
public function forceDelete(User $user, DropboxLog $dropboxLog) | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Database\Factories; | ||
|
||
use App\Models\Dropbox; | ||
use App\Models\DropboxLog; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
class DropboxLogFactory extends Factory | ||
{ | ||
/** | ||
* The name of the factory's corresponding model. | ||
* | ||
* @var string | ||
*/ | ||
protected $model = DropboxLog::class; | ||
|
||
/** | ||
* Define the model's default state. | ||
* | ||
* @return array | ||
*/ | ||
public function definition() | ||
{ | ||
return [ | ||
'dropbox_id' => Dropbox::factory(), | ||
'parent_id' => null, | ||
'activity' => $this->faker->randomElement(DropboxLog::$availableActivities), | ||
'weight' => $this->faker->numberBetween(100, 150) / 100, | ||
'final_weight' => $this->faker->numberBetween(200, 500) / 100, | ||
'starts_at' => $this->faker->dateTime(), | ||
'ends_at' => $this->faker->dateTime(), | ||
]; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
database/migrations/2021_04_15_014223_create_dropbox_logs_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class CreateDropboxLogsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('dropbox_logs', function (Blueprint $table) { | ||
$table->id(); | ||
$table->unsignedBigInteger('dropbox_id')->index(); | ||
$table->unsignedBigInteger('parent_id')->nullable(); | ||
$table->string('activity')->nullable(); | ||
$table->decimal('weight')->nullable(); | ||
$table->decimal('final_weight')->nullable(); | ||
$table->timestamp('starts_at')->nullable(); | ||
$table->timestamp('ends_at')->nullable(); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('dropbox_logs'); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"/js/app.js": "/js/app.js?id=8d18995014bb05fe0573", | ||
"/js/app.js": "/js/app.js?id=89c3fb98035f1e02267c", | ||
"/js/alpine.js": "/js/alpine.js?id=eea86eb67d792d022004", | ||
"/css/app.css": "/css/app.css?id=c3bf9f2999a83e5ef503", | ||
"/css/tailwind.css": "/css/tailwind.css?id=b58e2cfa033369d655d9" | ||
"/css/app.css": "/css/app.css?id=23bf7dc849d484910f1f", | ||
"/css/tailwind.css": "/css/tailwind.css?id=7a569a1ed13d8e85c3f1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<template> | ||
<div> | ||
<div class="card border-0 shadow my-auto" style="border-radius: 0.5em"> | ||
<div class="card-body"> | ||
<div class="text-center mb-3"> | ||
<img src="/img/logo_navbar.svg" class="w-50" alt="logo_dumask"> | ||
</div> | ||
<p class="text-justify text-muted w-100 my-4"> | ||
Masukkan alamat email akun Dumask.id Anda. | ||
Kami akan mengirimkan link untuk reset password. | ||
</p> | ||
|
||
<p v-show="isSent" class="text-justify text-success w-100 my-4"> | ||
Kami telah mengirimkan link untuk reset password melalui email Anda. | ||
</p> | ||
|
||
<div class="form-group"> | ||
<label for="email">Email</label> | ||
<input type="email" | ||
required | ||
v-model="form.email" | ||
class="form-control" | ||
:class="{ 'is-invalid': hasErrors('email') }" | ||
/> | ||
<div class="invalid-feedback"> | ||
{{ getErrors("email") }} | ||
</div> | ||
</div> | ||
|
||
<div class="form-group mt-4 text-right"> | ||
<button | ||
class="btn btn-primary w-100" | ||
v-show="!isLoading" | ||
@click="doEmailPasswordReset()" | ||
> | ||
RESET PASSWORD | ||
</button> | ||
<button class="btn btn-primary w-100" disabled v-show="isLoading"> | ||
RESET PASSWORD | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "ForgotPassword", | ||
data() { | ||
return { | ||
form: { | ||
email: null, | ||
}, | ||
isLoading: false, | ||
isSent: false, | ||
errors: {}, | ||
}; | ||
}, | ||
methods: { | ||
async doEmailPasswordReset() { | ||
this.isLoading = true; | ||
try { | ||
let response = await axios.post("/forgot-password", this.form); | ||
this.isSent = true; | ||
} catch (error) { | ||
console.log(error.response); | ||
this.errors = error.response.data.errors; | ||
} | ||
this.isLoading = false; | ||
}, | ||
hasErrors(key) { | ||
if (this.errors[key]) { | ||
return true; | ||
} | ||
return false; | ||
}, | ||
getErrors(key) { | ||
if (this.hasErrors(key)) { | ||
return this.errors[key].join(", "); | ||
} | ||
return ""; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
</style> |
Oops, something went wrong.