Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ca-portal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KIT
KIT-CA
ca-portal
Commits
6bd6f4cd
Verified
Commit
6bd6f4cd
authored
1 month ago
by
Peter Oettig
Browse files
Options
Downloads
Patches
Plain Diff
draft: current state
parent
47208b4d
Branches
vault-upload
No related tags found
No related merge requests found
Pipeline
#416726
passed
1 month ago
Stage: prebuild
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ts/common.ts
+3
-1
3 additions, 1 deletion
src/ts/common.ts
src/views/DistributeCertificates.vue
+31
-5
31 additions, 5 deletions
src/views/DistributeCertificates.vue
with
34 additions
and
6 deletions
src/ts/common.ts
+
3
−
1
View file @
6bd6f4cd
...
...
@@ -138,7 +138,9 @@ export async function requestBackendWithResponseHeaders<ResponseType>(
if
(
body
)
{
init
.
method
=
"
POST
"
;
init
.
headers
=
{
...
init
.
headers
,
...{
"
Content-Type
"
:
"
application/json
"
}
};
if
(
!
(
body
instanceof
FormData
))
{
init
.
headers
=
{
...
init
.
headers
,
...{
"
Content-Type
"
:
"
application/json
"
}
};
}
init
.
body
=
JSON
.
stringify
(
body
);
}
...
...
This diff is collapsed.
Click to expand it.
src/views/DistributeCertificates.vue
+
31
−
5
View file @
6bd6f4cd
...
...
@@ -29,10 +29,6 @@
}}
<
/v-card-subtitle
>
<
v
-
card
-
actions
class
=
"
ma-auto
"
>
<!--
TODO
implement
details
button
using
JS
p12
parser
-->
<!--
<
v
-
btn
color
=
"
secondary
"
variant
=
"
flat
"
class
=
"
px-4
"
@
click
=
"
openMoreDetails()
"
>-->
<!--
<
v
-
icon
icon
=
"
fas fa-circle-info
"
class
=
"
pr-2
"
/>
{{
$t
(
"
createIdent.search.result.moreDetailsButton
"
)
}}
-->
<!--
<
/v-btn>--
>
<
v
-
btn
color
=
"
primary
"
variant
=
"
flat
"
class
=
"
px-4
"
@
click
=
"
install(item)
"
>
<
icon
-
with
-
text
icon
=
"
download
"
>
{{
$t
(
"
distribute.available.download
"
)
}}
<
/icon-with-text
>
<
/v-btn
>
...
...
@@ -40,6 +36,16 @@
<
/v-card
>
<
/v-col
>
<
/v-row
>
<
v
-
row
justify
=
"
center
"
>
<
v
-
col
cols
=
"
6
"
>
<
v
-
file
-
input
v
-
model
=
"
uploadFile
"
accept
=
"
application/x-pkcs12
"
append
-
icon
=
"
fas fa-upload
"
:
on
-
click
:
append
=
"
upload
"
><
/v-file-input
>
<
/v-col
>
<
/v-row
>
<
/v-container
>
<
/FunctionPage
>
<
/template
>
...
...
@@ -58,6 +64,7 @@ type DistributeData = {
results
:
Array
<
PKCS12
>
;
error
:
APIError
|
null
;
}
;
uploadFile
:
File
|
null
;
}
;
export
default
defineComponent
({
...
...
@@ -74,6 +81,7 @@ export default defineComponent({
results
:
[],
error
:
null
,
}
,
uploadFile
:
null
,
}
;
}
,
mounted
()
{
...
...
@@ -103,7 +111,6 @@ export default defineComponent({
(
wrappedResponse
)
=>
{
const
downloadLink
=
document
.
createElement
(
"
a
"
);
downloadLink
.
href
=
window
.
URL
.
createObjectURL
(
wrappedResponse
.
response
);
console
.
log
(
downloadLink
.
href
);
downloadLink
.
setAttribute
(
"
download
"
,
item
.
filename
);
downloadLink
.
click
();
downloadLink
.
remove
();
...
...
@@ -113,6 +120,25 @@ export default defineComponent({
}
);
}
,
upload
:
function
()
{
if
(
this
.
uploadFile
==
null
)
{
return
;
}
const
formData
=
new
FormData
();
formData
.
append
(
"
type
"
,
this
.
uploadFile
.
type
);
formData
.
append
(
"
pkcs12
"
,
this
.
uploadFile
.
name
);
formData
.
append
(
"
file
"
,
this
.
uploadFile
);
console
.
log
(
this
.
uploadFile
.
stream
());
requestBackend
<
null
>
(
"
/vault/pkcs12
"
,
formData
).
then
(
(
response
)
=>
{
console
.
log
(
response
);
}
,
(
error
)
=>
{
console
.
log
(
error
);
}
);
}
,
}
,
}
);
<
/script
>
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