diff --git a/CHANGELOG.md b/CHANGELOG.md index 07482ef5ce02d25c655d8fd551e69d9823bd14a7..9007b610b1a1b3d91b5c4f9bf63a79e57be4e7d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.3.2] 2025-02-13 +### Added +- Added announcement about VM statuses +- Numbers on circle are now bigger +- Changed label for input on /select-vm page +- Any other status than ACTIVE or STOPPED have yellow color + ## [1.3.1] 2025-01-28 ### Added - Status of VM's on /select-vms page diff --git a/app/app.py b/app/app.py index e9d702a3930708a8480d7ceb29ffab35aac72915..09116d546afd80c6dbe463b56e8d68b0e87735c0 100644 --- a/app/app.py +++ b/app/app.py @@ -127,12 +127,25 @@ def select_vm(): src_project_servers = lib.get_ostack_project_servers(src_project_conn) session['src_server_validation_id'] = src_project_servers[0].id + #To migrate VM instance, VM instance should be in state `ACTIVE` or `STOPPED`. Following diagram shows [all possible states](https://docs.openstack.org/nova/latest/reference/vm-states.html), for instance transition from shelved state is described [in the cloud documenatation](https://docs.e-infra.cz/compute/openstack/technical-reference/brno-g1-site/instance-shelving/). + announcement = '''Cloud + To migrate VM instance, VM instance should be in state <span class='active'>ACTIVE</span> or <span class='stopped'>STOPPED</span>. + Following diagram shows <a href="https://docs.openstack.org/nova/latest/reference/vm-states.html" + target="_blank" rel="noopener noreferrer">all possible states</a>, + for instance transition from shelved state is described + <a href="https://docs.e-infra.cz/compute/openstack/technical-reference/brno-g1-site/instance-shelving/" + target="_blank" rel="noopener noreferrer">in the cloud documenatation</a>. + ''' session['servers_count'] = len(src_project_servers) src_project_server_names = [] for src_project_server in src_project_servers: - src_project_server_names.append(f"{src_project_server['name']} <span class='{src_project_server['vm_state']}'> {src_project_server['vm_state']} </span>") + vm_state_class=src_project_server['vm_state'] + if src_project_server['vm_state'] not in ['stopped','active']: + vm_state_class='warning-state' + + src_project_server_names.append(f"{src_project_server['name']} <span class='{vm_state_class}'> {src_project_server['vm_state']} </span>") boxes=[Box('Select source G1 OpenStack VMs for migration',[ - BoxItem('Virtual server names',src_project_server_names,type='checkbox',name='servers[]')]), + BoxItem('Virtual server names and corresponding states',src_project_server_names,type='checkbox',name='servers[]')]), ] boxes[0].set_error_message('You must select at least 1 server') next_url = '/migrate' @@ -140,7 +153,8 @@ def select_vm(): boxes=boxes, next_url=next_url, step=2, - error_message=error_message) + error_message=error_message, + announcement=announcement) @app.route('/select-vm',methods=['POST']) diff --git a/app/static/css/styles.css b/app/static/css/styles.css index bbbdeb6b0954b48c5d54ef658152e1e77ac94a7f..dbf14985657c74556a0184c5c44f5019bfa71a76 100644 --- a/app/static/css/styles.css +++ b/app/static/css/styles.css @@ -6206,7 +6206,7 @@ td) { display: flex; justify-content: center; align-items: center; - font-size: 20px; + font-size: 28px; font-weight: bold; color: var(--md-primary-fg-color); } @@ -6239,4 +6239,8 @@ td) { .stopped{ text-transform: uppercase; color: red; +} +.warning-state{ + text-transform: uppercase; + color: #BBAC11 ; } \ No newline at end of file diff --git a/app/templates/content/select-vms.html b/app/templates/content/select-vms.html index d4bef1d289e70dbde87da670246549a473b54d32..c716f6e9d00c0d2e5a76bba8e881144d41a51fd3 100644 --- a/app/templates/content/select-vms.html +++ b/app/templates/content/select-vms.html @@ -4,6 +4,11 @@ <section class="mdx-container"> <div class="md-grid md-typeset"> <div class="grid cards"> + {% if announcement %} + <div class="announcement"> + {{ announcement | safe }} + </div> + {% endif %} <article class="md-content__inner md-typeset"> {% for box in boxes %} <div class="migration_box"> @@ -19,7 +24,7 @@ <div> <input name="{{ input.name }}" type="{{ input.type }}" value="{{ input_value }}" {% if "class='active'" in input_value %} checked {% endif %} - {% if input.disabled %} disabled {% endif %}/> + {% if "class='warning-state'" in input_value %} disabled {% endif %}/> <label>{{ input_value | safe }}</label> </div> {% endfor %}