mirror of
https://github.com/symkat/MeshMage.git
synced 2024-11-10 17:05:08 +08:00
Move all deployment methods under /deploy
This commit is contained in:
parent
370374f56b
commit
5adad02ae3
9 changed files with 20 additions and 19 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,5 +4,6 @@ Web/local
|
|||
Web/devel
|
||||
Web/tmp
|
||||
Web/pans
|
||||
Web/cpanfile.snapshot
|
||||
Ansible/playbook*
|
||||
data/
|
||||
|
|
|
@ -53,20 +53,20 @@ sub startup ($self) {
|
|||
$r->post ('/node') ->to('Node#create');
|
||||
$r->get ('/node/:node_id') ->to('Node#show')->name('show_node');
|
||||
|
||||
$r->get ('/deploy') ->to('Deploy#index');
|
||||
$r->get ('/deploy/:node_id') ->to('Deploy#deploy');
|
||||
$r->post ('/deploy') ->to('Deploy#create');
|
||||
|
||||
# Manual Deployment
|
||||
$r->get ('/manual') ->to('Manual#index');
|
||||
$r->get ('/manual/:node_id') ->to('Manual#deploy');
|
||||
$r->post ('/manual') ->to('Manual#create');
|
||||
# Deployment
|
||||
$r->get ('/deploy/automatic' ) ->to('Deploy::Automatic#index' );
|
||||
$r->get ('/deploy/automatic/:node_id' ) ->to('Deploy::Automatic#deploy');
|
||||
$r->post ('/deploy/automatic' ) ->to('Deploy::Automatic#create');
|
||||
|
||||
$r->get ('/deploy/manual' ) ->to('Deploy::Manual#index' );
|
||||
$r->get ('/deploy/manual/:node_id' ) ->to('Deploy::Manual#deploy');
|
||||
$r->post ('/deploy/manual' ) ->to('Deploy::Manual#create');
|
||||
|
||||
# Manage SSH Keys
|
||||
$r->get ('/sshkeys') ->to('Sshkeys#index');
|
||||
$r->get ('/sshkeys/:id') ->to('Sshkeys#show');
|
||||
$r->post ('/sshkeys') ->to('Sshkeys#create');
|
||||
|
||||
|
||||
# Normal route to controller
|
||||
$r->get('/') ->to('Dashboard#index');
|
||||
$r->get('/dashboard') ->to('Dashboard#index');
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package MeshMage::Web::Controller::Deploy;
|
||||
package MeshMage::Web::Controller::Deploy::Automatic;
|
||||
use Mojo::Base 'Mojolicious::Controller', -signatures;
|
||||
|
||||
sub index ($c) {
|
|
@ -1,4 +1,4 @@
|
|||
package MeshMage::Web::Controller::Manual;
|
||||
package MeshMage::Web::Controller::Deploy::Manual;
|
||||
use Mojo::Base 'Mojolicious::Controller', -signatures;
|
||||
|
||||
sub index ($c) {
|
|
@ -56,14 +56,14 @@
|
|||
</h6>
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link [% $sb_active == "deploy_remote" ? "active" : "" %]" href="/deploy">
|
||||
<a class="nav-link [% $sb_active == "deploy_automatic" ? "active" : "" %]" href="/deploy/automatic">
|
||||
<span data-feather="hard-drive"></span>
|
||||
Remote Node
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link [% $sb_active == "deploy_manual" ? "active" : "" %]" href="/manual">
|
||||
<a class="nav-link [% $sb_active == "deploy_manual" ? "active" : "" %]" href="/deploy/manual">
|
||||
<span data-feather="user"></span>
|
||||
Manual Setup
|
||||
</a>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
%% cascade _base::layout { title => "Deploy Node",
|
||||
%% sb_active => 'deploy_remote'
|
||||
%% sb_active => 'deploy_automatic'
|
||||
%% }
|
||||
|
||||
%% override panel -> {
|
||||
|
@ -25,7 +25,7 @@
|
|||
|
||||
<h2 style="margin-top: 1.5em" class="h2">Deploy Node</h2>
|
||||
|
||||
<form style="margin-top: 1.5em" method="POST" action="/deploy">
|
||||
<form style="margin-top: 1.5em" method="POST" action="/deploy/automatic">
|
||||
<input type="hidden" name="node_id" value="[% $node.id %]" />
|
||||
|
||||
<div class="mb-3">
|
|
@ -5,7 +5,7 @@
|
|||
%% override panel -> {
|
||||
|
||||
%% if ( $nodes.size() ) {
|
||||
<h2 style="margin-top: 2em" class="h2">Machines</h2>
|
||||
<h2 style="margin-top: 2em" class="h2">Nodes</h2>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<tbody>
|
||||
%% for $nodes -> $node {
|
||||
<tr>
|
||||
<td><a href="/deploy/[% $node.id %]">[% $node.hostname %]</a></td>
|
||||
<td><a href="/deploy/automatic/[% $node.id %]">[% $node.hostname %]</a></td>
|
||||
<td>[% $node.network.name %]</td>
|
||||
<td>[% $node.nebula_ip %]</td>
|
||||
<td>[% $node.public_ip %]</td>
|
|
@ -5,7 +5,7 @@
|
|||
%% override panel -> {
|
||||
|
||||
%% if ( $nodes.size() ) {
|
||||
<h2 style="margin-top: 2em" class="h2">Machines</h2>
|
||||
<h2 style="margin-top: 2em" class="h2">Nodes</h2>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<tbody>
|
||||
%% for $nodes -> $node {
|
||||
<tr>
|
||||
<td><a href="/manual/[% $node.id %]">[% $node.hostname %]</a></td>
|
||||
<td><a href="/deploy/manual/[% $node.id %]">[% $node.hostname %]</a></td>
|
||||
<td>[% $node.network.name %]</td>
|
||||
<td>[% $node.nebula_ip %]</td>
|
||||
<td>[% $node.public_ip %]</td>
|
Loading…
Reference in a new issue