| gio | f6ad298 | 2024-08-23 17:42:49 +0400 | [diff] [blame] | 1 | {{ define "header" }} |
| 2 | <h1>Cluster - {{ .Cluster.Name }}</h1> |
| 3 | {{ end }} |
| 4 | |
| 5 | {{ define "content" }} |
| gio | 8f29032 | 2024-09-21 15:37:45 +0400 | [diff] [blame] | 6 | {{ $c := .Cluster }} |
| 7 | <form action="/clusters/{{ $c.Name }}/remove" method="POST"> |
| gio | f6ad298 | 2024-08-23 17:42:49 +0400 | [diff] [blame] | 8 | <button type="submit" name="remove-cluster">remove cluster</button> |
| 9 | </form> |
| gio | 8f29032 | 2024-09-21 15:37:45 +0400 | [diff] [blame] | 10 | <form action="/clusters/{{ $c.Name }}/servers" method="POST" autocomplete="off"> |
| gio | f6ad298 | 2024-08-23 17:42:49 +0400 | [diff] [blame] | 11 | <details class="dropdown"> |
| 12 | <summary id="type">worker</summary> |
| 13 | <ul> |
| 14 | <li> |
| 15 | <label> |
| 16 | <input type="radio" name="type" value="worker" checked /> |
| 17 | worker |
| 18 | </label> |
| 19 | </li> |
| 20 | <li> |
| 21 | <label> |
| 22 | <input type="radio" name="type" value="controller" /> |
| 23 | controller |
| 24 | </label> |
| 25 | </li> |
| 26 | </ul> |
| 27 | </details> |
| 28 | <input type="text" name="ip" placeholder="ip" /> |
| 29 | <input type="text" name="port" placeholder="22 (optional)" /> |
| 30 | <input type="text" name="user" placeholder="user" /> |
| 31 | <input type="password" name="password" placeholder="password" /> |
| 32 | <button type="submit" name="add-server">add server</button> |
| 33 | </form> |
| gio | 8f29032 | 2024-09-21 15:37:45 +0400 | [diff] [blame] | 34 | {{- if $c.StorageEnabled }} |
| 35 | Supports persistent storage<br/> |
| 36 | {{- else }} |
| 37 | <form action="/clusters/{{ $c.Name }}/setup-storage" method="POST"> |
| 38 | <button type="submit" name="remove-cluster">setup persistent storage</button> |
| 39 | </form> |
| 40 | {{- end }} |
| gio | f6ad298 | 2024-08-23 17:42:49 +0400 | [diff] [blame] | 41 | <table class="striped"> |
| 42 | <thead> |
| 43 | <tr> |
| 44 | <th scope="col">type</th> |
| 45 | <th scope="col">hostname</th> |
| 46 | <th scope="col">ip</th> |
| 47 | <th scope="col">remove</th> |
| 48 | </tr> |
| 49 | </thead> |
| 50 | <tbody> |
| gio | 8f29032 | 2024-09-21 15:37:45 +0400 | [diff] [blame] | 51 | {{ range $s := $c.Controllers }} |
| gio | f6ad298 | 2024-08-23 17:42:49 +0400 | [diff] [blame] | 52 | <tr> |
| 53 | <th>controller</th> |
| 54 | <th scope="row">{{ $s.Name }}</th> |
| 55 | <td>{{ $s.IP }} </td> |
| 56 | <td> |
| 57 | <form action="/clusters/{{ $c.Name }}/servers/{{ $s.Name }}/remove" method="POST"> |
| 58 | <button type="submit">remove</button> |
| 59 | </form> |
| 60 | </td> |
| 61 | </tr> |
| 62 | {{ end }} |
| gio | 8f29032 | 2024-09-21 15:37:45 +0400 | [diff] [blame] | 63 | {{ range $s := $c.Workers }} |
| gio | f6ad298 | 2024-08-23 17:42:49 +0400 | [diff] [blame] | 64 | <tr> |
| 65 | <th>worker</th> |
| 66 | <th scope="row">{{ $s.Name }}</th> |
| 67 | <td>{{ $s.IP }} </td> |
| 68 | <td> |
| 69 | <form action="/clusters/{{ $c.Name }}/servers/{{ $s.Name }}/remove" method="POST"> |
| 70 | <button type="submit">remove</button> |
| 71 | </form> |
| 72 | </td> |
| 73 | </tr> |
| 74 | {{ end }} |
| 75 | </tbody> |
| 76 | </table> |
| 77 | {{ end }} |