Skip to content

Commit

Permalink
Merge pull request #2815 from chaoss/startup-wizard
Browse files Browse the repository at this point in the history
Startup wizard
  • Loading branch information
sgoggins authored Jun 10, 2024
2 parents a7d5a27 + fdc18cb commit af14944
Show file tree
Hide file tree
Showing 21 changed files with 1,070 additions and 127 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
name: Build image
runs-on: ubuntu-latest
steps:
- name: Checkout main
- name: Checkout startup-wizard
uses: actions/checkout@v2
- name: Run the build
run: |
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
default:
@ echo "Installation Commands:"
@ echo " install Installs Augur's full stack for production"
@ echo " wizard Install Augur and launch the graphical setup wizard"
@ echo " clean Removes potentially troublesome compiled files"
@ echo " rebuild Removes build/compiled files & binaries and reinstalls the project"
@ echo
Expand Down Expand Up @@ -34,6 +35,9 @@ default:
install:
@ ./scripts/install/install.sh dev

wizard:
@ ./scripts/install/install.sh graphical

install-spdx:
@ ./scripts/install/install-spdx.sh

Expand Down
2 changes: 0 additions & 2 deletions augur/api/view/server/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from .Environment import Environment
from .ServerThread import ServerThread
from .LoginException import LoginException
25 changes: 24 additions & 1 deletion augur/application/cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import json
import logging

from augur.application.db.models import Config
from augur.application.db.session import DatabaseSession
from augur.application.config import AugurConfig
from augur.application.cli import DatabaseContext, test_connection, test_db_connection, with_database
Expand Down Expand Up @@ -160,7 +161,7 @@ def add_section(ctx, section_name, file):
@click.option('--section', required=True)
@click.option('--setting', required=True)
@click.option('--value', required=True)
@click.option('--data-type', required=True)
@click.option('--data-type')
@test_connection
@test_db_connection
@with_database
Expand All @@ -169,6 +170,12 @@ def config_set(ctx, section, setting, value, data_type):

with DatabaseSession(logger, engine=ctx.obj.engine) as session:
config = AugurConfig(logger, session)

if not data_type:
result = session.query(Config).filter(Config.section_name == section, Config.setting_name == setting).all()
if not result:
return click.echo("You must specify a data-type if the setting does not already exist")
data_type = result[0].type

if data_type not in config.accepted_types:
print(f"Error invalid type for config. Please use one of these types: {config.accepted_types}")
Expand Down Expand Up @@ -218,6 +225,22 @@ def config_get(ctx, section, setting):
else:
print(f"Error: {section} section not found in config")

@cli.command('get_all_json')
def config_get_all_json():
data = {}
try:
with DatabaseSession(logger) as session:
sections = session.query(Config.section_name).distinct().all()
for section in sections:
data[section[0]] = {}

for row in session.query(Config).all():
data[row.section_name][row.setting_name] = row.value
except:
pass

print(json.dumps(data, indent=4))

@cli.command('clear')
@test_connection
@test_db_connection
Expand Down
64 changes: 58 additions & 6 deletions augur/static/css/first_time.css
Original file line number Diff line number Diff line change
@@ -1,50 +1,102 @@
:root {
--color-bg: #1A233A;
--color-bg-light: #272E48;
--color-bg-contrast: #646683;
--color-fg: white;
--color-fg-dark: #b0bdd6;
--color-fg-contrast: black;
--color-accent: #6f42c1;
--color-accent-dark: #6134b3;
--color-notice: #00ddff;
--color-notice-contrast: #006979;
}

body{
margin-top:20px;
color: #bcd0f7;
background: #1A233A;
background-color: var(--color-bg);
color: var(--color-fg);
}

h1 {
font-size: 2rem;
}

.sidebar .sidebar-top {
margin: 0 0 1rem 0;
padding-bottom: 1rem;
text-align: center;
}

.sidebar .sidebar-top .brand-logo {
margin: 0 0 1rem 0;
}

.sidebar .sidebar-top .brand-logo img {
height: 90px;
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
border-radius: 100px;
}

.sidebar .about {
margin: 1rem 0 0 0;
font-size: 0.8rem;
text-align: center;
}

.subtitle {
color: var(--color-fg-dark);
margin-bottom: .5rem;
margin-left: 15px;
}

.no-margin-bottom {
margin-bottom: 0;
}

.card {
background: #272E48;
background: var(--color-bg-light);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 0;
margin-bottom: 1rem;
}

.form-control {
border: 1px solid #596280;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
font-size: .825rem;
background: #1A233A;
color: #bcd0f7;
background: var(--color-bg-light);
color: var(--color-fg);
}

.input-textbox {
color: var(--color-fg);
background-color: var(--color-bg);
border-color: var(--color-accent-dark);
}

.input-textbox::placeholder {
color: var(--color-fg-dark);
}

.input-textbox:focus {
color: var(--color-fg);
background-color: var(--color-bg);
border-color: var(--color-accent-dark);
}

.input-textbox:focus::placeholder {
color: var(--color-fg-dark);
}

.modal-content {
color: black;
color: var(--color-fg-contrast);
}

.editor-container {
height: 300px !important;
}
Expand Down
Loading

0 comments on commit af14944

Please sign in to comment.