fluentd-ui/app/views/shared/vue/_treeview.html.erb
2014-12-01 13:56:17 +09:00

31 lines
1.1 KiB
Plaintext

<% name ||= "" %>
<% action ||= "" %>
<% submit_button ||= "" %>
<%= form_tag(action, method: :post) do %>
<div id="treeview" initialPath="/var/log">
<pre>{{ path }}</pre>
<input type="hidden" name="<%= name %>" v-model="path" />
<div class="dirs">
<span v-repeat="currentDirs">
<span v-if="$index > 0">
<%= icon('fa-caret-right') %>
</span>
<span v-on="click: selectPath($value)" class="dir">{{ basename($value) }}</span>
</span>
</div>
<div class="tree">
<span v-on="click: selectPath(path)" class="vue-path" v-class="selected: isSelected(path)" v-repeat="paths">
<span v-if="is_dir"><%= icon("fa-folder") %></span>
<span v-if="!is_dir"><%= icon("fa-file-o") %></span>
{{ basename(path) }}
<br />
</span>
</div>
<pre v-if="preview" class="preview">{{ preview }}</pre>
<p>
<%= submit_tag submit_button, class: "btn btn-lg btn-primary pull-right", "v-attr" => "disabled: selectedIsDir", "v-class" => "btn-disable: selectedIsDir" %>
</p>
</div>
<% end %>