Kaydet (Commit) 8ad002f2 authored tarafından Emincan Özcan's avatar Emincan Özcan

wip

üst d2599537
<template>
<div
v-if="installationOpen"
v-if="IS_ELECTRON && installationOpen"
class="bg-gray-900 h-screen flex items-center justify-center"
>
<Installation @close="onInstallationEnd" />
......@@ -27,19 +27,27 @@ import Installation from "./views/Installation";
export default {
components: { Installation, Loading, Sidebar },
setup() {
const { IS_ELECTRON } = process.env;
store.fetchData().then(() => {
store.loading.value = false;
});
if (IS_ELECTRON) {
window.ipcRenderer.on(
"installation-start",
() => (installationOpen.value = true)
);
}
const installationOpen = ref(false);
window.ipcRenderer.on("installation-start", () => {
installationOpen.value = true;
});
function onInstallationEnd() {
installationOpen.value = false;
}
return { loading: store.loading, installationOpen, onInstallationEnd };
return {
loading: store.loading,
installationOpen,
onInstallationEnd,
IS_ELECTRON,
};
},
};
</script>
......@@ -32,11 +32,26 @@ echo "Kurulum öncesi hazırlıklar tamamlandı. Yüklemeler başlatılıyor."
return script;
}
function exportToFile() {
function pardusExport() {
window.ipcRenderer.send("exportBucket", generateShellScriptFromBucket());
}
function webExport() {
const element = document.createElement("a");
element.setAttribute(
"href",
"data:text/plain;charset=utf-8," +
encodeURIComponent(generateShellScriptFromBucket())
);
element.setAttribute("download", "kataliz.sh");
element.style.display = "none";
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
export default {
generateShellScriptFromBucket,
exportToFile,
pardusExport,
webExport,
};
......@@ -19,6 +19,7 @@
</div>
<button
class="bg-pardus-yellow px-4 py-2 text-sm text-gray-900 font-medium rounded-md shadow-md w-full mt-4"
v-if="IS_ELECTRON"
@click="install"
>
Kurulumu Gerçekleştir
......@@ -42,19 +43,28 @@ export default {
name: "Bucket",
components: { IconCross },
setup() {
const { IS_ELECTRON } = process.env;
const apps = computed(() => {
return store.bucket.value.map((appId) => {
return store.pardusApps.value.find((item) => item.id === appId);
});
});
const removeFromBucket = store.removeFromBucket;
return {
const returnObj = {
IS_ELECTRON,
apps,
bucket: store.bucket,
removeFromBucket,
install: install.install,
exportToFile: exportToFile.exportToFile,
removeFromBucket: store.removeFromBucket,
};
if (IS_ELECTRON) {
returnObj["install"] = install.install;
returnObj["exportToFile"] = exportToFile.webExport;
} else {
returnObj["install"] = () => {};
returnObj["exportToFile"] = exportToFile.pardusExport;
}
return returnObj;
},
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment