{% extends "layout.html" %}

{% block content %}

<ol class="breadcrumb">
    <li><a href="{{ url_for('account_view') }}">Account</a></li>
    <li><a href="{{ url_for('subscription_view', subscription_id=subscription_id) }}">{{subscription_id}}</a></li>
    <li><a href="{{ url_for('resourcegroup_view', subscription_id=subscription_id, resource_group_name=resource_group_name) }}">{{resource_group_name}}</a></li>
    <li class="active">{{model.name}}</li>
</ol>

<h3>Virtual Machine Properties</h3>
<table class="table table-striped table-condensed">
    <thead>
        <tr>
            <th class="col-sm-3">Name</th>
            <th class="col-sm-9">Value</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Resource Group</td>
            <td><a href="{{ url_for('resourcegroup_view', subscription_id=subscription_id, resource_group_name=resource_group_name) }}">{{resource_group_name}}</a></td>
        </tr>
        <tr>
            <td>Virtual Machine Name</td>
            <td>{{model.name}}</td>
        </tr>
        <tr>
            <td>Provisioning State</td>
            <td>{{model.vm.provisioning_state}}</td>
        </tr>
        <tr>
            <td>Location</td>
            <td>{{model.vm.location}}</td>
        </tr>
    </tbody>
</table>

<h3>Storage</h3>

{% if model.vm.storage_profile.image_reference %}
<h4>Image Reference</h4>
<table class="table table-striped table-condensed">
    <thead>
        <tr>
            <th class="col-sm-3">Name</th>
            <th class="col-sm-9">Value</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Offer</td>
            <td>{{model.vm.storage_profile.image_reference.offer}}</td>
        </tr>
        <tr>
            <td>Publisher</td>
            <td>{{model.vm.storage_profile.image_reference.publisher}}</td>
        </tr>
        <tr>
            <td>SKU</td>
            <td>{{model.vm.storage_profile.image_reference.sku}}</td>
        </tr>
        <tr>
            <td>Version</td>
            <td>{{model.vm.storage_profile.image_reference.version}}</td>
        </tr>
    </tbody>
</table>
{% endif %}

<h4>OS Disk</h4>
<table class="table table-striped table-condensed">
    <thead>
        <tr>
            <th class="col-sm-3">Name</th>
            <th class="col-sm-9">Value</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Caching</td>
            <td>{{model.vm.storage_profile.os_disk.caching}}</td>
        </tr>
        <tr>
            <td>Create Option</td>
            <td>{{model.vm.storage_profile.os_disk.create_option}}</td>
        </tr>
        <tr>
            <td>Name</td>
            <td>{{model.vm.storage_profile.os_disk.name}}</td>
        </tr>
        <tr>
            <td>Operating System Type</td>
            <td>{{model.vm.storage_profile.os_disk.os_type}}</td>
        </tr>
        <tr>
            <td>Virtual Hard Disk</td>
            <td>{{model.vm.storage_profile.os_disk.vhd.uri}}</td>
        </tr>
    </tbody>
</table>

<h4>Data Disks</h4>
<table class="table table-striped table-condensed">
    <thead>
        <tr>
            <th>Name</th>
            <th>LUN</th>
            <th>Caching</th>
            <th>Create Option</th>
            <th>Disk Size (GB)</th>
        </tr>
    </thead>
    <tbody>
        {% for disk in model.vm.storage_profile.data_disks %}
        <tr>
            <td class="col-sm-5">{{disk.name}}</td>
            <td class="col-sm-1">{{disk.lun}}</td>
            <td class="col-sm-2">{{disk.caching}}</td>
            <td class="col-sm-2">{{disk.create_option}}</td>
            <td class="col-sm-2">{{disk.disk_size_gb}}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>

{% endblock %}
