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

View File

@ -53,7 +53,7 @@ function returnConfig (res) {
app.get('/api/attrs', (req, res) => { app.get('/api/attrs', (req, res) => {
res.send( 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": { "dependencies": {
"axios": "^0.19.0", "axios": "^0.19.0",
"buefy": "^0.8.5", "buefy": "^0.8.8",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-axios": "^2.1.5", "vue-axios": "^2.1.5",
"vue-i18n": "^8.15.0", "vue-i18n": "^8.15.1",
"vue-router": "^3.1.3" "vue-router": "^3.1.3"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.0.4", "@vue/cli-plugin-babel": "^4.1.1",
"@vue/cli-plugin-eslint": "^4.0.4", "@vue/cli-plugin-eslint": "^4.1.1",
"@vue/cli-service": "^4.0.4", "@vue/cli-service": "^4.1.1",
"@vue/eslint-config-standard": "^4.0.0", "@vue/eslint-config-standard": "^5.0.1",
"babel-eslint": "^10.0.3", "babel-eslint": "^10.0.3",
"eslint": "^5.8.0", "eslint": "^6.7.2",
"eslint-plugin-vue": "^5.2.3", "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", "express": "^4.17.1",
"http-proxy-middleware": "^0.20.0", "http-proxy-middleware": "^0.20.0",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.10"

View File

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

View File

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

View File

@ -38,8 +38,10 @@ export default {
// Just launch the target application // Just launch the target application
that.$root.exit() that.$root.exit()
} else { } else {
that.$router.replace({ name: 'showerr', that.$router.replace({
params: { msg: this.$i18n.t('download_config.error_download_config', { msg: e }) } }) 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' var targetUrl = '/api/start-install'
if (this.is_uninstall) { if (this.is_uninstall) {
@ -62,16 +62,16 @@ export default {
this.$root.stream_ajax(targetUrl, function (line) { this.$root.stream_ajax(targetUrl, function (line) {
// On progress line received from server // 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_message = line.Status[0]
that.progress = line.Status[1] * 100 that.progress = line.Status[1] * 100
} }
if (line.hasOwnProperty('PackageInstalled')) { if (Object.prototype.hasOwnProperty.call(line, 'PackageInstalled')) {
that.packages_installed += 1 that.packages_installed += 1
} }
if (line.hasOwnProperty('Error')) { if (Object.prototype.hasOwnProperty.call(line, 'Error')) {
that.failed_with_error = true that.failed_with_error = true
that.$router.replace({ name: 'showerr', params: { msg: line.Error } }) that.$router.replace({ name: 'showerr', params: { msg: line.Error } })
} }
@ -94,19 +94,23 @@ export default {
app.exit() app.exit()
} else if (!that.failed_with_error) { } else if (!that.failed_with_error) {
if (that.is_uninstall) { if (that.is_uninstall) {
that.$router.replace({ name: 'complete', that.$router.replace({
name: 'complete',
params: { params: {
uninstall: true, uninstall: true,
update: that.is_update, update: that.is_update,
installed: that.packages_installed installed: that.packages_installed
} }) }
})
} else { } else {
that.$router.replace({ name: 'complete', that.$router.replace({
name: 'complete',
params: { params: {
uninstall: false, uninstall: false,
update: that.is_update, update: that.is_update,
installed: that.packages_installed installed: that.packages_installed
} }) }
})
} }
} }
} }

File diff suppressed because it is too large Load Diff