-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
1 parent
d36bd24
commit dc3f9f2
Showing
15 changed files
with
189 additions
and
28 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
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,27 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Models\Node; | ||
use App\Models\NodeTaskGroup; | ||
use App\Models\User; | ||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; | ||
use Illuminate\Http\Request; | ||
|
||
class NodeTaskGroupController extends Controller | ||
{ | ||
public function retry(Request $request, NodeTaskGroup $taskGroup) | ||
{ | ||
$this->authorizeOr403('retry', $taskGroup); | ||
|
||
$attrs = $request->validate([ | ||
'node_id' => 'required|exists:nodes,id', | ||
]); | ||
|
||
$node = Node::whereId($attrs['node_id'])->first(); | ||
|
||
$this->authorizeOr403('view', $node); | ||
|
||
$taskGroup->retry($node); | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
|
||
namespace App\Policies; | ||
|
||
use App\Models\Node; | ||
use App\Models\NodeTaskGroup; | ||
use App\Models\User; | ||
use Illuminate\Auth\Access\Response; | ||
|
||
class NodeTaskGroupPolicy | ||
{ | ||
public function retry(User $user, NodeTaskGroup $taskGroup): bool | ||
{ | ||
return $user->belongsToTeam($taskGroup->node->team); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,15 +1,29 @@ | ||
<script setup> | ||
import {reactive} from "vue"; | ||
import TaskResult from "@/Components/NodeTasks/TaskResult.vue"; | ||
import SecondaryButton from "@/Components/SecondaryButton.vue"; | ||
import {router} from "@inertiajs/vue3"; | ||
defineProps({ | ||
const props = defineProps({ | ||
'taskGroup': Object, | ||
}); | ||
const retry = () => { | ||
router.post(route('node-task-groups.retry', {taskGroup: props.taskGroup.id, node_id: props.taskGroup.node_id})); | ||
} | ||
</script> | ||
|
||
<template> | ||
<ul class="col-span-6 text-sm font-medium text-gray-900 bg-white border border-gray-200 rounded-lg dark:bg-gray-700 dark:border-gray-600 dark:text-white"> | ||
<TaskResult v-for="task in taskGroup.tasks" :key="task.id" :task="task" /> | ||
</ul> | ||
<div class="flex"> | ||
<div class="col-span-6 ms-4 mt-1 text-xs text-gray-900 dark:text-white grow">#{{ taskGroup.id }} Invoked by {{ taskGroup.invoker.name }}</div> | ||
<SecondaryButton v-if="taskGroup.status === 'failed' || taskGroup.status === 'canceled'" | ||
@click="retry" | ||
class="col-span-6 ms-4 mt-2 text-xs text-gray-900 dark:text-white"> | ||
Retry Failed Tasks | ||
</SecondaryButton> | ||
</div> | ||
</template> |
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,20 @@ | ||
|
||
<script setup> | ||
import ActionSection from "@/Components/ActionSection.vue"; | ||
</script> | ||
|
||
<template> | ||
<ActionSection> | ||
<template #title> | ||
Swarm Cluster | ||
</template> | ||
|
||
<template #description> | ||
Swarm Cluster has been initialized and is in a healthy state. | ||
</template> | ||
|
||
<template #content> | ||
Sorry, we're still working on the Swarm Cluster details block. | ||
</template> | ||
</ActionSection> | ||
</template> |
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