mirror of
https://github.com/kerberos-io/agent.git
synced 2026-08-29 16:08:33 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
068063695e | ||
|
|
b1722844f3 |
@@ -86,14 +86,18 @@ func OpenConfig(configuration *models.Configuration) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
var globalConfig models.Config
|
||||
collection.FindOne(ctx, bson.M{
|
||||
"type": "global",
|
||||
}).Decode(&configuration.GlobalConfig)
|
||||
}).Decode(&globalConfig)
|
||||
configuration.GlobalConfig = globalConfig
|
||||
|
||||
var customConfig models.Config
|
||||
collection.FindOne(ctx, bson.M{
|
||||
"type": "config",
|
||||
"name": os.Getenv("DEPLOYMENT_NAME"),
|
||||
}).Decode(&configuration.CustomConfig)
|
||||
}).Decode(&customConfig)
|
||||
configuration.CustomConfig = customConfig
|
||||
|
||||
// We will merge both configs in a single config file.
|
||||
// Read again from database but this store overwrite the same object.
|
||||
|
||||
@@ -224,13 +224,15 @@ class Settings extends React.Component {
|
||||
|
||||
calculateTimetable(timetable) {
|
||||
this.timetable = timetable;
|
||||
for (let i = 0; i < timetable.length; i += 1) {
|
||||
const time = timetable[i];
|
||||
const { start1, start2, end1, end2 } = time;
|
||||
this.timetable[i].start1Full = this.convertSecondsToHourMinute(start1);
|
||||
this.timetable[i].start2Full = this.convertSecondsToHourMinute(start2);
|
||||
this.timetable[i].end1Full = this.convertSecondsToHourMinute(end1);
|
||||
this.timetable[i].end2Full = this.convertSecondsToHourMinute(end2);
|
||||
if (this.timetable) {
|
||||
for (let i = 0; i < timetable.length; i += 1) {
|
||||
const time = timetable[i];
|
||||
const { start1, start2, end1, end2 } = time;
|
||||
this.timetable[i].start1Full = this.convertSecondsToHourMinute(start1);
|
||||
this.timetable[i].start2Full = this.convertSecondsToHourMinute(start2);
|
||||
this.timetable[i].end1Full = this.convertSecondsToHourMinute(end1);
|
||||
this.timetable[i].end2Full = this.convertSecondsToHourMinute(end2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user