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
36fc9ace
Kaydet (Commit)
36fc9ace
authored
May 06, 2021
tarafından
Eda Altuntaş
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Parka dosya yükleme özelliği eklendi
üst
76b44568
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
8 deletions
+52
-8
index.js
src/ipc/index.js
+29
-1
main.js
src/main.js
+3
-1
Containers.vue
src/views/Containers.vue
+20
-6
No files found.
src/ipc/index.js
Dosyayı görüntüle @
36fc9ace
const
{
ipcMain
}
=
require
(
"electron"
);
const
{
ipcMain
,
dialog
}
=
require
(
"electron"
);
const
{
spawn
}
=
require
(
"child_process"
);
const
{
basename
,
join
,
posix
}
=
require
(
"path"
);
const
{
copyFileSync
}
=
require
(
"fs"
);
const
handler
=
()
=>
{
ipcMain
.
on
(
"terminal"
,
(
_
,
data
)
=>
{
...
...
@@ -25,6 +27,32 @@ const handler = () => {
"Oyun Parkı"
]);
});
ipcMain
.
on
(
"upload"
,
(
_
,
data
)
=>
{
const
{
Id
,
Source
,
Target
,
Username
}
=
data
;
dialog
.
showOpenDialog
({
properties
:
[
"openFile"
,
"multiSelections"
]
})
.
then
(
result
=>
{
if
(
result
.
canceled
)
{
return
;
}
result
.
filePaths
.
map
(
f
=>
{
copyFileSync
(
f
,
join
(
Source
,
basename
(
f
)));
spawn
(
"docker"
,
[
"exec"
,
Id
,
"cp"
,
"-r"
,
`
${
posix
.
join
(
Target
,
basename
(
f
))}
`
,
`/home/
${
Username
}
/Desktop/`
]);
});
})
.
catch
(
err
=>
{
console
.
log
(
err
);
});
});
};
module
.
exports
=
handler
;
src/main.js
Dosyayı görüntüle @
36fc9ace
...
...
@@ -20,6 +20,7 @@ import { library } from "@fortawesome/fontawesome-svg-core";
import
{
faCircle
,
faExternalLinkAlt
,
faFileUpload
,
faPlay
,
faStop
,
faTerminal
,
...
...
@@ -36,7 +37,8 @@ library.add(
faTrash
,
faExternalLinkAlt
,
faTerminal
,
faCircle
faCircle
,
faFileUpload
);
Vue
.
component
(
"icon"
,
FontAwesomeIcon
);
...
...
src/views/Containers.vue
Dosyayı görüntüle @
36fc9ace
...
...
@@ -100,7 +100,7 @@
</el-table-column>
<el-table-column
v-bind:label=
"$t('containers.table.actions')"
width=
"3
0
0"
width=
"3
4
0"
>
<
template
slot-scope=
"scope"
>
<el-tooltip
v-bind:content=
"$t('containers.table.tooltips.viewer')"
>
...
...
@@ -122,6 +122,21 @@
<icon
icon=
"terminal"
fixed-width
/>
</el-button>
</el-tooltip>
<el-tooltip
v-bind:content=
"$t('containers.table.tooltips.upload')"
>
<el-button
v-on:click
.
native
.
prevent=
"
f('upload',
{
Id: scope.row.Id,
Source: scope.row.Labels['desktop.docker.io/binds/0/Source'],
Target: scope.row.Labels['desktop.docker.io/binds/0/Target'],
Username: scope.row.Labels['Username']
})
"
circle
>
<icon
icon=
"file-upload"
fixed-width
/>
</el-button>
</el-tooltip>
<el-tooltip
v-bind:content=
"$t('containers.table.tooltips.stop')"
v-if=
"scope.row.State === 'running'"
...
...
@@ -212,15 +227,14 @@ export default {
sound
:
this
.
form
.
sound
})
.
then
(()
=>
{
this
.
$notify
({
title
:
this
.
$t
(
"containers.create.notification.success.title"
),
this
.
$message
({
message
:
this
.
$t
(
"containers.create.notification.success.message"
),
type
:
"success"
type
:
"success"
,
showClose
:
true
});
})
.
catch
(()
=>
{
this
.
$notify
({
title
:
this
.
$t
(
"containers.create.notification.fail.title"
),
this
.
$message
({
message
:
this
.
$t
(
"containers.create.notification.fail.message"
)
});
})
...
...
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