Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
max-db-bundle
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
Container 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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pdn-certic
max-db-bundle
Commits
7a3ad4e0
Commit
7a3ad4e0
authored
4 months ago
by
Jerome Chauveau
Browse files
Options
Downloads
Patches
Plain Diff
cleaning stuff
parent
3c27829b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
static/max-db.js
+7
-6
7 additions, 6 deletions
static/max-db.js
templates/index.html
+1
-1
1 addition, 1 deletion
templates/index.html
with
8 additions
and
7 deletions
static/max-db.js
+
7
−
6
View file @
7a3ad4e0
let
currentSource
=
null
;
let
modal
=
null
;
window
.
addEventListener
(
'
load
'
,
function
()
{
document
.
querySelector
(
'
main
'
).
classList
.
remove
(
'
d-none
'
)
})
function
deleteSource
(
source
)
{
if
(
confirm
(
`Supprimer
${
source
}
?`
))
{
const
path
=
currentCollection
===
'
/
'
?
source
:
`
${
currentCollection
}
/
${
source
}
`
console
.
debug
(
path
)
fetch
(
`/bundles/max-db/
${
path
}
`
,
{
method
:
'
DELETE
'
}).
then
((
res
)
=>
{
if
(
res
.
status
==
200
){
document
.
getElementById
(
source
).
remove
()
...
...
@@ -58,7 +62,6 @@ function openMoveSourceDialog(source) {
function
doMoveSource
(){
const
collection
=
document
.
getElementById
(
'
move-collection-select
'
).
value
const
path
=
currentCollection
===
'
/
'
?
currentSource
:
`
${
currentCollection
}
/
${
currentSource
}
`
console
.
debug
(
'
Move
'
+
path
+
'
to
'
+
collection
)
modal
.
hide
()
fetch
(
`/bundles/max-db/move?sourcePath=
${
path
}
&collection=
${
collection
}
`
,
{
method
:
'
POST
'
}).
then
((
res
)
=>
{
if
(
res
.
status
==
200
)
...
...
@@ -72,18 +75,15 @@ function doMoveSource(){
async
function
dropHandler
(
ev
)
{
ev
.
preventDefault
();
const
delay
=
ms
=>
new
Promise
(
res
=>
setTimeout
(
res
,
ms
));
const
droppedFiles
=
await
DirectoryDropReader
.
getFilesFromDropEvent
(
ev
)
console
.
debug
(
droppedFiles
)
const
files
=
[...
droppedFiles
][
0
]
console
.
debug
(
files
)
document
.
getElementById
(
'
drop-zone
'
).
classList
.
add
(
'
d-none
'
)
document
.
getElementById
(
'
progress-wrapper
'
).
classList
.
remove
(
'
d-none
'
)
const
progressBar
=
document
.
getElementById
(
'
progress
'
)
const
step
=
Math
.
floor
(
100
/
files
.
length
)
let
value
=
0
;
for
(
let
i
=
0
;
i
<
files
.
length
;
i
++
){
console
.
debug
(
files
[
i
])
const
f
=
files
[
i
]
var
data
=
new
FormData
()
const
path
=
currentCollection
===
'
/
'
?
''
:
(
currentCollection
+
'
/
'
)
...
...
@@ -97,6 +97,7 @@ async function dropHandler(ev) {
progressBar
.
value
=
value
;
progressBar
.
textContent
=
`
${
value
}
%`
;
}
await
delay
(
1000
);
window
.
location
.
reload
(
true
);
}
function
dragLeaveHandler
(
ev
)
{
...
...
This diff is collapsed.
Click to expand it.
templates/index.html
+
1
−
1
View file @
7a3ad4e0
...
...
@@ -14,7 +14,7 @@
</script>
</head>
<body>
<main>
<main
class=
"d-none"
>
<sl-split-panel
position=
"75"
>
<div
...
...
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