Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MDM Lab
Website
Commits
e190ddc0
Commit
e190ddc0
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
display session expiration date
parent
12d68560
No related branches found
No related tags found
No related merge requests found
Pipeline
#117908
passed
1 year ago
Stage: delete-release
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
backend/analysis/api.py
+1
-1
1 addition, 1 deletion
backend/analysis/api.py
frontend/components/AnalysisList.vue
+6
-1
6 additions, 1 deletion
frontend/components/AnalysisList.vue
frontend/components/Main.vue
+5
-1
5 additions, 1 deletion
frontend/components/Main.vue
with
12 additions
and
3 deletions
backend/analysis/api.py
+
1
−
1
View file @
e190ddc0
...
...
@@ -34,7 +34,7 @@ def init_session(request):
request
.
session
.
create
()
request
.
session
.
set_expiry
(
60000
)
return
JsonResponse
({
"
session
"
:
"
ok
"
})
return
JsonResponse
({
"
session
"
:
"
ok
"
,
"
expire_date
"
:
request
.
session
.
get_expiry_date
()
})
@router.post
(
"
add
"
,
response
=
AnalysisOutSchema
)
...
...
This diff is collapsed.
Click to expand it.
frontend/components/AnalysisList.vue
+
6
−
1
View file @
e190ddc0
...
...
@@ -4,7 +4,7 @@ import type { Analysis } from '../composables/useFetchAnalysis';
const
router
=
useRouter
()
const
{
csrfToken
}
=
await
useCsrfToken
()
const
{
data
:
analyses
,
refresh
}
=
await
useFetch
<
Analysis
[]
>
(
"
/api/analysis/
"
,
{
server
:
false
});
const
sessionExpiryDate
=
useState
(
'
sessionExpiryDate
'
)
const
toEdit
:
Ref
<
number
|
null
>
=
ref
(
null
)
const
newTitle
:
Ref
<
string
|
null
>
=
ref
(
null
)
const
sanitizedAnalyses
=
computed
(()
=>
{
...
...
@@ -69,6 +69,11 @@ function goToAnalysis(analysisId: number) {
<
template
>
<v-card
flat
>
<v-card-title>
Analyses
</v-card-title>
<v-card-text>
<v-alert
type=
"info"
variant=
"tonal"
>
Session will expire
{{
new
Date
(
sessionExpiryDate
).
toLocaleString
()
}}
. After
this
date, all the analyses will be deleted
</v-alert>
</v-card-text>
<v-card-text
v-if=
"sanitizedAnalyses !== null"
>
<!--
<template
v-for=
"analysis, index in sanitizedAnalyses"
:key=
"analysis.id"
>
-->
<v-data-iterator
:items=
"sanitizedAnalyses"
:items-per-page=
"8"
>
...
...
This diff is collapsed.
Click to expand it.
frontend/components/Main.vue
+
5
−
1
View file @
e190ddc0
...
...
@@ -6,12 +6,15 @@ export interface Props {
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
fluid
:
true
});
const
sessionExpiryDate
=
useState
(
'
sessionExpiryDate
'
,
()
=>
"
testsetset
"
)
const
{
csrfToken
}
=
await
useCsrfToken
()
// init session
if
(
csrfToken
.
value
)
{
const
{
data
,
pending
,
error
}
=
useFetch
(
"
/api/analysis/init-session
"
,
{
const
{
data
,
pending
,
error
}
=
await
useFetch
(
"
/api/analysis/init-session
"
,
{
headers
:
[[
"
X-CSRFToken
"
,
csrfToken
.
value
]]
})
sessionExpiryDate
.
value
=
data
.
value
?.
expire_date
??
"
NA
"
}
const
scrollThreshold
=
ref
(
200
)
const
density
=
ref
<
'
compact
'
|
'
prominent
'
>
(
"
prominent
"
)
...
...
@@ -29,6 +32,7 @@ function onScroll() {
<VApp>
<Navbar
:density=
"density"
/>
<v-main
style=
"min-height: 300px"
>
<v-container
v-scroll=
"onScroll"
:fluid=
"props.fluid"
>
<slot
/>
</v-container>
...
...
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