Compare commits

..

27 Commits

Author SHA1 Message Date
Jonathan Carter
3dade195a5 Fix route 2025-07-20 11:47:29 +02:00
Jonathan Carter
b61c45b5f4 Push a bunch of uncommitted UI changes 2025-07-17 09:53:02 +02:00
Jonathan Carter
007a959274 some more ui work 2025-07-03 22:11:08 +02:00
Jonathan Carter
d0ab6f9803 Some initial menu and translation work 2025-06-20 19:30:10 +02:00
Jonathan Carter
bc0d6b1803 Remove trailing whitespace 2025-06-19 19:50:09 +02:00
Jonathan Carter
4b6b6282e1 hide some diagnostic and example data from disks 2025-04-06 20:49:28 +02:00
Jonathan Carter
1b990becc3 Show actual disks and partition sizes 2025-04-06 20:01:33 +02:00
Jonathan Carter
2c6c0675a2 Some more partitioning html 2025-04-04 22:21:11 +02:00
Jonathan Carter
d7b0491fdf Work a little more on disks html 2025-04-04 21:43:14 +02:00
Jonathan Carter
1dc9a1c734 Fix applet size 2025-04-04 21:07:41 +02:00
Jonathan Carter
4c234d76fb Fix body size 2025-04-04 20:48:59 +02:00
Jonathan Carter
12c1963d67 Catch up with uncommitted changes 2025-04-03 21:23:49 +02:00
Jonathan Carter
68667f2d86 Flesh out README 2024-12-18 20:56:12 +02:00
Jonathan Carter
d076c3c3e7 update hex 2024-12-18 20:48:18 +02:00
Jonathan Carter
29120ab016 Add hex sticker hehe 2024-12-18 20:47:23 +02:00
Jonathan Carter
f9057f2e1e Wishful thinking? :) 2024-12-18 20:43:42 +02:00
Jonathan Carter
38b6dc6a88 Add license 2024-12-18 20:28:19 +02:00
Jonathan Carter
63f71adf34 Flesh out readme a bit more 2024-12-18 20:20:53 +02:00
Jonathan Carter
46fd5c1505 Add a screenshot 2024-12-18 20:18:51 +02:00
Jonathan Carter
9b4239ca1c Move docs 2024-12-18 20:16:33 +02:00
Jonathan Carter
e788ab5d43 Add some screenshots 2024-12-18 20:16:00 +02:00
Jonathan Carter
42d35d6052 Add welcome img 2024-12-18 18:19:28 +02:00
Jonathan Carter
716f7e8773 Add footer file and installer template 2024-12-18 18:18:58 +02:00
Jonathan Carter
132efcec34 some initial themes toying 2024-12-18 18:18:22 +02:00
Jonathan Carter
66a24ea889 Initial favicon 2024-12-18 18:17:58 +02:00
Jonathan Carter
cb914ee60a Add extra welcome module files 2024-12-18 18:17:39 +02:00
Jonathan Carter
2ff0bb04bd Some more initial UI work, initial translation support 2024-12-18 18:17:24 +02:00
62 changed files with 1532 additions and 162 deletions

340
LICENCE Normal file
View File

@@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@@ -1,20 +1,46 @@
Dependencies ![Blippie System Installer Hexagon](https://git.jonathancarter.org/system-installer/system-installer-daemon/raw/branch/main/docs/hex-sticker.png)
# Welcome
Welcome to System Installer, a powerful toolkit for setting up an installer for operating systems.
![Installer screenshot](https://git.jonathancarter.org/system-installer/system-installer-daemon/raw/branch/main/docs/screenshots/welcome.png)
Dependencies:
- flask - flask
- flask-babel
- pytest - pytest
- coverage - coverage
- libjs-htmx - libxapp-gtk3-module
- libjs-material-design-lite - gettext
- xapp-gtk3-module
Recommended:
- libjs-htmx (needed if the web front-end is to be used)
- sass-stylesheets-bulma (needed if the web front-end is to be used)
## Development ## Development
**Please Note:** This project is in early development, and if you have stumbled across this page, please note that it is nowhere near ready for production use yet. Hopefully that changes over the next few months!
### Translations ### Translations
Upstream PyBabel documentation: This project uses gettext for translations. More instruction to follow...
https://python-babel.github.io/flask-babel/index.html#translating-applications
in the ./daemon directory, run the following to regenerate the translations file:
```pybabel extract -F babel.cfg -o messages.pot .``` ### Modules
Back-end modules:
* TODO: Explain DMM modules
Front-end modules:
* TODO: Explain Flask blueprint files
API:
A stable API doesn't exist yet, but it's planned!
## License
This software is released under the GPL-2 license or later. See the LICENSE
file for additional details.

BIN
docs/hex-sticker.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
docs/screenshots/users.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@@ -1,7 +1,7 @@
{% extends "layout.html" %} {% extends "layout.html" %}
{% block body %} {% block body %}
<div style="width: 1000px; height: 100%;"> <div style="">
<p><b>How would you like to install Debian?</b></p> <p><b>How would you like to install Debian?</b></p>
@@ -10,10 +10,13 @@
<div class="radios"> <div class="radios">
<label class="radio"> <label class="radio">
<input type="radio" name="rsvp" /> <input type="radio" name="rsvp" />
Preconfigured partitioning &nbsp;
<label class="radio">
<input type="radio" name="rsvp" disabled />
Erase entire disk Erase entire disk
</label> </label>
<label class="radio"> <label class="radio">
<input type="radio" name="rsvp" /> <input type="radio" name="rsvp" disabled />
Install alongside another operating system Install alongside another operating system
</label> </label>
<label class="radio"> <label class="radio">
@@ -22,18 +25,17 @@
</label> </label>
</div> </div>
<br>
<div class="columns" width="100%"> <div class="columns" width="100%">
<div class="column"><p> Proposed layout: </p></div> <div class="column"><p> <br>Proposed layout: </p></div>
<div class="column is-link"><button class="button iis-info"> <img src="/static/icons/tab-new-symbolic.svg"> &nbsp; Add Disk or Filesystem </button></div>
</div> </div>
<div style=""> <!-- partition bars -->
<div style="background-color: gray; padding: 10px; border-radius: 10px;"> <!--
<p> <span style="width: 100%;" class="tag is-black">Physical disk: TOSHIBA HDWD120 (2000 GB) <br> <div style="">
<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">Physical disk: TOSHIBA HDWD120 (2000 GB) <br>
<div class="columns"> <div class="columns">
<div class="column is-narrow is-primary"> <div class="column is-narrow is-primary">
<div class="box" style="min-width: 220px;"> <div class="box" style="min-width: 220px; border-radius: 0 0 0px 5px; height: 60px; padding-top: 5px;">
<p class="is-tiny">/dev/sda1</p> <p class="is-tiny">/dev/sda1</p>
<p class="title is-5"><span class="tag is-black">/boot/efi</span> <p class="title is-5"><span class="tag is-black">/boot/efi</span>
<span class="tag is-dark">200 MB</span> <span class="tag is-dark">200 MB</span>
@@ -43,7 +45,7 @@
</div> </div>
<a hx-get="/disks/partition/sda" hx-swap="outerHTML"/> <a hx-get="/disks/partition/sda" hx-swap="outerHTML"/>
<div class="column"> <div class="column">
<div class="box"> <div class="box" style="border-radius: 0 0 5px 0px; height: 60px; padding-top: 5px;">
<p class="is-tiny">/dev/sda2</p> <p class="is-tiny">/dev/sda2</p>
<p class="title is-5"><span class="tag is-black">/</span> <span class="tag is-dark">18 GB</span> <span class="tag is-link">btrfs</span></p> <p class="title is-5"><span class="tag is-black">/</span> <span class="tag is-dark">18 GB</span> <span class="tag is-link">btrfs</span></p>
</div> </div>
@@ -51,51 +53,81 @@
</div> </div>
</div> </div>
</div> </div>
<br><br>
<div style="background-color: gray; padding: 10px; border-radius: 10px;">
<p> <span style="width: 100%;" class="tag is-black">Physical disk: TOSHIBA HDWD120 (2000 GB) <br>
<div class="columns">
<div class="column is-narrow is-primary">
<div class="box" style="width: 220px;">
<p class="is-tiny">/dev/sda1</p>
<p class="title is-5"><span class="tag is-black">/boot/efi</span>
<span class="tag is-dark">200 MB</span>
<span class="tag is-link">vfat</span>
</p>
</div>
</div> </div>
<a hx-get="/disks/partition/sda" hx-swap="outerHTML"/> </div>
<div class="column"> -->
<div class="box">
<p class="is-tiny">/dev/sda2</p>
<p class="title is-5"><span class="tag is-black">/</span> <span class="tag is-dark">18 GB</span> <span class="tag is-link">btrfs</span></p>
</div>
</a>
</div>
</div>
</div>
</div> <!-- end partition bars -->
<br>
<!--
<p> There are {{ blockdevs["blockdevices"]|count }} block devices detected. </p> <p> There are {{ blockdevs["blockdevices"]|count }} block devices detected. </p>
<p> They are </p> <p> They are </p>
<br> <br>
-->
{% for disk in blockdevs["blockdevices"] %}
<!-- {% for disk in blockdevs["blockdevices"] if disk["name"] != "zram0"%} -->
<!--
<h1> Raw data </h1>
{{ disk }}
<h1> Children </h1>
{% for child in disk['children'] %}
<h2> <big><b> Child </b></big> </h2>
Path: {{ child['path'] }}
fstype: {{ child['fstype'] }}
fssize: {{ child['fssize'] }}
{{ child }}
{% endfor %}
-->
<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 %}
{% if disk['maj:min'] == "252:0" %}
<div class="column is-narrow is-primary">
<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 %}
</div>
</div>
<!--
<p> Diskname: {{ disk['name'] }} </p> <p> Diskname: {{ disk['name'] }} </p>
<p> Model: {{ disk['model'] }} </p> <p> Model: {{ disk['model'] }} </p>
<p> Serial: {{ disk['serial'] }} </p> <p> Serial: {{ disk['serial'] }} </p>
<p> Removable: {{ disk['rm'] }} </p> <p> Removable: {{ disk['rm'] }} </p>
<p> Size: {{ (disk['size'] | int) / 1024000000 | round(2) }} GiB </p> <p> Size: {{ disk['size'] | int / 1024000000 | round(2) }} GiB </p>
<p> ID: {{disk['id'] }} </p> <p> ID: {{disk['id'] }} </p>
<p> pttype: {{disk['pttype'] }} </p> <p> pttype: {{disk['pttype'] }} </p>
<p> Maj:min: {{disk['maj:min']}} </p> <p> Maj:min: {{disk['maj:min']}} </p>
<p> phy-sec: {{ disk['phy-sec'] }}. log-sec: {{ disk['log-sec'] }} </p> <p> phy-sec: {{ disk['phy-sec'] }}. log-sec: {{ disk['log-sec'] }} </p>
<p> There are {{ disk['children']|count }} Children </p> <p> There are {{ disk['children']|count }} Children </p>
-->
<!--
{% for child in disk['children'] %} {% for child in disk['children'] %}
<br> <br>
<p> Name: {{ child['name'] }}. Path: {{ child['path'] }}. {{ child['size'] }}. Block: {{ child['subsystems'] }} {{ child['maj:min'] }} {{ child['type'] }} </p> <p> Name: {{ child['name'] }}. Path: {{ child['path'] }}. {{ child['size'] }}. Block: {{ child['subsystems'] }} {{ child['maj:min'] }} {{ child['type'] }} </p>
@@ -103,6 +135,8 @@
<p> Parttypename: {{ child['parttypename'] }} <p> Parttypename: {{ child['parttypename'] }}
<br> <br>
{% endfor %} {% endfor %}
-->
<br> <br>
{% endfor %} {% endfor %}
@@ -111,18 +145,6 @@
Add Network Filesystem --> Add Network Filesystem -->
<div> <!-- Disks and Partitions Content -->
<br><br>
<div class="columns">
<div class="column"><button class="button is-light">Cancel</button></div>
<div class="column"><button class="btn primary" hx-trigger="click, keyup[altKey&&shiftKey&&key=='D'] from:body"
hx-post="/">Do It! (alt-shift-D)</button></div>
<a href="/software">
<div class="column"><button hx-src='html' class="button is-link" hx-trigger="click, keyup[altKey&&shiftKey&&key=='N'] from:body" hx-get="/software">Co<u>n</u>tinue</button></div></a>
</div>
</div>
</div> </div>
</div> </div>

View File

@@ -3,7 +3,7 @@
<div class="modal-content"> <div class="modal-content">
<div style="background-color: #424242; padding: 15px; border-radius: 15px; boders: none; color: white;"> <div style="background-color: #424242; padding: 15px; border-radius: 15px; boders: none; color: white;">
<h1 class="is-size-4"> Edit partition: /dev/sda2 </h1> <h1 class="is-size-4"> Edit partition: {{ partition }} </h1>
<p class="title is-6"><span class="tag is-black">Primary Partition</span> <p class="title is-6"><span class="tag is-black">Primary Partition</span>
<span> <span>

View File

@@ -2,6 +2,7 @@ from applets.disks import bp
from flask import Flask, request, session, redirect, \ from flask import Flask, request, session, redirect, \
url_for, render_template, flash, Blueprint url_for, render_template, flash, Blueprint
import dmm.lsblk as lsblk import dmm.lsblk as lsblk
from flask import current_app
@bp.route('/disks') @bp.route('/disks')
def disks(): def disks():
@@ -10,7 +11,24 @@ def disks():
""" """
blockdevs = lsblk.list_block_devices() blockdevs = lsblk.list_block_devices()
print(lsblk.list_block_devices()) print(lsblk.list_block_devices())
return render_template('disks.html', blockdevs=blockdevs) 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]
add_disks_button = '&nbsp; <button class="button iis-info"> <i class="fa fa-hdd-o" aria-hidden="true"></i> &nbsp; Add Disk or Filesystem </button>'
add_swap_button = '&nbsp; <button class="button iis-info"> <i class="fa fa-object-group" aria-hidden="true"></i> &nbsp; Swap Configuration </button>'
bottom_menu = add_disks_button + add_swap_button
build_summary()
return render_template('disks.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,
next_step = next_step_url,
bottom_menu = bottom_menu)
@bp.route('/disks/partition/<part>') @bp.route('/disks/partition/<part>')
@@ -18,6 +36,30 @@ def disks_partition(part):
""" """
Partition modal for the webui partition screen. Partition modal for the webui partition screen.
""" """
return render_template('disks_partition.html') print("Partition is: " + part)
partition = part
return render_template('disks_partition.html',
menu=current_app.config['CONFIG']['settings']['menu'],
partition=partition)
def build_menu():
"""
Define menu items and paths.
"""
# proper one once translations are done:
#current_app.config['CONFIG']['settings']['menu']['welcome'] = (build_stringlist()['menu_item'], "/welcome", 10)
current_app.config['CONFIG']['settings']['menu']['disks'] = ("Disks", "/disks", 30)
def build_summary():
"""
Write up a summary of what this module will do.
"""
current_app.config['CONFIG']['Summary']['disks'] = {}
current_app.config['CONFIG']['Summary']['disks']['heading'] = "Disks and Partitions"
current_app.config['CONFIG']['Summary']['disks']['bleh'] = current_app.config['CONFIG']['recipe']['popcon']['enable_popcon']
current_app.config['CONFIG']['Summary']['disks']['text'] = "Pre-configured disk layout."
return("ok?")
build_menu()

View File

@@ -0,0 +1,7 @@
from flask import Blueprint
bp = Blueprint('install', __name__,
template_folder='')
from applets.install import routes

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,18 @@
{% extends "layout.html" %}
{% block body %}
<center>
<p style="position: absolute: left: 45px; top: 10px;"> <big><big> Installing...</big></big></p> <br />
<img style="width: 400px; padding: 20px;" src="/static/slide1.png" /> <br />
<p> Installing system, the rest of the process is automated. </p>
<p style="margin: 20px;"> <input style="background-color: #777777;" type="checkbox" id="reboot" name="reboot" value="reboot" checked>
<label for="reboot"> Reboot automatically when ready </label></p><br>
</center>
<div style="position: absolute; padding: 10px; background-color: #26495e; left: 40px; right: 40px; bottom: 40px; height: text-align: middle;"> <center> Initializing... </center> </div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,37 @@
from applets.install import bp
from flask import Flask, request, session, redirect, \
url_for, render_template, flash, Blueprint
from flask import current_app
@bp.route('/install',methods=['GET', 'POST', 'PUT'])
def install_index():
"""
The page you'd get if you access the root of
this app in a browser.
"""
install_start()
return render_template('install.html')
@bp.route('/install-start',methods=['GET', 'POST', 'PUT'])
def install_start():
"""
Trigger the installation process
"""
print("The installation process is starting!... in theory at least")
@bp.route('/install-status',methods=['GET', 'POST', 'PUT'])
def install_status():
"""
Update on the status of the installation process.
"""
print("installation en coers")
@bp.route('/settings',methods=['GET', 'POST', 'PUT'])
def settings():
"""
Manage settings for the installation module.
"""
print("Settings")

View File

@@ -1,11 +1,65 @@
from applets.software import bp from applets.software import bp
from flask import Flask, request, session, redirect, \ from flask import Flask, request, session, redirect, \
url_for, render_template, flash, Blueprint url_for, render_template, flash, Blueprint
from flask import current_app
@bp.route('/software') @bp.route('/software')
def webui_software(): def webui_software():
""" """
Software screen for the webui. Software screen for the webui.
""" """
return render_template('software.html') menu = current_app.config['CONFIG']['settings']['menu_order'].split(" ")
next_step_url = menu[menu.index("software")+1]
if menu[menu.index("software")] == 1:
previous_step_url = False
else:
previous_step_url = menu[menu.index("software")-1]
sources_button = '&nbsp; <button class="button iis-info"> <i class="fa fa-cloud-download" aria-hidden="true"></i> &nbsp; Edit Sources </button>'
blends_button = '&nbsp; <button class="button iis-info"> <i class="fa fa-download" aria-hidden="true"></i> &nbsp; Install a Blend </button>'
bottom_menu = sources_button + blends_button
build_summary()
return render_template('software.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,
bottom_menu = bottom_menu,
popcon=current_app.config['CONFIG']['recipe']['popcon']['enable_popcon'])
@bp.route('/software/settings', methods=['GET', 'POST'])
def software_settings():
"""
Receive settings for the software applet.
"""
if request.method == 'POST':
popcon = "popcon" in request.form
current_app.config['CONFIG']['recipe']['popcon']['enable_popcon'] = popcon
print(current_app.config['CONFIG']['recipe']['popcon']['enable_popcon'])
build_summary()
return ('', 204)
def build_menu():
"""
Define menu items and paths.
"""
# proper one once translations are done:
#current_app.config['CONFIG']['settings']['menu']['welcome'] = (build_stringlist()['menu_item'], "/welcome", 10)
current_app.config['CONFIG']['settings']['menu']['software'] = ("Software", "/software", 40)
def build_summary():
"""
Write up a summary of what this module will do.
"""
current_app.config['CONFIG']['Summary']['software'] = {}
current_app.config['CONFIG']['Summary']['software']['heading'] = "Software"
current_app.config['CONFIG']['Summary']['software']['bleh'] = current_app.config['CONFIG']['recipe']['popcon']['enable_popcon']
current_app.config['CONFIG']['Summary']['software']['text'] = "Participate in Popularity Contest: " + str(current_app.config['CONFIG']['recipe']['popcon']['enable_popcon']) + "<br/>No desktop environment selected."
return("ok?")
build_menu()

View File

@@ -5,12 +5,55 @@
<br> <br>
<ul> <div style="background-color: gray; padding: 4px 6px 7px 6px;
<li>Would you like to participate in popcon?</li> border-radius: 10px; margin-bottom: 20px;">
<li>Desktop environment</li>
<li>Server software</li>
</ul>
<span style="width: 100%; border-radius: 8px 8px 0 0;"
class="tag is-black">
Popularity Contest
</span>
<div style="padding-left: 15px; padding-right: 15px; background-color: #fff;
color: #000;">
<p>The Popularity Contest (popcon) is a programme where anonymous data is sent back to Debian, tracking the number of packages installed. More information can be obtained at https://popcon.debian.org.</p> <br>
<input style="background-color: #777777;" type="checkbox" id="popcon"
name="popcon" hx-post="/software/settings" hx-trigger="change"
{% if popcon %} checked {% endif %}>
<label for="popcon"> Participate in PopCon </label><br>
</div>
</div>
<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">
Desktop Environment</span>
<div style="padding: 15px; padding-top: 10px; padding-bottom: 5px; background-color: #fff; color: #000;">
<p>
<img src="/static/icons/console.png" width="48px" alt="" style="padding-right: 10px;" />
<img src="/static/icons/gnome.jpeg" width="48px" alt="" style="padding-right: 10px;" />
<img src="/static/icons/kde.jpeg" width="48px" alt="" style="padding-right: 10px;" />
<img src="/static/icons/xfce.jpeg" width="48px" alt="" style="padding-right: 10px;" />
<img src="/static/icons/mate.jpeg" width="48px" alt="" style="padding-right: 10px;" />
<img src="/static/icons/lxde.jpeg" width="48px" alt="" style="padding-right: 10px;" />
<p>
</div>
</div>
<br />
<div style="background-color: gray; padding: 4px 6px 7px 6px; border-radius: 10px; margin-bottom: 20px;">
<p> <span style="width: 100%; border-radius: 8px 8px 0 0;" class="tag is-black">
Select software from Debian archives</span>
<div style="padding-left: 15px; padding-right: 15px; padding-bottom: 5px; background-color: #fff; color: #000;">
<p><b>Select packages or selections of packages from the Debian archives.</b></p>
<button class="button is-dark">Games</button>
<button class="button is-dark">Productivity</button>
<button class="button is-dark">Creativity</button>
<button class="button is-dark">Server</button>
<button class="button is-dark">Development</button>
</div>
</div>
</div> </div>
</div> </div>

View File

@@ -1,6 +1,7 @@
from applets.summary import bp from applets.summary import bp
from flask import Flask, request, session, redirect, \ from flask import Flask, request, session, redirect, \
url_for, render_template, flash, Blueprint url_for, render_template, flash, Blueprint
from flask import current_app
@bp.route('/summary',methods=['GET', 'POST', 'PUT']) @bp.route('/summary',methods=['GET', 'POST', 'PUT'])
def summary_index(): def summary_index():
@@ -8,6 +9,34 @@ def summary_index():
The page you'd get if you access the root of The page you'd get if you access the root of
this app in a browser. this app in a browser.
""" """
return render_template('summary.html') build_menu()
menu = current_app.config['CONFIG']['settings']['menu_order'].split(" ")
previous_step_url = menu[menu.index("summary")-1]
next_step_url = "install"
config = current_app.config['CONFIG']
print (current_app.config['CONFIG']['Summary'])
html = (str(current_app.config['CONFIG']['Summary']['welcome']) + "<br>" + str(current_app.config['CONFIG']['Summary']['software']))
summary = config['Summary']
return render_template('summary.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,
config=config,
html=html,
summary=summary)
def build_menu():
"""
Define menu items and paths.
"""
# proper one once translations are done:
#current_app.config['CONFIG']['settings']['menu']['welcome'] = (build_stringlist()['menu_item'], "/welcome", 10)
current_app.config['CONFIG']['settings']['menu']['summary'] = ("Summary", "/summary", 60)
build_menu()

View File

@@ -3,6 +3,26 @@
<p><b> Ready to install! Please review all changes.</b></p> <p><b> Ready to install! Please review all changes.</b></p>
<p> This is the last chance to back out before committing to install, please ensure all the details are correct. </p>
<br>
{% for module in summary %}
<h3> <big> {{ summary[module]['heading'] }} </big> </h3>
<!-- {{ summary[module]['bleh'] }}
{{ summary[module]['settings'] }} -->
{{ summary[module]['text']|safe }}
<br /><br />
{% endfor %}
<br><br/>
<!-- <p>Config is: <code> {{ config }} </code></p> -->
</div> </div>
</div> </div>
</div> </div>

Binary file not shown.

View File

@@ -0,0 +1,65 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-06-20 15:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: routes.py:33
msgid "Let's set up an initial user."
msgstr "Kom on stel 'n gebruiker op."
msgid "Users"
msgstr "Gebruikers"
#: routes.py:34
msgid "Full Name"
msgstr "Volle Naam"
#: routes.py:35
msgid "Username"
msgstr "Gebruikersnaam"
#: routes.py:36
msgid "This username is available"
msgstr "Hierdie gebruikersnaam is nie beskikbaar nie."
#: routes.py:37
msgid "This username is not available"
msgstr "Hierdie gebruikersnaam is nie beskikbaar nie."
#: routes.py:38
msgid "This username is reserved by the system"
msgstr "Hierdie gebruikersnaam is reserveerd deur vir die sisteem."
#: routes.py:39
msgid "The username must be one word, lowercase, with no special characters"
msgstr "Die gebruikersnaam moet een woord wees, kleinletters, met geen spesiale karakters."
#: routes.py:40
msgid "Password"
msgstr "Wagwoord"
#: routes.py:41
msgid "Password (confirm)"
msgstr "Wagwoord (bevestig)"
#: routes.py:42
msgid "These passwords do now match"
msgstr "Hierdie wagwoorde is nie dieselfde nie"
#: routes.py:43
msgid "This password is too short"
msgstr "Hierdie wagwoord is te kort"

View File

@@ -0,0 +1,62 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-06-20 15:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: routes.py:33
msgid "Let's set up an initial user."
msgstr ""
#: routes.py:34
msgid "Full Name"
msgstr ""
#: routes.py:35
msgid "Username"
msgstr ""
#: routes.py:36
msgid "This username is available"
msgstr ""
#: routes.py:37
msgid "This username is not available"
msgstr ""
#: routes.py:38
msgid "This username is reserved by the system"
msgstr ""
#: routes.py:39
msgid "The username must be one word, lowercase, with no special characters"
msgstr ""
#: routes.py:40
msgid "Password"
msgstr ""
#: routes.py:41
msgid "Password (confirm)"
msgstr ""
#: routes.py:42
msgid "These passwords do now match"
msgstr ""
#: routes.py:43
msgid "This password is too short"
msgstr ""

View File

@@ -1,6 +1,21 @@
from applets.software import bp from applets.software import bp
from flask import Flask, request, session, redirect, \ from flask import Flask, request, session, redirect, \
url_for, render_template, flash, Blueprint url_for, render_template, flash, Blueprint
import gettext
# we use this neat little trick to get config data from the main app
from flask import current_app
# Set up Gettext
def set_language(LANG):
"""
Sets language for this applet
"""
translations = gettext.translation("users", './applets/users/locales',
fallback=True, languages=[LANG])
translations.install()
_ = translations.gettext
set_language('')
@bp.route('/users') @bp.route('/users')
@@ -8,4 +23,99 @@ def users_root():
""" """
Users screen for the webui. Users screen for the webui.
""" """
return render_template('users.html') set_language(current_app.config['CONFIG']['settings']['language'])
string_dict = build_stringlist()
build_menu()
menu = current_app.config['CONFIG']['settings']['menu_order'].split(" ")
next_step_url = menu[menu.index("users")+1]
if menu[menu.index("users")] == 1:
previous_step_url = False
else:
previous_step_url = menu[menu.index("users")-1]
root_button = '&nbsp; <button class="button is-light"> <i class="fa fa-user" aria-hidden="true"></i> &nbsp; Setup root user </button>'
ldap_button = '&nbsp; <button class="button is-light"> <i class="fa fa-address-card" aria-hidden="true"></i> &nbsp; Connect LDAP </button>'
ad_button = '&nbsp; <button class="button is-light"> <i class="fa fa-address-card" aria-hidden="true"></i> &nbsp; Connect AD </button>'
csv_button = '&nbsp; <button class="button is-light"> <i class="fa fa-users" aria-hidden="true"></i> &nbsp; Import CSV </button>'
bottom_menu = root_button + ldap_button + ad_button + csv_button
initial_user = current_app.config['CONFIG']['recipe']['users']['users'][0]
build_summary()
return render_template('users.html', string_dict=string_dict,
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,
bottom_menu=bottom_menu,
initial_user=initial_user)
@bp.route('/users/user-check/', methods=['GET', 'POST', 'PUT'])
def check_user():
if request.method == 'POST':
print("Ok, so method is POST")
print("keys are: ", request.form.keys())
username = request.form["username"]
fullname = request.form["fullname"]
password = request.form["password"]
password_confirm = request.form["password_confirm"]
print(current_app.config['CONFIG']['recipe']['users']['users'][0])
print("fullname is: " + fullname)
print("password is: " + password)
print("password_confirm is: " + password_confirm)
current_app.config['CONFIG']['recipe']['users']['users'][0]['username'] = username
current_app.config['CONFIG']['recipe']['users']['users'][0]['fullname'] = fullname
current_app.config['CONFIG']['recipe']['users']['users'][0]['password'] = password
current_app.config['CONFIG']['recipe']['users']['users'][0]['password_confirm'] = password_confirm
if username in ["root", "games"]:
return('<p class="has-text-danger"><b>That username is not available</b> </p>')
else:
return('<p class="has-text-success"><b>That username is available</b> </p>')
build_summary()
return("bleh")
def build_stringlist():
"""
Return all the strings that is used in this applet.
"""
string_dict = {}
string_dict['menu_item'] = _("Users")
string_dict['initial_user_text'] = _("Let's set up an initial user.")
string_dict['full_name'] = _("Full Name")
string_dict['user_name'] = _("Username")
string_dict['user_name_hint'] = _("One word, all lowercase")
string_dict['user_name_available'] = _("This username is available")
string_dict['user_name_not_available'] = _("This username is not available")
string_dict['user_name_reserved'] = _("This username is reserved by the system")
string_dict['user_name_characters'] = _("The username must be one word, lowercase, with no special characters")
string_dict['password'] = _("Password")
string_dict['password_confirm'] = _("Password (confirm)")
string_dict['password_nomatch'] = _("These passwords do now match")
string_dict['password_tooshort'] = _("This password is too short")
return string_dict
def build_menu():
"""
Define menu items and paths.
"""
current_app.config['CONFIG']['settings']['menu']['users'] = (build_stringlist()['menu_item'], "/users", 20)
print(current_app.config['CONFIG']['settings']['menu'])
def build_summary():
"""
Write up a summary of what this module will do.
"""
current_app.config['CONFIG']['Summary']['users'] = {}
current_app.config['CONFIG']['Summary']['users']['heading'] = "Users and Identity"
current_app.config['CONFIG']['Summary']['users']['bleh'] = current_app.config['CONFIG']['recipe']['popcon']['enable_popcon']
current_app.config['CONFIG']['Summary']['users']['settings'] = current_app.config['CONFIG']['recipe']['users']['users']
current_app.config['CONFIG']['Summary']['users']['text'] = "Add primary user with the username: " + str(current_app.config['CONFIG']['recipe']['users']['users'][0]['username'])
return("ok?")
build_menu()

View File

@@ -1,47 +1,61 @@
{% extends "layout.html" %} {% extends "layout.html" %}
{% block body %} {% block body %}
<p><b> Let's set up an initial user. </b></p> <p><b> {{ string_dict['initial_user_text'] }} </b></p>
<br> <br>
<form action="/users" method="POST">
<img src="/static/icons/avatar-default.svg" width="160px" style="float: left; position: absolute;" /> <img src="/static/icons/avatar-default.svg" width="160px" style="float: left; position: absolute;" />
<div style="margin-left: 180px;"> <div style="margin-left: 180px;">
<div class="field"> <div class="field">
<label>Full Name</label> <div class="control"><input class="input" type="text" placeholder="Text input"> <label>{{ string_dict['full_name'] }}</label>
</div> <div class="control has-icons-left has-icons-right">
</div> <input class="input" name="fullname" type="text" placeholder="Full Name" value="{% if initial_user['fullname'] %}{{ initial_user['fullname'] }}{% endif %}" hx-post="/users/user-check" hx-trigger="keyup changed delay:500ms" hx-target="#username-name">
<div class="field">
<label>Username</label>
<div class="control has-icons-left has-icons-right">
<input class="input is-success" type="text" placeholder="Text input" value="user">
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fas fa-user"></i> <i class="fa fa-user-circle-o" aria-hidden="true"></i>
</span> </span>
<span class="icon is-small is-right">
<i class="fas fa-check"></i>
</span>
</div>
<p class="help is-success">This username is available</p>
</div>
<div class="field">
<label class="password">Password</label>
<div class="control">
<input class="input" type="password" placeholder="Enter password">
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<label class="password">Password (confirm)</label> <label>{{ string_dict['user_name'] }}</label>
<div class="control"> <div class="control has-icons-left has-icons-right">
<input class="input" type="password" placeholder="Enter password (confirm)"> <input class="input is-success" type="text" placeholder="{{ string_dict['user_name'] }}" value="{% if initial_user['username'] %}{{ initial_user['username'] }}{% endif %}" name="username" hx-post="/users/user-check" hx-trigger="keyup changed delay:200ms" hx-trigger="load" hx-target="#username-status">
<span class="icon is-small is-left">
<i class="fa fa-user-circle-o" aria-hidden="true"></i>
</span>
</div>
<div id="username-status">
<p> {{ string_dict['user_name_hint'] }}</p>
</div> </div>
</div> </div>
<div class="field">
<label class="password">{{ string_dict['password'] }}</label>
<div class="control has-icons-left has-icons-right">
<input class="input" name="password" type="password" placeholder="{{ string_dict['password'] }}" value="{% if initial_user['password'] %}{{ initial_user['password'] }}{% endif %}" hx-post="/users/user-check" hx-trigger="keyup changed delay:200ms" hx-target="#username-status">
<span class="icon is-small is-left">
<i class="fa fa-address-card" aria-hidden="true"></i>
</span>
</div>
</div>
<div class="field">
<label class="password">{{ string_dict['password_confirm'] }}</label>
<div class="control has-icons-left has-icons-right">
<input class="input" name="password_confirm" type="password" placeholder="{{ string_dict['password_confirm'] }}" value="{% if initial_user['password_confirm'] %}{{ initial_user['password_confirm'] }}{% endif %}" hx-post="/users/user-check" hx-trigger="keyup changed delay:200ms" hx-target="#password-status">
<span class="icon is-small is-left">
<i class="fa fa-address-card" aria-hidden="true"></i>
</span>
</div>
</div>
</form>
</div> <!-- style 180 --> </div> <!-- style 180 -->
</div> </div>

View File

@@ -4,4 +4,3 @@ bp = Blueprint('welcome', __name__,
template_folder='') template_folder='')
from applets.welcome import routes from applets.welcome import routes

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

View File

@@ -0,0 +1,33 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-15 21:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: UTF-8\n"
#: routes.py:27
msgid "Welcome! This setup program will install Debian on to your system."
msgstr "Welkom! Hierdie program sal jou deur die proses lei om Debian te installeer na jou sisteem."
#: routes.py:28
msgid "Please confirm the following details:"
msgstr "Bevestig asseblief die volgende:"
#: routes.py:29
msgid "Language:"
msgstr "Taal:"
#: routes.py:30
msgid "Keyboard Layout:"
msgstr "Knoppies Uitleg:"
#: routes.py:31
msgid "Time Zone:"
msgstr "Tyd Zone:"

View File

@@ -0,0 +1,33 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-15 21:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: en-za\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: UTF-8\n"
#: routes.py:27
msgid "Welcome! This setup program will install Debian on to your system."
msgstr "Howzit! This setup program will install Debian on to your system."
#: routes.py:28
msgid "Please confirm the following details:"
msgstr "Please confirm the following details:"
#: routes.py:29
msgid "Language:"
msgstr "Language:"
#: routes.py:30
msgid "Keyboard Layout:"
msgstr "Keyboard Layout:"
#: routes.py:31
msgid "Time Zone:"
msgstr "Time Zone:"

Binary file not shown.

View File

@@ -0,0 +1,33 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-15 21:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: UTF-8\n"
#: routes.py:27
msgid "Welcome! This setup program will install Debian on to your system."
msgstr "Welcomen! This setup program will install Debian on to your system."
#: routes.py:28
msgid "Please confirm the following details:"
msgstr "Please confirmen the following details:"
#: routes.py:29
msgid "Language:"
msgstr "Language:"
#: routes.py:30
msgid "Keyboard Layout:"
msgstr "Keyboard Layout:"
#: routes.py:31
msgid "Time Zone:"
msgstr "Time Zone:"

Binary file not shown.

View File

@@ -0,0 +1,33 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-15 21:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: UTF-8\n"
#: routes.py:27
msgid "Welcome! This setup program will install Debian on to your system."
msgstr "Bienvienue! This setup program will install Debian on to your system."
#: routes.py:28
msgid "Please confirm the following details:"
msgstr "Please confirmen the following details:"
#: routes.py:29
msgid "Language:"
msgstr "Language:"
#: routes.py:30
msgid "Keyboard Layout:"
msgstr "Keyboard Layout:"
#: routes.py:31
msgid "Time Zone:"
msgstr "Time Zone:"

View File

@@ -0,0 +1,38 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-15 21:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: routes.py:27
msgid "Welcome! This setup program will install Debian on to your system."
msgstr ""
#: routes.py:28
msgid "Please confirm the following details:"
msgstr ""
#: routes.py:29
msgid "Language:"
msgstr ""
#: routes.py:30
msgid "Keyboard Layout:"
msgstr ""
#: routes.py:31
msgid "Time Zone:"
msgstr ""

View File

@@ -1,12 +1,21 @@
from applets.welcome import bp from applets.welcome import bp
from flask import Flask, request, session, redirect, \ from flask import Flask, request, session, redirect, \
url_for, render_template, flash, Blueprint url_for, render_template, flash, Blueprint
# we use this neat little trick to get config data from the main app
from flask import current_app
import gettext import gettext
import dmm.lsblk as lsblk import dmm.lsblk as lsblk
# Set up Gettext # Set up Gettext
en_i18n = gettext.translation("welcome", './locales', fallback=True, languages=['af', 'en']) def set_language(LANG):
en_i18n.install() """
Sets language for this applet
"""
translations = gettext.translation("welcome", './applets/welcome/locales',
fallback=True, languages=[LANG])
translations.install()
_ = translations.gettext
@bp.route('/welcome',methods=['GET', 'POST', 'PUT']) @bp.route('/welcome',methods=['GET', 'POST', 'PUT'])
def welcome_index(): def welcome_index():
@@ -14,9 +23,46 @@ def welcome_index():
The page you'd get if you access the root of The page you'd get if you access the root of
this app in a browser. this app in a browser.
""" """
set_language(current_app.config['CONFIG']['settings']['language'])
if request.method == 'POST':
if "lang" in request.form.keys():
current_app.config['CONFIG']['settings']['language'] = request.form["lang"]
LANG = current_app.config['CONFIG']['settings']['language']
set_language(LANG)
FORMLANG = request.form["lang"]
if "keyboard" in request.form.keys():
print(request.form["keyboard"])
if "timezone" in request.form.keys():
print(request.form["timezone"])
global lang
lang = current_app.config['CONFIG']['settings']['language']
blkid = lsblk.list_scsi_devices() blkid = lsblk.list_scsi_devices()
string_dict = build_stringlist() string_dict = build_stringlist()
return render_template('welcome.html', string_dict=string_dict) build_menu()
build_summary()
menu = current_app.config['CONFIG']['settings']['menu_order'].split(" ")
next_step_url = menu[menu.index("welcome")+1]
previous_step_url = menu[menu.index("welcome")-1]
print("index is: " , menu.index("welcome"))
if menu.index("welcome") == 0:
previous_step_url = False
else:
previous_step_url = menu[menu.index("users")-1]
print("next is: " + next_step_url)
print("previous is: " , previous_step_url)
power_button = '<button class="button is-dark"> <img width="16px;" src="/static/icons/greencheck.png"> &nbsp; Power: AC </button>'
internet_button = '&nbsp; <button class="button is-dark"> <img width="16px;" src="/static/icons/greencheck.png"> &nbsp; Internet </button>'
bottom_menu = power_button + internet_button
return render_template('welcome.html',
string_dict=string_dict, selected_lang=lang,
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,
bottom_menu=bottom_menu)
def build_stringlist(): def build_stringlist():
@@ -24,10 +70,43 @@ def build_stringlist():
Return all the strings that is used in this applet." Return all the strings that is used in this applet."
""" """
string_dict = {} string_dict = {}
string_dict['menu_item'] = _("Welcome")
string_dict['welcome_text'] = _("Welcome! This setup program will install Debian on to your system.") string_dict['welcome_text'] = _("Welcome! This setup program will install Debian on to your system.")
string_dict['confirm_text'] = _("Please confirm the following details:") string_dict['confirm_text'] = _("Please confirm the following details:")
string_dict['language_text'] = _("Language:") string_dict['language_text'] = _("Language:")
string_dict['keylayout_text'] = _("Keyboard Layout:") string_dict['keylayout_text'] = _("Keyboard Layout:")
string_dict['timezone_text'] = _("Time Zone:") string_dict['timezone_text'] = _("Time Zone:")
string_dict['basicsettings_text'] = _("Basic Settings:")
lang_dict = {}
lang_dict['af'] = _("Afrikaans")
lang_dict['en'] = _("English (International)")
lang_dict['en-us'] = _("English (United States)")
lang_dict['en-uk'] = _("English (United Kingdom)")
lang_dict['en-za'] = _("English (South Africa)")
string_dict['lang_list'] = lang_dict
return string_dict return string_dict
def build_menu():
"""
Define menu items and paths.
"""
current_app.config['CONFIG']['settings']['menu']['welcome'] = (build_stringlist()['menu_item'], "/welcome", 10)
def build_summary():
"""
Write up a summary of what this module will do.
"""
html = ("<b><big>Basic settings</big></b><p> Language: " + lang + "</p>")
if not 'Summary' in current_app.config['CONFIG']:
current_app.config['CONFIG']['Summary'] = {}
current_app.config['CONFIG']['Summary']['welcome'] = {}
current_app.config['CONFIG']['Summary']['welcome']['heading'] = "Basic Settings"
print(current_app.config['CONFIG']['Summary']['welcome'])
text = "Language: " + str(current_app.config['CONFIG']['settings']['language'])
current_app.config['CONFIG']['Summary']['welcome']['text'] = text
return(html)
set_language(current_app.config['CONFIG']['settings']['language'])
build_menu

View File

@@ -1,45 +1,55 @@
{% extends "layout.html" %} {% extends "layout.html" %}
{% block body %} {% block body %}
<img style="top: 10px; width: 100%;" src="/static/applets/welcome/img/banner.png" alt="Debian Image banner" /> <img style="width: 100%; border-radius: 8px;"
<p><b> {{ string_dict['welcome_text'] }} </b></p> src="/static/applets/welcome/img/banner.png"
<p>{{ string_dict['confirm_text'] }} </p> alt="Debian Image banner" />
<img src="/static/icons/keyboard.svg" /> {{ string_dict['language_text'] }} <p><b> {{ string_dict['welcome_text'] }} </b></p>
<p>{{ string_dict['confirm_text'] }} </p> <br />
<div style="padding-left: 15px;">
<form action="/welcome" method="POST">
<i class="fa fa-language" aria-hidden="true"></i> {{ string_dict['language_text'] }}
<div class="control is-link" width="180px"> <div class="control is-link" width="180px">
<div class="select"> <div class="select">
<select style="width: 180px"> <select hx-post="/welcome" hx-target="body" name="lang" style="width: 220px">
<option>English</option> {% for lang in string_dict['lang_list'] %}
<option>Afrikaans</option> <option value="{{lang}}" {% if lang == selected_lang %} selected=selected {% endif %}>{{ string_dict['lang_list'][lang] }}</option>
{% endfor %}
</select> </select>
</div> </div>
</div> </div>
</form>
<br> <br>
<img src="/static/icons/keyboard.svg" /> {{ string_dict['keylayout_text'] }} <form>
<i class="fa fa-keyboard-o" aria-hidden="true"></i> {{ string_dict['keylayout_text'] }}
<div class="control is-link"> <div class="control is-link">
<div class="select"> <div class="select">
<select style="width: 180px"> <select hx-post="/welcome" hx-target="body" name="keyboard" style="width: 220px">
<option>en-us</option> <option>en-us</option>
<option>en-uk</option> <option>en-uk</option>
</select> </select>
</div> </div>
</div> </div>
</form>
<br /> <br />
<img src="/static/icons/keyboard.svg" /> {{ string_dict['timezone_text'] }} <form>
<i class="fa fa-clock-o" aria-hidden="true"></i> {{ string_dict['timezone_text'] }}
<div class="control is-link"> <div class="control is-link">
<div class="select"> <div class="select">
<select style="width: 180px"> <select hx-post="/welcome" hx-target="body" name="timezone" style="width: 220px">
<option>Africa/Johannesburg</option> <option>Africa/Johannesburg</option>
<option>UTC</option> <option>UTC</option>
</select> </select>
</div> </div>
</div> </div>
</form>
</div>
</div> </div>
</div> </div>

View File

@@ -0,0 +1 @@
../../../applets/welcome/img

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/static/icons/gnome.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
src/static/icons/kde.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -1 +1,53 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><g font-weight="400" fill="#474747"><path d="M3.702 1C2.17 1 .984 2.32.984 3.844v8.344c0 1.524 1.185 2.843 2.718 2.843h8.58c1.532 0 2.75-1.32 2.75-2.844V3.845c0-1.525-1.218-2.844-2.75-2.844zm.782 1.031c3.526.256 5.317.134 7.047 0 .754-.058 1.532.616 1.532 1.438v7.375c0 .665-.532 1.095-1.188 1.187-2.836.397-4.753.44-7.673 0-.655-.099-1.187-.522-1.187-1.187V3.5c0-.822.714-1.524 1.469-1.469z" style="line-height:normal;-inkscape-font-specification:'Bitstream Vera Sans';text-indent:0;text-align:start;text-decoration-line:none;text-transform:none;marker:none" color="#bebebe" font-family="Bitstream Vera Sans" overflow="visible"/><path d="M10.564 5.977l-2.939.044.016 1 2.879-.043c.2.018.33.076.396.135.067.06.105.121.105.293l-.008.604H8.517l.037.002a1.457 1.457 0 00-1.164.43 1.558 1.558 0 00-.416 1.023c-.013.367.092.75.352 1.053.26.303.687.496 1.162.482h3.482l.051-3.59v-.004c0-.402-.16-.786-.435-1.035-.276-.249-.63-.364-.998-.393zM8.48 9.01h2.519l-.014.99H8.457c-.22.007-.302-.051-.371-.133a.553.553 0 01-.112-.367.587.587 0 01.141-.371c.079-.083.163-.134.363-.12zm2.862-5.985l-3 1 .316.95 3-1z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;shape-padding:0;isolation:auto;mix-blend-mode:normal;marker:none" color="#000" font-family="sans-serif" overflow="visible"/></g></svg> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="16"
height="16"
version="1.1"
id="svg2"
sodipodi:docname="keyboard.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">
<defs
id="defs2" />
<sodipodi:namedview
id="namedview2"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="52.375"
inkscape:cx="8"
inkscape:cy="8"
inkscape:window-width="1236"
inkscape:window-height="1041"
inkscape:window-x="662"
inkscape:window-y="199"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<g
font-weight="400"
fill="#474747"
id="g2"
style="fill:#c0bfbc">
<path
d="M3.702 1C2.17 1 .984 2.32.984 3.844v8.344c0 1.524 1.185 2.843 2.718 2.843h8.58c1.532 0 2.75-1.32 2.75-2.844V3.845c0-1.525-1.218-2.844-2.75-2.844zm.782 1.031c3.526.256 5.317.134 7.047 0 .754-.058 1.532.616 1.532 1.438v7.375c0 .665-.532 1.095-1.188 1.187-2.836.397-4.753.44-7.673 0-.655-.099-1.187-.522-1.187-1.187V3.5c0-.822.714-1.524 1.469-1.469z"
style="line-height:normal;-inkscape-font-specification:'Bitstream Vera Sans';text-indent:0;text-align:start;text-decoration-line:none;text-transform:none;marker:none;fill:#c0bfbc"
color="#bebebe"
font-family="Bitstream Vera Sans"
overflow="visible"
id="path1" />
<path
d="M10.564 5.977l-2.939.044.016 1 2.879-.043c.2.018.33.076.396.135.067.06.105.121.105.293l-.008.604H8.517l.037.002a1.457 1.457 0 00-1.164.43 1.558 1.558 0 00-.416 1.023c-.013.367.092.75.352 1.053.26.303.687.496 1.162.482h3.482l.051-3.59v-.004c0-.402-.16-.786-.435-1.035-.276-.249-.63-.364-.998-.393zM8.48 9.01h2.519l-.014.99H8.457c-.22.007-.302-.051-.371-.133a.553.553 0 01-.112-.367.587.587 0 01.141-.371c.079-.083.163-.134.363-.12zm2.862-5.985l-3 1 .316.95 3-1z"
style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;shape-padding:0;isolation:auto;mix-blend-mode:normal;marker:none;fill:#c0bfbc"
color="#000"
font-family="sans-serif"
overflow="visible"
id="path2" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
src/static/icons/lxde.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/static/icons/mate.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
src/static/icons/xfce.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -1,4 +0,0 @@
mem()
{
ps -eo rss,pid,euser,args:100 --sort %mem | grep -v grep | grep -i $@ | awk '{printf $1/1024 "MB"; $1=""; print }'
}

View File

@@ -0,0 +1,37 @@
html {
/* Overwrite the white that is set by bulma.css */
body {
display: flex;
font-family: Noto Sans;
color: white;
overflow: hidden;
min-width: 1050px;
min-height: 600px;
}
.frame {
border-radius: 10px;
background-color: #0f1933;
padding: 15px 15px 15px 15px;
width: 100%;
min-height: 600px;
position: absolute;
top: 0px;
bottom: 0px;
}
.applet a:link a:hover a:active {
color: yellow;
}
.applet {
width: 100%;
height: 470px;
bottom: 0px;
overflow-y: scroll;
overflow-x: hidden;
}
.radio:hover {
color: #f1f1f1;
}

View File

@@ -0,0 +1,41 @@
html {
/* Overwrite the white that is set by bulma.css */
background: transparent;
}
body {
display: flex;
font-family: Sans; Roboto; Lato; Noto Sans;
color: white;
overflow: hidden;
min-width: 1050px;
min-height: 600px;
}
html, body {margin: 0; height: 100%; overflow: hidden;}
.frame {
border-radius: 10px;
background-color: #404040;
padding: 15px 15px 15px 15px;
width: 100%;
min-height: 600px;
position: absolute;
top: 0px;
bottom: 0px;
}
.applet a:link a:hover a:active {
color: yellow;
}
.applet {
width: 100%;
height: 442px;
overflow-y: scroll;
overflow-x: hidden;
}
.radio:hover {
color: #f1f1f1;
}

View File

@@ -0,0 +1,37 @@
html {
/* Overwrite the white that is set by bulma.css */
background-color: transparent;
}
body {
display: flex;
font-family: Noto Sans;
color: white;
overflow: hidden;
min-width: 1050px;
min-height: 600px;
}
.frame {
border-radius: 10px;
background-color: #e9e8e4;
padding: 15px;
max-width: 1050px;
}
.applet a:link a:hover a:active {
color: yellow;
}
.applet {
color: #383838;
width: 1040px;
height: 470px;
overflow-y: scroll;
overflow-x: hidden;
padding-right: 20px;
}
.radio:hover {
color: #404040;
}

View File

@@ -1,13 +0,0 @@
body {
display: flex;
font-family: Noto Sans;
min-width: 1150px;
min-height: 600px;
overflow: hidden;
}
html {
/* Overwrite the white that is set by bulma.css */
background-color: transparent;
}

View File

@@ -0,0 +1 @@
system-installer-dark.css

View File

@@ -9,25 +9,30 @@ from waitress import serve
import logging import logging
import dmm.lsblk as lsblk import dmm.lsblk as lsblk
import importlib import importlib
import yaml
# configuration # configuration
VERSION = "0.00" CONFIGFILE="templates/dmm-installer-template.yaml"
BABEL_TRANSLATION_DIRECTORIES="translations"
BABEL_DOMAIN="translations" # import config
SECRET_KEY = "exampls" global config
DEV_MODE = True config_contents = open(CONFIGFILE, "r")
APPS = "main welcome users disks software summary" config = yaml.safe_load(config_contents)
APPS = config['settings']['apps']
DEV_MODE = config['settings']['devmode']
# create our application in flask
app = Flask(__name__)
app.config.from_object(__name__)
app.config['CONFIG'] = config
app.app_context().push()
config['settings']['menu'] = {}
if DEV_MODE: if DEV_MODE:
print("Note: Starting in devmode!") print("Note: Starting in devmode!")
DEBUG = True DEBUG = True
tracebacks = True tracebacks = True
# create our application in flask
app = Flask(__name__)
app.config.from_object(__name__)
# Register blueprints here # Register blueprints here
for APP in APPS.split(" "): for APP in APPS.split(" "):
print(f"Loading applet: {APP} ") print(f"Loading applet: {APP} ")

View File

@@ -2,7 +2,7 @@
import webview import webview
LOCATION = "http://10.10.99.22:8080/welcome" LOCATION = "http://localhost:8080/welcome"
def on_closed(): def on_closed():
""" """
@@ -14,7 +14,7 @@ def on_closed():
window = webview.create_window('System Installer', LOCATION, window = webview.create_window('System Installer', LOCATION,
transparent=True, easy_drag=False, frameless=True, transparent=True, easy_drag=False, frameless=True,
width=1050, focus=True, zoomable=True, width=1050, focus=True, zoomable=True,
confirm_close=True) confirm_close=True, resizable=True)
window.events.closed += on_closed window.events.closed += on_closed
webview.start() webview.start()

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env dmm-perform-recipe
module_path:
- local
settings:
language: en
devmode: True
apt_depends: util-linux adduser parted e2fsprogs debootstrap
apps: main welcome users disks software summary install
menu_order: welcome users disks software summary
recipe:
installer_dependencies:
description: Installing Dependencies
module: aptpkg
function: install
packagooes: apt
chrooti: /tmp
users:
module: users
function: add
users:
- username:
password:
fullname:
sudo: True
popcon:
module: software
function: popcon
enable_popcon: False

24
src/templates/footer.html Normal file
View File

@@ -0,0 +1,24 @@
<!-- Buttons on the left -->
<div style="position: absolute; bottom: 15px; left: 15px;">
{% if previous_step %}
<a href="/{{ previous_step }}"><button class="button is-light">Back</button></a>
{% endif %}
{% if bottom_menu %}
{{ bottom_menu | safe }}
{% endif %}
</div>
<!-- Buttons on the right -->
<div style="position: absolute; bottom: 15px; right: 15px;">
{% if next_step %}
{% if next_step == "install" %}
<a href="/{{ next_step }}"><button hx-trigger="click, keyup[shiftKey&&key=='I'] from:body" class="button is-link">Install</button></a>
{% else %}
<a href="/{{ next_step }}"><button hx-trigger="click, keyup[shiftKey&&key=='N'] from:body" hx-target="/{{ next_step }}" class="button is-link">Next</button></a>
{% endif %}
{% endif %}
</div>

View File

@@ -1,14 +1,20 @@
<!-- Header --> <!-- Header -->
<div id="titlebar" class="pywebview-drag-region" style="padding-bottom: 10px;"> <div id="titlebar" style="padding: 15px; margin: -15px; padding-bottom: 30px;">
<span>
<button class="button is-link"></button> <!-- drag region class: -->
<a href="/welcome"><button class="button is-{% if request.path == "/welcome" %}info{% else %}dark{% endif %}">Welcome</button></a> <!-- <div id="titlebar" class="pywebview-drag-region" style="padding: 15px; margin: -15px; padding-bottom: 30px;"> -->
<a href="/users"><button class="button is-{% if request.path == "/users" %}info{% else %}dark{% endif %}">Users</button></a>
<a href="/disks"><button class="button is-{% if request.path == "/disks" %}info{% else %}dark{% endif %}">Disks</button></a> <button class="button is-link"></button>
<a href="/software"><button class="button is-{% if request.path == "/software" %}info{% else %}dark{% endif %}">Software</button></a>
<a href="/summary"><button class="button is-{% if request.path == "/summary" %}info{% else %}dark{% endif %}">Summary</button></a> {% for item in menu_order %}
<button onclick="closeApp()" class="button is-danger" style="float: right;"> 🗙 </button> <a href="{{ menu[item][1]}}"> <button class="button is-{% if request.path == menu[item][1] %}info{% else %}dark{% endif %}"> {{ menu[item][0]}} </button></a>
<a href="/help"> <button class="button is-light" style="float: right; margin-right: 5px;"> <b> ? </b> </button></a> {% endfor %}
</span>
<div style="position: absolute; top: 15px; right: 15px;">
<a href="/help"> <button class="button is-light"> <b> ? </b> </button></a>
<button onclick="closeApp()" class="button is-danger" > 🗙 </button>
</div>
</div> <!-- end pywebview-drag-region --> </div> <!-- end pywebview-drag-region -->
<!-- End Header --> <!-- End Header -->

View File

@@ -5,20 +5,24 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/static/bulma.css" rel="stylesheet"> <link href="/static/bulma.css" rel="stylesheet">
<link href="/static/system-installer.css" rel="stylesheet"> <link href="/static/system-installer.css" rel="stylesheet">
<link rel="shortcut icon" href="/static/icons/blippie.png" type="image/x-icon">
<link rel="stylesheet" href="/usr/share/fonts-fork-awesome/css/fork-awesome.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/css/fork-awesome.min.css" integrity="sha256-XoaMnoYC5TH6/+ihMEnospgm0J1PM/nioxbOUdnM8HY=" crossorigin="anonymous">
<script src="/static/htmx.min.js" crossorigin="anonymous"></script> <script src="/static/htmx.min.js" crossorigin="anonymous"></script>
</head> </head>
<body style="overflow: hidden; max-height: 450px;"> <body>
<div style="width: 1050px; height: 600px; border-radius: 10px; padding: 13px; overflow: hidden;" class="notification is-dark">
<div class="frame">
{% include "header.html" %} {% include "header.html" %}
<div style="height: 450px; overflow-y: scroll"> <div class="applet">
{% block body %} {% block body %}
{% endblock %} {% endblock %}
</div> </div>
{% include "footer.html" %} {% include "footer.html" %}
</div> <!-- class "frame" -->
</body> </body>
</html> </html>