mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-15 10:47:06 +02:00
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
<% add_javascript_pack_tag("treeview") %>
|
|
<% name ||= "" %>
|
|
<% action ||= "" %>
|
|
<% submit_button ||= "" %>
|
|
<%= form_tag(action, method: :post) do %>
|
|
<div id="treeview">
|
|
<div class="card">
|
|
<pre class="card-body pb-0">{{ path }}</pre>
|
|
</div>
|
|
<input type="hidden" name="<%= name %>" v-model="path" />
|
|
<div class="dirs">
|
|
<span v-for="(dir, index) in currentDirs">
|
|
<span v-if="index > 0">
|
|
<%= icon('fa-caret-right') %>
|
|
</span>
|
|
<span v-on:click="selectPath(dir)" class="dir">{{ basename(dir) }}</span>
|
|
</span>
|
|
</div>
|
|
<div class="tree">
|
|
<span v-on:click="selectPath(value.path)" class="vue-path" v-bind:class="{ selected: isSelected(value.path) }" v-for="value in paths">
|
|
<span v-if="value.is_dir"><%= icon("fa-folder") %></span>
|
|
<span v-if="!value.is_dir"><%= icon("fa-file-o") %></span>
|
|
{{ basename(value.path) }}
|
|
<br />
|
|
</span>
|
|
</div>
|
|
|
|
<pre v-if="preview" class="preview">{{ preview }}</pre>
|
|
<p>
|
|
<%= submit_tag submit_button, class: "btn btn-lg btn-primary float-right", "v-bind:disabled" => "selectedIsDir" %>
|
|
</p>
|
|
</div>
|
|
<% end %>
|