Refactor into module
Add Dockerfile with kluges Update portfolio
This commit is contained in:
parent
2be144c378
commit
53895b6f65
9 changed files with 37 additions and 8 deletions
9
Dockerfile
Normal file
9
Dockerfile
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
FROM python:3.12-bookworm
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
COPY site_mcknight_tech /site
|
||||||
|
COPY requirements.txt /tmp/requirements.txt
|
||||||
|
RUN pip install -r /tmp/requirements.txt
|
||||||
|
|
||||||
|
ENTRYPOINT [ "python3", "/site/__main__.py" ]
|
1
requirements.txt
Normal file
1
requirements.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
nicegui~=2.10
|
0
site_mcknight_tech/__init__.py
Normal file
0
site_mcknight_tech/__init__.py
Normal file
15
__main__.py → site_mcknight_tech/__main__.py
Normal file → Executable file
15
__main__.py → site_mcknight_tech/__main__.py
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
||||||
from os.path import abspath, isfile
|
# Copyright (C) 2025 Daniel McKnight - All Rights Reserved
|
||||||
|
|
||||||
|
from os.path import isfile, join, dirname
|
||||||
from nicegui import ui
|
from nicegui import ui
|
||||||
|
|
||||||
_tab_to_content = {
|
_tab_to_content = {
|
||||||
|
@ -16,9 +17,10 @@ def _get_content_from_file(file_name: str) -> str:
|
||||||
Take a file name/path and return its contents
|
Take a file name/path and return its contents
|
||||||
:param file_name: Relative or absolute path to a file
|
:param file_name: Relative or absolute path to a file
|
||||||
"""
|
"""
|
||||||
if not isfile(abspath(file_name)):
|
file_name = join(dirname(__file__), file_name)
|
||||||
|
if not isfile(file_name):
|
||||||
file_name = _error_page
|
file_name = _error_page
|
||||||
with open(abspath(file_name), 'r') as f:
|
with open(file_name, 'r') as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
def render_tab(tab_name: str):
|
def render_tab(tab_name: str):
|
||||||
|
@ -32,11 +34,11 @@ def render_header() -> ui.tab_panels:
|
||||||
"""
|
"""
|
||||||
tab_names = _tab_to_content.keys()
|
tab_names = _tab_to_content.keys()
|
||||||
with ui.tabs().classes('w-full') as tabs:
|
with ui.tabs().classes('w-full') as tabs:
|
||||||
tab_list = [ui.tab(name) for name in tab_names]
|
tab_list = {name: ui.tab(name) for name in tab_names}
|
||||||
with ui.tab_panels(tabs).classes('w-full') as header:
|
with ui.tab_panels(tabs).classes('w-full') as header:
|
||||||
for t in tab_list:
|
for name, t in tab_list.items():
|
||||||
with ui.tab_panel(t):
|
with ui.tab_panel(t):
|
||||||
render_tab(t._props['name'])
|
render_tab(name)
|
||||||
return header
|
return header
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -45,5 +47,4 @@ def main():
|
||||||
ui.run(dark=None)
|
ui.run(dark=None)
|
||||||
|
|
||||||
|
|
||||||
if __name__ in ("__main__", "__mp_main__"):
|
|
||||||
main()
|
main()
|
|
@ -2,6 +2,13 @@
|
||||||
I have developed and contributed to hundreds of open source repositories on GitHub (as well as some Private ones that
|
I have developed and contributed to hundreds of open source repositories on GitHub (as well as some Private ones that
|
||||||
I cannot share here). This is just a selection of some of my favorite projects and what I like about them.
|
I cannot share here). This is just a selection of some of my favorite projects and what I like about them.
|
||||||
|
|
||||||
|
## Neon Core
|
||||||
|
This is the primary project I contributed to as part of my work at NeonGecko. It started as work with the (now defunct)
|
||||||
|
open source Mycroft AI project, turned into a proprietary fork, and then we ended up open sourcing that fork. Working on
|
||||||
|
this project, I learned a lot about contributing to open source and managing open source projects. At the start, I learned
|
||||||
|
how to be a helpful individual contributor, and later I was on the other side, learning how to interface with the community
|
||||||
|
to balance internal goals with community feedback.
|
||||||
|
|
||||||
## `neon-data-models`
|
## `neon-data-models`
|
||||||
This repository contains barely any functional code, but it was an exercise in careful planning.
|
This repository contains barely any functional code, but it was an exercise in careful planning.
|
||||||
It is structured into a logical hierarchy with documentation and unit tests.
|
It is structured into a logical hierarchy with documentation and unit tests.
|
||||||
|
@ -25,6 +32,17 @@ This isn't the prettiest project, but it is my first foray into writing Helm cha
|
||||||
developer-oriented CLI tools for generating Helm charts to deploy the same services NeonGecko uses in production
|
developer-oriented CLI tools for generating Helm charts to deploy the same services NeonGecko uses in production
|
||||||
systems.
|
systems.
|
||||||
|
|
||||||
|
## `neon-debos`
|
||||||
|
This project was my first foray into Go templates. It started as a fork of another similar project which I adapted to
|
||||||
|
our needs. As part of this project, I used squashfs/overlayfs to enable safe OS updates with methods to roll-back or
|
||||||
|
reset an installation in case of any errors. To support this, I compiled custom kernels and implemented a customized
|
||||||
|
initramfs.
|
||||||
|
|
||||||
|
## `.github`
|
||||||
|
This repository contains a number of shared GitHub Actions, in addition to the standard issue templates and other special
|
||||||
|
files GitHub supports here. Creating this repository was part of an effort to consolidate code and make sprawling
|
||||||
|
repositories more manageable.
|
||||||
|
|
||||||
## `neon-docs`
|
## `neon-docs`
|
||||||
Just what it says, this is all documentation.
|
Just what it says, this is all documentation.
|
||||||
|
|
Loading…
Reference in a new issue