-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into users/xingdong/redissidecar
- Loading branch information
Showing
30 changed files
with
697 additions
and
56 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
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,10 @@ | ||
apiVersion: workflow.symphony/v1 | ||
kind: Activation | ||
metadata: | ||
name: counter-activation | ||
spec: | ||
campaign: "counter-campaign" | ||
stage: "" | ||
inputs: | ||
val.init: 10 | ||
val: 2 |
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,12 @@ | ||
apiVersion: workflow.symphony/v1 | ||
kind: Campaign | ||
metadata: | ||
name: counter-campaign | ||
spec: | ||
firstStage: "counter" | ||
selfDriving: true | ||
stages: | ||
counter: | ||
name: "counter" | ||
provider: "providers.stage.counter" | ||
stageSelector: "${{$if($lt($output(counter,val), 20), counter, '')}}" |
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 @@ | ||
apiVersion: workflow.symphony/v1 | ||
kind: Activation | ||
metadata: | ||
name: hello-world-activation | ||
spec: | ||
campaign: "hello-world" | ||
inputs: | ||
foo: "bar" |
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,11 @@ | ||
apiVersion: workflow.symphony/v1 | ||
kind: Campaign | ||
metadata: | ||
name: hello-world | ||
spec: | ||
firstStage: "mock" | ||
selfDriving: true | ||
stages: | ||
mock: | ||
name: "mock" | ||
provider: "providers.stage.mock" |
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,37 @@ | ||
# Step 1: Build the base image with node.js | ||
FROM node:16-alpine as builder | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json | ||
COPY package.json package-lock.json ./ | ||
|
||
# Install dependencies | ||
RUN npm ci | ||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Build the application | ||
RUN npm run build | ||
|
||
# Step 2: Use a smaller base image for the production environment | ||
FROM node:16-alpine | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Install the Next.js production server | ||
RUN npm install next | ||
|
||
# Copy the build artifacts from the builder stage | ||
COPY --from=builder /app/public ./public | ||
COPY --from=builder /app/.next ./.next | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package.json ./package.json | ||
|
||
# Expose the port Next.js runs on | ||
EXPOSE 3000 | ||
|
||
# Command to run the application | ||
CMD ["npm", "start"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react' | ||
import { getServerSession } from 'next-auth'; | ||
import MultiView from '@/components/MultiView'; | ||
import { options } from '../api/auth/[...nextauth]/options'; | ||
import {TargetState, User} from '../types'; | ||
const getTargets = async () => { | ||
const session = await getServerSession(options); | ||
const symphonyApi = process.env.SYMPHONY_API; | ||
const userObj: User | undefined = session?.user?? undefined; | ||
const res = await fetch( `${symphonyApi}targets/registry`, { | ||
method: 'GET', | ||
headers: { | ||
'Authorization': `Bearer ${userObj?.accessToken}`, | ||
} | ||
}); | ||
const data = await res.json(); | ||
return data; | ||
} | ||
async function TargetsPage() { | ||
const targets = await getTargets(); | ||
const params = { | ||
type: 'targets', | ||
menuItems: [ | ||
{ | ||
name: 'Add Solution', | ||
href: '/solutions/add', | ||
} | ||
], | ||
views: ['cards', 'table'], | ||
items: targets, | ||
columns: [] | ||
} | ||
return ( | ||
<div> | ||
<MultiView params={params} /> | ||
</div> | ||
); | ||
} | ||
|
||
export default TargetsPage; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React, { useState } from 'react'; | ||
import { Input, NavbarContent, Button } from '@nextui-org/react'; | ||
|
||
// Define an interface for the component props | ||
interface FilterProps { | ||
onSelectFilter: (filter: string) => void; // This function takes a string and returns void | ||
} | ||
|
||
const Filter: React.FC<FilterProps> = ({ onSelectFilter }) => { | ||
const [selectedFilter, setSelectedFilter] = useState(''); // State to keep track of the filter input | ||
|
||
// Function to handle input changes | ||
const handleFilterChange = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
const filter = event.target.value; | ||
setSelectedFilter(filter); // Update selected filter state | ||
onSelectFilter(filter); // Pass filter to parent component | ||
}; | ||
|
||
// Function to handle filter submission | ||
const handleFilterSubmit = () => { | ||
onSelectFilter(selectedFilter); | ||
}; | ||
|
||
return ( | ||
<NavbarContent> | ||
<Input | ||
isClearable={true} | ||
placeholder="Filter" | ||
value={selectedFilter} | ||
onChange={handleFilterChange} | ||
/> | ||
<Button onClick={handleFilterSubmit}> | ||
Apply | ||
</Button> | ||
</NavbarContent> | ||
); | ||
}; | ||
|
||
export default Filter; |
Oops, something went wrong.