-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathStateCodes.page
65 lines (58 loc) · 3.42 KB
/
StateCodes.page
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<apex:page action="{!action}"
extensions="StateCodes"
standardController="AsyncApexJob"
setup="{!NOT CONTAINS($User.UiThemeDisplayed, '4')}"
lightningStylesheets="{!CONTAINS($User.UiThemeDisplayed, '4')}">
<style>
td.Failed {color: #c00;}
td.Completed {color: #090;}
</style>
<apex:form id="form">
<apex:sectionHeader title="State Codes"
help="https://github.com/mattandneil/statecodes"
description="{!IF(AsyncApexJob.CompletedDate == null, 'This tool initializes all ISO states by screen scraping the forms in setup.', LINKTO('« Back to start', $Page.StateCodes))}"
/>
<apex:pageMessages />
<apex:pageBlock mode="edit">
<apex:pageBlockSection id="detail" columns="2" collapsible="false" title="Batch Job Status" rendered="{!Id != null}">
<apex:pageBlockSectionItem >
<apex:outputLabel value="{!$ObjectType.AsyncApexJob.fields.Id.Label}" />
<apex:outputField value="{!AsyncApexJob.Id}" />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="{!$ObjectType.AsyncApexJob.fields.JobItemsProcessed.Label}" />
<apex:outputField value="{!AsyncApexJob.JobItemsProcessed}" />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem dataStyleClass="{!AsyncApexJob.Status}">
<apex:outputLabel value="{!$ObjectType.AsyncApexJob.fields.Status.Label}" />
<apex:outputText value="{!AsyncApexJob.Status} {!AsyncApexJob.ExtendedStatus}" />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="{!$ObjectType.AsyncApexJob.fields.TotalJobItems.Label}" />
<apex:outputField value="{!AsyncApexJob.TotalJobItems}" />
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockSection rendered="{!Id == null}" columns="1" collapsible="false" title="State Codes">
<apex:pageBlockSectionItem >
<apex:inputTextarea rows="15" style="width: 100%; font-size: 12px; font-family: monospace;" value="{!stateCodes}" />
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons location="bottom">
<apex:actionStatus id="busy">
<apex:facet name="stop"><apex:outputPanel >
<apex:commandButton rendered="{!Id == null}" status="busy" action="{!startBatch}" value="Start Batch" reRender="form" />
<apex:commandButton rendered="{!Id != null}" status="busy" action="{!abortBatch}" value="Abort Batch" reRender="form" disabled="{!AsyncApexJob.CompletedDate != null}" />
</apex:outputPanel></apex:facet>
<apex:facet name="start"><apex:outputPanel >
<apex:image value="{!URLFOR('/img/loading.gif')}" />
</apex:outputPanel></apex:facet>
</apex:actionStatus>
</apex:pageBlockButtons>
</apex:pageBlock>
<apex:actionPoller interval="5"
reRender="detail"
action="{!action}"
rendered="{!Id != null && AsyncApexJob.CompletedDate == null}"
/>
</apex:form>
</apex:page>