This commit is contained in:
BoHung Chiu 2022-03-31 13:58:30 +08:00
parent 3d871aec8f
commit 6d33769ee6
1 changed files with 2 additions and 1 deletions

View File

@ -18,6 +18,7 @@
</thead> </thead>
<tbody> <tbody>
<% status_relation = {"creating"=>"<span style=\"color: skyblue;\">creating</span>".html_safe,"error"=>"<span style=\"color: red;\">error</span>".html_safe,"finish"=>"<span style=\"color: darkseagreen;\">finish</span>".html_safe,"closed"=>"<span style=\"color: red;\">closed</span>".html_safe}%> <% status_relation = {"creating"=>"<span style=\"color: skyblue;\">creating</span>".html_safe,"error"=>"<span style=\"color: red;\">error</span>".html_safe,"finish"=>"<span style=\"color: darkseagreen;\">finish</span>".html_safe,"closed"=>"<span style=\"color: red;\">closed</span>".html_safe}%>
<% time_now = Time.now %>
<% @sites.each do |site|%> <% @sites.each do |site|%>
<tr> <tr>
<td><%=site.server_type%></td> <td><%=site.server_type%></td>
@ -35,7 +36,7 @@
<td class="site_status"><%= (site.status.blank? ? "not yet create" : status_relation[site.status]) %></td> <td class="site_status"><%= (site.status.blank? ? "not yet create" : status_relation[site.status]) %></td>
<td> <td>
<a href="#" title="<%=t("client_management.see_logs_for_site",{:site=>site.domain_name})%>" class="btn btn-primary see_infos" data-id="<%=site.id.to_s%>"><%=t('client_management.see_logs')%></a> <a href="#" title="<%=t("client_management.see_logs_for_site",{:site=>site.domain_name})%>" class="btn btn-primary see_infos" data-id="<%=site.id.to_s%>"><%=t('client_management.see_logs')%></a>
<% if site.status.blank? %> <% if site.status.blank? || (site.status == 'creating' && (time_now - site.updated_at > 60)) %>
<a href="#" title="create <%=site.domain_name%>" class="btn btn-primary create_site" data-id="<%=site.id.to_s%>"><%=t('client_management.create_site')%></a> <a href="#" title="create <%=site.domain_name%>" class="btn btn-primary create_site" data-id="<%=site.id.to_s%>"><%=t('client_management.create_site')%></a>
<% elsif site.status == "error" || site.status == "finish" %> <% elsif site.status == "error" || site.status == "finish" %>
<a href="#" title="recreate <%=site.domain_name%>" class="btn btn-primary recreate_site" data-id="<%=site.id.to_s%>"><%=t('client_management.recreate_site')%></a> <a href="#" title="recreate <%=site.domain_name%>" class="btn btn-primary recreate_site" data-id="<%=site.id.to_s%>"><%=t('client_management.recreate_site')%></a>