From 5adad02ae322431d26f3d2e0e2572a863596ff7a Mon Sep 17 00:00:00 2001 From: Kaitlyn Parkhurst Date: Fri, 18 Jun 2021 21:27:15 -0700 Subject: [PATCH] Move all deployment methods under /deploy --- .gitignore | 1 + Web/lib/MeshMage/Web.pm | 18 +++++++++--------- .../{Deploy.pm => Deploy/Automatic.pm} | 2 +- .../Web/Controller/{ => Deploy}/Manual.pm | 2 +- Web/templates/_base/sidebar.tx | 4 ++-- .../deploy/{ => automatic}/deploy.html.tx | 4 ++-- .../deploy/{ => automatic}/index.html.tx | 4 ++-- .../{ => deploy}/manual/deploy.html.tx | 0 .../{ => deploy}/manual/index.html.tx | 4 ++-- 9 files changed, 20 insertions(+), 19 deletions(-) rename Web/lib/MeshMage/Web/Controller/{Deploy.pm => Deploy/Automatic.pm} (94%) rename Web/lib/MeshMage/Web/Controller/{ => Deploy}/Manual.pm (93%) rename Web/templates/deploy/{ => automatic}/deploy.html.tx (97%) rename Web/templates/deploy/{ => automatic}/index.html.tx (81%) rename Web/templates/{ => deploy}/manual/deploy.html.tx (100%) rename Web/templates/{ => deploy}/manual/index.html.tx (82%) diff --git a/.gitignore b/.gitignore index badc579..477eefb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ Web/local Web/devel Web/tmp Web/pans +Web/cpanfile.snapshot Ansible/playbook* data/ diff --git a/Web/lib/MeshMage/Web.pm b/Web/lib/MeshMage/Web.pm index b32c800..4864cb9 100644 --- a/Web/lib/MeshMage/Web.pm +++ b/Web/lib/MeshMage/Web.pm @@ -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'); diff --git a/Web/lib/MeshMage/Web/Controller/Deploy.pm b/Web/lib/MeshMage/Web/Controller/Deploy/Automatic.pm similarity index 94% rename from Web/lib/MeshMage/Web/Controller/Deploy.pm rename to Web/lib/MeshMage/Web/Controller/Deploy/Automatic.pm index cd2f028..f04fb94 100644 --- a/Web/lib/MeshMage/Web/Controller/Deploy.pm +++ b/Web/lib/MeshMage/Web/Controller/Deploy/Automatic.pm @@ -1,4 +1,4 @@ -package MeshMage::Web::Controller::Deploy; +package MeshMage::Web::Controller::Deploy::Automatic; use Mojo::Base 'Mojolicious::Controller', -signatures; sub index ($c) { diff --git a/Web/lib/MeshMage/Web/Controller/Manual.pm b/Web/lib/MeshMage/Web/Controller/Deploy/Manual.pm similarity index 93% rename from Web/lib/MeshMage/Web/Controller/Manual.pm rename to Web/lib/MeshMage/Web/Controller/Deploy/Manual.pm index 7f39b96..76487ce 100644 --- a/Web/lib/MeshMage/Web/Controller/Manual.pm +++ b/Web/lib/MeshMage/Web/Controller/Deploy/Manual.pm @@ -1,4 +1,4 @@ -package MeshMage::Web::Controller::Manual; +package MeshMage::Web::Controller::Deploy::Manual; use Mojo::Base 'Mojolicious::Controller', -signatures; sub index ($c) { diff --git a/Web/templates/_base/sidebar.tx b/Web/templates/_base/sidebar.tx index eb278df..ecd3f15 100644 --- a/Web/templates/_base/sidebar.tx +++ b/Web/templates/_base/sidebar.tx @@ -56,14 +56,14 @@