Skip to content

Commit 93c452b

Browse files
committed
added tables, 404 pages, fixed minor weather widget error
1 parent cd2ff8e commit 93c452b

File tree

12 files changed

+432
-150
lines changed

12 files changed

+432
-150
lines changed

Diff for: common/models/data.pb.go

+92-62
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: core/scraper/helpers.go

+2
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ func splitRoomTitle(s string) (string, string) {
220220
var fullName string
221221
if len(parts) > 1 {
222222
fullName = strings.TrimSpace(parts[1])
223+
} else {
224+
fullName = designator
223225
}
224226
return designator, fullName
225227
}

Diff for: core/scraper/scraper.go

+36
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import (
1717
"github.com/PuerkitoBio/goquery"
1818
)
1919

20+
// TODO: Add the ability to add more resource indexes to the scraper, (SKat)
21+
2022
var Config config.ScraperConfig
2123

2224
type ResourceType string
@@ -70,6 +72,40 @@ func (s *ScraperResource) StopHub() {
7072
}
7173
}
7274

75+
func (s *ScraperResource) GetDesignatorFromIndex(index int64) string {
76+
s.Mu.RLock()
77+
defer s.Mu.RUnlock()
78+
for designator, _index := range s.Metadata.Designators {
79+
if index == _index {
80+
return designator
81+
}
82+
}
83+
return ""
84+
}
85+
86+
func (s *ScraperResource) GetFullNameFromIndex(index int64) string {
87+
s.Mu.RLock()
88+
defer s.Mu.RUnlock()
89+
for fullName, _index := range s.Metadata.FullNames {
90+
if index == _index {
91+
return fullName
92+
}
93+
}
94+
return ""
95+
}
96+
97+
func (s *ScraperResource) GetIndexFromDesignator(designator string) int64 {
98+
s.Mu.RLock()
99+
defer s.Mu.RUnlock()
100+
return s.Metadata.Designators[designator]
101+
}
102+
103+
func (s *ScraperResource) GetIndexFromFullName(fullName string) int64 {
104+
s.Mu.RLock()
105+
defer s.Mu.RUnlock()
106+
return s.Metadata.FullNames[fullName]
107+
}
108+
73109
func (s *ScraperResource) UpdateMetadata(newDesignator, newFullName string, index int64) {
74110
s.Mu.Lock()
75111
defer s.Mu.Unlock()

Diff for: data.proto

+6-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,12 @@ message TimeRange {
6464
message Lesson {
6565
string full_name = 1;
6666
string teacher_designator = 2;
67-
string room_designator = 3;
68-
string division_designator = 4;
69-
TimeRange time_range = 5;
67+
int64 teacher_index = 3;
68+
string room_designator = 4;
69+
int64 room_index = 5;
70+
string division_designator = 6;
71+
int64 division_index = 7;
72+
TimeRange time_range = 8;
7073
}
7174

7275
message LessonGroup {

Diff for: web/optivum-better-schedule-frontend/src/components/Overlay.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
<v-main>
4444
<div class="background-container">
45-
<router-view class="fill-height fill-width" v-slot="{ Component }">
45+
<router-view v-slot="{ Component }">
4646
<component :is="Component" />
4747
</router-view>
4848
</div>

0 commit comments

Comments
 (0)