Skip to content

Commit

Permalink
Merge pull request #118 from swordensen/feature/logTerminal
Browse files Browse the repository at this point in the history
Feature/log terminal
  • Loading branch information
swordensen authored Feb 7, 2024
2 parents 7e5b850 + f633336 commit 81ac779
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scheduler",
"version": "0.0.32",
"version": "0.0.33",
"description": "Open source application for scheduling tasks (processes)",
"main": "dist/main",
"authors": "michael sorensen",
Expand Down
15 changes: 9 additions & 6 deletions app/src/main/controllers/schedule.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export class ScheduleController {
* @param cb
*/
forEachTask(cb:(task:Readonly<Task | TaskGroup>)=>Task | TaskGroup ){

function recurse(taskGroup:Readonly<TaskGroup>):TaskGroup{
// const _newTaskGroup = cb(taskGroup) as TaskGroup;
return {
...taskGroup,
tasks: taskGroup.tasks.reduce((acc, cur) => {
Expand All @@ -72,11 +74,11 @@ export class ScheduleController {
}


const newTaskGroup = cb(this.schedule);
if(newTaskGroup){
return Object.freeze(newTaskGroup) as Schedule
}
const newSchedule:Schedule = recurse(this.schedule);
const _newSchedule = Object.freeze(cb(this.schedule) as TaskGroup);

const newSchedule:Schedule = recurse(_newSchedule);



return newSchedule;

Expand Down Expand Up @@ -128,7 +130,6 @@ export class ScheduleController {

this._schedule = this.forEachTask(taskGroup => {
if(taskGroup.id === targetTaskGroup.id && taskGroup.type === 'taskGroup'){
console.log("FOUND TASK GROUP TO UPDATE");
const id = uuid()
return {
...taskGroup,
Expand All @@ -155,6 +156,8 @@ export class ScheduleController {
},
]
}
}else {
return taskGroup
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export class ClockComponent {
}

toggleClock(){
console.log('toggle clock triggered');
this.store.dispatch(toggleClock());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

</div>
<mat-card-content>
<p>{{ task.command }}</p>
<p class="no-overflow">{{ task.command }}</p>
<!-- <p>last ran: {{ task.lastExecuted | date: "medium" }}</p> -->
<!-- <p *ngIf="next">next: {{ next | date: "medium" }}</p>
<p *ngIf="!next && hasStartupTrigger">next: startup</p> -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ mat-card {
text-overflow: ellipsis;
position:relative;
}

.no-overflow{
overflow: hidden;
}
.active {
animation: pulse 2s infinite;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export class TaskLogsComponent implements OnInit, AfterViewInit, OnDestroy{


async onTaskFileUpdated(event:Electron.IpcRendererEvent, text:string){
console.log("TASK_LOG_FILE_UPDATED");
await new Promise((resolve, reject)=>{
this.term.write('\u001B[2J', ()=>resolve(true));
})
Expand All @@ -54,7 +53,6 @@ export class TaskLogsComponent implements OnInit, AfterViewInit, OnDestroy{
}

startListeningToLogFile(task:Task){
console.log("START LISTENING TO LOG FILE");
ipcRenderer.send(START_LISTENING_TO_LOG_FILE, task);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export class MainComponent {
}

handleSideNavResize(event:ResizeEvent){
console.log(event);
this.sideNavWidth = event.rectangle.width + "px";
}
}

0 comments on commit 81ac779

Please sign in to comment.