mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 02:02:08 +00:00
[API Nodes] Remove cost from signin required dialog (#3532)
This commit is contained in:
31
src/components/common/ApiNodesList.vue
Normal file
31
src/components/common/ApiNodesList.vue
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<template>
|
||||||
|
<div class="flex flex-col gap-3 h-full">
|
||||||
|
<div class="flex text-xs">
|
||||||
|
<div>{{ t('apiNodesCostBreakdown.title') }}</div>
|
||||||
|
</div>
|
||||||
|
<ScrollPanel class="flex-grow h-0">
|
||||||
|
<div class="flex flex-col gap-2">
|
||||||
|
<div
|
||||||
|
v-for="nodeName in nodeNames"
|
||||||
|
:key="nodeName"
|
||||||
|
class="flex items-center justify-between px-3 py-2 rounded-md bg-[var(--p-content-border-color)]"
|
||||||
|
>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<span class="text-base font-medium leading-tight">{{
|
||||||
|
nodeName
|
||||||
|
}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ScrollPanel>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import ScrollPanel from 'primevue/scrollpanel'
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
|
|
||||||
|
const { nodeNames } = defineProps<{ nodeNames: string[] }>()
|
||||||
|
</script>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
{{ t('apiNodesSignInDialog.message') }}
|
{{ t('apiNodesSignInDialog.message') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ApiNodesCostBreakdown :nodes="apiNodes" :show-total="true" />
|
<ApiNodesList :node-names="apiNodeNames" />
|
||||||
|
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<Button :label="t('g.learnMore')" link />
|
<Button :label="t('g.learnMore')" link />
|
||||||
@@ -30,13 +30,10 @@
|
|||||||
import Button from 'primevue/button'
|
import Button from 'primevue/button'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
import ApiNodesCostBreakdown from '@/components/common/ApiNodesCostBreakdown.vue'
|
|
||||||
import type { ApiNodeCost } from '@/types/apiNodeTypes'
|
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const { apiNodes, onLogin, onCancel } = defineProps<{
|
const { apiNodeNames, onLogin, onCancel } = defineProps<{
|
||||||
apiNodes: ApiNodeCost[]
|
apiNodeNames: string[]
|
||||||
onLogin?: () => void
|
onLogin?: () => void
|
||||||
onCancel?: () => void
|
onCancel?: () => void
|
||||||
}>()
|
}>()
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import TemplateWorkflowsDialogHeader from '@/components/templates/TemplateWorkfl
|
|||||||
import { t } from '@/i18n'
|
import { t } from '@/i18n'
|
||||||
import type { ExecutionErrorWsMessage } from '@/schemas/apiSchema'
|
import type { ExecutionErrorWsMessage } from '@/schemas/apiSchema'
|
||||||
import { type ShowDialogOptions, useDialogStore } from '@/stores/dialogStore'
|
import { type ShowDialogOptions, useDialogStore } from '@/stores/dialogStore'
|
||||||
import { ApiNodeCost } from '@/types/apiNodeTypes'
|
|
||||||
import { ManagerTab } from '@/types/comfyManagerTypes'
|
import { ManagerTab } from '@/types/comfyManagerTypes'
|
||||||
|
|
||||||
export type ConfirmationDialogType =
|
export type ConfirmationDialogType =
|
||||||
@@ -225,14 +224,14 @@ export const useDialogService = () => {
|
|||||||
* @returns Promise that resolves to true if user clicks login, false if cancelled
|
* @returns Promise that resolves to true if user clicks login, false if cancelled
|
||||||
*/
|
*/
|
||||||
async function showApiNodesSignInDialog(
|
async function showApiNodesSignInDialog(
|
||||||
apiNodes: ApiNodeCost[]
|
apiNodeNames: string[]
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
return new Promise<boolean>((resolve) => {
|
return new Promise<boolean>((resolve) => {
|
||||||
dialogStore.showDialog({
|
dialogStore.showDialog({
|
||||||
key: 'api-nodes-signin',
|
key: 'api-nodes-signin',
|
||||||
component: ApiNodesSignInContent,
|
component: ApiNodesSignInContent,
|
||||||
props: {
|
props: {
|
||||||
apiNodes,
|
apiNodeNames,
|
||||||
onLogin: () => showSignInDialog().then((result) => resolve(result)),
|
onLogin: () => showSignInDialog().then((result) => resolve(result)),
|
||||||
onCancel: () => resolve(false)
|
onCancel: () => resolve(false)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user