Apply PR #8043 to develop

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2020-05-11 22:57:55 -07:00
parent d22be8ee0e
commit 730632e2eb
No known key found for this signature in database
GPG key ID: 10BFFDA3ED34B5AC
6 changed files with 29 additions and 11 deletions

View file

@ -118,8 +118,15 @@ class ImportController extends Controller
public function process(ItemImportRequest $request, $import_id) public function process(ItemImportRequest $request, $import_id)
{ {
$this->authorize('import'); $this->authorize('import');
// Run a backup immediately before processing // Run a backup immediately before processing
if ($request->has('run-backup')) {
\Log::debug('Backup manually requested via importer');
Artisan::call('backup:run'); Artisan::call('backup:run');
} else {
\Log::debug('NO BACKUP requested via importer');
}
$errors = $request->import(Import::find($import_id)); $errors = $request->import(Import::find($import_id));
$redirectTo = "hardware.index"; $redirectTo = "hardware.index";
switch ($request->get('import-type')) { switch ($request->get('import-type')) {

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=a7bc4e83c6d3ae912094", "/js/build/app.js": "/js/build/app.js?id=f1cc6a7ff104c9cbd2e4",
"/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=59413334823616b81341", "/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=59413334823616b81341",
"/css/build/app.css": "/css/build/app.css?id=3911a887c2bdc7d0b528", "/css/build/app.css": "/css/build/app.css?id=3911a887c2bdc7d0b528",
"/css/build/overrides.css": "/css/build/overrides.css?id=688f59cd273484405f9b", "/css/build/overrides.css": "/css/build/overrides.css?id=688f59cd273484405f9b",
@ -34,5 +34,5 @@
"/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=a534edb9f7179f6dcf62", "/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=a534edb9f7179f6dcf62",
"/js/build/vendor.js": "/js/build/vendor.js?id=ac70ab5fd89efc2aa7d0", "/js/build/vendor.js": "/js/build/vendor.js?id=ac70ab5fd89efc2aa7d0",
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=9407782198cbc29f23d1", "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=9407782198cbc29f23d1",
"/js/dist/all.js": "/js/dist/all.js?id=f930032e5ca0a4bb587a" "/js/dist/all.js": "/js/dist/all.js?id=43e4e9e0ddff773e54b2"
} }

View file

@ -22,21 +22,31 @@ tr {
</div> </div>
<div class="dynamic-form-row"> <div class="dynamic-form-row">
<div class="col-md-5 col-xs-12"> <div class="col-md-5 col-xs-12">
<label for="import-update">Update Existing Values?:</label> <label for="import-update">Update Existing Values?</label>
</div> </div>
<div class="col-md-7 col-xs-12"> <div class="col-md-7 col-xs-12">
<input type="checkbox" name="import-update" v-model="options.update"> <input type="checkbox" class="minimal" name="import-update" v-model="options.update">
</div> </div>
</div> </div>
<div class="dynamic-form-row"> <div class="dynamic-form-row">
<div class="col-md-5 col-xs-12"> <div class="col-md-5 col-xs-12">
<label for="send-welcome">Send Welcome Email for new Users?</label> <label for="send-welcome">Send Welcome Email for new Users?</label>
</div> </div>
<div class="col-md-7 col-xs-12"> <div class="col-md-7 col-xs-12">
<input type="checkbox" name="send-welcome" v-model="options.send_welcome"> <input type="checkbox" class="minimal" name="send-welcome" v-model="options.send_welcome">
</div> </div>
</div> </div>
<div class="dynamic-form-row">
<div class="col-md-5 col-xs-12">
<label for="run-backup">Backup before importing?</label>
</div> </div>
<div class="col-md-7 col-xs-12">
<input type="checkbox" class="minimal" name="run-backup" v-model="options.run_backup">
</div>
</div>
<div class="alert col-md-8 col-md-offset-2" style="text-align:left" <div class="alert col-md-8 col-md-offset-2" style="text-align:left"
:class="alertClass" :class="alertClass"
v-if="statusText"> v-if="statusText">
@ -238,6 +248,7 @@ tr {
'import-update': this.options.update, 'import-update': this.options.update,
'send-welcome': this.options.send_welcome, 'send-welcome': this.options.send_welcome,
'import-type': this.options.importType, 'import-type': this.options.importType,
'run-backup': this.options.run_backup,
'column-mappings': this.columnMappings 'column-mappings': this.columnMappings
}).then( ({body}) => { }).then( ({body}) => {
// Success // Success

View file

@ -66,9 +66,9 @@
<div class="modal-header"> <div class="modal-header">
<button type="button " class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <button type="button " class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h2 class="modal-title"> <h4 class="modal-title">
Create Token Create Token
</h2> </h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
@ -134,9 +134,9 @@
<div class="modal-header"> <div class="modal-header">
<button type="button " class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <button type="button " class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h2 class="modal-title"> <h4 class="modal-title">
Personal Access Token Personal Access Token
</h2> </h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">