mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Assorted fixed (#3332)
* Better error handling of failed file uploads. Also improve formatting of modal dialog * Readd app.js to the js build, fixes collapsing sidebar * Update JS * Fix font size. We need to explicitly set the font size for the table because everywhere else that comes from bootstrap-tables
This commit is contained in:
parent
381526e488
commit
ad9470b6f8
|
@ -79,8 +79,7 @@ class ImportController extends Controller
|
||||||
'files' => $results
|
'files' => $results
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
$results['error']=trans('general.feature_disabled');
|
return response()->json(Helper::formatStandardApiResponse('error', null, trans('general.feature_disabled')), 500);
|
||||||
return $results;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Processes the specified Import.
|
* Processes the specified Import.
|
||||||
|
|
|
@ -53,7 +53,8 @@ elixir(function(mix) {
|
||||||
bowerPath + '/iCheck/icheck.js',
|
bowerPath + '/iCheck/icheck.js',
|
||||||
bowerPath + '/select2/dist/js/select2.full.js',
|
bowerPath + '/select2/dist/js/select2.full.js',
|
||||||
bowerPath + '/ekko-lightbox/dist/ekko-lightbox.js',
|
bowerPath + '/ekko-lightbox/dist/ekko-lightbox.js',
|
||||||
'snipeit.js'
|
'snipeit.js',
|
||||||
|
'app.js'
|
||||||
|
|
||||||
],'public/assets/js');
|
],'public/assets/js');
|
||||||
mix.version(['assets/css/app.css','assets/js/all.js']);
|
mix.version(['assets/css/app.css','assets/js/all.js']);
|
||||||
|
|
0
public/assets/css/app.css
Normal file → Executable file
0
public/assets/css/app.css
Normal file → Executable file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
0
public/build/assets/css/app-97b46ba110.css
Normal file → Executable file
0
public/build/assets/css/app-97b46ba110.css
Normal file → Executable file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"assets/css/app.css": "assets/css/app-97b46ba110.css",
|
"assets/css/app.css": "assets/css/app-97b46ba110.css",
|
||||||
"assets/js/all.js": "assets/js/all-e871790407.js"
|
"assets/js/all.js": "assets/js/all-cedefbcf04.js"
|
||||||
}
|
}
|
|
@ -691,11 +691,3 @@ function _init() {
|
||||||
};
|
};
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const app = new Vue({
|
|
||||||
el: '#app'
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
td {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="row">
|
||||||
<alert v-show="alert.visible" :alertType="alert.type" v-on:hide="alert.visible = false">{{ alert.message }}</alert>
|
<alert v-show="alert.visible" :alertType="alert.type" v-on:hide="alert.visible = false">{{ alert.message }}</alert>
|
||||||
<errors :errors="importErrors"></errors>
|
<errors :errors="importErrors"></errors>
|
||||||
<modal v-model="displayImportModal" effect="fade">
|
<modal v-model="displayImportModal" effect="fade">
|
||||||
<div slot="modal-header" class="modal-title">Import File:</div>
|
<div slot="modal-header" class="modal-header">
|
||||||
|
<h4 class="modal-title">Import File:</h4>
|
||||||
|
</div>
|
||||||
<div slot="modal-body" class="modal-body">
|
<div slot="modal-body" class="modal-body">
|
||||||
<div class="dynamic-form-row">
|
<div class="dynamic-form-row">
|
||||||
<div class="col-md-4 col-xs-12">
|
<div class="col-md-4 col-xs-12">
|
||||||
|
@ -29,18 +32,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div slot="modal-footer" class="modal-footer">
|
<div class="modal-footer" slot="modal-footer">
|
||||||
<div class="row">
|
<div class="alert alert-success col-md-5 col-md-offset-1" style="text-align:left" v-if="modal.statusText">{{ this.modal.statusText }}</div>
|
||||||
<div class="alert alert-success col-md-5 col-md-offset-1" style="text-align:left" v-if="modal.statusText">{{ this.modal.statusText }}</div>
|
<button type="button" class="btn btn-default" @click="displayImportModal = false">Cancel</button>
|
||||||
<button type="button" class="btn btn-default" @click="displayImportModal = false">Cancel</button>
|
<button type="submit" class="btn btn-primary" @click="postSave">Process</button>
|
||||||
<button type="submit" class="btn btn-primary" @click="postSave">Save</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</modal>
|
</modal>
|
||||||
<div class="row">
|
<div class="col-md-12">
|
||||||
<div class="col-md-12">
|
<div class="box">
|
||||||
<div class="box">
|
<div class="box-body">
|
||||||
<div class="box-body">
|
<div class="row">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<!-- The fileinput-button span is used to style the file input field as button -->
|
<!-- The fileinput-button span is used to style the file input field as button -->
|
||||||
<span class="btn btn-info fileinput-button">
|
<span class="btn btn-info fileinput-button">
|
||||||
|
@ -58,28 +59,28 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
</div>
|
||||||
<div class="col-md-12">
|
<div class="row">
|
||||||
<table class="table table-striped" id="upload-table">
|
<div class="col-md-12">
|
||||||
<thead>
|
<table class="table table-striped" id="upload-table">
|
||||||
<th>File</th>
|
<thead>
|
||||||
<th>Created</th>
|
<th>File</th>
|
||||||
<th>Size</th>
|
<th>Created</th>
|
||||||
<th></th>
|
<th>Size</th>
|
||||||
</thead>
|
<th></th>
|
||||||
<tbody>
|
</thead>
|
||||||
<tr v-for="file in files">
|
<tbody>
|
||||||
<td>{{ file.file_path }}</td>
|
<tr v-for="file in files">
|
||||||
<td>{{ file.created_at }} </td>
|
<td>{{ file.file_path }}</td>
|
||||||
<td>{{ file.filesize }}</td>
|
<td>{{ file.created_at }} </td>
|
||||||
<td>
|
<td>{{ file.filesize }}</td>
|
||||||
<button class="btn btn-sm btn-info" @click="showModal(file)"><i class="fa fa-spinner process"></i>Process</button>
|
<td>
|
||||||
<button class="btn btn-sm btn-danger" @click="deleteFile(file)"><i class="fa fa-trash icon-white"></i></button>
|
<button class="btn btn-sm btn-info" @click="showModal(file)"><i class="fa fa-spinner process"></i>Process</button>
|
||||||
</td>
|
<button class="btn btn-sm btn-danger" @click="deleteFile(file)"><i class="fa fa-trash icon-white"></i></button>
|
||||||
</tr>
|
</td>
|
||||||
</tbody>
|
</tr>
|
||||||
</table>
|
</tbody>
|
||||||
</div>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -155,7 +156,8 @@
|
||||||
},
|
},
|
||||||
fail(e, data) {
|
fail(e, data) {
|
||||||
vm.progress.currentClass = "progress-bar-danger";
|
vm.progress.currentClass = "progress-bar-danger";
|
||||||
vm.progress.statusText = data.errorThrown;
|
// Display any errors returned from the $.ajax()
|
||||||
|
vm.progress.statusText = data.jqXHR.responseJSON.messages;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -187,6 +189,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
postSave() {
|
postSave() {
|
||||||
|
this.modal.statusText = "Processing...";
|
||||||
this.$http.post('/api/v1/imports/process/'+this.activeFile.id, {
|
this.$http.post('/api/v1/imports/process/'+this.activeFile.id, {
|
||||||
'import-update': this.modal.update,
|
'import-update': this.modal.update,
|
||||||
'import-type': this.modal.importType
|
'import-type': this.modal.importType
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue