-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
198 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/content/jcr_root/apps/groovyconsole/components/console/active-jobs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="panel panel-default" data-sly-use.panel="com.icfolson.aem.groovy.console.components.ActiveJobsPanel"> | ||
<div class="panel-heading"> | ||
<h4 class="panel-title">Active Jobs</h4> | ||
</div> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>Start Time</th> | ||
<th>Title</th> | ||
<th>Description</th> | ||
<th>Script</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr data-sly-repeat.job="${panel.activeJobs}"> | ||
<td>${job.id}</td> | ||
<td>${job.formattedStartTime}</td> | ||
<td>${job.title}</td> | ||
<td>${job.description}</td> | ||
<td>${job.script}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/content/jcr_root/apps/groovyconsole/components/console/scheduled-jobs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/groovy/com/icfolson/aem/groovy/console/api/ActiveJob.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.icfolson.aem.groovy.console.api | ||
|
||
import com.icfolson.aem.groovy.console.constants.GroovyConsoleConstants | ||
import com.icfolson.aem.groovy.console.utils.GroovyScriptUtils | ||
import groovy.transform.Memoized | ||
import groovy.transform.TupleConstructor | ||
import org.apache.sling.event.jobs.Job | ||
|
||
@TupleConstructor | ||
class ActiveJob { | ||
|
||
Job job | ||
|
||
String getFormattedStartTime() { | ||
job.processingStarted.format(GroovyConsoleConstants.DATE_FORMAT_DISPLAY) | ||
} | ||
|
||
String getId() { | ||
job.id | ||
} | ||
|
||
String getTitle() { | ||
jobProperties.jobTitle | ||
} | ||
|
||
String getDescription() { | ||
jobProperties.jobDescription | ||
} | ||
|
||
String getScript() { | ||
GroovyScriptUtils.getScriptPreview(jobProperties.script) | ||
} | ||
|
||
@Memoized | ||
JobProperties getJobProperties() { | ||
JobProperties.fromJob(job) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/groovy/com/icfolson/aem/groovy/console/components/ActiveJobsPanel.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.icfolson.aem.groovy.console.components | ||
|
||
import com.icfolson.aem.groovy.console.GroovyConsoleService | ||
import com.icfolson.aem.groovy.console.api.ActiveJob | ||
import org.apache.sling.api.SlingHttpServletRequest | ||
import org.apache.sling.models.annotations.Model | ||
import org.apache.sling.models.annotations.injectorspecific.OSGiService | ||
|
||
@Model(adaptables = SlingHttpServletRequest) | ||
class ActiveJobsPanel { | ||
|
||
@OSGiService | ||
private GroovyConsoleService groovyConsoleService | ||
|
||
List<ActiveJob> getActiveJobs() { | ||
groovyConsoleService.activeJobs | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.