Skip to content

Commit 47d6ab4

Browse files
committed
1. Change region input to select element
2. Make Build command to sh file
1 parent 543d14d commit 47d6ab4

File tree

7 files changed

+91
-13
lines changed

7 files changed

+91
-13
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# v1.0.2
2+
1. Change region input to select element.
3+
2. Make Build command to sh file.
4+
5+
# v1.0.1
6+
- Update event from onchange to oninput.
7+
> The setting UI used to save value after input blur, now will save on type immediately.
8+
9+
# v1.0.0
10+
Initialize plugin.

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22
# Stream Deck - AWS CodePipeline
33
Stream Deck Plugin - With this plugin, you can simply click a button to get the AWS CodePipeline status.
44

5+
- [Button Status](#button-status)
6+
- [Supported Stage](#supported-stage)
7+
- [Install](#install)
8+
- [Feature](#feature)
9+
- [Setting up](#setting-up)
10+
- [CHANGELOG](#changelog)
11+
512
## Button Status
6-
Status | Screenchot
7-
---|---
8-
Default | ![preview-default](./doc/preview-default.png)
9-
Fetching | ![preview-fetching](./doc/preview-fetching.png)
10-
Result | ![preview-result](./doc/preview-result.png)
13+
| Status | Screenchot |
14+
| -------- | ----------------------------------------------- |
15+
| Default | ![preview-default](./doc/preview-default.png) |
16+
| Fetching | ![preview-fetching](./doc/preview-fetching.png) |
17+
| Result | ![preview-result](./doc/preview-result.png) |
1118

1219
---
1320

@@ -28,10 +35,13 @@ Result | ![preview-result](./doc/preview-result.png)
2835
- Long Press to open aws codepipeline webpage.
2936

3037
## Setting up
31-
Config | Description
32-
---|---
33-
Pipeline | uuid of code pipeline
34-
Access Key Id | AWS IAM access key
35-
Secret Access Key | AWS IAM secret access key
36-
Region | AWS Region id. `ap-northeast-1`
38+
| Config | Description |
39+
| ----------------- | ------------------------------- |
40+
| Pipeline | uuid of code pipeline |
41+
| Access Key Id | AWS IAM access key |
42+
| Secret Access Key | AWS IAM secret access key |
43+
| Region | AWS Region id. `ap-northeast-1` |
44+
3745

46+
## CHANGELOG
47+
See [CHANGELOG.md](./CHANGELOG.md)

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rm ./dist/tw.phantas.aws-codepipeline-status.streamDeckPlugin; DistributionTool -b -i ../tw.phantas.aws-codepipeline-status.sdPlugin -o ./dist
Binary file not shown.

pi/index.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,14 @@
5555
<div class="sdpi-item-label">Secret Access Key</div>
5656
<input id="secretAccessKey" class="sdpi-item-value" type="text" value="" required />
5757
</div>
58-
<div class="sdpi-item">
58+
<!-- <div class="sdpi-item">
5959
<div class="sdpi-item-label">Region</div>
6060
<input id="regionId" class="sdpi-item-value" type="text" value="" required />
61+
</div> -->
62+
<div class="sdpi-item" id="select_single">
63+
<div class="sdpi-item-label">Region</div>
64+
<select class="sdpi-item-value select" id="regionId">
65+
</select>
6166
</div>
6267
</div>
6368
<!-- <div class="sdpi-item">
@@ -81,6 +86,8 @@
8186
</div>
8287

8388
<div class="sdpi-info-label hidden" style="top: -1000;" value=""></div>
89+
<script src="https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.1119.0/aws-sdk.min.js" integrity="sha512-m485HaWlvDQFzqGDHQGXUlqmypssaICQ+/oga6TVxYCUrztIudbOCBIyH5yJTPQGMqGDzW4aMn0ciHki1XCdKQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
90+
<script src="js/constants.js"></script>
8491
<script src="js/common.js"></script>
8592
<script src="js/common_pi.js"></script>
8693
<script src="js/index_pi.js"></script>

pi/js/constants.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const regionsList = {
2+
US: {
3+
'US West (N. California)': 'us-west-1',
4+
'US West (Oregon)': 'us-west-2',
5+
},
6+
Africa: {
7+
'Africa (Cape Town)': 'af-south-1',
8+
},
9+
AsiaPacific: {
10+
'Asia Pacific (Hong Kong)': 'ap-east-1',
11+
'Asia Pacific (Jakarta)': 'ap-southeast-3',
12+
'Asia Pacific (Mumbai)': 'ap-south-1',
13+
'Asia Pacific (Osaka)': 'ap-northeast-3',
14+
'Asia Pacific (Seoul)': 'ap-northeast-2',
15+
'Asia Pacific (Singapore)': 'ap-southeast-1',
16+
'Asia Pacific (Sydney)': 'ap-southeast-2',
17+
'Asia Pacific (Tokyo)': 'ap-northeast-1',
18+
},
19+
Canada: {
20+
'Canada (Central)': 'ca-central-1',
21+
},
22+
China: {
23+
'China (Beijing)': 'cn-north-1',
24+
'China (Ningxia)': 'cn-northwest-1',
25+
},
26+
Europe: {
27+
'Europe (Frankfurt)': 'eu-central-1',
28+
'Europe (Ireland)': 'eu-west-1',
29+
'Europe (London)': 'eu-west-2',
30+
'Europe (Milan)': 'eu-south-1',
31+
'Europe (Paris)': 'eu-west-3',
32+
'Europe (Stockholm)': 'eu-north-1',
33+
},
34+
MiddleEast: {
35+
'Middle East (Bahrain)': 'me-south-1',
36+
},
37+
SouthAmerica: {
38+
'South America (São Paulo)': 'sa-east-1'
39+
}
40+
}

pi/js/index_pi.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,17 @@ $SD.on('connected', (jsn) => {
6767
*
6868
* const foundObject = Utils.getProp(JSON-OBJECT, 'path.to.target', defaultValueIfNotFound)
6969
*/
70-
70+
for (const group of Object.keys(regionsList)) {
71+
const child = document.createElement('optgroup')
72+
child.label = group
73+
document.querySelector('#regionId').appendChild(child)
74+
for (const region of Object.keys(regionsList[group])) {
75+
const child = document.createElement('option')
76+
child.innerHTML = `${regionsList[group][region]}: ${region}`
77+
child.value = regionsList[group][region]
78+
document.querySelector(`optgroup[label=${group}]`).appendChild(child)
79+
}
80+
}
7181
settings = Utils.getProp(jsn, 'actionInfo.payload.settings', false);
7282
if (settings) {
7383
updateUI(settings);

0 commit comments

Comments
 (0)