-
Notifications
You must be signed in to change notification settings - Fork 1
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
30 changed files
with
2,943 additions
and
14,105 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,8 @@ | ||
import {atom} from "recoil"; | ||
import {DefaultTemplateData} from "../interface"; | ||
|
||
export const TemplateState = atom({ | ||
key: 'templateState', | ||
default: DefaultTemplateData, | ||
}); | ||
|
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 {ConnectionTemplateData, ServiceTemplateData} from "../interface"; | ||
import {useRecoilValue} from "recoil"; | ||
import {TemplateState} from "./Recoil"; | ||
|
||
export function GetServiceWithTemplate(serviceType: string) | ||
: ServiceTemplateData | undefined { | ||
const template = useRecoilValue(TemplateState); | ||
|
||
const serviceTemplate = template.services?.find(item => item.type === serviceType) | ||
if (serviceTemplate == null) { | ||
return undefined | ||
} | ||
|
||
return serviceTemplate | ||
} | ||
|
||
export function GetConnectionWithTemplate(connectionType: string) | ||
: ConnectionTemplateData | undefined { | ||
const template = useRecoilValue(TemplateState); | ||
|
||
const connectionTemplate = template.connections?.find(item => item.type === connectionType) | ||
if (connectionTemplate == null) { | ||
return undefined | ||
} | ||
|
||
return connectionTemplate | ||
} |
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.