2022-08-10 01:59:10 -04:00
|
|
|
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
|
|
|
|
# Bruno Charest
|
|
|
|
# 2022-08-09
|
|
|
|
#
|
|
|
|
# __ DESCRIPTIONS __
|
|
|
|
# web_utils : procedure related web interface
|
|
|
|
#
|
|
|
|
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
|
2022-10-27 13:11:22 -04:00
|
|
|
import xlsx # read dashbord.xlsx
|
2022-08-06 16:51:49 -04:00
|
|
|
import jester
|
2022-08-10 01:59:10 -04:00
|
|
|
import joplin_utils
|
2022-08-06 16:51:49 -04:00
|
|
|
|
2022-08-10 01:59:10 -04:00
|
|
|
|
|
|
|
# --==--==--==--==--==--==--==--==--==--==-- #
|
2022-10-27 13:10:16 -04:00
|
|
|
# TYPE : Selected Option for master web page
|
2022-08-10 01:59:10 -04:00
|
|
|
# --==--==--==--==--==--==--==--==--==--==-- #
|
2022-10-27 13:10:16 -04:00
|
|
|
type
|
2022-08-06 16:51:49 -04:00
|
|
|
selectedOption* = enum
|
2022-10-27 13:10:16 -04:00
|
|
|
newNote = "New Note", search = "Search", shortcuts = "Shortcuts",
|
|
|
|
notes = "Notes", notebooks = "Notesbooks", tags = "Tags",
|
|
|
|
notes_selectednote = "Notes-SelectedNote", dashbord = "Dashboard"
|
2022-08-06 16:51:49 -04:00
|
|
|
|
2022-08-10 01:59:10 -04:00
|
|
|
|
|
|
|
# --==--==--==--==--==--==--==--==--==--==-- #
|
2022-10-27 13:10:16 -04:00
|
|
|
# TYPE : Data Informations for Left Colomn
|
2022-08-10 01:59:10 -04:00
|
|
|
# --==--==--==--==--==--==--==--==--==--==-- #
|
2022-08-06 16:51:49 -04:00
|
|
|
type ColomnLeftData* = ref object of RootObj
|
2022-10-27 13:10:16 -04:00
|
|
|
j_status*: bool
|
|
|
|
option*: selectedOption
|
|
|
|
j_notes*: joplin_notes
|
|
|
|
j_notes_nb*: int
|
|
|
|
j_notebooks*: joplin_notebooks
|
|
|
|
j_notebooks_nb*: int
|
|
|
|
j_tags*: joplin_tags
|
|
|
|
j_tags_nb*: int
|
|
|
|
req*: Request
|
|
|
|
|
|
|
|
# --==--==--==--==--==--==--==--==--==--==-- #
|
|
|
|
# TYPE : Data Informations for Right Colomn
|
|
|
|
# --==--==--==--==--==--==--==--==--==--==-- #
|
|
|
|
type ColomnRightData* = ref object of RootObj
|
|
|
|
j_status*: bool
|
|
|
|
option*: selectedOption
|
|
|
|
j_SelectedNote*: joplin_note
|
|
|
|
j_notebooksNote*: joplin_notebooks
|
|
|
|
j_tagsNote*: joplin_tags
|
|
|
|
req*: Request
|
|
|
|
|
2022-08-06 16:51:49 -04:00
|
|
|
|
2022-10-27 13:11:22 -04:00
|
|
|
# --==--==--==--==--==--==--==--==--==--==-- #
|
|
|
|
# TYPE : Dashbord information
|
|
|
|
# --==--==--==--==--==--==--==--==--==--==-- #
|
|
|
|
type DashbordData* = ref object of RootObj
|
|
|
|
position*: seq[int]
|
|
|
|
ext_link*: seq[string]
|
|
|
|
int_link*: seq[string]
|
|
|
|
title*: seq[string]
|
|
|
|
category*: seq[string]
|
|
|
|
icon*: seq[string]
|
|
|
|
open_method*: seq[string]
|
|
|
|
tag*: seq[string]
|
|
|
|
hotkey*: seq[string]
|
|
|
|
color*: seq[string]
|
|
|
|
req*: Request
|
|
|
|
|
|
|
|
|
|
|
|
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
|
|
|
|
# PROC :
|
|
|
|
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
|
|
|
|
proc getDashbordData(ddata: var DashbordData) =
|
|
|
|
let
|
|
|
|
data = parseExcel("data/dashbord.xlsx", header = true)
|
|
|
|
sheetName = "dashbord"
|
|
|
|
echo data[sheetName]
|
|
|
|
|
|
|
|
let rows = data[sheetName].toSeq(true)
|
|
|
|
echo rows.len()
|
|
|
|
# for i in 0 ..data[sheetName]:
|
|
|
|
# ddata.position[i] = row[i]
|
|
|
|
for row in rows:
|
|
|
|
echo "position: " & row[0]
|
|
|
|
echo "URL externe: " & row[1]
|