Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud-3406140
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
cloud-3406140
Commits
e8253439
Commit
e8253439
authored
1 year ago
by
L N
Committed by
Yas Naoi
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3404519
by nakamurarts, yas: Refactor to native JavaScript from jQuery (k8s_cost_block.js)
parent
a8e0e612
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/cloud_service_providers/k8s/js/k8s_cost_block.js
+14
-22
14 additions, 22 deletions
modules/cloud_service_providers/k8s/js/k8s_cost_block.js
modules/cloud_service_providers/k8s/k8s.libraries.yml
+0
-4
0 additions, 4 deletions
modules/cloud_service_providers/k8s/k8s.libraries.yml
with
14 additions
and
26 deletions
modules/cloud_service_providers/k8s/js/k8s_cost_block.js
+
14
−
22
View file @
e8253439
(
function
(
$
)
{
(
function
()
{
'
use strict
'
;
$
(
'
button[name=apply]
'
).
click
(
function
()
{
let
$parent
=
$
(
this
).
parent
(
'
.form-inline
'
);
if
(
$parent
.
length
===
0
||
$parent
.
parents
(
'
.panel
'
).
length
===
0
)
{
return
;
for
(
const
apply_button
of
document
.
querySelectorAll
(
'
.simple-datatable .form-inline .button[name="apply"]
'
))
{
const
form_inline
=
apply_button
.
closest
(
'
.form-inline
'
);
const
block_id
=
form_inline
.
closest
(
'
.simple-datatable
'
).
id
;
if
(
!
block_id
)
{
continue
;
}
let
block_id
=
$parent
.
parents
(
'
.panel
'
).
attr
(
'
id
'
);
let
params
=
(
new
URL
(
location
)).
searchParams
;
let
param_arr
=
[];
$parent
.
find
(
'
select
'
).
each
(
function
()
{
let
name
=
$
(
this
).
attr
(
'
name
'
);
params
.
set
(
block_id
+
'
[
'
+
name
+
'
]
'
,
$
(
this
).
val
());
apply_button
.
addEventListener
(
'
click
'
,
function
()
{
const
url
=
new
URL
(
location
.
href
);
form_inline
.
querySelectorAll
(
'
select
'
).
forEach
(
function
(
select
)
{
url
.
searchParams
.
set
(
block_id
+
'
[
'
+
select
.
name
+
'
]
'
,
select
.
value
);
});
location
.
href
=
url
.
href
;
});
if
(
Array
.
from
(
params
).
length
===
0
)
{
return
;
}
let
url
=
location
.
href
;
if
(
url
.
indexOf
(
'
?
'
)
!==
-
1
)
{
url
=
url
.
substr
(
0
,
url
.
indexOf
(
'
?
'
));
}
location
=
url
+
'
?
'
+
params
.
toString
();
});
})(
jQuery
);
}
})();
This diff is collapsed.
Click to expand it.
modules/cloud_service_providers/k8s/k8s.libraries.yml
+
0
−
4
View file @
e8253439
...
...
@@ -54,8 +54,6 @@ k8s_cost_block:
version
:
6.x-dev
js
:
js/k8s_cost_block.js
:
{}
dependencies
:
-
core/jquery
k8s_project_costs_chart
:
version
:
6.x-dev
...
...
@@ -79,8 +77,6 @@ k8s_all_resources:
version
:
6.x-dev
js
:
js/k8s_all_resources.js
:
{}
dependencies
:
-
core/jquery
k8s_refresh_resource_trigger
:
version
:
6.x-dev
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment