Compare commits
11 Commits
ed2ddb0a77
...
0.0.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de76cd16ea | ||
|
|
24c5f6e12d | ||
|
|
3a3d211cd3 | ||
|
|
829149ebc1 | ||
|
|
87799719c2 | ||
|
|
401bfb55d9 | ||
|
|
1c4656ade3 | ||
|
|
7337daac01 | ||
|
|
7eec15b7df | ||
|
|
d823bdd251 | ||
|
|
f10ff43adb |
2
src/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
__pycache__
|
||||
.swp
|
||||
@@ -4,6 +4,14 @@ import webview
|
||||
|
||||
LOCATION = "http://localhost:9274/welcome"
|
||||
|
||||
class Api():
|
||||
def log(self, value):
|
||||
print(value)
|
||||
|
||||
def close(self):
|
||||
window.destroy()
|
||||
|
||||
|
||||
def on_closed():
|
||||
"""
|
||||
Actions to take when System Installer is closed.
|
||||
@@ -13,9 +21,9 @@ def on_closed():
|
||||
|
||||
window = webview.create_window('System Installer', LOCATION,
|
||||
transparent=True, easy_drag=False, frameless=True,
|
||||
width=1050, focus=True, zoomable=True,
|
||||
confirm_close=True, resizable=True, shadow=True,
|
||||
text_select=False, draggable=False
|
||||
width=1050, height=650, focus=True, zoomable=True,
|
||||
confirm_close=False, resizable=True, shadow=True,
|
||||
text_select=False, draggable=True, js_api=Api()
|
||||
)
|
||||
|
||||
webview.settings = {
|
||||
@@ -30,6 +38,13 @@ webview.settings = {
|
||||
'SHOW_DEFAULT_MENUS': True
|
||||
}
|
||||
|
||||
|
||||
def custom_logic(window):
|
||||
pass
|
||||
#window.toggle_fullscreen()
|
||||
#window.evaluate_js('alert("Nice one brother")')
|
||||
#window.destroy()
|
||||
|
||||
window.events.closed += on_closed
|
||||
#webview.start(icon='/usr/share/icons/yasi.png')
|
||||
webview.start()
|
||||
webview.start(custom_logic, window)
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from flask import Blueprint
|
||||
|
||||
bp = Blueprint('disks', __name__,
|
||||
template_folder='')
|
||||
template_folder='',
|
||||
static_folder='static',
|
||||
static_url_path='/disks/static')
|
||||
|
||||
from yasi_applets.disks import routes
|
||||
|
||||
|
||||
BIN
src/yasi_applets/disks/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
src/yasi_applets/disks/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
src/yasi_applets/disks/__pycache__/routes.cpython-312.pyc
Normal file
@@ -1,36 +1,7 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<div style="">
|
||||
|
||||
<p><b>How would you like to install Debian?</b></p>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="radios">
|
||||
<label class="radio">
|
||||
<input selected type="radio" name="rsvp" />
|
||||
Preconfigured partitioning
|
||||
<!-- Let's hide these babies for the initial release.
|
||||
<label class="radio">
|
||||
<input type="radio" name="rsvp" disabled />
|
||||
Erase entire disk
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="rsvp" disabled />
|
||||
Install alongside another operating system
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="rsvp" disabled />
|
||||
Edit existing partitions
|
||||
</label>
|
||||
-->
|
||||
</div>
|
||||
|
||||
<div class="columns" width="100%">
|
||||
<div class="column"><p> <br>Current layout: </p></div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div style="">
|
||||
<div style="background-color: gray; padding: 4px 6px 7px 6px; border-radius: 10px;">
|
||||
@@ -88,33 +59,57 @@ fssize: {{ child['fssize'] }}
|
||||
<div style=""> <!-- partition bars -->
|
||||
<div style="background-color: gray; padding: 4px 6px 7px 6px; border-radius: 10px;">
|
||||
<p> <span style="width: 100%; border-radius: 8px 8px 0 0;" class="tag is-black">
|
||||
<small><small>{{ disk['name'] }} ({{(disk['size']/1024000000)|round(0)|int }} GB) - Serial: {{ disk['serial'] }}</small></small>
|
||||
<div class="columns">
|
||||
{% for child in disk['children'] %}
|
||||
<a hx-get="/disks/partition/{{ child['name'] }}" hx-swap="outerHTML"/>
|
||||
<div class="column is-narrow is-primary">
|
||||
<div class="box" style="min-width: 220px; border-radius: 0 0 0px 5px; height: 60px; padding-top: 5px;">
|
||||
<p class="is-tiny">{{ child['name'] }} ({{ (child['size']/1024000000)|round(2) }} GiB) </p>
|
||||
<p class="title is-5"><span class="tag is-black">{{ child['mountpoint'] }}</span>
|
||||
<span class="tag is-link">{{ child['fstype'] }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
<b>{{ disk['name'] }}: </b> {{ disk['model'] }} - {{ disk['tran'] }} disk ({{(disk['size']/1024000000)|round(0)|int }} GB) - Serial: {{ disk['serial'] }} </p>
|
||||
<center style="padding: 5px; padding-bottom: 5px;">
|
||||
<td><a hx-get="/disks/details/{{ disk['name'] }}" hx-swap="outerHTML"><span class="tag is-link"> Disk Details </span></a></td>
|
||||
<td><a hx-get="/disks/wipe_table/{{ disk['name'] }}" hx-swap="outerHTML"><span class="tag is-link"> Wipe Disk </span></a></td>
|
||||
<td><a hx-get="/disks/new_partition/{{ disk['name'] }}" hx-swap="outerHTML"><span class="tag is-link"> New Partition </span></a></td>
|
||||
<td><a hx-get="/disks/replicate/{{ disk['name'] }}" hx-swap="outerHTML"><span class="tag is-link"> Replicate Layout </span></a></td>
|
||||
<td><a hx-get="/disks/diagnostics/{{ disk['name'] }}" hx-swap="outerHTML"><span class="tag is-link"> Diagnostics </span></a></td>
|
||||
</center>
|
||||
|
||||
{% if disk['maj:min'] == "252:0" %}
|
||||
<div class="column is-narrow is-primary">
|
||||
<div class="column">
|
||||
<div class="box" style="width: 100%; border-radius: 0 0 0px 5px; height: 60px; padding-top: 5px; right: 0px;">
|
||||
<p class="is-tiny"> {{ disk['name'] }} ({{ (disk['size']/1024000000)|round(2) }} GiB) </p>
|
||||
<p class="title is-5"><span class="tag is-black">/dev/{{ disk['name'] }}</span>
|
||||
<span class="tag is-link">swap</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set colors = ['teal', '#E69F00', '#56B4E9', '#009E73', '#0072B2', '#D55E00', '#CC79A7'] %}
|
||||
|
||||
<div id="percentagebar" style="width: 100%; height: 50px; background-color: transparent; display: inline-block; margin: 5; padding: 5; overflow: hidden; display: flex;">
|
||||
{% for child in disk['children'] %}
|
||||
<a hx-get="/disks/partition/{{ child['name'] }}" hx-swap="outerHTML">
|
||||
<div style="min-width: 100px; width: {{ (((child['size'] / disk['size'])*100)|round(0)|int) }}%; height: 100%; background-color: {{ colors[loop.index0 % colors|length] }}; display: inline-block; margin: 1; padding: 1; border-radius: 8px;">
|
||||
<a hx-get="/disks/partition/{{ child['name'] }}" hx-swap="outerHTML"> <font color="white">{{ child['name'] }} </font>
|
||||
</div></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<table width="100%">
|
||||
<th>Partition</th>
|
||||
<th>Type</th>
|
||||
<th>Mount Point</th>
|
||||
<th>Label</th>
|
||||
<th>Size</th>
|
||||
<th>Used</th>
|
||||
{% for child in disk['children'] %}
|
||||
<tr>
|
||||
<td><a hx-get="/disks/partition/{{ child['name'] }}" hx-swap="outerHTML"><span class="tag is-link">{{ child['name'] }}</span></a></td>
|
||||
<td>{{ child['fstype'] }}</td>
|
||||
<td>{{ child['mountpoint'] }}</td>
|
||||
<td>{{ child['label'] }} </td>
|
||||
<td>{{ (child['size']/1024000000)|round(2) }} GiB </td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<!--
|
||||
<p> Diskname: {{ disk['name'] }} </p>
|
||||
<p> Model: {{ disk['model'] }} </p>
|
||||
@@ -128,6 +123,7 @@ fssize: {{ child['fssize'] }}
|
||||
<p> There are {{ disk['children']|count }} Children </p>
|
||||
-->
|
||||
|
||||
|
||||
<!--
|
||||
{% for child in disk['children'] %}
|
||||
<br>
|
||||
40
src/yasi_applets/disks/disks_details.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<div class="modal is-active">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-content">
|
||||
|
||||
<div style="background-color: #424242; padding: 15px; border-radius: 15px; boders: none; color: white;">
|
||||
<h1 class="is-size-4"> Disk: {{ disk }} </h1>
|
||||
|
||||
<p>
|
||||
|
||||
{% for pdisk in blockdevs["blockdevices"] if pdisk["name"] != "zram0" and "loop" not in pdisk["name"] and pdisk["name"] != "sr0" %}
|
||||
{% if pdisk['name'] == disk %}
|
||||
|
||||
<p> Model: {{ pdisk['model'] }} </p>
|
||||
<p> Revision: {{ pdisk['rev'] }} </p>
|
||||
<p> Serial: {{ pdisk['serial'] }} </p>
|
||||
<p> Link: {{ pdisk['id-link'] }} </p>
|
||||
<p> Path: {{ pdisk['path'] }} </p>
|
||||
<p> Label: {{ pdisk['label'] }} </p>
|
||||
<p> Partition type: {{ pdisk['pttype'] }} </p>
|
||||
<p> Interface: {{ pdisk['tran'] }} </p>
|
||||
<p> Size: {{ pdisk['size'] }} </p>
|
||||
<p> Flags: {{ pdisk['flags'] }} </p>
|
||||
<p> UUID: {{ pdisk['uuid'] }} </p>
|
||||
<p> Partitions: {{ pdisk['children']|count }} </p>
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
<div class="columns">
|
||||
<a href="/disks">
|
||||
<div class="column"><button class="button is-light">Cancel</button></div>
|
||||
</a>
|
||||
<a href="/disks"><div class="column"><button class="button is-link">Continue</button></div></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
105
src/yasi_applets/disks/disks_erase_confirmed.html
Normal file
@@ -0,0 +1,105 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<p><b>The following disk will be erased:</b></p>
|
||||
|
||||
{% for disk in blockdevs["blockdevices"] if disk["name"] == diskname %}
|
||||
{% set disk_size = disk['size'] %}
|
||||
|
||||
<div style="padding-top: 20px;"> <!-- partition bars -->
|
||||
<div style="background-color: gray; padding: 4px 6px 7px 6px; border-radius: 10px;">
|
||||
<p> <span style="width: 100%; border-radius: 8px 8px 0 0;" class="tag is-black">
|
||||
<b>{{ disk['name'] }}: </b> {{ disk['model'] }} - {{ disk['tran'] }} disk ({{(disk['size']/1024000000)|round(0)|int }} GB) - Serial: {{ disk['serial'] }} </p>
|
||||
<center style="padding: 5px; padding-bottom: 5px;">
|
||||
</center>
|
||||
|
||||
{% if disk['maj:min'] == "252:0" %}
|
||||
<div class="column">
|
||||
<div class="box" style="width: 100%; border-radius: 0 0 0px 5px; height: 60px; padding-top: 5px; right: 0px;">
|
||||
<span class="tag is-link">swap</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set colors = ['teal', '#E69F00', '#56B4E9', '#009E73', '#0072B2', '#D55E00', '#CC79A7'] %}
|
||||
|
||||
<div id="percentagebar" style="width: 100%; height: 50px; background-color: transparent; display: inline-block; margin: 5; padding: 5; overflow: hidden; display: flex;">
|
||||
{% for child in disk['children'] %}
|
||||
<a hx-get="/disks/partition/{{ child['name'] }}" hx-swap="outerHTML">
|
||||
<div style="min-width: 100px; width: {{ (((child['size'] / disk['size'])*100)|round(0)|int) }}%; height: 100%; background-color: {{ colors[loop.index0 % colors|length] }}; display: inline-block; margin: 1; padding: 1; border-radius: 8px;">
|
||||
<a hx-get="/disks/partition/{{ child['name'] }}" hx-swap="outerHTML"> <font color="white">{{ child['name'] }} </font>
|
||||
</div></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<table width="100%">
|
||||
<th>Partition</th>
|
||||
<th>Type</th>
|
||||
<th>Mount Point</th>
|
||||
<th>Label</th>
|
||||
<th>Size</th>
|
||||
{% for child in disk['children'] %}
|
||||
<tr>
|
||||
<td><a hx-get="/disks/partition/{{ child['name'] }}" hx-swap="outerHTML"><span class="tag is-link">{{ child['name'] }}</span></a></td>
|
||||
<td>{{ child['fstype'] }}</td>
|
||||
<td>{{ child['mountpoint'] }}</td>
|
||||
<td>{{ child['label'] }} </td>
|
||||
<td>{{ (child['size']/1024000000)|round(2) }} GiB </td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<br>
|
||||
|
||||
<p><b>This layout will be created:</b></p>
|
||||
|
||||
{% for disk in blockdevs["blockdevices"] if disk["name"] == diskname %}
|
||||
{% set disk_size = disk['size'] %}
|
||||
<div style="padding-top: 20px;"> <!-- partition bars -->
|
||||
<div style="background-color: gray; padding: 4px 6px 7px 6px; border-radius: 10px;">
|
||||
<p> <span style="width: 100%; border-radius: 8px 8px 0 0;" class="tag is-black">
|
||||
<b>New GPT Partition Table on {{ disk['name'] }} </b> </p>
|
||||
<!-- TODO: Unhardcode that, it might be a BIOS or other type of partition -->
|
||||
<center style="padding: 5px; padding-bottom: 5px;">
|
||||
</center>
|
||||
|
||||
{% set colors = ['teal', '#E69F00', '#56B4E9', '#009E73', '#0072B2', '#D55E00', '#CC79A7'] %}
|
||||
|
||||
<div id="percentagebar" style="width: 100%; height: 50px; background-color: transparent; display: inline-block; margin: 5; padding: 5; overflow: hidden; display: flex;">
|
||||
{% for partition in partitions['command_set'] if partition['action-type'] == 'newpart' %}
|
||||
<a hx-get="/disks/partition/" hx-swap="outerHTML">
|
||||
<div style="min-width: 100px; width: {{ partition['size']}}; display: inline-block; margin: 1; padding: 1; border-radius: 8px; background-color: {{ colors[loop.index0 % colors|length] }}; display: inline-block; margin: 1; padding: 1; border-radius: 8px;">
|
||||
<!-- TODO: That is totally wrong, but works for POC -->
|
||||
<a hx-get="/disks/partition/" hx-swap="outerHTML"> <font color="white"> {{ partition['device'] }} </font>
|
||||
</div></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<table width="100%">
|
||||
<th>Partition</th>
|
||||
<th>Type</th>
|
||||
<th>Mount Point</th>
|
||||
<th>Label</th>
|
||||
<th>Size</th>
|
||||
{% for partition in partitions['command_set'] if partition['action-type'] == 'newpart' %}
|
||||
<tr>
|
||||
<td><a hx-get="/disks/partition/{{ partition['device']}}" hx-swap="outerHTML"><span class="tag is-link">{{ partition['device'] }}</span></a></td>
|
||||
<td>{{ partition['fstype'] }}</td>
|
||||
<td>{{ partition['mountpoint'] }}</td>
|
||||
<td>{{ partition['label'] }} </td>
|
||||
<td>{{ partition['size'] }} </td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
<BR>
|
||||
|
||||
{% endblock %}
|
||||
58
src/yasi_applets/disks/disks_erase_menu.html
Normal file
@@ -0,0 +1,58 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<p><b>Please confirm the disk to erase:</b></p>
|
||||
|
||||
{% for disk in blockdevs["blockdevices"] if disk["name"] != "zram0" and "loop" not in disk["name"] and disk["name"] != "sr0" %}
|
||||
|
||||
<div style="padding-top: 20px;"> <!-- partition bars -->
|
||||
<div style="background-color: gray; padding: 4px 6px 7px 6px; border-radius: 10px;">
|
||||
<p> <span style="width: 100%; border-radius: 8px 8px 0 0;" class="tag is-black">
|
||||
<b>{{ disk['name'] }}: </b> {{ disk['model'] }} - {{ disk['tran'] }} disk ({{(disk['size']/1024000000)|round(0)|int }} GB) - Serial: {{ disk['serial'] }} </p>
|
||||
<center style="padding: 5px; padding-bottom: 5px;">
|
||||
<td><a href="/disks/choose_disk_erase_chosen/{{ disk['name'] }}"><span class="tag is-link"> Select Disk </span></a></td>
|
||||
</center>
|
||||
|
||||
{% if disk['maj:min'] == "252:0" %}
|
||||
<div class="column">
|
||||
<div class="box" style="width: 100%; border-radius: 0 0 0px 5px; height: 60px; padding-top: 5px; right: 0px;">
|
||||
<span class="tag is-link">swap</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set colors = ['teal', '#E69F00', '#56B4E9', '#009E73', '#0072B2', '#D55E00', '#CC79A7'] %}
|
||||
|
||||
<div id="percentagebar" style="width: 100%; height: 50px; background-color: transparent; display: inline-block; margin: 5; padding: 5; overflow: hidden; display: flex;">
|
||||
{% for child in disk['children'] %}
|
||||
<a hx-get="/disks/partition/{{ child['name'] }}" hx-swap="outerHTML">
|
||||
<div style="min-width: 100px; width: {{ (((child['size'] / disk['size'])*100)|round(0)|int) }}%; height: 100%; background-color: {{ colors[loop.index0 % colors|length] }}; display: inline-block; margin: 1; padding: 1; border-radius: 8px;">
|
||||
<a hx-get="/disks/partition/{{ child['name'] }}" hx-swap="outerHTML"> <font color="white">{{ child['name'] }} </font>
|
||||
</div></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<table width="100%">
|
||||
<th>Partition</th>
|
||||
<th>Type</th>
|
||||
<th>Mount Point</th>
|
||||
<th>Label</th>
|
||||
<th>Size</th>
|
||||
<th>Used</th>
|
||||
{% for child in disk['children'] %}
|
||||
<tr>
|
||||
<td><a hx-get="/disks/partition/{{ child['name'] }}" hx-swap="outerHTML"><span class="tag is-link">{{ child['name'] }}</span></a></td>
|
||||
<td>{{ child['fstype'] }}</td>
|
||||
<td>{{ child['mountpoint'] }}</td>
|
||||
<td>{{ child['label'] }} </td>
|
||||
<td>{{ (child['size']/1024000000)|round(2) }} GiB </td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -11,12 +11,11 @@
|
||||
<div class="select">
|
||||
<select>
|
||||
<option>Local file system</option>
|
||||
<option>Remote file system</option>
|
||||
<option>Logical volume for ZFS zpool</option>
|
||||
<option>Logical volume for LVM</option>
|
||||
<option>Logical volume for LUKS encryption</option>
|
||||
<option>Logical volume for Linux (mdadm) RAID</option>
|
||||
<option>Logical volume for Microsoft LDM RAID</option>
|
||||
<option>Logical volume for (existing) Microsoft LDM RAID</option>
|
||||
<option>Swap partition</option>
|
||||
<option>Do not configure</option>
|
||||
</select>
|
||||
@@ -49,9 +48,6 @@
|
||||
<option>jfs</option>
|
||||
<option>ntfs</option>
|
||||
<option>vfat</option>
|
||||
<option>nfs</option>
|
||||
<option>nbd</option>
|
||||
<option>samba</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
60
src/yasi_applets/disks/disks_welcome.html
Normal file
@@ -0,0 +1,60 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<p><b>How would you like to install Debian?</b></p>
|
||||
|
||||
<br>
|
||||
|
||||
<center>
|
||||
|
||||
<a href="">
|
||||
<div style="width: 200px; float: left; padding: 10px; color: white;">
|
||||
<img width="130px;" src="/disks/static/img/install_alongside.png"><br>
|
||||
Install next to existing partition
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="/disks/choose_partition_erase">
|
||||
<div style="width: 200px; float: left; padding: 10px; color: white;">
|
||||
<img width="130px;" src="/disks/static/img/erase_partition.png"><br>
|
||||
Replace a partition
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="/disks/choose_disk_erase">
|
||||
<div style="width: 200px; float: left; padding: 10px; color: white;">
|
||||
<img width="130px;" src="/disks/static/img/erase_disk.png"><br>
|
||||
Erase entire disk
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="/disks/advanced">
|
||||
<div style="width: 200px; float: left; padding: 10px; color: white;">
|
||||
<img width="130px;" src="/disks/static/img/advanced_partitioning.png"><br>
|
||||
Advanced partitioning
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="">
|
||||
<div style="width: 200px; float: left; padding: 10px; color: white;">
|
||||
<img width="130px;" src="/disks/static/img/preconfigured_partitioning.png"><br>
|
||||
Preconfigured Partitioning
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</center>
|
||||
|
||||
<div style="float: none;">
|
||||
<p> <b>The following devices have been detected:</b>
|
||||
|
||||
<br><br>
|
||||
|
||||
<ul>
|
||||
{% for disk in blockdevs["blockdevices"] if disk["name"] != "zram0" and "loop" not in disk["name"] and disk["name"] != "sr0" %}
|
||||
<li>{{ disk['name'] }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
</div>
|
||||
24
src/yasi_applets/disks/disks_wipe_partition.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<div class="modal is-active">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-content">
|
||||
|
||||
<div style="background-color: #424242; padding: 15px; border-radius: 15px; boders: none; color: white;">
|
||||
<h1 class="is-size-4"> Wipe partition: {{ disk }} </h1>
|
||||
|
||||
<p>Warning: wiping the partition table effectively destroys all data on the disk.</p>
|
||||
|
||||
<p>What kind of partition would you like to create? </p>
|
||||
|
||||
<p>DOS/MBR (Only use for legacy purposes, disks smaller than 2TB</p>
|
||||
<p>GPT (Usable on all disk sizes, modern systems)</p>
|
||||
|
||||
|
||||
<div class="columns">
|
||||
<a href="/disks">
|
||||
<div class="column"><button class="button is-light">Cancel</button></div>
|
||||
</a>
|
||||
<a href="/disks"><div class="column"><button class="button is-link">Continue</button></div></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -5,6 +5,84 @@ import dmm.lsblk as lsblk
|
||||
from flask import current_app
|
||||
|
||||
@bp.route('/disks')
|
||||
def disks_welcome():
|
||||
"""
|
||||
Welcome menu for partitioning
|
||||
"""
|
||||
menu = current_app.config['CONFIG']['settings']['menu_order'].split(" ")
|
||||
next_step_url = menu[menu.index("disks")+1]
|
||||
if menu[menu.index("disks")] == 1:
|
||||
previous_step_url = False
|
||||
else:
|
||||
previous_step_url = menu[menu.index("disks")-1]
|
||||
|
||||
blockdevs = lsblk.list_block_devices()
|
||||
|
||||
return render_template('disks_welcome.html',
|
||||
menu=current_app.config['CONFIG']
|
||||
['settings']['menu'],
|
||||
menu_order=current_app.config['CONFIG']
|
||||
['settings']
|
||||
['menu_order'].split(),
|
||||
previous_step=previous_step_url,
|
||||
next_step=next_step_url, blockdevs=blockdevs
|
||||
)
|
||||
|
||||
|
||||
@bp.route('/disks/choose_disk_erase')
|
||||
def disks_choose_disk_erase():
|
||||
"""
|
||||
Choose a disk to erase
|
||||
"""
|
||||
menu = current_app.config['CONFIG']['settings']['menu_order'].split(" ")
|
||||
next_step_url = menu[menu.index("disks")+1]
|
||||
if menu[menu.index("disks")] == 1:
|
||||
previous_step_url = False
|
||||
else:
|
||||
previous_step_url = menu[menu.index("disks")-1]
|
||||
|
||||
blockdevs = lsblk.list_block_devices()
|
||||
|
||||
return render_template('disks_erase_menu.html',
|
||||
menu=current_app.config['CONFIG']
|
||||
['settings']['menu'],
|
||||
menu_order=current_app.config['CONFIG']
|
||||
['settings']
|
||||
['menu_order'].split(),
|
||||
previous_step = previous_step_url,
|
||||
next_step=next_step_url, blockdevs=blockdevs
|
||||
)
|
||||
|
||||
|
||||
@bp.route('/disks/choose_disk_erase_chosen/<disk>')
|
||||
def disks_choose_disk_erase_confirm(disk):
|
||||
"""
|
||||
Disk chosen, show before and after of disk configuration.
|
||||
"""
|
||||
|
||||
partitions = current_app.config['CONFIG']['recipe']['create_partitions']
|
||||
|
||||
menu = current_app.config['CONFIG']['settings']['menu_order'].split(" ")
|
||||
next_step_url = menu[menu.index("disks")+1]
|
||||
if menu[menu.index("disks")] == 1:
|
||||
previous_step_url = False
|
||||
else:
|
||||
previous_step_url = menu[menu.index("disks")-1]
|
||||
blockdevs = lsblk.list_block_devices()
|
||||
|
||||
return render_template('disks_erase_confirmed.html',
|
||||
menu=current_app.config['CONFIG']
|
||||
['settings']['menu'],
|
||||
menu_order=current_app.config['CONFIG']
|
||||
['settings']
|
||||
['menu_order'].split(),
|
||||
previous_step = previous_step_url,
|
||||
next_step=next_step_url, blockdevs=blockdevs,
|
||||
diskname=disk, partitions=partitions
|
||||
)
|
||||
|
||||
|
||||
@bp.route('/disks/advanced')
|
||||
def disks():
|
||||
"""
|
||||
Disks screen for the webui.
|
||||
@@ -25,7 +103,7 @@ def disks():
|
||||
bottom_menu = ""
|
||||
build_summary()
|
||||
|
||||
return render_template('disks.html', blockdevs=blockdevs,
|
||||
return render_template('disks_advanced.html', blockdevs=blockdevs,
|
||||
menu=current_app.config['CONFIG']['settings']['menu'],
|
||||
menu_order=current_app.config['CONFIG']['settings']['menu_order'].split(),
|
||||
previous_step = previous_step_url,
|
||||
@@ -47,6 +125,23 @@ def disks_partition(part):
|
||||
partition=partition)
|
||||
|
||||
|
||||
@bp.route('/disks/details/<disk>')
|
||||
def disks_details(disk):
|
||||
"""
|
||||
Show some details about a disk.
|
||||
"""
|
||||
blockdevs = lsblk.list_block_devices()
|
||||
return render_template('disks_details.html', disk=disk, blockdevs=blockdevs)
|
||||
|
||||
|
||||
@bp.route('/disks/wipe_table/<disk>')
|
||||
def disks_wipe_table(disk):
|
||||
"""
|
||||
Create a new partition table
|
||||
"""
|
||||
return render_template('disks_wipe_partition.html', disk=disk)
|
||||
|
||||
|
||||
def build_menu():
|
||||
"""
|
||||
Define menu items and paths.
|
||||
|
||||
BIN
src/yasi_applets/disks/static/img/advanced_partitioning.png
Normal file
|
After Width: | Height: | Size: 159 KiB |
BIN
src/yasi_applets/disks/static/img/erase_disk.png
Normal file
|
After Width: | Height: | Size: 147 KiB |
BIN
src/yasi_applets/disks/static/img/erase_partition.png
Normal file
|
After Width: | Height: | Size: 130 KiB |
BIN
src/yasi_applets/disks/static/img/install_alongside.png
Normal file
|
After Width: | Height: | Size: 128 KiB |
BIN
src/yasi_applets/disks/static/img/preconfigured_partitioning.png
Normal file
|
After Width: | Height: | Size: 141 KiB |
@@ -3,7 +3,7 @@ from flask import Blueprint
|
||||
bp = Blueprint('install', __name__,
|
||||
template_folder='',
|
||||
static_folder='static',
|
||||
static_url_path='/welcome/static')
|
||||
static_url_path='/install/static')
|
||||
|
||||
from yasi_applets.install import routes
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ def run_script():
|
||||
status["status"] = "running"
|
||||
|
||||
process = subprocess.Popen(
|
||||
["bash", "/data/jonathan/devel/highvoltage/system-installer/daemon/src/fake-install-shell.sh"],
|
||||
["bash", "/home/jonathan/devel/highvoltage/yasi/yasi-daemon/src/fake-install-shell.sh"],
|
||||
stdout = subprocess.PIPE,
|
||||
stderr = subprocess.STDOUT,
|
||||
text = True)
|
||||
|
||||
@@ -21,7 +21,7 @@ than a proper webapp.
|
||||
|
||||
<div style="position: absolute; top: 15px; right: 15px;">
|
||||
<a hx-get="/main/help" hx-swap="outerHTML"/> <button class="button is-light"> <i class="fa fa-question" aria-hidden="true"></i> </button></a>
|
||||
<a hx-get="/main/quit" hx-swap="outerHTML"/><button onclick="closeApp()" class="button is-danger" > 🗙 </button></a>
|
||||
<a hx-trigger="click, keydown[altKey&&code=='F4'] from:body" hx-get="/main/quit" hx-swap="outerHTML"/><button class="button is-danger" > 🗙 </button></a>
|
||||
</div>
|
||||
|
||||
</div> <!-- end pywebview-drag-region -->
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
<p>Some keyboard tips:<p>
|
||||
<br>
|
||||
<ul>
|
||||
<li>ALT+n or CTRL+PGDn moves to the next page.</li>
|
||||
<li>ALT+p or CTRL+PGUp moves to the previous page.</li>
|
||||
<li><button>ALT</button> + <button>n</button> or <button>CTRL</button>+<button>PGDn</button> moves to the next page.</li>
|
||||
<li><button>ALT</button> + <button>p</button> or <button>CTRL</button>+<button>PGUp</button> moves to the previous page.</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-content">
|
||||
|
||||
<div style="background-color: #424242; padding: 15px; border-radius: 15px; borders: none; color: white;">
|
||||
<div style="background-color: #424242; height: 180px; padding: 15px; border-radius: 15px; borders: none; color: white; position: fixed; left: 15px; top: 15px; bottom: 15px;">
|
||||
|
||||
<h1 class="is-size-4"> Main menu </h1>
|
||||
|
||||
<br />
|
||||
|
||||
@@ -4,15 +4,14 @@
|
||||
|
||||
<div style="background-color: #424242; padding: 15px; border-radius: 15px; boders: none; color: white;">
|
||||
<h1 class="is-size-4"> Exit system installer </h1>
|
||||
<br /><p class="title is-6"><span class="tag is-danger">Quitting is not yet implemented.</span>
|
||||
|
||||
<br />
|
||||
<br>
|
||||
<p> Are you sure you want to quit? </p>
|
||||
<br>
|
||||
|
||||
<p> ALT+F4 will bring up a dialog that works though. </p>
|
||||
|
||||
<br />
|
||||
<div class="columns">
|
||||
<a href="/welcome"><div class="column"><button class="button is-link">Continue</button></div></a>
|
||||
<a href="/welcome"><div class="column"><button class="button is-link">Back</button></div></a>
|
||||
<a href=""><div class="column"><button onclick='pywebview.api.close()' class="button is-danger">Quit</button></div></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@ def set_language(LANG):
|
||||
"""
|
||||
Sets language for this applet
|
||||
"""
|
||||
translations = gettext.translation("users", '/usr/share/yasi-daemon/yasi_applets/users/locales',
|
||||
translations = gettext.translation("users", './yasi_applets/users/locales',
|
||||
fallback=True, languages=[LANG])
|
||||
translations.install()
|
||||
_ = translations.gettext
|
||||
|
||||
@@ -15,7 +15,7 @@ def set_language(LANG):
|
||||
Sets language for this applet
|
||||
"""
|
||||
# TODO: unhardcode this path
|
||||
translations = gettext.translation("welcome", '/usr/share/yasi-daemon/yasi_applets/welcome/locales',
|
||||
translations = gettext.translation("welcome", './yasi_applets/welcome/locales',
|
||||
fallback=True, languages=[LANG])
|
||||
translations.install()
|
||||
_ = translations.gettext
|
||||
|
||||
19
src/yasi_applets/welcome/static/img/keyboard.svg
Normal file
|
After Width: | Height: | Size: 11 KiB |
12
src/yasi_applets/welcome/static/img/lang.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g transform="translate(1,1)">
|
||||
<path style="fill:currentColor" d="M 8 3 L 8 5 L 3 5 L 3 7 L 11.6 7 C 11.1 8.5 10.3 9.4 9.1855469 10.681641 C 8.4665869 9.885369 7.8700275 8.91997 7.3984375 8 L 5.8535156 8 C 6.4178656 9.26012 7.1899 10.542606 8.15625 11.617188 L 4.2207031 15.498047 L 5.3183594 16.595703 L 9.1855469 12.730469 L 11.589844 15.134766 L 12.175781 13.558594 L 10.212891 11.617188 L 10.236328 11.59375 C 11.581488 10.09397 12.43566 8.82447 13 7 L 15 7 L 15 5 L 10 5 L 10 3 L 8 3 z M 14.982422 10 L 11.503906 19 L 13.050781 19 L 13.916016 16.595703 L 17.587891 16.595703 L 18.460938 19 L 20.007812 19 L 16.529297 10 L 14.982422 10 z M 15.755859 11.703125 L 17.007812 15.050781 L 14.503906 15.050781 L 15.755859 11.703125 z " class="ColorScheme-Text"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
52
src/yasi_applets/welcome/static/img/lang_w.svg
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
sodipodi:docname="lang_w.svg"
|
||||
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:zoom="48.375"
|
||||
inkscape:cx="11.989664"
|
||||
inkscape:cy="12"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1364"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg1" />
|
||||
<defs
|
||||
id="defs3051">
|
||||
<style
|
||||
type="text/css"
|
||||
id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g
|
||||
transform="translate(1,1)"
|
||||
id="g1"
|
||||
style="fill:#deddda">
|
||||
<path
|
||||
style="fill:#deddda"
|
||||
d="M 8 3 L 8 5 L 3 5 L 3 7 L 11.6 7 C 11.1 8.5 10.3 9.4 9.1855469 10.681641 C 8.4665869 9.885369 7.8700275 8.91997 7.3984375 8 L 5.8535156 8 C 6.4178656 9.26012 7.1899 10.542606 8.15625 11.617188 L 4.2207031 15.498047 L 5.3183594 16.595703 L 9.1855469 12.730469 L 11.589844 15.134766 L 12.175781 13.558594 L 10.212891 11.617188 L 10.236328 11.59375 C 11.581488 10.09397 12.43566 8.82447 13 7 L 15 7 L 15 5 L 10 5 L 10 3 L 8 3 z M 14.982422 10 L 11.503906 19 L 13.050781 19 L 13.916016 16.595703 L 17.587891 16.595703 L 18.460938 19 L 20.007812 19 L 16.529297 10 L 14.982422 10 z M 15.755859 11.703125 L 17.007812 15.050781 L 14.503906 15.050781 L 15.755859 11.703125 z "
|
||||
class="ColorScheme-Text"
|
||||
id="path1" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -12,12 +12,16 @@
|
||||
<div hx-get="/software" hx-target="#none" hx-trigger="load"></div>
|
||||
<div hx-get="/summary" hx-target="#none" hx-trigger="load"></div>
|
||||
<!-- TODO: Add hook to fix next tab again after loading summary -->
|
||||
<div style="display: none;" id="none"></div>
|
||||
|
||||
<div style="display: none;" id="none"></div>
|
||||
|
||||
<p><b> {{ string_dict['welcome_text'] }} </b></p>
|
||||
<p>{{ string_dict['confirm_text'] }} </p> <br />
|
||||
|
||||
<!-- pywebview api example
|
||||
<button onclick='pywebview.api.log("Woah dude")'>Click me</button>
|
||||
-->
|
||||
|
||||
<div style="left: 25px; display: flex; align-items: center; gap: 1rem;">
|
||||
<img style="width: 80px;" src="/welcome/static/img/lang_w.svg" alt="Language icon" />
|
||||
<form action="/welcome" method="POST" style="display: flex; flex-direction: column; gap: 0.5rem;">
|
||||
|
||||