Project

General

Profile

Download (7.4 KB) Statistics
| Branch: | Tag: | Revision:

foreman_docker / app / views / containers / show.html.erb @ bc82d5d5

1 f880f56e Daniel Lobato
<% title "#{@container.name.titleize} - #{@container.in_fog.name}" %>
2 751c6470 Daniel Lobato
<%= stylesheet 'foreman_docker/terminal' %>
3 f880f56e Daniel Lobato
<%= container_title_actions(@container) %>
4
<div id="host-show" class="row">
5
  <div class="col-md-4">
6
   <div id="myTabContent" class="tab-content">
7
      <div class="tab-pane active in">
8
        <table id="properties_table" class="table table-bordered table-striped">
9
          <tr><th colspan="2"><%= _('Properties') %></th></tr>
10
            <tr>
11
              <td><%= _('Name') %></td>
12
              <td><%= @container.in_fog.name %></td>
13
            </tr>
14
            <tr>
15 c57dae56 David Davis
              <td><%= _('Image Repository') %></td>
16
              <td><%= @container.repository_name %> </td>
17 f880f56e Daniel Lobato
            </tr>
18
            <tr>
19 c57dae56 David Davis
              <td><%= _('Image Tag') %></td>
20
              <td><%= @container.tag %> </td>
21 f880f56e Daniel Lobato
            </tr>
22
            <tr>
23
              <td><%= _('IP Address') %></td>
24
              <td><%= @container.in_fog.ipaddress %> </td>
25
            </tr>
26
            <tr>
27
              <td><%= _('CPU shares') %></td>
28
              <td><%= @container.in_fog.cores %></td>
29
            </tr>
30
            <tr>
31
              <td><%= _('UUID') %></td>
32 89c59306 Partha Aji
              <td><%= trunc_with_tooltip @container.in_fog.identity %></td>
33 f880f56e Daniel Lobato
            </tr>
34
            <tr>
35
              <td><%= _('Memory') %></td>
36
              <td><%= number_to_human_size @container.in_fog.memory %> </td>
37
            </tr>
38
            <tr>
39
              <td><%= _('Command') %></td>
40
              <td><%= @container.in_fog.command %> </td>
41
            </tr>
42
            <tr>
43
              <td><%= _('Exposed ports') %></td>
44 8e2848d5 Vanya Jauhal
              <td>
45
                <table id="exposed_ports" class="table table-bordered" style="table-layout:fixed; word-wrap: break-word">
46
                  <% (@container.in_fog.exposed_ports || []).each do |exposed_port| %>
47
                  <% pair = exposed_port.first.split("/") %>
48
                    <tr>
49
                      <td><b><%= pair.first %></b></td>
50
                      <td><i><%= pair.second %></i></td>
51
                    </tr>
52
                  <% end %>
53
                </table>
54
              </td>
55 f880f56e Daniel Lobato
            </tr>
56 713c0455 Vanya Jauhal
            <tr>
57 bc82d5d5 Vanya Jauhal
              <td><%= _('DNS') %></td>
58
              <td>
59
                  <% (@container.in_fog.attributes['host_config_dns'] || []).each do |dns| %>
60
                    <%= dns %><br/>
61
                  <% end %>
62
                </td>
63
            </tr>            
64
            <tr>
65 713c0455 Vanya Jauhal
              <td><%= _('Environment Variables') %></td>
66
              <td>
67
                <table id="environment_variables" class="table table-bordered" style="table-layout:fixed; word-wrap: break-word">
68 e6eb1c48 Dmitri Dolguikh
                  <% (@container.in_fog.attributes['config_env'] || []).each do |environment_variable| %>
69 713c0455 Vanya Jauhal
                  <% pair = environment_variable.split("=") %>
70
                    <tr>
71
                      <td><b><%= pair.first %></b></td>
72
                      <td><i><%= pair.second %></i></td>
73
                    </tr>
74
                  <% end %>
75
                </table>
76
              </td>
77
            </tr>
78 30891c0a Daniel Lobato
            <% Taxonomy.enabled_taxonomies.each do |taxonomy| %>
79
              <tr>
80
                <td><%= _(taxonomy.humanize) %></td>
81
                <td><%= link_to_taxonomies(@container.send(:"#{taxonomy}")).html_safe %> </td>
82
              </tr>
83
            <% end %>
84 f880f56e Daniel Lobato
            <tr>
85
              <td><%= _('Running on') %></td>
86
              <td><%= link_to @container.compute_resource,
87
                              compute_resource_path(@container.compute_resource) %></td>
88
            </tr>
89
          </tr>
90
        </table>
91
      </div>
92
    </div>
93
  </div>
94
  <div class="col-md-8">
95 751c6470 Daniel Lobato
    <% if @container.in_fog.ready? %>
96 f880f56e Daniel Lobato
    <ul id="myTab" class="nav nav-tabs">
97
      <li class="active"><a href="#processes" data-toggle="tab">
98
        <span class="glyphicon glyphicon-credit-card"></span>
99
        <%= _('Processes') %>
100
      </a></li>
101 751c6470 Daniel Lobato
      <li><a href="#logs" data-toggle="tab">
102
        <span class="glyphicon glyphicon-list-alt"></span>
103
        <%= _('Logs') %>
104
      </a></li>
105 f880f56e Daniel Lobato
    </ul>
106
    <div id="myTabContent" class="tab-content">
107
      <div class="tab-pane active in" id="processes">
108 751c6470 Daniel Lobato
        <div class='accordion' id='accordion'>
109 5397ee73 David Davis
          <% processes(@container).each do |process| %>
110 751c6470 Daniel Lobato
          <div>
111
            <h2>
112
              <a href='#<%= process['PID'] %>-index'
113
               class='accordion-toggle'
114
               data-toggle='collapse'
115
               data-parent='#accordion'>
116
               <%= process['CMD'] %>
117
              </a><br>
118
              <small><%= process['UID'] %></small>
119
            </h2>
120 f880f56e Daniel Lobato
          </div>
121 751c6470 Daniel Lobato
          <div id='<%= process['PID'] %>-index' class='collapse accordion-body'>
122
            <pre class="prettyprint"><%= JSON.pretty_generate(process) %></pre>
123 f880f56e Daniel Lobato
          </div>
124
        <% end %>
125 751c6470 Daniel Lobato
        </div>
126
      </div>
127
      <div class="tab-pane" id="logs">
128 5397ee73 David Davis
        <pre class="terminal terminal-output pre-scrollable"><code>
129
          <%= logs(@container, :stdout => true, :tail => 100) %>
130
        </code></pre>
131 f880f56e Daniel Lobato
      </div>
132
    </div>
133 751c6470 Daniel Lobato
    <% else %>
134
      <div class="alert alert-block alert-warning">
135
        <p><strong><%= _("Notice") %></strong>
136
        <hr>
137
        <%= _("Your container is stopped.") %></p>
138
        <p><%= _("Please turn on your container to see processes running, logs, and more.") %></p>
139
      </div>
140
    <% end %>
141 f880f56e Daniel Lobato
  </div>
142
</div>
143 387babdd Daniel Lobato
144
<div id="commit-modal" class="modal fade">
145
  <div class="modal-dialog">
146
    <div class="modal-content">
147
      <div class="modal-header">
148
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
149
        <h4 class="modal-title"><%= _('Commit this container state') %></h4>
150
      </div>
151
      <div class="modal-body">
152
        This will save your current container state to an image.
153
      <hr/>
154
      <%= form_tag commit_container_path(:id => @container.id), :id => 'commit-form', :class => 'form-horizontal' do %>
155
        <div class="form-group">
156
          <%= label_tag "commit[repo]", _("Repo"), :class=>"col-sm-2 control-label" %>
157
          <%= text_field :commit, :repo, { :class => "col-sm-8", :focus_on_load => true,
158
                                           :placeholder => _('docker/my-committed-image') } %>
159
        </div>
160
        <div class="form-group">
161
          <%= label_tag "commit[tag]", _("Tag"), :class=>"col-sm-2 control-label" %>
162 6225eda9 Daniel Lobato
          <%= text_field :commit, :tag, { :class => "col-sm-8",
163
                                          :placeholder => _('latest') } %>
164 387babdd Daniel Lobato
        </div>
165
        <div class="form-group">
166
          <%= label_tag "commit[author]", _("Author"), :class=>"col-sm-2 control-label" %>
167
          <%= text_field :commit, :author, { :class => "col-sm-8",
168
                                             :placeholder => _('Foreman user <foremaner@theforeman.org>') } %>
169
        </div>
170
        <div class="form-group">
171
          <%= label_tag "commit[comment]", _("Comment"), :class=>"col-sm-2 control-label" %>
172
          <%= text_field :commit, :comment, { :class => "col-sm-8",
173
                                              :placeholder => _('Description of the commit') } %>
174
        </div>
175
        <div class="modal-footer">
176
          <button type="button" class="btn btn-default" data-dismiss="modal"><%= _('Cancel') %></button>
177
          <%= button_tag(:type => 'submit', :class => 'btn btn-primary') do %>
178
            <%= _('Submit') %> <span class="glyphicon glyphicon-cloud-upload"></span>
179
          <% end %>
180
        </div>
181
        <% end %>
182
    </div>
183
  </div>
184
</div>