Add a new dashboard page.
This commit is contained in:
parent
89150e1164
commit
fd24b1898e
133 changed files with 17303 additions and 11112 deletions
38
webui/src/_helpers/Errors.js
Normal file
38
webui/src/_helpers/Errors.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
import { Notify } from 'quasar'
|
||||
import { APP } from './APP'
|
||||
|
||||
class Errors {
|
||||
// Getters
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
// Public
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
// Static
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
static showError (body) {
|
||||
body = APP._.isString(body) ? JSON.parse(body) : body
|
||||
Notify.create({
|
||||
color: 'negative',
|
||||
position: 'top',
|
||||
message: body.message, // TODO - get correct error message
|
||||
icon: 'report_problem'
|
||||
})
|
||||
}
|
||||
|
||||
static handleResponse (error) {
|
||||
console.log('handleResponse', error, error.response)
|
||||
let body = error.response.data
|
||||
if (error.response.status === 401) {
|
||||
// TODO - actions...
|
||||
}
|
||||
Errors.showError(body)
|
||||
return Promise.reject(body)
|
||||
}
|
||||
|
||||
// Static Private
|
||||
// ------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
export default Errors
|
Loading…
Add table
Add a link
Reference in a new issue