Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
V
vidai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SexHackMe
vidai
Commits
818836f4
Commit
818836f4
authored
Oct 06, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move API token creation form to modal, add 'Add Token' button
parent
073790e9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
11 deletions
+36
-11
api_tokens.html
templates/api_tokens.html
+36
-11
No files found.
templates/api_tokens.html
View file @
818836f4
...
...
@@ -38,7 +38,8 @@
<div
class=
"container"
>
<div
class=
"tokens-card"
>
<div
class=
"card-header"
>
<h3><i
class=
"fas fa-plus"
></i>
Generate New API Token
</h3>
<h3><i
class=
"fas fa-key"
></i>
Your API Tokens
</h3>
<button
onclick=
"openAddTokenModal()"
class=
"btn"
style=
"margin-left: auto;"
><i
class=
"fas fa-plus"
></i>
Add Token
</button>
</div>
{% with messages = get_flashed_messages(with_categories=true) %}
...
...
@@ -49,16 +50,6 @@
{% endif %}
{% endwith %}
<form
method=
"post"
action=
"/api_tokens/generate"
>
<div
class=
"form-group"
>
<label
for=
"token_name"
>
Token Name
</label>
<input
type=
"text"
id=
"token_name"
name=
"token_name"
placeholder=
"e.g., My App Token"
required
>
</div>
<button
type=
"submit"
class=
"btn"
>
Generate Token
</button>
</form>
</div>
<div
class=
"tokens-card"
>
<div
class=
"card-header"
>
<h3><i
class=
"fas fa-key"
></i>
Your API Tokens
</h3>
...
...
@@ -96,6 +87,28 @@
</div>
</div>
<!-- Add Token Modal -->
<div
id=
"addTokenModal"
class=
"modal"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h3><i
class=
"fas fa-plus"
></i>
Generate New API Token
</h3>
<span
onclick=
"closeAddTokenModal()"
style=
"cursor: pointer; font-size: 1.5rem;"
>
×
</span>
</div>
<form
method=
"post"
action=
"/api_tokens/generate"
>
<div
class=
"modal-body"
>
<div
class=
"form-group"
>
<label
for=
"modal_token_name"
>
Token Name
</label>
<input
type=
"text"
id=
"modal_token_name"
name=
"token_name"
placeholder=
"e.g., My App Token"
required
>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
onclick=
"closeAddTokenModal()"
class=
"btn"
style=
"background: #6b7280;"
>
Cancel
</button>
<button
type=
"submit"
class=
"btn"
>
Generate Token
</button>
</div>
</form>
</div>
</div>
<!-- Token Generated Modal -->
{% if generated_token %}
<div
id=
"tokenModal"
class=
"modal"
style=
"display: block;"
>
...
...
@@ -166,6 +179,14 @@
document
.
getElementById
(
'deleteModal'
).
style
.
display
=
'none'
;
}
function
openAddTokenModal
()
{
document
.
getElementById
(
'addTokenModal'
).
style
.
display
=
'block'
;
}
function
closeAddTokenModal
()
{
document
.
getElementById
(
'addTokenModal'
).
style
.
display
=
'none'
;
}
function
closeTokenModal
()
{
document
.
getElementById
(
'tokenModal'
).
style
.
display
=
'none'
;
location
.
reload
();
// Reload the page
...
...
@@ -189,6 +210,10 @@
// Close modal when clicking outside
window
.
onclick
=
function
(
event
)
{
const
addModal
=
document
.
getElementById
(
'addTokenModal'
);
if
(
addModal
&&
event
.
target
==
addModal
)
{
closeAddTokenModal
();
}
const
deleteModal
=
document
.
getElementById
(
'deleteModal'
);
if
(
deleteModal
&&
event
.
target
==
deleteModal
)
{
closeDeleteModal
();
...
...
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