[KiRi] Simplified the layout

- No more web/ and redirect.html
- No more favicon.ico (embedded)
- Now we check for blank.svg, that now is simplified
This commit is contained in:
Salvador E. Tropea 2023-12-28 14:06:50 -03:00
parent c95d6a47c4
commit 8f8ca67458
4 changed files with 18 additions and 29 deletions

View File

@ -220,13 +220,13 @@ class KiRiOptions(VariantOptions):
def create_kiri_files(self):
src_dir = GS.get_resource_path('kiri')
copy2(os.path.join(src_dir, 'redirect.html'), os.path.join(self.cache_dir, 'index.html'))
copy2(os.path.join(src_dir, 'kiri-server'), os.path.join(self.cache_dir, 'kiri-server'))
web_dir = os.path.join(self.cache_dir, 'web')
web_dir = self.cache_dir
os.makedirs(web_dir, exist_ok=True)
copy2(os.path.join(src_dir, 'favicon.ico'), os.path.join(web_dir, 'favicon.ico'))
copy2(os.path.join(src_dir, 'blank.svg'), os.path.join(web_dir, 'blank.svg'))
self.copy_index(src_dir, os.path.join(src_dir, 'index.html'), os.path.join(web_dir, 'index.html'))
# copy2(os.path.join(src_dir, 'redirect.html'), os.path.join(self.cache_dir, 'index.html'))
# copy2(os.path.join(src_dir, 'favicon.ico'), os.path.join(web_dir, 'favicon.ico'))
# copytree(os.path.join(src_dir, 'images'), os.path.join(web_dir, 'images'), dirs_exist_ok=True)
# copy2(os.path.join(src_dir, 'kiri.css'), os.path.join(web_dir, 'kiri.css'))
# copy2(os.path.join(src_dir, 'kiri.js'), os.path.join(web_dir, 'kiri.js'))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File

@ -546,13 +546,13 @@ function update_selected_page()
var image_path_2;
if (sheet_pages_commit1.has(page_filename)) {
image_path_1 = "../" + commit1.value + "/_KIRI_/sch/" + page_filename + ".svg";
image_path_1 = commit1.value + "/_KIRI_/sch/" + page_filename + ".svg";
} else {
image_path_1 = "blank.svg";
}
if (sheet_pages_commit2.has(page_filename)) {
image_path_2 = "../" + commit2.value + "/_KIRI_/sch/" + page_filename + ".svg";
image_path_2 = commit2.value + "/_KIRI_/sch/" + page_filename + ".svg";
} else {
image_path_2 = "blank.svg";
}
@ -593,11 +593,11 @@ function update_page()
function update_sheets_list() {
// File = ../[COMMIT]/_KIRI_/sch_sheets
// File = [COMMIT]/_KIRI_/sch_sheets
// Data format: Name_without_extension|Relative_file_name|UUID|Instance_name|Sheet_Path_Name
data1 = loadFile("../" + commit1.value + "/_KIRI_/sch_sheets" + url_timestamp(commit1));
data2 = loadFile("../" + commit2.value + "/_KIRI_/sch_sheets" + url_timestamp(commit2));
data1 = loadFile(commit1.value + "/_KIRI_/sch_sheets" + url_timestamp(commit1));
data2 = loadFile(commit2.value + "/_KIRI_/sch_sheets" + url_timestamp(commit2));
var sheets = [];
var new_sheets_list = [];
@ -704,7 +704,7 @@ function pad(num, size)
function load_commits()
{
commit1 = commit2 = -1;
commits = loadFile("../commits");
commits = loadFile("commits");
var i = 1;
var all_commits_html = "";
for (const line of commits)
@ -761,7 +761,7 @@ function load_project_data()
// Data format: TITLE
// SCH_TITLE|SCH_REVISION|SCH_DATE
// PCB_TITLE|PCB_REVISION|PCB_DATE
data = loadFile("../project");
data = loadFile("project");
document.title = data[0];
splitted = data[1].split("|");
document.getElementById("sch_title_text").innerHTML = splitted[0];
@ -788,11 +788,11 @@ function update_layers_list()
var new_layers_list = [];
var form_inputs_html;
// File = ../[COMMIT]/_KIRI_/pcb_layers
// File = [COMMIT]/_KIRI_/pcb_layers
// Format = ID|LAYER
var used_layers_1 = loadFile("../" + commit1.value + "/_KIRI_/pcb_layers" + url_timestamp(commit1));
var used_layers_2 = loadFile("../" + commit2.value + "/_KIRI_/pcb_layers" + url_timestamp(commit2));
var used_layers_1 = loadFile(commit1.value + "/_KIRI_/pcb_layers" + url_timestamp(commit1));
var used_layers_2 = loadFile(commit2.value + "/_KIRI_/pcb_layers" + url_timestamp(commit2));
layers_commit1 = new Set();
for (const line of used_layers_1)
@ -901,16 +901,16 @@ function update_layer()
function update_selected_layer() {
var layer_id = layers[selected_layer].id.split("-")[1];
var image_path_1 = "../" + commit1.value + "/_KIRI_/pcb/layer" + "-" + layer_id + ".svg";
var image_path_2 = "../" + commit2.value + "/_KIRI_/pcb/layer" + "-" + layer_id + ".svg";
var image_path_1;
var image_path_2;
if (layers_commit1.has(layer_id)) {
image_path_1 = "../" + commit1.value + "/_KIRI_/pcb/layer" + "-" + layer_id + ".svg";
image_path_1 = commit1.value + "/_KIRI_/pcb/layer" + "-" + layer_id + ".svg";
} else {
image_path_1 = "blank.svg";
}
if (layers_commit2.has(layer_id)) {
image_path_2 = "../" + commit2.value + "/_KIRI_/pcb/layer" + "-" + layer_id + ".svg";
image_path_2 = commit2.value + "/_KIRI_/pcb/layer" + "-" + layer_id + ".svg";
} else {
image_path_2 = "blank.svg";
}
@ -1055,7 +1055,7 @@ function check_server_status()
server_is_offline();
};
img.src = "favicon.ico" + url_timestamp();
img.src = "blank.svg" + url_timestamp();
setTimeout(check_server_status, 5000);
}

View File

@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='refresh' content='0; URL=/web/index.html'>
</head>
<body>
</body>
</html>