diff --git a/frontend/locales/english.lng b/frontend/locales/english.lng index 24b25a0..68a2c8e 100644 --- a/frontend/locales/english.lng +++ b/frontend/locales/english.lng @@ -70,6 +70,7 @@ menu-admin-overview; Overview menu-admin-users; Users menu-admin-vpses; VPSes menu-admin-nodes; Nodes +menu-admin-templates; Templates ## Global warnings and errors error-form; One or more problems occurred. diff --git a/frontend/modules/admin/template/add.php b/frontend/modules/admin/template/add.php new file mode 100644 index 0000000..bccb007 --- /dev/null +++ b/frontend/modules/admin/template/add.php @@ -0,0 +1,18 @@ +strings, array( + "templates" => array("ubuntu.tar.gz", "fedora.tar.gz", "debian7.tar.gz", "opensuse.tar.gz") +)); diff --git a/frontend/rewrite.php b/frontend/rewrite.php index 8cdf70f..b0166e4 100644 --- a/frontend/rewrite.php +++ b/frontend/rewrite.php @@ -186,6 +186,27 @@ try 'auth_error' => "modules/error/access.php", '_menu' => "admin" ), + /* Admin - Templates - Overview */ + '^/admin/templates/?$' => array( + 'target' => "modules/admin/template/list.php", + 'authenticator' => "authenticators/admin.php", + 'auth_error' => "modules/error/access.php", + '_menu' => "admin" + ), + /* Admin - Templates - Lookup */ + '^/admin/templates/([0-9]+)/?$' => array( + 'target' => "modules/admin/template/lookup.php", + 'authenticator' => "authenticators/admin.php", + 'auth_error' => "modules/error/access.php", + '_menu' => "admin" + ), + /* Admin - Templates - Add */ + '^/admin/templates/add/?$' => array( + 'target' => "modules/admin/template/add.php", + 'authenticator' => "authenticators/admin.php", + 'auth_error' => "modules/error/access.php", + '_menu' => "admin" + ), /* Admin - Nodes - Overview */ '^/admin/nodes/?$' => array( 'target' => "modules/admin/node/list.php", diff --git a/frontend/templates/default/admin/main.tpl b/frontend/templates/default/admin/main.tpl index c7307d7..efcf68d 100644 --- a/frontend/templates/default/admin/main.tpl +++ b/frontend/templates/default/admin/main.tpl @@ -1,6 +1,7 @@ diff --git a/frontend/templates/default/admin/template/add.tpl b/frontend/templates/default/admin/template/add.tpl new file mode 100644 index 0000000..e3e353b --- /dev/null +++ b/frontend/templates/default/admin/template/add.tpl @@ -0,0 +1,26 @@ +

Add templates

+ +{%if isempty|templates == true} +

+ To add new templates, add the corresponding tar.gz files to /etc/cvm/templates on the master node, and reload this page. + New files will be automatically detected, and you will be able to add them as templates from this page. +

+ +

+ All templates will be automatically synchronized to slave nodes. +

+{%else} +
+ {%foreach template in templates} +
+

{%?template}

+ +
+ + {%input type="text" group="addtemplate" name="name[]"} +
+
+
+ {%/foreach} +
+{%/if} diff --git a/frontend/templates/default/static/css/cvm.css b/frontend/templates/default/static/css/cvm.css index 37fd7f8..cfdea1a 100644 --- a/frontend/templates/default/static/css/cvm.css +++ b/frontend/templates/default/static/css/cvm.css @@ -568,7 +568,12 @@ button.column background-color: #4E4D69; } -form.dark +.darkform +{ + margin-bottom: 6px; +} + +form.dark, .darkform { background-color: #31305E; color: white; @@ -578,7 +583,7 @@ form.dark width: 75%; } -form.dark label, form .filler +form.dark label, form .filler, .darkform label { display: block; float: left; @@ -586,7 +591,7 @@ form.dark label, form .filler width: 45.8%; } -form.dark input, form.dark select +form.dark input, form.dark select, .darkform input { display: block; float: left; @@ -597,13 +602,13 @@ form.dark input, form.dark select box-sizing: content-box; } -form.dark input[type="checkbox"] +form.dark input[type="checkbox"], .darkform input[type="checkbox"] { width: auto; margin-top: 7px; } -form.dark input[type="file"] +form.dark input[type="file"], .darkform input[type="file"] { height: 24px; font-size: 13px; @@ -612,7 +617,7 @@ form.dark input[type="file"] padding: 0px 0px; } -form.dark button[type="submit"] +form.dark button[type="submit"], .darkform button[type="submit"] { float: right; margin: 9px 7px 7px 7px; @@ -620,13 +625,13 @@ form.dark button[type="submit"] font-weight: bold; } -form.dark .field.disabled +form.dark .field.disabled, .darkform .field.disabled { background-color: #444452; color: #B5B5B5; } -form.dark .filler a +form.dark .filler a, .darkform .filler a { display: block; color: white; @@ -634,6 +639,12 @@ form.dark .filler a margin-top: 12px; } +form.dark h3, .darkform h3 +{ + color: #F1F1F1; + margin: 6px 1% 4px 1%; +} + form.login { width: 40%;