Commit f530afff authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Base machines can't be modified

parent 3bbe8081
......@@ -3,22 +3,38 @@
</div>
<div class="tab-pane fade" id="rename">
% if ($domain->is_base) {
%= include 'main/vm_locked_is_base'
% } else {
%= include 'main/vm_rename'
% }
</div>
% if ($USER->can_change_settings ) {
<div class="tab-pane fade" id="options">
% if ($domain->is_base) {
%= include 'main/vm_locked_is_base'
% } else {
%= include 'main/vm_options'
% }
</div>
% }
% if ($USER->can_change_settings && $domain->drivers) {
<div class="tab-pane fade" id="drivers">
% if ($domain->is_base) {
%= include 'main/vm_locked_is_base'
% } else {
%= include 'main/vm_drivers'
% }
</div>
% }
% if (1) { # TODO check VM is KVM
<div class="tab-pane fade" id="graphics">
% if ($domain->is_base) {
%= include 'main/vm_locked_is_base'
% } else {
%= include 'main/vm_graphics'
% }
</div>
% }
<div class="tab-pane fade" id="copy">
......
<div class="panel-body">
<div class="panel panel-warning">
<div class="panel-heading">This machine is base and it can't be modified.</div>
</div>
</div>
......@@ -24,7 +24,7 @@
ng-change="validate_new_name(showmachine.name)"
ng-disabled="<%= $disable_rename %>"
>
<button type="button" ng-disabled="<%= $disable_rename %> || new_name_duplicated"
<button type="button" ng-disabled="<%= $disable_rename %> || new_name_duplicated || new_name_invalid"
ng-click="rename(showmachine.id, showmachine.name)">
Rename
</button>
......@@ -34,6 +34,11 @@
class="control-label" for="new_name">
This name is duplicated
</label>
<label ng-show="new_name_invalid"
class="control-label" for="new_name">
This name is invalid. It can only contain words and numbers
and must start by a letter.
</label>
</div>
</div>
<div class="panel panel-success" ng-show="rename_requested">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment