Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
truenas-rk3588
webui
Commits
4e9a999d
Commit
4e9a999d
authored
3 years ago
by
akarpov
Browse files
Options
Download
Email Patches
Plain Diff
NAS-112433: Enable no-restricted-globals linter rule
parent
98ed8d1d
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
.eslintrc.js
+1
-1
.eslintrc.js
.nvmrc
+1
-0
.nvmrc
src/app/core/classes/thread.ts
+1
-0
src/app/core/classes/thread.ts
src/app/core/services/chart-data-utils.service.ts
+1
-0
src/app/core/services/chart-data-utils.service.ts
src/app/pages/account/users/user-form/user-form.component.ts
+1
-1
src/app/pages/account/users/user-form/user-form.component.ts
src/app/pages/common/entity/entity-form/components/form-input/form-input.component.ts
+1
-1
...entity-form/components/form-input/form-input.component.ts
src/app/pages/common/entity/entity-table/table-utils.worker.ts
+1
-1
...pp/pages/common/entity/entity-table/table-utils.worker.ts
src/app/pages/common/entity/entity-tree-table/entity-tree-table.component.ts
+1
-1
...n/entity/entity-tree-table/entity-tree-table.component.ts
src/app/pages/common/entity/table/table.component.ts
+1
-1
src/app/pages/common/entity/table/table.component.ts
src/app/pages/credentials/backup-credentials/backup-credentials.component.ts
+1
-1
...ntials/backup-credentials/backup-credentials.component.ts
src/app/pages/credentials/certificates-dash/certificates-dash.component.ts
+3
-3
...dentials/certificates-dash/certificates-dash.component.ts
src/app/pages/dashboard/components/widget-cpu/widget-cpu.component.ts
+1
-1
...s/dashboard/components/widget-cpu/widget-cpu.component.ts
src/app/pages/dashboard/components/widget-pool/widget-pool.component.ts
+2
-2
...dashboard/components/widget-pool/widget-pool.component.ts
src/app/pages/dashboard/components/widget-storage/widget-storage.component.ts
+1
-0
...ard/components/widget-storage/widget-storage.component.ts
src/app/pages/data-protection/replication/replication-form/replication-form.component.ts
+1
-1
...eplication/replication-form/replication-form.component.ts
src/app/pages/network/network.component.ts
+4
-4
src/app/pages/network/network.component.ts
src/app/pages/reports-dashboard/reports-utils.worker.ts
+1
-1
src/app/pages/reports-dashboard/reports-utils.worker.ts
src/app/pages/services/components/service-ftp/service-ftp.component.ts
+1
-1
.../services/components/service-ftp/service-ftp.component.ts
src/app/pages/services/components/service-s3/service-s3.component.ts
+1
-1
...es/services/components/service-s3/service-s3.component.ts
src/app/pages/sharing/iscsi/extent/extent-form/extent-form.component.ts
+1
-1
...sharing/iscsi/extent/extent-form/extent-form.component.ts
with
26 additions
and
22 deletions
+26
-22
.eslintrc.js
View file @
4e9a999d
...
...
@@ -108,7 +108,7 @@ module.exports = {
"
no-nested-ternary
"
:
"
off
"
,
"
implicit-arrow-linebreak
"
:
"
off
"
,
"
@typescript-eslint/no-shadow
"
:
"
off
"
,
"
no-restricted-globals
"
:
"
off
"
,
//
"no-restricted-globals": "off",
"
no-case-declarations
"
:
"
off
"
,
"
no-multi-str
"
:
"
off
"
,
"
max-classes-per-file
"
:
"
off
"
,
...
...
This diff is collapsed.
Click to expand it.
.nvmrc
0 → 100644
View file @
4e9a999d
v15.14.0
This diff is collapsed.
Click to expand it.
src/app/core/classes/thread.ts
View file @
4e9a999d
...
...
@@ -49,6 +49,7 @@ export class Thread extends IxAbstractObject {
readonly
main
=
():
void
=>
{
// Some example code to show how messages can be exchanged with main thread
// eslint-disable-next-line no-restricted-globals
const
context
:
Worker
=
self
as
any
;
// Needed for TypeScript not to complain. DO NOT REMOVE!
context
.
postMessage
(
'
ThreadInitialized
'
);
// This inits the worker. DO NOT REMOVE!
...
...
This diff is collapsed.
Click to expand it.
src/app/core/services/chart-data-utils.service.ts
View file @
4e9a999d
...
...
@@ -15,6 +15,7 @@ export class ChartDataUtilsService {
constructor
(
protected
core
:
CoreService
)
{
// Operations are what will run on the thread
const
operations
=
():
void
=>
{
// eslint-disable-next-line no-restricted-globals
const
context
:
Worker
=
self
as
any
;
// Required so Typescript doesn't complain
const
callback
=
(
data
:
any
):
void
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/account/users/user-form/user-form.component.ts
View file @
4e9a999d
...
...
@@ -388,7 +388,7 @@ export class UserFormComponent implements FormConfiguration {
/* list groups */
this
.
ws
.
call
(
'
group.query
'
).
pipe
(
untilDestroyed
(
this
)).
subscribe
((
groups
)
=>
{
this
.
loader
.
callDone
.
emit
(
status
);
this
.
loader
.
callDone
.
emit
(
window
.
status
);
this
.
group
=
this
.
fieldSets
.
config
(
'
group
'
)
as
FormSelectConfig
;
this
.
groups
=
this
.
fieldSets
.
config
(
'
groups
'
)
as
FormSelectConfig
;
for
(
let
i
=
0
;
i
<
groups
.
length
;
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/common/entity/entity-form/components/form-input/form-input.component.ts
View file @
4e9a999d
...
...
@@ -70,7 +70,7 @@ export class FormInputComponent implements Field {
this
.
group
.
controls
[
this
.
config
.
name
].
value
,
this
.
config
.
inputUnit
,
);
if
(
isNaN
(
phrasedValue
as
number
))
{
if
(
Number
.
isNaN
(
phrasedValue
as
number
))
{
this
.
group
.
controls
[
this
.
config
.
name
].
setErrors
({
manualValidateError
:
true
,
manualValidateErrorMsg
:
globalHelptext
.
invalidInputValueWithUnit
,
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/common/entity/entity-table/table-utils.worker.ts
View file @
4e9a999d
...
...
@@ -155,7 +155,7 @@ function tableUtilsEmit(evt: any): void {
postMessage
(
evt
);
}
addEventListener
(
'
message
'
,
({
data
})
=>
{
addEventListener
(
'
message
'
,
({
data
})
=>
{
// eslint-disable-line no-restricted-globals
const
evt
=
data
;
let
output
;
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/common/entity/entity-tree-table/entity-tree-table.component.ts
View file @
4e9a999d
...
...
@@ -116,7 +116,7 @@ export class EntityTreeTableComponent implements OnInit, AfterViewInit {
}
resolve
(
path
:
string
,
obj
:
any
):
string
{
return
path
.
split
(
'
.
'
).
reduce
((
prev
,
curr
)
=>
(
prev
?
prev
[
curr
]
:
null
),
obj
||
self
);
return
path
.
split
(
'
.
'
).
reduce
((
prev
,
curr
)
=>
(
prev
?
prev
[
curr
]
:
null
),
obj
||
self
);
// eslint-disable-line no-restricted-globals
}
ngAfterViewInit
():
void
{
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/common/entity/table/table.component.ts
View file @
4e9a999d
...
...
@@ -253,7 +253,7 @@ export class TableComponent implements OnInit, AfterViewInit, AfterViewChecked {
}
else
{
this
.
tableService
.
delete
(
this
,
row
);
}
event
.
stopPropagation
();
event
.
stopPropagation
();
// eslint-disable-line no-restricted-globals
}
// TODO: Enum
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/credentials/backup-credentials/backup-credentials.component.ts
View file @
4e9a999d
...
...
@@ -154,7 +154,7 @@ export class BackupCredentialsComponent implements OnInit {
const
blob
=
new
Blob
([
key
as
any
],
{
type
:
'
text/plain
'
});
this
.
storage
.
downloadBlob
(
blob
,
filename
);
}
event
.
stopPropagation
();
event
.
stopPropagation
();
// eslint-disable-line no-restricted-globals
},
}];
}
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/credentials/certificates-dash/certificates-dash.component.ts
View file @
4e9a999d
...
...
@@ -291,7 +291,7 @@ export class CertificatesDashComponent implements OnInit {
new
EntityUtils
().
handleWSError
(
this
,
err
,
this
.
dialogService
);
},
);
event
.
stopPropagation
();
event
.
stopPropagation
();
// eslint-disable-line no-restricted-globals
},
},
];
...
...
@@ -333,7 +333,7 @@ export class CertificatesDashComponent implements OnInit {
matTooltip
:
T
(
'
Create ACME Certificate
'
),
onClick
:
(
rowinner
:
Certificate
)
=>
{
this
.
modalService
.
openInSlideIn
(
CertificateAcmeAddComponent
,
rowinner
.
id
);
event
.
stopPropagation
();
event
.
stopPropagation
();
// eslint-disable-line no-restricted-globals
},
};
...
...
@@ -350,7 +350,7 @@ export class CertificatesDashComponent implements OnInit {
onClick
:
(
rowinner
:
CertificateAuthority
)
=>
{
this
.
dialogService
.
dialogForm
(
this
.
signCSRFormConf
);
this
.
caId
=
rowinner
.
id
;
event
.
stopPropagation
();
event
.
stopPropagation
();
// eslint-disable-line no-restricted-globals
},
};
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/dashboard/components/widget-cpu/widget-cpu.component.ts
View file @
4e9a999d
...
...
@@ -152,7 +152,7 @@ export class WidgetCpuComponent extends WidgetComponent implements AfterViewInit
// Filter out stats per thread
const
keys
=
Object
.
keys
(
cpuData
);
const
threads
=
keys
.
filter
((
n
)
=>
!
isNaN
(
parseFloat
(
n
)));
const
threads
=
keys
.
filter
((
n
)
=>
!
Number
.
isNaN
(
parseFloat
(
n
)));
for
(
let
i
=
0
;
i
<
this
.
threadCount
;
i
++
)
{
usageColumn
.
push
(
parseInt
(
cpuData
[
i
].
usage
.
toFixed
(
1
)));
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/dashboard/components/widget-pool/widget-pool.component.ts
View file @
4e9a999d
...
...
@@ -259,7 +259,7 @@ export class WidgetPoolComponent extends WidgetComponent implements OnInit, Afte
}
let
usedValue
;
if
(
isNaN
(
this
.
volumeData
.
used
))
{
if
(
isNaN
(
this
.
volumeData
.
used
))
{
// eslint-disable-line no-restricted-globals
usedValue
=
this
.
volumeData
.
used
;
}
else
{
usedValue
=
filesize
(
this
.
volumeData
.
used
,
{
exponent
:
3
});
...
...
@@ -271,7 +271,7 @@ export class WidgetPoolComponent extends WidgetComponent implements OnInit, Afte
return
0
;
}
if
(
!
isNaN
(
this
.
volumeData
.
avail
))
{
if
(
!
isNaN
(
this
.
volumeData
.
avail
))
{
// eslint-disable-line no-restricted-globals
this
.
voldataavail
=
true
;
}
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/dashboard/components/widget-storage/widget-storage.component.ts
View file @
4e9a999d
...
...
@@ -255,6 +255,7 @@ export class WidgetStorageComponent extends WidgetComponent implements AfterView
getFreeSpace
(
pool
:
Pool
):
string
{
const
volume
=
this
.
volumeData
[
pool
.
name
];
if
(
volume
&&
volume
.
used_pct
)
{
// eslint-disable-next-line no-restricted-globals
if
(
isNaN
(
volume
.
used
)
?
volume
.
used
:
filesize
(
volume
.
used
,
{
exponent
:
3
})
!==
'
Locked
'
)
{
return
this
.
getSizeString
(
volume
.
avail
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/data-protection/replication/replication-form/replication-form.component.ts
View file @
4e9a999d
...
...
@@ -1295,7 +1295,7 @@ export class ReplicationFormComponent implements FormConfiguration {
const
filteredValue
=
value
?
this
.
storageService
.
convertHumanStringToNum
(
value
)
:
undefined
;
speedLimitField
[
'
hasErrors
'
]
=
false
;
speedLimitField
[
'
errors
'
]
=
''
;
if
(
filteredValue
!==
undefined
&&
isNaN
(
filteredValue
))
{
if
(
filteredValue
!==
undefined
&&
Number
.
isNaN
(
filteredValue
))
{
speedLimitField
[
'
hasErrors
'
]
=
true
;
speedLimitField
[
'
errors
'
]
=
helptext
.
speed_limit_errors
;
}
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/network/network.component.ts
View file @
4e9a999d
...
...
@@ -622,7 +622,7 @@ export class NetworkComponent extends ViewControllerComponent implements OnInit,
'
ipmi.identify
'
,
'
seconds
'
,
);
event
.
stopPropagation
();
event
.
stopPropagation
();
// eslint-disable-line no-restricted-globals
},
},
{
icon
:
'
launch
'
,
...
...
@@ -630,7 +630,7 @@ export class NetworkComponent extends ViewControllerComponent implements OnInit,
matTooltip
:
T
(
'
Manage
'
),
onClick
:
(
row
:
IpmiRow
)
=>
{
window
.
open
(
`http://
${
row
.
ipaddress
}
`
);
event
.
stopPropagation
();
event
.
stopPropagation
();
// eslint-disable-line no-restricted-globals
},
}];
}
...
...
@@ -701,7 +701,7 @@ export class NetworkComponent extends ViewControllerComponent implements OnInit,
);
},
);
event
.
stopPropagation
();
event
.
stopPropagation
();
// eslint-disable-line no-restricted-globals
},
},
{
...
...
@@ -740,7 +740,7 @@ export class NetworkComponent extends ViewControllerComponent implements OnInit,
);
},
);
event
.
stopPropagation
();
event
.
stopPropagation
();
// eslint-disable-line no-restricted-globals
},
}];
}
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/reports-dashboard/reports-utils.worker.ts
View file @
4e9a999d
...
...
@@ -331,7 +331,7 @@ function emit(evt: any): void {
postMessage
(
evt
);
}
addEventListener
(
'
message
'
,
({
data
})
=>
{
addEventListener
(
'
message
'
,
({
data
})
=>
{
// eslint-disable-line no-restricted-globals
const
evt
=
data
;
let
output
;
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/services/components/service-ftp/service-ftp.component.ts
View file @
4e9a999d
...
...
@@ -459,7 +459,7 @@ export class ServiceFTPComponent implements FormConfiguration, OnInit {
const
filteredValue
=
value
?
this
.
storageService
.
convertHumanStringToNum
(
value
,
false
,
'
kmgtp
'
)
:
undefined
;
formField
[
'
hasErrors
'
]
=
false
;
formField
[
'
errors
'
]
=
''
;
if
(
filteredValue
!==
undefined
&&
isNaN
(
filteredValue
))
{
if
(
filteredValue
!==
undefined
&&
Number
.
isNaN
(
filteredValue
))
{
formField
[
'
hasErrors
'
]
=
true
;
formField
[
'
errors
'
]
=
helptext
.
bandwidth_err
;
}
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/services/components/service-s3/service-s3.component.ts
View file @
4e9a999d
...
...
@@ -134,7 +134,7 @@ export class ServiceS3Component implements FormConfiguration {
})
.
pipe
(
untilDestroyed
(
this
))
.
subscribe
(()
=>
{
if
(
!
confirm
)
{
if
(
!
window
.
confirm
)
{
this
.
storage_path
.
setValue
(
this
.
initial_path
);
}
else
{
this
.
warned
=
true
;
...
...
This diff is collapsed.
Click to expand it.
src/app/pages/sharing/iscsi/extent/extent-form/extent-form.component.ts
View file @
4e9a999d
...
...
@@ -127,7 +127,7 @@ export class ExtentFormComponent implements FormConfiguration {
(
control
:
FormControl
):
ValidationErrors
=>
{
const
config
=
this
.
fieldConfig
.
find
((
c
)
=>
c
.
name
===
'
filesize
'
);
const
size
=
this
.
storageService
.
convertHumanStringToNum
(
control
.
value
,
true
);
const
errors
=
control
.
value
&&
isNaN
(
size
)
const
errors
=
control
.
value
&&
Number
.
isNaN
(
size
)
?
{
invalid_byte_string
:
true
}
:
null
;
if
(
errors
)
{
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment