Status:
<%= cond do %>
<% not @changeset.valid? -> %>
Invalid Configurations!
<% is_tuple(@state.status) -> %>
Error! check logs
<% true -> %>
<%= show_status(@state.status) %>
<% end %>
<%= if not is_nil(@state.validation_status) do %>
Validation Status:
<%= @state.validation_status %>!
<% end %>
<%= if @state.status != :init do %>
Total Files: <%= Enum.count(Map.values(@state.files)) %>
Files Imported: <%= Enum.count(Map.values(@state.files), fn %{status: status} -> status == :done end) %>
CPU Usage: <%= @cpu_usage %>%
Memory Usage of Application: <%= @memory_usage %>
Time Elapsed: <%= @time_spend %> seconds
<% end %>
<%= Enum.map Map.values(@state.files), fn %{name: name, path: path, size: size, row_count: row_count, rows_processed: rows_processed, status: status} -> %>
Name:
<%= name %>
Path:
<%= path %>
Size:
<%= size %>
Total Number of Records:
<%= row_count %>
Status:
<%= case status do %>
<% :pending -> %> Pending
<% :analyze -> %> Infering Schema
<% :loading -> %>
Inserting Data
Record Inserted:
<%= rows_processed %>
<% end %>
<% percentage_progress=if(row_count==0, do: 100, else: (rows_processed / row_count) * 100) %>
<% :done -> %> Finished
<% end %>