Move files to actual applets
This commit is contained in:
7
src/applets/disks/__init__.py
Normal file
7
src/applets/disks/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from flask import Blueprint
|
||||
|
||||
bp = Blueprint('disks', __name__,
|
||||
template_folder='')
|
||||
|
||||
from applets.disks import routes
|
||||
|
||||
108
src/applets/disks/disks.html
Normal file
108
src/applets/disks/disks.html
Normal file
@@ -0,0 +1,108 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<h1 class="is-size-3"> Disks and Partitions </h1>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><a href="/welcome">Welcome</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li class="is-active"><a href="/disks">Disks</a></li>
|
||||
<li><a href="/software">Software</a></li>
|
||||
<li><a href="/summary">Summary</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<p> How would you like to install Debian?</p>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="radios">
|
||||
<label class="radio">
|
||||
<input type="radio" name="rsvp" />
|
||||
Erase entire disk
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="rsvp" />
|
||||
Install alongside another operating system
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="rsvp" disabled />
|
||||
Define your own disk and partitioning setup
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<p> Proposed layout: </p>
|
||||
<br>
|
||||
|
||||
<div style="background-color: gray; padding: 15px; border-radius: 15px;">
|
||||
<p> <span style="width: 100%;" class="tag is-black">Physical disk: TOSHIBA HDWD120 (2000 GB)<span class="tag is-primary">Healthy</span></span> </p>
|
||||
<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>
|
||||
<a hx-get="/disks/partition/sda" hx-swap="outerHTML"/>
|
||||
<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>
|
||||
|
||||
<br><br>
|
||||
|
||||
<div style="background-color: gray; padding: 15px; border-radius: 15px;">
|
||||
<p> <span style="width: 100%;" class="tag is-black">Physical disk: TOSHIBA HDWD120 (2000 GB)<span class="tag is-primary">Healthy</span></span> </p>
|
||||
<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>
|
||||
<a hx-get="/disks/partition/sda" hx-swap="outerHTML"/>
|
||||
<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>
|
||||
|
||||
<br><br>
|
||||
|
||||
<div class="columns">
|
||||
<div class="column"><button class="button is-light">Cancel</button></div>
|
||||
<a href="/software"><div class="column"><button class="button is-link">Continue</button></div></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<br><br>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
88
src/applets/disks/disks_partition.html
Normal file
88
src/applets/disks/disks_partition.html
Normal file
@@ -0,0 +1,88 @@
|
||||
<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"> Edit partition: /dev/sda2 </h1>
|
||||
<p class="title is-6"><span class="tag is-black">Primary Partition</span>
|
||||
|
||||
<span>
|
||||
<p>Select usage: <div class="control is-link">
|
||||
<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>Swap partition</option>
|
||||
<option>Do not configure</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<p>Select Mount Point: <div class="control is-link">
|
||||
<div class="select">
|
||||
<select>
|
||||
<option>/</option>
|
||||
<option>/usr</option>
|
||||
<option>/var</option>
|
||||
<option>Other...</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<p>Select Filesystem: <div class="control is-link">
|
||||
<div class="select">
|
||||
<select>
|
||||
<option is-active>btrfs</option>
|
||||
<option>ext4</option>
|
||||
<option>ext3</option>
|
||||
<option>ext2</option>
|
||||
<option>xfs</option>
|
||||
<option>jfs</option>
|
||||
<option>ntfs</option>
|
||||
<option>vfat</option>
|
||||
<option>nfs</option>
|
||||
<option>nbd</option>
|
||||
<option>samba</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</p>
|
||||
|
||||
|
||||
<div class="checkboxes">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" />
|
||||
noatime
|
||||
</label>
|
||||
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" />
|
||||
nodiratime
|
||||
</label>
|
||||
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" />
|
||||
discard
|
||||
</label>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<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>
|
||||
21
src/applets/disks/routes.py
Normal file
21
src/applets/disks/routes.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from applets.disks import bp
|
||||
from flask import Flask, request, session, redirect, \
|
||||
url_for, render_template, flash, Blueprint
|
||||
import dmm.lsblk as lsblk
|
||||
|
||||
@bp.route('/disks/')
|
||||
def disks():
|
||||
"""
|
||||
Disks screen for the webui.
|
||||
"""
|
||||
return render_template('disks.html')
|
||||
|
||||
|
||||
@bp.route('/disks/partition/<part>')
|
||||
def disks_partition(part):
|
||||
"""
|
||||
Partition modal for the webui partition screen.
|
||||
"""
|
||||
return render_template('disks_partition.html')
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from flask import Blueprint
|
||||
|
||||
bp = Blueprint('main', __name__)
|
||||
bp = Blueprint('main', __name__,
|
||||
template_folder='')
|
||||
|
||||
from applets.main import routes
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
7
src/applets/software/__init__.py
Normal file
7
src/applets/software/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from flask import Blueprint
|
||||
|
||||
bp = Blueprint('software', __name__,
|
||||
template_folder='')
|
||||
|
||||
from applets.software import routes
|
||||
|
||||
11
src/applets/software/routes.py
Normal file
11
src/applets/software/routes.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from applets.software import bp
|
||||
from flask import Flask, request, session, redirect, \
|
||||
url_for, render_template, flash, Blueprint
|
||||
|
||||
|
||||
@bp.route('/software')
|
||||
def webui_software():
|
||||
"""
|
||||
Software screen for the webui.
|
||||
"""
|
||||
return render_template('software.html')
|
||||
39
src/applets/software/software.html
Normal file
39
src/applets/software/software.html
Normal file
@@ -0,0 +1,39 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<h1 class="is-size-3"> Select Software </h1>
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><a href="/welcome">Welcome</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/disks">Disks</a></li>
|
||||
<li class="is-active"><a href="/software">Software</a></li>
|
||||
<li><a href="/summary">Summary</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<p> Would you like fries with that?</p>
|
||||
|
||||
<br>
|
||||
|
||||
<ul>
|
||||
<li>Desktop environment</li>
|
||||
<li>Server software</li>
|
||||
</ul>
|
||||
<br><br>
|
||||
|
||||
<div class="columns">
|
||||
<div class="column"><button class="button is-light">Back</button></div>
|
||||
<a href="./summary"><div class="column"><button class="button is-link">Next</button></div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
7
src/applets/summary/__init__.py
Normal file
7
src/applets/summary/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from flask import Blueprint
|
||||
|
||||
bp = Blueprint('summary', __name__,
|
||||
template_folder='')
|
||||
|
||||
from applets.summary import routes
|
||||
|
||||
13
src/applets/summary/routes.py
Normal file
13
src/applets/summary/routes.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from applets.summary import bp
|
||||
from flask import Flask, request, session, redirect, \
|
||||
url_for, render_template, flash, Blueprint
|
||||
|
||||
@bp.route('/summary',methods=['GET', 'POST', 'PUT'])
|
||||
def summary_index():
|
||||
"""
|
||||
The page you'd get if you access the root of
|
||||
this app in a browser.
|
||||
"""
|
||||
return render_template('summary.html')
|
||||
|
||||
|
||||
48
src/applets/summary/summary.html
Normal file
48
src/applets/summary/summary.html
Normal file
@@ -0,0 +1,48 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="/static/bulma.css" rel="stylesheet">
|
||||
<link href="/static/welcome.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="bg"></div>
|
||||
|
||||
<div style="min-height: 80%; left: 22%; right: 22%; top: 50px; bottom: 50px; position: absolute; width:1000px;" class="container">
|
||||
<div class="notification is-dark">
|
||||
|
||||
<h1 class="is-size-3"> Summary </h1>
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><a href="./welcome">Welcome</a></li>
|
||||
<li><a href="./users">Users</a></li>
|
||||
<li><a href="./disks">Disks</a></li>
|
||||
<li><a href="./software">Software</a></li>
|
||||
<li class="is-active"><a href="./summary">Summary</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<p> Ready to install.</p>
|
||||
|
||||
<br>
|
||||
|
||||
<br><br>
|
||||
|
||||
<div class="columns">
|
||||
<div class="column"><button class="button is-light">Back</button></div>
|
||||
<a href="./install"><div class="column"><button class="button is-link">Start Install</button></div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
7
src/applets/users/__init__.py
Normal file
7
src/applets/users/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from flask import Blueprint
|
||||
|
||||
bp = Blueprint('users', __name__,
|
||||
template_folder='')
|
||||
|
||||
from applets.users import routes
|
||||
|
||||
11
src/applets/users/routes.py
Normal file
11
src/applets/users/routes.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from applets.software import bp
|
||||
from flask import Flask, request, session, redirect, \
|
||||
url_for, render_template, flash, Blueprint
|
||||
|
||||
|
||||
@bp.route('/users')
|
||||
def users_root():
|
||||
"""
|
||||
Users screen for the webui.
|
||||
"""
|
||||
return render_template('users.html')
|
||||
83
src/applets/users/users.html
Normal file
83
src/applets/users/users.html
Normal file
@@ -0,0 +1,83 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="/static/bulma.css" rel="stylesheet">
|
||||
<link href="/static/welcome.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="bg"></div>
|
||||
|
||||
<div style="min-height: 80%; left: 22%; right: 22%; top: 50px; bottom: 50px; position: absolute; width:1000px;" class="container">
|
||||
<div class="notification is-dark">
|
||||
|
||||
<h1 class="is-size-3"> Configure User </h1>
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><a href="./welcome">Welcome</a></li>
|
||||
<li class="is-active"><a href="./users">Users</a></li>
|
||||
<li><a href="./disks">Disks</a></li>
|
||||
<li><a href="./software">Software</a></li>
|
||||
<li><a href="./summary">Summary</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<p> Let's set up an initial user.</p>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="field">
|
||||
<label>Full Name</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" placeholder="Text input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<i class="fas fa-user"></i>
|
||||
</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 class="field">
|
||||
<label class="password">Password (confirm)</label>
|
||||
<div class="control">
|
||||
<input class="input" type="password" placeholder="Enter password (confirm)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
<div class="columns">
|
||||
<div class="column"><button class="button is-light">Back</button> <button class="button is-light">Connect Active Directory</button> <button class="button is-light">Connect LDAP</button></div>
|
||||
<a href="./disks"><div class="column"><button class="button is-link">Next</button></div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,7 @@
|
||||
from flask import Blueprint
|
||||
|
||||
bp = Blueprint('welcome', __name__)
|
||||
bp = Blueprint('welcome', __name__,
|
||||
template_folder='')
|
||||
|
||||
from applets.welcome import routes
|
||||
|
||||
|
||||
@@ -21,11 +21,3 @@ def welcome2_index():
|
||||
return ("Changins some text in our htmx front-end")
|
||||
|
||||
|
||||
|
||||
@bp.route('/api/')
|
||||
def api_home():
|
||||
"""
|
||||
Wel
|
||||
"""
|
||||
return ("Welcome to the welcome API")
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
test:
|
||||
93
src/applets/welcome/welcome.html
Normal file
93
src/applets/welcome/welcome.html
Normal file
@@ -0,0 +1,93 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="/static/bulma.css" rel="stylesheet">
|
||||
<link href="/static/welcome.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="bg"></div>
|
||||
|
||||
|
||||
<div style="min-height: 80%; left: 22%; right: 22%; top: 50px; bottom: 50px; position: absolute; width:1000px;" class="container">
|
||||
<div class="notification is-dark">
|
||||
|
||||
<h1 class="is-size-3"> Welcome to System Installer </h1>
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li class="is-active"><a href="./welcome">Welcome</a></li>
|
||||
<li><a href="./users">Users</a></li>
|
||||
<li><a href="./disks">Disks</a></li>
|
||||
<li><a href="./software">Software</a></li>
|
||||
<li><a href="./summary">Summary</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<p> Welcome! This setup program will install Debian on to your system.</p>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="columns">
|
||||
|
||||
<div class="column">
|
||||
<img src="/static/icons/keyboard.svg" width="180px" />
|
||||
<div class="control is-link">
|
||||
<div class="select">
|
||||
<select>
|
||||
<option>English</option>
|
||||
<option>Afrikaans</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div
|
||||
|
||||
<br>
|
||||
|
||||
<div class="column">
|
||||
<img src="/static/icons/keyboard.svg" width="180px" />
|
||||
<div class="control is-link">
|
||||
<div class="select">
|
||||
<select>
|
||||
<option>en-us</option>
|
||||
<option>en-uk</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="column">
|
||||
<img src="/static/icons/keyboard.svg" width="180px" />
|
||||
<div class="control is-link">
|
||||
<div class="select">
|
||||
<select>
|
||||
<option>Africa/Johannesburg</option>
|
||||
<option>UTC</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!-- end columns -->
|
||||
|
||||
<br><br><br><br><br><br>
|
||||
|
||||
<div class="columns">
|
||||
<div class="column"><button class="button is-light">Quit</button></div>
|
||||
<a href="./users"><div class="column"><button class="button is-link">Next</button></div></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user