-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added create page framework * fixed relative imports * fixed relative imports * Add git remote url input (#68) * Updated git remote check for windows * Added os dependent spacer * Removed spacer * Added favicon * remove unused import * Added construction page * Version 1.10.3 * Updated docs
- Loading branch information
1 parent
60a4f3a
commit 99b14a8
Showing
19 changed files
with
438 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ temp/ | |
|
||
*.egg-info/ | ||
/build/ | ||
docs/build/ | ||
.env | ||
__pycache__ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
======= | ||
gui | ||
======= | ||
|
||
The ``gui`` command is used to start the DashTools UI at http://127.0.0.1:8050/ | ||
|
||
Usage | ||
======== | ||
|
||
``dashtools gui`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ Commands | |
:maxdepth: 2 | ||
|
||
docker/index | ||
gui/index | ||
heroku/index | ||
init/index | ||
run/index | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
''' | ||
# @ Author: Andrew Hossack | ||
# @ Create Time: 2022-10-23 14:52:57 | ||
''' | ||
|
||
|
||
from dash import Dash, Input, Output, State, no_update, ctx, html | ||
try: | ||
from dashtools.dashboard.pages import createPage | ||
except ModuleNotFoundError: | ||
from ..pages import createPage | ||
|
||
|
||
def generate_callbacks(app: Dash): | ||
@ app.callback( | ||
[ | ||
Output('create-terminal', 'value'), | ||
Output('create-terminal-runjs', 'run'), | ||
], | ||
Input('create-terminal-refresh-interval', 'n_intervals'), | ||
State('create-terminal', 'value'), | ||
) | ||
def update_terminal(n, current_value): | ||
logCMD = ''' | ||
var textarea = document.getElementById('create-terminal'); | ||
textarea.scrollTop = textarea.scrollHeight; | ||
''' | ||
new_value = createPage.terminal.read() | ||
if current_value != new_value: | ||
return new_value, logCMD | ||
return no_update, "" | ||
|
||
@app.callback( | ||
Output('create-terminal-hidden-div', 'children'), | ||
Input('create-terminal-clear-button', 'n_clicks') | ||
) | ||
def deploy_button(clear_terminal): | ||
button_clicked = ctx.triggered_id | ||
if button_clicked == 'create-terminal-clear-button' and clear_terminal: | ||
createPage.terminal.clear() | ||
return html.Div() |
25 changes: 6 additions & 19 deletions
25
src/dashtools/dashboard/callbacks.py → ...shboard/callbacks/deployPage_callbacks.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
''' | ||
# @ Author: Andrew Hossack | ||
# @ Create Time: 2022-10-23 14:52:57 | ||
''' | ||
|
||
from dash import Dash, Input, Output, dcc | ||
|
||
try: | ||
from dashtools.dashboard.pages import createPage, deployPage, errorPage, infoPage | ||
except ModuleNotFoundError: | ||
from dashtools.dashboard.pages import createPage, deployPage, errorPage, infoPage | ||
|
||
|
||
def generate_callbacks(app: Dash): | ||
@app.callback(Output("page-content", "children"), [Input("url", "pathname")]) | ||
def render_page_content(pathname): | ||
if pathname == '/': | ||
# Setup url redirect to default page | ||
return dcc.Location(id="url", pathname='/deploy') | ||
elif pathname == "/deploy": | ||
deployPage.terminal.clear() | ||
return deployPage.render() | ||
elif pathname == "/info": | ||
return infoPage.render() | ||
elif pathname == "/create": | ||
createPage.terminal.clear() | ||
return createPage.render() | ||
else: | ||
return errorPage.render() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
from dash import html | ||
import dash_mantine_components as dmc | ||
import dash_bootstrap_components as dbc | ||
from dash_iconify import DashIconify | ||
from dashtools import version | ||
|
||
|
||
def render() -> html.Div: | ||
return html.Div( | ||
[ | ||
html.Div(id='hidden-div'), | ||
dmc.Center([ | ||
DashIconify(icon='heroicons:command-line-20-solid', | ||
height=60, style={'margin-bottom': '8px', 'margin-right': '5px'}), | ||
html.H2("DashTools", className='dashtools-logo'), | ||
]), | ||
dmc.Space(h=1, style={'margin-top': '-20px'}), | ||
html.H6( | ||
"Application Management Dashboard", | ||
style={'font-weight': 'inherit', 'font-size': '14px'} | ||
), | ||
|
||
|
||
dbc.Nav( | ||
[ | ||
dbc.NavLink( | ||
[ | ||
DashIconify(icon='akar-icons:plus', | ||
style={'margin-right': '5px'}), | ||
"Create" | ||
], href="/create", active="exact"), | ||
dbc.NavLink( | ||
[ | ||
DashIconify(icon='akar-icons:cloud', | ||
style={'margin-right': '5px'}), | ||
"Deploy" | ||
], href="/deploy", active="exact"), | ||
# dbc.NavLink( # TODO | ||
# [ | ||
# DashIconify(icon='akar-icons:info', | ||
# style={'margin-right': '5px'}), | ||
# "Info" | ||
# ], href="/info", active="exact"), | ||
], | ||
vertical=True, | ||
pills=True, | ||
), | ||
|
||
dmc.Space(style={'height': '460px'}), | ||
html.Hr(), | ||
html.Div([ | ||
html.H6( | ||
[ | ||
html.A( | ||
[ | ||
DashIconify( | ||
icon='logos:pypi', | ||
width=20, | ||
style={'margin-right': '10px'}), | ||
f'PyPi v{version.__version__}', | ||
], | ||
href="https://pypi.org/project/dash-tools/", target='_blank', style={'text-decoration': 'none', 'color': 'black', 'font-weight': 'lighter'}), | ||
]), | ||
html.H6( | ||
[ | ||
html.A( | ||
[ | ||
DashIconify( | ||
icon='file-icons:readthedocs', | ||
width=15, | ||
style={'margin-right': '10px', 'margin-left': '5px'}), | ||
f'Read the Docs', | ||
], | ||
href="https://dash-tools.readthedocs.io/en/latest/index.html", target='_blank', style={'text-decoration': 'none', 'color': 'black', 'font-weight': 'lighter'}), | ||
]), | ||
html.H6( | ||
[ | ||
html.A( | ||
[ | ||
DashIconify( | ||
icon='ant-design:github-filled', | ||
width=20, | ||
style={'margin-right': '8px', 'margin-left': '2px'}), | ||
f'GitHub', | ||
], | ||
href="https://github.com/andrew-hossack/dash-tools", target='_blank', style={'text-decoration': 'none', 'color': 'black', 'font-weight': 'lighter'}), | ||
]), | ||
]), | ||
], | ||
style={ | ||
"position": "fixed", | ||
"top": 0, | ||
"left": 0, | ||
"bottom": 0, | ||
"width": "20rem", | ||
"padding": "2rem 1rem", | ||
"background-color": "#f8f9fa", | ||
}, | ||
|
||
) |
Oops, something went wrong.