Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
project
cloud
Merge requests
!756
Issue
#3269377
: Add the function to add K8s Namespace in the SPA
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3269377
: Add the function to add K8s Namespace in the SPA
issue/cloud-3269377:3269377-add-function-to-add-k8s-namespace
into
5.x
Overview
0
Commits
4
Pipelines
0
Changes
12
Merged
Ryo Yamashita
requested to merge
issue/cloud-3269377:3269377-add-function-to-add-k8s-namespace
into
5.x
3 years ago
Overview
0
Commits
4
Pipelines
0
Changes
12
Expand
0
0
Merge request reports
Compare
5.x
version 3
8930e9f2
3 years ago
version 2
8de4df87
3 years ago
version 1
fe5ac5ea
3 years ago
5.x (base)
and
latest version
latest version
8930e9f2
4 commits,
3 years ago
version 3
8930e9f2
4 commits,
3 years ago
version 2
8de4df87
4 commits,
3 years ago
version 1
fe5ac5ea
2 commits,
3 years ago
12 files
+
249
−
438
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
12
Search (e.g. *.vue) (Ctrl+P)
modules/cloud_dashboard/cloud_dashboard/src/pages/k8s/K8sNamespaceCreatePage.tsx
0 → 100644
+
76
−
0
Options
import
PanelWrapper
from
'
atoms/PanelWrapper
'
;
import
Button
from
'
bootstrap3-components/Button
'
;
import
Col
from
'
bootstrap3-components/Col
'
;
import
FluidContainer
from
'
bootstrap3-components/FluidContainer
'
;
import
Form
from
'
bootstrap3-components/Form
'
;
import
GlyphIcon
from
'
bootstrap3-components/GlyphIcon
'
;
import
Row
from
'
bootstrap3-components/Row
'
;
import
KeyValueItem
from
'
model/KeyValueItem
'
;
import
KeyValueTableBlock
from
'
molecules/KeyValueTableBlock
'
;
import
MenuBar
from
'
organisms/MenuBar
'
;
import
{
useState
}
from
'
react
'
;
import
{
useTranslation
}
from
'
react-i18next
'
;
import
{
useEntityData
}
from
'
service/state
'
;
const
K8sNamespaceCreatePage
=
()
=>
{
const
[
name
,
setName
]
=
useState
(
''
);
const
[
labels
,
setLabels
]
=
useState
<
KeyValueItem
[]
>
([
{
item_key
:
''
,
item_value
:
''
},
]);
const
[
annotations
,
setAnnotations
]
=
useState
<
KeyValueItem
[]
>
([
{
item_key
:
''
,
item_value
:
''
},
]);
const
{
t
}
=
useTranslation
();
const
{
create
}
=
useEntityData
({
cloudServiceProvider
:
'
k8s
'
,
entityName
:
'
namespace
'
,
entityRecords
:
[]
});
return
<>
<
MenuBar
/>
<
FluidContainer
className
=
"px-0"
>
<
Row
className
=
"mx-0"
>
<
Col
>
<
Form
>
<
PanelWrapper
titleKey
=
"namespace"
title
=
"Namespace"
>
<
Form
.
Group
>
<
Form
.
Label
className
=
"form-required"
>
Name
</
Form
.
Label
>
<
input
className
=
"form-text form-control"
type
=
"text"
value
=
{
name
}
onChange
=
{
(
e
)
=>
{
setName
(
e
.
currentTarget
.
value
);
}
}
/>
</
Form
.
Group
>
<
Form
.
Group
>
<
KeyValueTableBlock
title
=
"Labels"
keyValueList
=
{
labels
}
setKeyValueList
=
{
setLabels
}
/>
<
KeyValueTableBlock
title
=
"Annotations"
keyValueList
=
{
annotations
}
setKeyValueList
=
{
setAnnotations
}
/>
</
Form
.
Group
>
</
PanelWrapper
>
<
Button
className
=
"icon-before btn-success"
disabled
=
{
name
===
''
}
onClick
=
{
()
=>
{
create
({
'
name
'
:
name
,
'
labels
'
:
JSON
.
stringify
(
labels
),
'
annotations
'
:
JSON
.
stringify
(
annotations
),
});
}
}
>
<
GlyphIcon
iconName
=
"ok"
/>
{
'
'
+
t
(
'
Save
'
)
}
</
Button
>
</
Form
>
</
Col
>
</
Row
>
</
FluidContainer
>
</>;
}
export
default
K8sNamespaceCreatePage
;
Loading