diff --git a/app/storage.py b/app/storage.py new file mode 100644 index 0000000..e631708 --- /dev/null +++ b/app/storage.py @@ -0,0 +1,43 @@ +import pickle + +from typing import List, Tuple +from model.settings import Settings + + +class Project(): + def __init__(self, name: str, settings: Settings): + self.name = name + self.settings: Settings = settings + + +class Storage(): + def __init__(self): + self.data: List[Project] = self.get_data() + + def get_project(self, name): + for project in self.data: + if project.name == name: + return project + return None + + def add_project(self, project): + self.data.append(project) + self.save_data() + + def get_data(self): + print("Read data") + with open("app/data.pickle", "rb") as f: + data = f.read() + data = pickle.loads(data) + + for project in data: + print(" {}".format(project.name)) + + return data + + def save_data(self): + print("Save data") + with open("app/data.pickle", "wb") as f: + f.write(pickle.dumps(self.data)) + +storage = Storage() \ No newline at end of file diff --git a/app/templates/files.html b/app/templates/files.html new file mode 100644 index 0000000..658f5c7 --- /dev/null +++ b/app/templates/files.html @@ -0,0 +1,52 @@ + + + + {% include 'header.html' %} + + + +{% include 'navigation.html' %} + +
+
+ +
+ +
+ +
+
+ {% for log_file in log_files %} +
+
{{log_file['content']|safe}} +
+
+ {% endfor %} +
+
+
+ +
+ + + \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html index 211bb7f..442d97a 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -10,6 +10,14 @@

SuperMega

+ + + + Add \ No newline at end of file diff --git a/app/templates/inject.html b/app/templates/inject.html deleted file mode 100644 index e69de29..0000000 diff --git a/app/templates/project.html b/app/templates/project.html index 658f5c7..1e67c05 100644 --- a/app/templates/project.html +++ b/app/templates/project.html @@ -4,49 +4,88 @@ {% include 'header.html' %} - -{% include 'navigation.html' %} + {% include 'navigation.html' %} -
-
+
+ +

Project {{project_name}}

+ +
+
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + -
- -
- -
-
- {% for log_file in log_files %} -
-
{{log_file['content']|safe}} -
- {% endfor %} -
-
-
+
- +
+
+
\ No newline at end of file diff --git a/app/templates/build.html b/app/templates/project_add_get.html similarity index 87% rename from app/templates/build.html rename to app/templates/project_add_get.html index b3e82de..6f12d40 100644 --- a/app/templates/build.html +++ b/app/templates/project_add_get.html @@ -10,11 +10,12 @@
- -
-
+ + + +