Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
P
Pardus Kataliz - 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ç
kataliz
Pardus Kataliz - pardusacikhack
Commits
80f44d5c
Kaydet (Commit)
80f44d5c
authored
May 03, 2021
tarafından
Emincan Özcan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
wip
üst
b5982c47
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
115 additions
and
58 deletions
+115
-58
PardusAppSeeder.php
backend/database/seeders/PardusAppSeeder.php
+4
-5
preload.js
desktop-client/preload.js
+2
-3
exportToFile.js
desktop-client/src/actions/exportToFile.js
+28
-7
background.js
desktop-client/src/background.js
+5
-2
AlternativeAppSuggestionRow.vue
...top-client/src/components/AlternativeAppSuggestionRow.vue
+3
-3
Bucket.vue
desktop-client/src/components/Bucket.vue
+14
-13
exportToFileListener.js
...top-client/src/electron-listeners/exportToFileListener.js
+41
-0
store.js
desktop-client/src/global-state/store.js
+15
-4
AppPackages.vue
desktop-client/src/views/AppPackages.vue
+3
-17
vue.config.js
desktop-client/vue.config.js
+0
-4
No files found.
backend/database/seeders/PardusAppSeeder.php
Dosyayı görüntüle @
80f44d5c
...
...
@@ -18,6 +18,7 @@ class PardusAppSeeder extends Seeder
'name'
=>
'Spotify'
,
'image_url'
=>
"https://upload.wikimedia.org/wikipedia/commons/1/19/Spotify_logo_without_text.svg"
,
'scripts'
=>
[
'sudo apt install curl -y'
,
'sudo curl -sS https://download.spotify.com/debian/pubkey_0D811D58.gpg | sudo apt-key add -'
,
'sudo echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list'
,
'sudo apt-get update -y'
,
...
...
@@ -113,7 +114,7 @@ class PardusAppSeeder extends Seeder
'name'
=>
'Zoom'
,
'image_url'
=>
"https://seeklogo.com/images/Z/zoom-fondo-azul-vertical-logo-8246E36E95-seeklogo.com.png"
,
'scripts'
=>
[
'sudo wget
-O ~/zoom_install.deb
https://zoom.us/client/latest/zoom_amd64.deb'
,
'sudo wget https://zoom.us/client/latest/zoom_amd64.deb'
,
'sudo apt --fix-broken install ~/zoom_install.deb -y'
,
'sudo rm -f zoom_install.deb'
,
]
...
...
@@ -188,7 +189,7 @@ class PardusAppSeeder extends Seeder
PardusApp
::
create
([
'name'
=>
'Kdenlive'
,
'image_url'
=>
"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c6/Kdenlive-logo.svg/1280px-Kdenlive-logo.svg.png"
,
'scripts'
=>
[
'sudo a
pt install thunderbird
-y'
]
'scripts'
=>
[
'sudo a
dd-apt-repository ppa:kdenlive/kdenlive-stable -y'
,
'sudo apt update -y'
,
'sudo apt install kdenlive
-y'
]
]);
PardusApp
::
create
([
...
...
@@ -203,9 +204,7 @@ class PardusAppSeeder extends Seeder
'name'
=>
'Python'
,
'image_url'
=>
"https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/267_Python_logo-512.png"
,
'scripts'
=>
[
'sudo add-apt-repository ppa:deadsnakes/ppa -y'
,
'sudo apt-get update -y'
,
'sudo apt-get install python3.9 -y'
,
'sudo apt-get install python3 -y'
,
]
]);
...
...
desktop-client/preload.js
Dosyayı görüntüle @
80f44d5c
console
.
log
(
"it works"
);
import
{
ipcRenderer
}
from
"electron"
;
window
.
ipcRenderer
=
ipcRenderer
;
const
electron
=
require
(
"electron"
);
window
.
ipcRenderer
=
electron
.
ipcRenderer
;
desktop-client/src/actions/exportToFile.js
Dosyayı görüntüle @
80f44d5c
import
store
from
"../global-state/store"
;
function
generateShellScriptContent
()
{
const
items
=
store
.
pardusApps
.
filter
((
app
)
=>
store
.
bucket
.
value
.
includes
(
app
.
id
)
);
console
.
log
(
items
);
function
generateShellScriptFromBucket
()
{
let
script
=
`#!bin/sh
sudo apt update -y
sudo apt-get install software-properties-common -y
`
;
store
.
bucket
.
value
.
forEach
((
id
)
=>
{
const
pardusApp
=
store
.
pardusApps
.
value
.
find
((
app
)
=>
app
.
id
===
id
);
let
base
=
[
"
\n
"
,
"# ------------"
,
`echo '
${
pardusApp
.
name
}
adlı program yüklenecek.'`
,
].
join
(
"
\n
"
);
script
+=
[
base
,
pardusApp
.
scripts
.
join
(
"
\n
"
),
'sudo find /etc/apt/sources.list.d/ -name "*.save" -type f -delete'
,
].
join
(
"
\n
"
);
});
return
script
;
}
// function exportOnPardus() {}
function
exportToFile
()
{
window
.
ipcRenderer
.
send
(
"exportBucket"
,
generateShellScriptFromBucket
());
}
export
default
{
generateShellScriptContent
,
generateShellScriptFromBucket
,
exportToFile
,
};
desktop-client/src/background.js
Dosyayı görüntüle @
80f44d5c
"use strict"
;
import
{
app
,
protocol
,
BrowserWindow
}
from
"electron"
;
import
{
app
,
protocol
,
BrowserWindow
,
ipcMain
}
from
"electron"
;
import
{
createProtocol
}
from
"vue-cli-plugin-electron-builder/lib"
;
import
installExtension
,
{
VUEJS_DEVTOOLS
}
from
"electron-devtools-installer"
;
import
exportToFileListener
from
"./electron-listeners/exportToFileListener"
;
const
isDevelopment
=
process
.
env
.
NODE_ENV
!==
"production"
;
const
path
=
require
(
"path"
);
// Scheme must be registered before the app is ready
protocol
.
registerSchemesAsPrivileged
([
{
scheme
:
"app"
,
privileges
:
{
secure
:
true
,
standard
:
true
}
},
...
...
@@ -19,6 +20,7 @@ async function createWindow() {
// Use pluginOptions.nodeIntegration, leave this alone
// See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
nodeIntegration
:
process
.
env
.
ELECTRON_NODE_INTEGRATION
,
preload
:
path
.
join
(
__dirname
,
"../preload.js"
),
},
});
...
...
@@ -61,6 +63,7 @@ app.on("ready", async () => {
}
}
createWindow
();
ipcMain
.
on
(
"exportBucket"
,
exportToFileListener
);
});
// Exit cleanly on request from parent process in development mode.
...
...
desktop-client/src/components/AlternativeAppSuggestionRow.vue
Dosyayı görüntüle @
80f44d5c
...
...
@@ -21,7 +21,7 @@
<button
class=
"bg-pardus-yellow px-2 py-1 font-medium rounded-lg shadow-lg text-gray-900"
@
click=
"addToBucket(pardusApp.id)"
v-if=
"!
bucket.includes
(pardusApp.id)"
v-if=
"!
isInBucket
(pardusApp.id)"
>
Sepete Ekle
</button>
...
...
@@ -50,10 +50,10 @@ export default {
},
},
setup
()
{
const
{
addToBucket
,
b
ucket
}
=
store
;
const
{
addToBucket
,
isInB
ucket
}
=
store
;
return
{
addToBucket
,
b
ucket
,
isInB
ucket
,
};
},
};
...
...
desktop-client/src/components/Bucket.vue
Dosyayı görüntüle @
80f44d5c
...
...
@@ -3,22 +3,21 @@
<h2
class=
"mb-8 text-xl font-medium flex items-center justify-center"
>
Uygulama Sepeti
<span
class=
"text-base ml-2"
>
(
{{
apps
.
length
}}
)
</span>
</h2>
<div
class=
"relative"
>
<div
class=
"flex-1"
>
<div
class=
"relative mr-2"
v-for=
"app in apps"
:key=
"app.id"
>
<div
class=
"flex items-center py-2 px-2 my-2 bg-gray-700 rounded-md"
>
<img
class=
"h-8 w-8 mr-4"
:src=
"app.image_url"
/>
<h4
class=
"font-bold text-sm text-gray-300"
>
{{
app
.
name
}}
</h4>
</div>
<button
class=
"absolute px-1 py-1 transform top-1/2 -translate-y-1/2 bg-red-500 text-white -right-2 rounded-md"
@
click=
"removeFromBucket(app.id)"
>
<IconCross
class=
"w-2 h-2"
/>
</button>
<div
class=
"flex-1"
>
<div
class=
"relative mr-2"
v-for=
"app in apps"
:key=
"app.id"
>
<div
class=
"flex items-center py-2 px-2 my-2 bg-gray-700 rounded-md"
>
<img
class=
"h-8 w-8 mr-4"
:src=
"app.image_url"
/>
<h4
class=
"font-bold text-sm text-gray-300"
>
{{
app
.
name
}}
</h4>
</div>
<button
class=
"absolute px-1 py-1 transform top-1/2 -translate-y-1/2 bg-red-500 text-white -right-2 rounded-md"
@
click=
"removeFromBucket(app.id)"
>
<IconCross
class=
"w-2 h-2"
/>
</button>
</div>
</div>
<button
@
click=
"exportToFile"
>
Dışa Aktar
</button>
</div>
</
template
>
...
...
@@ -26,6 +25,7 @@
import
IconCross
from
"../icons/icon-cross.svg"
;
import
store
from
"../global-state/store"
;
import
{
computed
}
from
"vue"
;
import
exportToFile
from
"../actions/exportToFile"
;
export
default
{
name
:
"Bucket"
,
components
:
{
IconCross
},
...
...
@@ -40,6 +40,7 @@ export default {
apps
,
bucket
:
store
.
bucket
,
removeFromBucket
,
exportToFile
:
exportToFile
.
exportToFile
,
};
},
};
...
...
desktop-client/src/electron-listeners/exportToFileListener.js
0 → 100644
Dosyayı görüntüle @
80f44d5c
const
fs
=
require
(
"fs"
);
const
path
=
require
(
"path"
);
import
{
dialog
,
app
}
from
"electron"
;
export
default
function
exportToFileListener
(
event
,
param
)
{
dialog
.
showSaveDialog
({
title
:
"Kayıt Yeri Seçiniz"
,
defaultPath
:
path
.
join
(
app
.
getPath
(
"desktop"
),
"pardus-kataliz.sh"
),
buttonLabel
:
"Kaydet"
,
filters
:
[
{
name
:
"Text Files"
,
extensions
:
[
"sh"
],
},
],
properties
:
[],
})
.
then
((
file
)
=>
{
// Stating whether dialog operation was cancelled or not.
if
(
!
file
.
canceled
)
{
const
parsedPath
=
path
.
parse
(
file
.
filePath
);
const
dir
=
parsedPath
.
dir
;
const
name
=
parsedPath
.
name
;
fs
.
writeFile
(
path
.
join
(
dir
,
name
+
"_KURULUM.txt"
),
`Kurulumu gerçekleştirmek için Pardus işletim sisteminde sırasıyla şu adımları takip ediniz.
// buraya kurulum talimatlari yazilacak.`
,
function
(
err
)
{
if
(
err
)
throw
err
;
}
);
fs
.
writeFile
(
file
.
filePath
.
toString
(),
param
,
function
(
err
)
{
if
(
err
)
throw
err
;
});
}
})
.
catch
((
err
)
=>
{
console
.
log
(
err
);
});
}
desktop-client/src/global-state/store.js
Dosyayı görüntüle @
80f44d5c
...
...
@@ -5,11 +5,13 @@ const loading = ref(true);
const
pardusApps
=
ref
([]);
const
nonPardusApps
=
ref
([]);
const
appPackages
=
ref
([]);
const
bucket
=
ref
([]);
async
function
fetchData
()
{
try
{
const
response
=
await
axios
.
get
(
"http://localhost/api/get-all-data"
);
await
new
Promise
((
resolve
)
=>
setTimeout
(()
=>
resolve
(),
2000
));
const
response
=
await
axios
.
get
(
"https://kataliz-admin.emincanozcan.com/api/get-all-data"
);
const
data
=
response
.
data
.
data
;
pardusApps
.
value
=
data
[
"pardus_apps"
];
nonPardusApps
.
value
=
data
[
"non_pardus_apps"
];
...
...
@@ -18,10 +20,9 @@ async function fetchData() {
console
.
error
(
"API DATA FETCH ERROR"
,
e
);
}
}
const
bucket
=
ref
([]);
function
addToBucket
(
pardusAppId
)
{
if
(
bucket
.
value
.
find
((
item
)
=>
item
===
pardusAppId
))
{
if
(
bucket
.
value
.
includes
(
pardusAppId
))
{
return
;
}
bucket
.
value
.
push
(
pardusAppId
);
...
...
@@ -31,6 +32,15 @@ function removeFromBucket(pardusAppId) {
bucket
.
value
=
bucket
.
value
.
filter
((
item
)
=>
item
!==
pardusAppId
);
}
function
isInBucket
(
item
)
{
if
(
Array
.
isArray
(
item
))
{
let
flag
=
true
;
item
.
forEach
((
i
)
=>
(
flag
=
flag
&&
isInBucket
(
i
)));
return
flag
;
}
return
bucket
.
value
.
includes
(
item
);
}
export
default
{
loading
,
pardusApps
,
...
...
@@ -40,4 +50,5 @@ export default {
bucket
,
addToBucket
,
removeFromBucket
,
isInBucket
,
};
desktop-client/src/views/AppPackages.vue
Dosyayı görüntüle @
80f44d5c
...
...
@@ -30,8 +30,7 @@
>
<button
class=
"absolute rounded-tl-lg right-0 bottom-0 px-2 py-2 text-gray-900 bg-pardus-yellow flex items-center"
:disabled=
"isPackageInBucket(pkg['pardus_apps'])"
v-if=
"!isPackageInBucket(pkg['pardus_apps'])"
v-if=
"!isInBucket(pkg['pardus_apps'])"
@
click=
"addToBucket(pkg['pardus_apps'])"
>
<IconPlus
class=
"w-4 h-4"
/>
...
...
@@ -59,7 +58,7 @@
<span>
{{
app
.
name
}}
</span>
<span
class=
"ml-1 flex items-center text-green-500"
v-if=
"is
App
InBucket(app.id)"
v-if=
"isInBucket(app.id)"
>
<IconCheck
class=
"h-6 w-6"
/>
</span>
...
...
@@ -105,18 +104,6 @@ export default {
);
}
function
isAppInBucket
(
appId
)
{
return
store
.
bucket
.
value
.
findIndex
((
item
)
=>
item
===
appId
)
!==
-
1
;
}
function
isPackageInBucket
(
pardusAppIds
)
{
let
result
=
true
;
pardusAppIds
.
forEach
((
appId
)
=>
{
result
=
result
&&
isAppInBucket
(
appId
);
});
return
result
;
}
function
addToBucket
(
pardusAppIds
)
{
pardusAppIds
.
forEach
((
id
)
=>
store
.
addToBucket
(
id
));
}
...
...
@@ -124,8 +111,7 @@ export default {
return
{
search
,
filteredAppPackages
,
isPackageInBucket
,
isAppInBucket
,
isInBucket
:
store
.
isInBucket
,
getPardusAppsById
,
addToBucket
,
};
...
...
desktop-client/vue.config.js
Dosyayı görüntüle @
80f44d5c
console
.
log
(
"running"
);
module
.
exports
=
{
chainWebpack
:
(
config
)
=>
{
console
.
log
(
"here"
);
const
svgRule
=
config
.
module
.
rule
(
"svg"
);
svgRule
.
uses
.
clear
();
svgRule
.
use
(
"vue-loader"
)
.
loader
(
"vue-loader-v16"
)
// or `vue-loader-v16` if you are using a preview support of Vue 3 in Vue CLI
...
...
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