File tree 7 files changed +47
-12
lines changed
7 files changed +47
-12
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ class NodeController extends Controller
16
16
*/
17
17
public function index ()
18
18
{
19
- return Inertia::render ('Nodes/Index ' );
19
+ $ nodes = Node::all ();
20
+
21
+ return Inertia::render ('Nodes/Index ' , ['nodes ' => $ nodes ]);
20
22
}
21
23
22
24
/**
Original file line number Diff line number Diff line change
1
+ <script setup>
2
+ defineProps ({
3
+ ' node' : Object ,
4
+ });
5
+ </script >
6
+
7
+ <template >
8
+ <div class =" mx-2" >
9
+ <span v-if =" $props.node.online"
10
+ class =" bg-green-300 text-green-950 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300" >Online</span >
11
+ <span v-else
12
+ class =" bg-red-300 text-red-950 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-red-900 dark:text-red-300" >Offline</span >
13
+ </div >
14
+ </template >
Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ const createNode = () => {
47
47
</template >
48
48
49
49
<template #description >
50
- How your server will be represented in our system.
50
+ <p >How your server will be represented in our system.</p >
51
+ <p >You will receive Agent installation instructions on the next step.</p >
51
52
</template >
52
53
53
54
<template #form >
Original file line number Diff line number Diff line change @@ -3,6 +3,12 @@ import { router } from '@inertiajs/vue3'
3
3
4
4
import AppLayout from ' @/Layouts/AppLayout.vue' ;
5
5
import PrimaryButton from " @/Components/PrimaryButton.vue" ;
6
+ import NodeStatus from " @/Components/NodeStatus.vue" ;
7
+ import ValueCard from " @/Components/ValueCard.vue" ;
8
+
9
+ defineProps ({
10
+ ' nodes' : Array ,
11
+ })
6
12
</script >
7
13
8
14
<template >
@@ -19,9 +25,23 @@ import PrimaryButton from "@/Components/PrimaryButton.vue";
19
25
20
26
<div class =" py-12" >
21
27
<div class =" max-w-7xl mx-auto sm:px-6 lg:px-8" >
22
- <div class =" bg-white dark:bg-gray-800 overflow-hidden shadow-xl sm:rounded-lg" >
23
- list nodes here
24
- </div >
28
+ <a v-for =" node in nodes" :key =" node.id" :href =" route('nodes.show', {node: node.id})"
29
+ class =" w-96 bg-white dark:bg-gray-800 overflow-hidden shadow-xl sm:rounded-lg p-4 flex justify-around" >
30
+
31
+ <div class =" flex" >
32
+ <div class =" font-bold text-xl" >{{ node.name }}</div >
33
+ <NodeStatus :node =" node" />
34
+ </div >
35
+ <div class =" flex flex-col"
36
+ >
37
+ <template v-for =" network in node .data .host .networks " :key =" network .if_name "
38
+ >
39
+ <ValueCard
40
+ v-for =" ip in network.ips" :key =" ip.ip"
41
+ :label =" network.if_name" :value =" ip.ip" />
42
+ </template >
43
+ </div >
44
+ </a >
25
45
</div >
26
46
</div >
27
47
</AppLayout >
File renamed without changes.
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import ShowLayout from "@/Pages/Nodes/ShowLayout.vue";
5
5
import AgentStatus from " @/Pages/Nodes/Partials/AgentStatus.vue" ;
6
6
import SectionBorder from " @/Components/SectionBorder.vue" ;
7
7
import InitSwarmProgress from " @/Pages/Nodes/Partials/InitSwarmProgress.vue" ;
8
- import SwarmDetauls from " @/Pages/Nodes/Partials/SwarmDetauls .vue" ;
8
+ import SwarmDetails from " @/Pages/Nodes/Partials/SwarmDetails .vue" ;
9
9
10
10
defineProps ([
11
11
' node' ,
@@ -26,7 +26,7 @@ defineProps([
26
26
<template v-if =" $props .node .online " >
27
27
<NewSwarmCluster v-if =" $props.node.swarm_id === null" :node =" $props.node" />
28
28
<InitSwarmProgress v-if =" $props.initTaskGroup" :taskGroup =" $props.initTaskGroup" />
29
- <SwarmDetauls v-if =" $props.node.swarm_id !== null" :node =" $props.node" />
29
+ <SwarmDetails v-if =" $props.node.swarm_id !== null" :node =" $props.node" />
30
30
</template >
31
31
</ShowLayout >
32
32
</template >
Original file line number Diff line number Diff line change 1
1
<script setup>
2
2
import AppLayout from " @/Layouts/AppLayout.vue" ;
3
3
import LayoutTab from " @/Components/LayoutTab.vue" ;
4
+ import NodeStatus from " @/Components/NodeStatus.vue" ;
4
5
5
6
const props = defineProps ({
6
7
node: Object
@@ -10,14 +11,11 @@ const props = defineProps({
10
11
<template >
11
12
<AppLayout title =" Dashboard" >
12
13
<template #header >
13
- <h2 class =" font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight" >
14
+ <h2 class =" font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight flex " >
14
15
{{ $props.node.name }}
15
16
16
17
17
- <span v-if =" $props.node.online"
18
- class =" bg-green-300 text-green-950 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300" >Online</span >
19
- <span v-else
20
- class =" bg-red-300 text-red-950 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-red-900 dark:text-red-300" >Offline</span >
18
+ <NodeStatus :node =" $props.node" />
21
19
22
20
</h2 >
23
21
</template >
You can’t perform that action at this time.
0 commit comments