Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
O
Oyun Parkı-pardusacikhack
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Nyx
Oyun Parkı-pardusacikhack
Commits
5838361a
Kaydet (Commit)
5838361a
authored
May 07, 2021
tarafından
Eda Altuntaş
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Park Imajı indirme arayüzü eklendi
üst
5edb48e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
132 additions
and
3 deletions
+132
-3
PullModal.vue
src/components/PullModal.vue
+48
-0
Containers.vue
src/views/Containers.vue
+84
-3
No files found.
src/components/PullModal.vue
0 → 100644
Dosyayı görüntüle @
5838361a
<
template
>
<el-dialog
v-bind:visible
.
sync=
"modal"
v-bind:close-on-press-escape=
"false"
v-bind:before-close=
"check"
v-bind:show-close=
"false"
v-bind:title=
"$t('containers.pull_modal.message')"
custom-class=
"pull_modal"
>
<pre
v-if=
"this.progress.length === 0"
v-text=
"$t('containers.pull_modal.waiting')"
/>
<div
class=
"pull_output"
v-else
>
<pre
v-for=
"p in this.progress"
v-bind:key=
"p.progress"
v-text=
"
`$
{p.id !== undefined ? p.id + ': ' : ''}${p.status ||
''} ${p.progress || ''}`
"
/>
</div>
</el-dialog>
</
template
>
<
script
>
export
default
{
name
:
"PullModal"
,
props
:
{
open
:
Boolean
,
progress
:
Array
},
computed
:
{
modal
:
function
()
{
return
this
.
open
;
}
},
methods
:
{
check
:
function
(
hide
)
{
if
(
this
.
modal
===
true
)
{
return
;
}
hide
();
}
}
};
</
script
>
src/views/Containers.vue
Dosyayı görüntüle @
5838361a
<
template
>
<
template
>
<div>
<div>
<PullModal
v-bind:open=
"this.pull_modal"
v-bind:progress=
"this.pull_progress"
/>
<el-row
type=
"flex"
align=
"middle"
v-bind:gutter=
"20"
>
<el-row
type=
"flex"
align=
"middle"
v-bind:gutter=
"20"
>
<el-col
align=
"right"
>
<el-col
align=
"right"
>
<el-button
<el-button
...
@@ -68,7 +72,7 @@
...
@@ -68,7 +72,7 @@
v-on:click=
"
v-on:click=
"
() =>
{
() =>
{
createModal = false;
createModal = false;
c
reate
();
c
heck
();
}
}
"
"
>Oluştur
</el-button
>Oluştur
</el-button
...
@@ -186,8 +190,12 @@
...
@@ -186,8 +190,12 @@
</template>
</template>
<
script
>
<
script
>
import
PullModal
from
"../components/PullModal"
;
export
default
{
export
default
{
name
:
"Containers"
,
name
:
"Containers"
,
components
:
{
PullModal
},
data
()
{
data
()
{
return
{
return
{
containers
:
[],
containers
:
[],
...
@@ -200,11 +208,54 @@ export default {
...
@@ -200,11 +208,54 @@ export default {
max_ram
:
2
,
max_ram
:
2
,
sudo
:
true
,
sudo
:
true
,
sound
:
false
sound
:
false
}
},
notify
:
null
,
pull_modal
:
false
,
pull_progress
:
[],
socket
:
null
};
};
},
},
created
()
{
created
()
{
this
.
getContainers
();
this
.
getContainers
();
this
.
socket
=
new
WebSocket
(
"ws://127.0.0.1:30000/socket"
);
this
.
socket
.
onmessage
=
e
=>
{
try
{
e
=
JSON
.
parse
(
e
.
data
);
if
(
e
.
method
===
"pull"
)
{
this
.
pull_modal
=
true
;
if
(
e
.
event
===
"progress"
)
{
try
{
const
p
=
JSON
.
parse
(
e
.
output
);
if
(
Object
.
keys
(
p
).
includes
(
"id"
))
{
const
index
=
this
.
pull_progress
.
findIndex
(
pr
=>
pr
.
id
===
p
.
id
);
if
(
index
!==
-
1
)
{
this
.
pull_progress
=
this
.
pull_progress
.
map
(
pr
=>
pr
.
id
===
p
.
id
?
p
:
pr
);
}
else
{
this
.
pull_progress
.
push
(
p
);
}
}
else
{
this
.
pull_progress
.
push
(
p
);
}
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
else
if
(
e
.
event
===
"done"
)
{
this
.
pull_modal
=
false
;
this
.
$message
({
message
:
this
.
$t
(
"containers.pull_modal.completed"
),
type
:
"success"
,
showClose
:
true
});
}
}
}
catch
(
e
)
{
console
.
error
(
e
);
}
};
},
},
methods
:
{
methods
:
{
getContainers
:
function
()
{
getContainers
:
function
()
{
...
@@ -218,8 +269,38 @@ export default {
...
@@ -218,8 +269,38 @@ export default {
this
.
$loading
().
close
();
this
.
$loading
().
close
();
});
});
},
},
c
reate
:
function
()
{
c
heck
:
function
()
{
this
.
$loading
();
this
.
$loading
();
this
.
$http
.
post
(
`/images`
,
{
image
:
`nyxteam/oyunparki-
${
this
.
form
.
version
}
`
})
.
then
(()
=>
{
this
.
create
();
})
.
catch
(()
=>
{
this
.
notify
=
this
.
$notify
({
title
:
this
.
$t
(
"containers.create.notification.no_image.title"
),
message
:
this
.
$t
(
"containers.create.notification.no_image.message"
),
duration
:
0
,
onClick
:
this
.
pull
,
type
:
"error"
,
dangerouslyUseHTMLString
:
true
});
this
.
$loading
().
close
();
});
},
pull
:
function
()
{
this
.
notify
.
close
();
this
.
pull_modal
=
true
;
this
.
socket
.
send
(
JSON
.
stringify
({
method
:
"pull"
,
image
:
`nyxteam/oyunparki-
${
this
.
form
.
version
}
`
})
);
},
create
:
function
()
{
this
.
$http
this
.
$http
.
post
(
`/create`
,
{
.
post
(
`/create`
,
{
image
:
`nyxteam/oyunparki-
${
this
.
form
.
version
}
`
,
image
:
`nyxteam/oyunparki-
${
this
.
form
.
version
}
`
,
...
...
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