-
Notifications
You must be signed in to change notification settings - Fork 0
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
6 changed files
with
93 additions
and
29 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
8 changes: 8 additions & 0 deletions
8
spin-observatory-plugin-deck/src/components/actions/RetriggerButton.scss
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,8 @@ | ||
.retrigger-button { | ||
width: 7rem; | ||
color: #fff; | ||
background-color: var(--color-accent); | ||
&:hover { | ||
background-color: var(--button-primary-hover-bg); | ||
} | ||
} |
36 changes: 15 additions & 21 deletions
36
spin-observatory-plugin-deck/src/components/actions/RetriggerButton.tsx
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 |
---|---|---|
@@ -1,24 +1,18 @@ | ||
import Button from '@material-ui/core/Button'; | ||
import React, { useState } from 'react'; | ||
import { Button, makeStyles } from '@material-ui/core'; | ||
import React from 'react'; | ||
|
||
export const RetriggerButton = () => { | ||
const [hover, setHover] = useState(false); | ||
const useStyles = makeStyles({ | ||
'retrigger-button': { | ||
width: '7rem', | ||
color: '#fff', | ||
backgroundColor: 'var(--color-accent)', | ||
}, | ||
'retrigger-button:hover': { | ||
backgroundColor: 'var(--button-primary-hover-bg)', | ||
}, | ||
}); | ||
|
||
const handleHover = () => setHover((prevHover) => !prevHover); | ||
|
||
return ( | ||
<div> | ||
<Button | ||
onMouseEnter={handleHover} | ||
onMouseLeave={handleHover} | ||
style={{ | ||
width: '7rem', | ||
color: 'white', | ||
backgroundColor: hover ? 'var(--button-primary-hover-bg)' : 'var(--color-accent)', | ||
}} | ||
> | ||
Retrigger | ||
</Button> | ||
</div> | ||
); | ||
export const RetriggerButton = ({ disabled, onClick }: { disabled: boolean; onClick: () => void }) => { | ||
const styles = useStyles(); | ||
return <Button className={styles['retrigger-button']}>Retrigger</Button>; | ||
}; |
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
27 changes: 27 additions & 0 deletions
27
spin-observatory-plugin-deck/src/services/BroadsideService.ts
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,27 @@ | ||
import type { IExecution } from '@spinnaker/core'; | ||
import { REST } from '@spinnaker/core'; | ||
// http://broadside.cd:80 | ||
const BROADSIDE_URI = 'http://broadside.cd:80/v1/broadsides'; | ||
|
||
// See https://github.com/one-thd/broadside/blob/main/api/swagger.yml#L206 | ||
export const retriggerExecutions = ({ executions }: { executions: IExecution[] }): Promise<any[]> => { | ||
/*** | ||
* application: "clipper" | ||
* pipelineNameOrId: "Generate Clipper X.509 Key Pair" | ||
* amount: 50 | ||
* delay: 100 | ||
* pipelineBaseParameters: '{ "parameterName": "custom data" }' | ||
* pipelineMultiParameters: '[ { "multiParameterName": "custom data" } ]' | ||
*/ | ||
// eslint-disable-next-line no-console | ||
console.log({ executions }); | ||
return Promise.all( | ||
executions.map(async (execution) => { | ||
return await REST(BROADSIDE_URI).post({ | ||
application: execution.application, | ||
pipelineNameOrId: execution.pipelineConfigId, | ||
pipelineBaseParameters: execution.trigger.parameters, | ||
}); | ||
}), | ||
); | ||
}; |
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 |
---|---|---|
|
@@ -1431,10 +1431,10 @@ | |
resolved "https://registry.yarnpkg.com/@spinnaker/mocks/-/mocks-1.0.7.tgz#3e30fde4d691b310910e7fa5201c7424609042c0" | ||
integrity sha512-WXoNtZoFZFNDTrckCbbTShxoRN088IN+awWweNNv89EU4GsMX8HnnG/9J6N9rAt0R3ZgzhJmaNG06/JHHBzxEw== | ||
|
||
"@spinnaker/pluginsdk-peerdeps@0.13.0": | ||
version "0.13.0" | ||
resolved "https://registry.yarnpkg.com/@spinnaker/pluginsdk-peerdeps/-/pluginsdk-peerdeps-0.13.0.tgz#5435e3061a78791c023259ae2dd6f6b030f5328d" | ||
integrity sha512-2Tlh8brwSOsZxKJDedPhR/BKnfwSy3GDknW8t4cvI9RwQ/JTLlPHwb45CAhXgO6bPjZMZFylYjoMXd7sAX4zNQ== | ||
"@spinnaker/pluginsdk-peerdeps@0.14.0": | ||
version "0.14.0" | ||
resolved "https://registry.yarnpkg.com/@spinnaker/pluginsdk-peerdeps/-/pluginsdk-peerdeps-0.14.0.tgz#a6a87c778cb04cd829280bdb45c55feeb3917c28" | ||
integrity sha512-xnVmlR5vCcQ+Tl/7Ye7x7G28puE0PICg2EVxhuXPOZ59RMw1r8Mh+MmB4rYSvvcILI5dDgyQ+aa6MyiayRh6Nw== | ||
|
||
"@spinnaker/[email protected]": | ||
version "0.3.0" | ||
|
@@ -2405,7 +2405,7 @@ cheerio@^1.0.0-rc.3: | |
parse5 "^7.0.0" | ||
parse5-htmlparser2-tree-adapter "^7.0.0" | ||
|
||
chokidar@^3.5.1: | ||
"chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.1: | ||
version "3.5.3" | ||
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" | ||
integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== | ||
|
@@ -4082,6 +4082,11 @@ image-size@~0.5.0: | |
resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c" | ||
integrity sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ== | ||
|
||
immutable@^4.0.0: | ||
version "4.3.0" | ||
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.0.tgz#eb1738f14ffb39fd068b1dbe1296117484dd34be" | ||
integrity sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg== | ||
|
||
import-cwd@^3.0.0: | ||
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-3.0.0.tgz#20845547718015126ea9b3676b7592fb8bd4cf92" | ||
|
@@ -6550,6 +6555,15 @@ safe-regex-test@^1.0.0: | |
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" | ||
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== | ||
|
||
sass@^1.62.1: | ||
version "1.62.1" | ||
resolved "https://registry.yarnpkg.com/sass/-/sass-1.62.1.tgz#caa8d6bf098935bc92fc73fa169fb3790cacd029" | ||
integrity sha512-NHpxIzN29MXvWiuswfc1W3I0N8SXBd8UR26WntmDlRYf0bSADnwnOjsyMZ3lMezSlArD33Vs3YFhp7dWvL770A== | ||
dependencies: | ||
chokidar ">=3.0.0 <4.0.0" | ||
immutable "^4.0.0" | ||
source-map-js ">=0.6.2 <2.0.0" | ||
|
||
scheduler@^0.19.1: | ||
version "0.19.1" | ||
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" | ||
|
@@ -6740,7 +6754,7 @@ slice-ansi@^4.0.0: | |
astral-regex "^2.0.0" | ||
is-fullwidth-code-point "^3.0.0" | ||
|
||
source-map-js@^1.0.2: | ||
"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.2: | ||
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" | ||
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== | ||
|