Features: improved UI for importer (#9467)

* Small UI improvements for importer

Signed-off-by: snipe <snipe@snipe.net>

* And UI backup improvements

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2021-04-21 20:16:17 -07:00 committed by GitHub
parent cef689a679
commit 1d43eda21f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 81 additions and 59 deletions

Binary file not shown.

BIN
public/js/dist/all.js vendored

Binary file not shown.

View file

@ -1,5 +1,5 @@
{
"/js/build/app.js": "/js/build/app.js?id=dbeda4a18809e6247c2a",
"/js/build/app.js": "/js/build/app.js?id=b23ec8d1be42f9d3d810",
"/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=59413334823616b81341",
"/css/build/app.css": "/css/build/app.css?id=032fd8c3fce99c7fd862",
"/css/build/overrides.css": "/css/build/overrides.css?id=0b4aefd7ef0c117ef23a",
@ -34,5 +34,5 @@
"/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=1e77fde04b3f42432581",
"/js/build/vendor.js": "/js/build/vendor.js?id=b93877b4a88a76e1b18b",
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=fd6e727609678bf04984",
"/js/dist/all.js": "/js/dist/all.js?id=0efed60df4636f215a73"
"/js/dist/all.js": "/js/dist/all.js?id=dde965016a515da2f8d2"
}

View file

@ -1,6 +1,7 @@
<template>
<div v-show="processDetail" class="col-md-12">
<tr v-show="processDetail">
<td colspan="5">
<div class="col-md-12">
<div class="row">
<div class="dynamic-form-row">
@ -20,7 +21,7 @@
<label for="import-update">Update Existing Values?:</label>
</div>
<div class="col-md-7 col-xs-12">
<input type="checkbox" class="minimal" name="import-update" v-model="options.update">
<input type="checkbox" class="iCheck minimal" name="import-update" v-model="options.update">
</div>
</div><!-- /dynamic-form-row -->
@ -94,6 +95,8 @@
</div><!-- /div v-show -->
</td>
</tr>
</template>
<script>

View file

@ -14,20 +14,6 @@
display:none;
}
/* Rules for the div table */
.tbl_head {
font-weight: bold;
}
.div_tbl {
display: table;
}
.div_tbl_row {
display: table-row;
}
.div_tbl_cell {
display: table-cell;
padding: 2px
}
</style>
<div id="app">
@ -40,59 +26,77 @@
<div class="box">
<div class="box-body">
<div class="row">
<div class="col-md-3 pull-right">
<!-- The fileinput-button span is used to style the file input field as button -->
@if (!config('app.lock_passwords'))
<span class="btn btn-primary fileinput-button">
<span>Select Import File...</span>
<!-- The file input field used as target for the file upload widget -->
<label for="files[]"><span class="sr-only">Select file</span></label>
<input id="fileupload" type="file" name="files[]" data-url="{{ route('api.imports.index') }}" accept="text/csv" aria-label="files[]">
</span>
@endif
<div class="col-md-12">
</div>
<div class="col-md-9" v-show="progress.visible" style="padding-bottom:20px">
<div class="col-md-11">
<div class="col-md-9" v-show="progress.visible" style="padding-bottom:20px">
<div class="progress progress-striped-active" style="margin-top: 8px">
<div class="progress-bar" :class="progress.currentClass" role="progressbar" :style="progressWidth">
<span>@{{ progress.statusText }}</span>
</div>
</div>
</div>
<div class="col-md-3 text-right pull-right">
<!-- The fileinput-button span is used to style the file input field as button -->
@if (!config('app.lock_passwords'))
<span class="btn btn-primary fileinput-button">
<span>Select Import File...</span>
<!-- The file input field used as target for the file upload widget -->
<label for="files[]"><span class="sr-only">Select file</span></label>
<input id="fileupload" type="file" name="files[]" data-url="{{ route('api.imports.index') }}" accept="text/csv" aria-label="files[]">
</span>
@endif
</div>
</div>
</div>
<div class="row">
<div class="col-md-12" style="padding-top: 30px;">
<div class="table table-striped" id="upload-table">
<div class="div_tbl_row col-md-12">
<div class="tbl_head col-md-5">File</div>
<div class="tbl_head col-md-3">Created</div>
<div class="tbl_head col-md-2">Size</div>
<div class="tbl_head col-md-2"></div>
</div>
<div class="col-md-12 table-responsive" style="padding-top: 30px;">
<table data-pagination="true"
data-id-table="upload-table"
data-search="true"
data-side-pagination="client"
id="upload-table"
class="col-md-12 table table-striped snipe-table">
<tr>
<th class="col-md-6">File</th>
<th class="col-md-3">Created</th>
<th class="col-md-1">Size</th>
<th class="col-md-1 text-right"><span class="sr-only">Process</span></th>
<th class="col-md-1 text-right"><span class="sr-only">Delete</span></th>
</tr>
<template v-for="currentFile in files">
<div class="div_tbl_row col-md-12">
<div class="div_tbl_cell col-md-5">@{{ currentFile.file_path }}</div>
<div class="div_tbl_cell col-md-3">@{{ currentFile.created_at }} </div>
<div class="div_tbl_cell col-md-2">@{{ currentFile.filesize }}</div>
<div class="div_tbl_cell col-md-2">
<button class="btn btn-sm btn-info" @click="toggleEvent(currentFile.id)">Process</button>
<button class="btn btn-sm btn-danger" @click="deleteFile(currentFile)"><i class="fa fa-trash icon-white"></i></button>
</div>
</div>
<import-file
:key="currentFile.id"
:file="currentFile"
:custom-fields="customFields"
@alert="updateAlert(alert)">
</import-file>
<tr>
<td class="col-md-6">@{{ currentFile.file_path }}</td>
<td class="col-md-3">@{{ currentFile.created_at }} </td>
<td class="col-md-1">@{{ currentFile.filesize }}</td>
<td class="col-md-1 text-right">
<button class="btn btn-sm btn-info" @click="toggleEvent(currentFile.id)">
Process
</button>
</td>
<td class="col-md-1 text-right">
<button class="btn btn-sm btn-danger" @click="deleteFile(currentFile)">
<i class="fa fa-trash icon-white" aria-hidden="true"></i><span class="sr-only"></span></button>
</td>
</tr>
<import-file
:key="currentFile.id"
:file="currentFile"
:custom-fields="customFields"
@alert="updateAlert(alert)">
</import-file>
</template>
</div>
</table>
</div>
</div>
</div>

View file

@ -19,7 +19,17 @@
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table class="table table-striped">
<table
data-cookie="true"
data-cookie-id-table="system-backups"
data-pagination="true"
data-id-table="system-backups"
data-search="true"
data-side-pagination="client"
data-sort-order="asc"
id="system-backups"
class="table table-striped snipe-table">
<thead>
<thead>
<th>File</th>
<th>Created</th>
@ -78,3 +88,8 @@
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table')
@stop