ui: update frontend dependencies

This commit is contained in:
liushuyu 2019-12-08 18:27:12 -07:00 committed by James
parent 74cefc277e
commit 9fcfe0c77b
8 changed files with 1202 additions and 1104 deletions

View File

@ -3,7 +3,7 @@ module.exports = {
env: {
node: true
},
'extends': [
extends: [
'plugin:vue/essential',
'@vue/standard'
],
@ -11,7 +11,7 @@ module.exports = {
'no-console': 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-redeclare': 'off',
'camelcase': 'off'
camelcase: 'off'
},
parserOptions: {
parser: 'babel-eslint'

View File

@ -53,7 +53,7 @@ function returnConfig (res) {
app.get('/api/attrs', (req, res) => {
res.send(
{ 'name': 'yuzu', 'target_url': 'https://raw.githubusercontent.com/j-selby/test-installer/master/config.linux.v2.toml' }
{ name: 'yuzu', target_url: 'https://raw.githubusercontent.com/j-selby/test-installer/master/config.linux.v2.toml' }
)
})

View File

@ -9,20 +9,24 @@
},
"dependencies": {
"axios": "^0.19.0",
"buefy": "^0.8.5",
"buefy": "^0.8.8",
"vue": "^2.6.10",
"vue-axios": "^2.1.5",
"vue-i18n": "^8.15.0",
"vue-i18n": "^8.15.1",
"vue-router": "^3.1.3"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.0.4",
"@vue/cli-plugin-eslint": "^4.0.4",
"@vue/cli-service": "^4.0.4",
"@vue/eslint-config-standard": "^4.0.0",
"@vue/cli-plugin-babel": "^4.1.1",
"@vue/cli-plugin-eslint": "^4.1.1",
"@vue/cli-service": "^4.1.1",
"@vue/eslint-config-standard": "^5.0.1",
"babel-eslint": "^10.0.3",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.2.3",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^6.0.1",
"express": "^4.17.1",
"http-proxy-middleware": "^0.20.0",
"vue-template-compiler": "^2.6.10"

View File

@ -41,7 +41,7 @@ export function ajax (path, successCallback, failCallback, data) {
var form = ''
for (var key in data) {
if (!data.hasOwnProperty(key)) {
if (!Object.prototype.hasOwnProperty.call(data, key)) {
continue
}
@ -116,7 +116,7 @@ export function stream_ajax (path, callback, successCallback, failCallback, data
var form = ''
for (var key in data) {
if (!data.hasOwnProperty(key)) {
if (!Object.prototype.hasOwnProperty.call(data, key)) {
continue
}

View File

@ -85,7 +85,7 @@ window.addEventListener('keydown', disableShortcuts)
axios.get('/api/attrs').then(function (resp) {
document.getElementById('window-title').innerText =
i18n.t('app.window_title', { 'name': resp.data.name })
i18n.t('app.window_title', { name: resp.data.name })
}).catch(function (err) {
console.error(err)
})
@ -127,12 +127,14 @@ var app = new Vue({
var searchLocation = app.metadata.install_path.length > 0 ? app.metadata.install_path
: i18n.t('error.location_unknown')
app.$router.replace({ name: 'showerr',
params: { msg: i18n.t('error.exit_error', {
'name': app.attrs.name,
'path': searchLocation,
'msg': msg
})
app.$router.replace({
name: 'showerr',
params: {
msg: i18n.t('error.exit_error', {
name: app.attrs.name,
path: searchLocation,
msg: msg
})
}
})
})

View File

@ -38,8 +38,10 @@ export default {
// Just launch the target application
that.$root.exit()
} else {
that.$router.replace({ name: 'showerr',
params: { msg: this.$i18n.t('download_config.error_download_config', { msg: e }) } })
that.$router.replace({
name: 'showerr',
params: { msg: this.$i18n.t('download_config.error_download_config', { msg: e }) }
})
}
})
},

View File

@ -49,7 +49,7 @@ export default {
}
}
results['path'] = app.install_location
results.path = app.install_location
var targetUrl = '/api/start-install'
if (this.is_uninstall) {
@ -62,16 +62,16 @@ export default {
this.$root.stream_ajax(targetUrl, function (line) {
// On progress line received from server
if (line.hasOwnProperty('Status')) {
if (Object.prototype.hasOwnProperty.call(line, 'Status')) {
that.progress_message = line.Status[0]
that.progress = line.Status[1] * 100
}
if (line.hasOwnProperty('PackageInstalled')) {
if (Object.prototype.hasOwnProperty.call(line, 'PackageInstalled')) {
that.packages_installed += 1
}
if (line.hasOwnProperty('Error')) {
if (Object.prototype.hasOwnProperty.call(line, 'Error')) {
that.failed_with_error = true
that.$router.replace({ name: 'showerr', params: { msg: line.Error } })
}
@ -94,19 +94,23 @@ export default {
app.exit()
} else if (!that.failed_with_error) {
if (that.is_uninstall) {
that.$router.replace({ name: 'complete',
that.$router.replace({
name: 'complete',
params: {
uninstall: true,
update: that.is_update,
installed: that.packages_installed
} })
}
})
} else {
that.$router.replace({ name: 'complete',
that.$router.replace({
name: 'complete',
params: {
uninstall: false,
update: that.is_update,
installed: that.packages_installed
} })
}
})
}
}
}

File diff suppressed because it is too large Load Diff