Skip to content

Commit eebf7fa

Browse files
onitakerohityadavcloud
authored andcommitted
eslint: fix missing eslint dependencies and lint errors (#19)
Fixes: #17 Fixes: #18 These dependencies are necessary or eslint will fail with the standard vue.js rule set. The PR also includes fixes for all lint errors. Signed-off-by: Rohit Yadav <[email protected]>
1 parent c131e6f commit eebf7fa

33 files changed

+188
-185
lines changed

ui/package-lock.json

Lines changed: 27 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"@vue/cli-plugin-eslint": "^4.0.5",
6868
"@vue/cli-plugin-unit-jest": "^4.0.5",
6969
"@vue/cli-service": "^4.0.5",
70-
"@vue/eslint-config-standard": "^4.0.0",
70+
"@vue/eslint-config-standard": "^5.0.0",
7171
"@vue/test-utils": "^1.0.0-beta.20",
7272
"babel-core": "7.0.0-bridge.0",
7373
"babel-eslint": "^10.0.3",
@@ -76,6 +76,10 @@
7676
"eslint": "^6.6.0",
7777
"eslint-plugin-html": "^6.0.0",
7878
"eslint-plugin-vue": "^6.0.1",
79+
"eslint-plugin-import": "^2.18.2",
80+
"eslint-plugin-node": "^10.0.0",
81+
"eslint-plugin-promise": "^4.2.1",
82+
"eslint-plugin-standard": "^4.0.1",
7983
"less": "^3.10.3",
8084
"less-loader": "^5.0.0",
8185
"vue-cli-plugin-i18n": "^0.6.0",

ui/src/api/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import { axios } from '@/utils/request'
1919

2020
export function api (command, args = {}) {
21-
args['command'] = command
22-
args['response'] = 'json'
21+
args.command = command
22+
args.response = 'json'
2323
return axios.get('/', {
2424
params: args
2525
})

ui/src/components/header/HeaderNotice.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ export default {
6161
jobs: [],
6262
poller: null,
6363
notificationAvatar: {
64-
'done': { 'icon': 'check-circle', 'style': 'backgroundColor:#87d068' },
65-
'progress': { 'icon': 'loading', 'style': 'backgroundColor:#ffbf00' },
66-
'failed': { 'icon': 'close-circle', 'style': 'backgroundColor:#f56a00' }
64+
done: { icon: 'check-circle', style: 'backgroundColor:#87d068' },
65+
progress: { icon: 'loading', style: 'backgroundColor:#ffbf00' },
66+
failed: { icon: 'close-circle', style: 'backgroundColor:#f56a00' }
6767
}
6868
}
6969
},
@@ -85,11 +85,11 @@ export default {
8585
var hasUpdated = false
8686
for (var i in this.jobs) {
8787
if (this.jobs[i].status === 'progress') {
88-
await api('queryAsyncJobResult', { 'jobid': this.jobs[i].jobid }).then(json => {
88+
await api('queryAsyncJobResult', { jobid: this.jobs[i].jobid }).then(json => {
8989
var result = json.queryasyncjobresultresponse
9090
if (result.jobstatus === 1 && this.jobs[i].status !== 'done') {
9191
hasUpdated = true
92-
this.$notification['success']({
92+
this.$notification.success({
9393
message: this.jobs[i].title,
9494
description: this.jobs[i].description
9595
})
@@ -100,7 +100,7 @@ export default {
100100
if (result.jobresult.errortext !== null) {
101101
this.jobs[i].description = '(' + this.jobs[i].description + ') ' + result.jobresult.errortext
102102
}
103-
this.$notification['error']({
103+
this.$notification.error({
104104
message: this.jobs[i].title,
105105
description: this.jobs[i].description
106106
})

ui/src/components/header/ProjectMenu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export default {
8484
getNextPage()
8585
},
8686
isDisabled () {
87-
return !store.getters.apis.hasOwnProperty('listProjects')
87+
return !Object.prototype.hasOwnProperty.call(store.getters.apis, 'listProjects')
8888
},
8989
setSelectedProject (project) {
9090
this.selectedProject = project.displaytext || project.name

ui/src/components/multitab/MultiTab.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export default {
150150
}
151151
},
152152
watch: {
153-
'$route': function (newVal) {
153+
$route: function (newVal) {
154154
this.activeKey = newVal.fullPath
155155
if (this.fullPathList.indexOf(newVal.fullPath) < 0) {
156156
this.fullPathList.push(newVal.fullPath)

ui/src/components/view/InfoCard.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ export default {
496496
return
497497
}
498498
this.tags = []
499-
api('listTags', { 'listall': true, 'resourceid': this.resource.id, 'resourcetype': this.resourceType }).then(json => {
499+
api('listTags', { listall: true, resourceid: this.resource.id, resourcetype: this.resourceType }).then(json => {
500500
if (json.listtagsresponse && json.listtagsresponse.tag) {
501501
this.tags = json.listtagsresponse.tag
502502
}
@@ -507,7 +507,7 @@ export default {
507507
return
508508
}
509509
this.notes = []
510-
api('listAnnotations', { 'entityid': this.resource.id, 'entitytype': this.annotationType }).then(json => {
510+
api('listAnnotations', { entityid: this.resource.id, entitytype: this.annotationType }).then(json => {
511511
if (json.listannotationsresponse && json.listannotationsresponse.annotation) {
512512
this.notes = json.listannotationsresponse.annotation
513513
}
@@ -527,8 +527,8 @@ export default {
527527
},
528528
handleInputConfirm () {
529529
const args = {}
530-
args['resourceids'] = this.resource.id
531-
args['resourcetype'] = this.resourceType
530+
args.resourceids = this.resource.id
531+
args.resourcetype = this.resourceType
532532
args['tags[0].key'] = this.inputKey
533533
args['tags[0].value'] = this.inputValue
534534
api('createTags', args).then(json => {
@@ -542,8 +542,8 @@ export default {
542542
},
543543
handleDeleteTag (tag) {
544544
const args = {}
545-
args['resourceids'] = tag.resourceid
546-
args['resourcetype'] = tag.resourcetype
545+
args.resourceids = tag.resourceid
546+
args.resourcetype = tag.resourcetype
547547
args['tags[0].key'] = tag.key
548548
args['tags[0].value'] = tag.value
549549
api('deleteTags', args).then(json => {
@@ -560,9 +560,9 @@ export default {
560560
}
561561
this.showNotesInput = false
562562
const args = {}
563-
args['entityid'] = this.resource.id
564-
args['entitytype'] = this.annotationType
565-
args['annotation'] = this.annotation
563+
args.entityid = this.resource.id
564+
args.entitytype = this.annotationType
565+
args.annotation = this.annotation
566566
api('addAnnotation', args).then(json => {
567567
}).finally(e => {
568568
this.getNotes()
@@ -571,7 +571,7 @@ export default {
571571
},
572572
deleteNote (annotation) {
573573
const args = {}
574-
args['id'] = annotation.id
574+
args.id = annotation.id
575575
api('removeAnnotation', args).then(json => {
576576
}).finally(e => {
577577
this.getNotes()

ui/src/components/widgets/OsLogo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default {
7676
return
7777
}
7878
this.name = 'linux'
79-
api('listOsTypes', { 'id': osId }).then(json => {
79+
api('listOsTypes', { id: osId }).then(json => {
8080
if (json && json.listostypesresponse && json.listostypesresponse.ostype && json.listostypesresponse.ostype.length > 0) {
8181
this.discoverOsLogo(json.listostypesresponse.ostype[0].description)
8282
} else {

ui/src/config/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function generateRouterMap (section) {
9696
title: child.title,
9797
name: child.name,
9898
keepAlive: true,
99-
permission: [ action.api ]
99+
permission: [action.api]
100100
},
101101
component: action.component,
102102
hidden: true

ui/src/config/section/compute.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ export default {
2424
name: 'vm',
2525
title: 'Instances',
2626
icon: 'desktop',
27-
permission: [ 'listVirtualMachinesMetrics', 'listVirtualMachines' ],
27+
permission: ['listVirtualMachinesMetrics', 'listVirtualMachines'],
2828
resourceType: 'UserVm',
2929
columns: [
3030
'name', 'state', 'instancename', 'ipaddress', 'cpunumber', 'cpuused', 'cputotal',
31-
{ 'memoryused':
31+
{
32+
memoryused:
3233
(record) => {
3334
return record.memorykbs && record.memoryintfreekbs ? parseFloat(100.0 * (record.memorykbs - record.memoryintfreekbs) / record.memorykbs).toFixed(2) + '%' : '0.0%'
3435
}
@@ -230,7 +231,7 @@ export default {
230231
name: 'ssh',
231232
title: 'SSH Key Pairs',
232233
icon: 'key',
233-
permission: [ 'listSSHKeyPairs' ],
234+
permission: ['listSSHKeyPairs'],
234235
columns: ['name', 'fingerprint', 'account', 'domain'],
235236
details: ['name', 'fingerprint', 'account', 'domain'],
236237
actions: [
@@ -261,7 +262,7 @@ export default {
261262
name: 'affinitygroup',
262263
title: 'Affinity Groups',
263264
icon: 'swap',
264-
permission: [ 'listAffinityGroups' ],
265+
permission: ['listAffinityGroups'],
265266
columns: ['name', 'type', 'description', 'account', 'domain'],
266267
details: ['name', 'id', 'description', 'type', 'account', 'domain'],
267268
actions: [

ui/src/config/section/config.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@ export default {
1919
name: 'config',
2020
title: 'Configuration',
2121
icon: 'setting',
22-
permission: [ 'listConfigurations' ],
22+
permission: ['listConfigurations'],
2323
children: [
2424
{
2525
name: 'globalsetting',
2626
title: 'Global Settings',
2727
icon: 'setting',
28-
permission: [ 'listConfigurations' ],
29-
columns: [ 'name', 'description', 'category', 'value' ],
30-
details: [ 'name', 'category', 'description', 'value' ]
28+
permission: ['listConfigurations'],
29+
columns: ['name', 'description', 'category', 'value'],
30+
details: ['name', 'category', 'description', 'value']
3131
},
3232
{
3333
name: 'ldapsetting',
3434
title: 'LDAP Configuration',
3535
icon: 'team',
36-
permission: [ 'listLdapConfigurations' ],
37-
columns: [ 'hostname', 'port' ],
36+
permission: ['listLdapConfigurations'],
37+
columns: ['hostname', 'port'],
3838
actions: [
3939
{
4040
api: 'addLdapConfiguration',
@@ -51,8 +51,8 @@ export default {
5151
name: 'hypervisorcapability',
5252
title: 'Hypervisor Capabilities',
5353
icon: 'database',
54-
permission: [ 'listHypervisorCapabilities' ],
55-
columns: [ 'hypervisor', 'hypervisorversion', 'maxguestlimit', 'maxdatavolumeslimit', 'maxhostspercluster' ],
54+
permission: ['listHypervisorCapabilities'],
55+
columns: ['hypervisor', 'hypervisorversion', 'maxguestlimit', 'maxdatavolumeslimit', 'maxhostspercluster'],
5656
actions: [
5757
{
5858
api: 'updateHypervisorCapabilities',

ui/src/config/section/iam.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ export default {
1919
name: 'iam',
2020
title: 'Identity and Access',
2121
icon: 'solution',
22-
permission: [ 'listAccounts', 'listUsers', 'listDomains', 'listRoles' ],
22+
permission: ['listAccounts', 'listUsers', 'listDomains', 'listRoles'],
2323
children: [
2424
{
2525
name: 'accountuser',
2626
title: 'Users',
2727
icon: 'user',
28-
permission: [ 'listUsers' ],
28+
permission: ['listUsers'],
2929
columns: ['username', 'state', 'firstname', 'lastname', 'email', 'account', 'domain'],
3030
details: ['username', 'id', 'firstname', 'lastname', 'email', 'usersource', 'timezone', 'rolename', 'roletype', 'account', 'domain', 'created'],
3131
actions: [
@@ -86,7 +86,7 @@ export default {
8686
name: 'account',
8787
title: 'Accounts',
8888
icon: 'team',
89-
permission: [ 'listAccounts' ],
89+
permission: ['listAccounts'],
9090
columns: ['name', 'state', 'firstname', 'lastname', 'rolename', 'roletype', 'domain'],
9191
details: ['name', 'id', 'rolename', 'roletype', 'domain', 'networkdomain', 'iptotal', 'vmtotal', 'volumetotal', 'receivedbytes', 'sentbytes', 'vmlimit', 'iplimit', 'volumelimit', 'snapshotlimit', 'templatelimit', 'vpclimit', 'cpulimit', 'memorylimit', 'networklimit', 'primarystoragelimit', 'secondarystoragelimit'],
9292
actions: [
@@ -118,7 +118,7 @@ export default {
118118
dataView: true,
119119
show: (record) => { return record.state === 'disabled' || record.state === 'locked' },
120120
args: ['id'],
121-
params: { 'lock': 'false' }
121+
params: { lock: 'false' }
122122
},
123123
{
124124
api: 'disableAccount',
@@ -127,7 +127,7 @@ export default {
127127
dataView: true,
128128
show: (record) => { return record.state === 'enabled' },
129129
args: ['id'],
130-
params: { 'lock': 'false' }
130+
params: { lock: 'false' }
131131
},
132132
{
133133
api: 'disableAccount',
@@ -153,7 +153,7 @@ export default {
153153
name: 'domain',
154154
title: 'Domains',
155155
icon: 'block',
156-
permission: [ 'listDomains' ],
156+
permission: ['listDomains'],
157157
resourceType: 'Domain',
158158
columns: ['name', 'state', 'path', 'parentdomainname', 'level'],
159159
details: ['name', 'id', 'path', 'parentdomainname', 'level', 'networkdomain', 'iptotal', 'vmtotal', 'volumetotal', 'vmlimit', 'iplimit', 'volumelimit', 'snapshotlimit', 'templatelimit', 'vpclimit', 'cpulimit', 'memorylimit', 'networklimit', 'primarystoragelimit', 'secondarystoragelimit'],
@@ -193,7 +193,7 @@ export default {
193193
name: 'role',
194194
title: 'Roles',
195195
icon: 'idcard',
196-
permission: [ 'listRoles' ],
196+
permission: ['listRoles'],
197197
columns: ['name', 'type', 'description'],
198198
details: ['name', 'id', 'type', 'description'],
199199
actions: [

0 commit comments

Comments
 (0)