Skip to content

Commit

Permalink
Merge pull request #51 from SkywardAI/training-improve
Browse files Browse the repository at this point in the history
embed yeager microservice to page
  • Loading branch information
cbh778899 authored Jul 22, 2024
2 parents 908dbd5 + 20a3b99 commit 3490a43
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion components/training-page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function switchPage(page) {
if(current_page === page) return;
switch(page) {
case 'parameters':
loadParametersPage(training_page_main);
loadParametersPage(training_page_main, ()=>switchPage('training-visualization'));
break;
case 'faq':
loadFAQPage(training_page_main);
Expand Down
7 changes: 5 additions & 2 deletions components/training-page/parameters-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ for(const key in settings) setting_value_type[key] = typeof settings[key];
// TODO: load settings from local

const [ advanced_settings_dialog, controller ] = createDialog();
let main_form, init = false;
let main_form, init = false, showTrainingPage;

export default function loadParametersPage(main) {
export default function loadParametersPage(main, switchPage) {
showTrainingPage = switchPage;
main.innerHTML = `
<form id='training-params'>
<section class='token'>
Expand Down Expand Up @@ -195,6 +196,8 @@ function getEntryValues() {

function startTraining(evt) {
evt.preventDefault();

showTrainingPage();
}

function settingValueParser(type, value) {
Expand Down
6 changes: 6 additions & 0 deletions components/training-page/training-visualization-page.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
export default function loadTrainingVisualizationPage(main) {
main.innerHTML = '';

const training_frame = document.createElement('iframe');
training_frame.src = '/training-visualization/';
training_frame.className = 'seamless-frame'
main.appendChild(training_frame);

return null;
}
12 changes: 8 additions & 4 deletions nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ server {
proxy_pass http://kirin/api;
}

location /training-visualization {
proxy_pass http://yeager/;
}

location / {
root /usr/share/nginx/html;
index index.html index.htm;
Expand All @@ -27,10 +31,10 @@ server {

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# root /usr/share/nginx/html;
# }

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
Expand Down
15 changes: 11 additions & 4 deletions styles/training_page.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.training-main {
--tabs-height: 40px;
--main-height: 90vh;
--main-height: calc(100vh - var(--tabs-height) - 15px);
background-color: var(--transparent-gray-bg);
width: 100%;
height: 100%;
Expand Down Expand Up @@ -52,6 +52,8 @@

.training-main #training-tabs .tab.selected::before,
.training-main #training-tabs .tab.selected::after {
content: "";
position: absolute;
background-color: transparent;
height: 10px;
width: 10px;
Expand Down Expand Up @@ -81,7 +83,7 @@
position: absolute;
bottom: 0;
background-color: white;
padding-top: 10px;
padding-top: 7px;
}

.training-main #training-page-main #training-params {
Expand Down Expand Up @@ -120,6 +122,12 @@
border-left-width: 1px !important;
}

.training-main .seamless-frame {
border: none;
width: 100%;
height: 100%;
}

/*
=====================================================
Expand Down Expand Up @@ -255,5 +263,4 @@ section.params > div.advanced {

.advanced-setting-table tbody tr:has(td input:focus) {
background-color: var(--transparent-gray-bg);
}

}

0 comments on commit 3490a43

Please sign in to comment.