Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
osp
tools.gitlabculture
Commits
53a39f16
Commit
53a39f16
authored
Feb 25, 2020
by
svilayphiou
Browse files
testing vue.js
parent
5f2680a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
vue.html
0 → 100644
View file @
53a39f16
<!DOCTYPE HTML>
<html>
<head>
<meta
http-equiv=
"content-type"
content=
"text/html; charset=utf-8"
>
<title>
Vue
</title>
<script
src=
"https://cdn.jsdelivr.net/npm/vue/dist/vue.js"
></script>
</head>
<body>
<div
id=
"repos"
>
<div
class=
"repo"
v-for=
"repo in repos"
v-bind:class=
"repo.archived"
v-bind:key=
"repo.id"
>
<h2>
{{repo.name}}
</h2>
<div
class=
'iceberg'
>
<h3>
Iceberg
</h3>
<div
v-for=
"image in repo.iceberg"
>
<img
v-bind:src=
"image.src"
>
</div>
</div>
<!--<div class='processus'>-->
<!--<h3>Processus</h3>-->
<!--<img v-for="image in processus">-->
<!--</div>-->
</div>
</div>
<script
type=
"text/javascript"
charset=
"utf-8"
>
var
gitlab_url
=
"
http://gitlab.constantvzw.org
"
;
var
user_name
=
"
osp
"
;
var
reposList
=
[
448
,
456
,
512
]
var
repos
=
[]
for
(
i
=
0
;
i
<
reposList
.
length
;
i
++
)
{
getMetadata
(
reposList
[
i
]);
getIceberg
(
i
,
reposList
[
i
]);
}
document
.
addEventListener
(
'
DOMContentLoaded
'
,
function
(){
console
.
log
(
repos
);
var
reposApp
=
new
Vue
({
el
:
'
#repos
'
,
data
:
{
repos
}
})
},
false
);
// METADATA ///////////////////////////////
function
getMetadata
(
repoID
)
{
let
repo_url
=
"
https://gitlab.constantvzw.org/api/v4/projects/
"
+
repoID
;
fetch
(
repo_url
).
then
(
function
(
resp
){
return
resp
.
json
();
})
.
then
(
function
(
data
){
name
=
data
.
name
.
split
(
"
.
"
).
slice
(
1
);
repo
=
{};
repo
.
id
=
repoID
;
repo
.
repo
=
data
.
name
;
repo
.
name
=
name
.
replace
(
"
,
"
,
"
"
);
repo
.
iceberg
=
[];
if
(
data
.
default_branch
==
"
archive
"
){
repo
.
archived
=
"
archived
"
;
}
repos
.
push
(
repo
);
})
}
function
getIceberg
(
i
,
repoID
){
let
icebergURL
=
"
https://gitlab.constantvzw.org/api/v4/projects/
"
+
repoID
+
"
/repository/tree?path=iceberg
"
;
fetch
(
icebergURL
).
then
(
function
(
resp
){
return
resp
.
json
();
})
.
then
(
function
(
data
){
return
data
.
map
(
function
(
image
)
{
item
=
{};
item
.
name
=
image
.
name
;
console
.
log
(
repos
[
i
]);
project_path
=
[
gitlab_url
,
user_name
,
repo
.
repo
].
join
(
'
/
'
);
if
(
repo
.
archived
){
branch
=
"
archive
"
;}
else
{
branch
=
"
master
"
}
item
.
src
=
project_path
+
"
/raw/
"
+
branch
+
"
/
"
+
image
.
path
;
repo
.
iceberg
.
push
(
item
);
})
});
}
</script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"pad.js"
>
</script>
</body>
</html>
Write
Preview
Supports
Markdown
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