-
Notifications
You must be signed in to change notification settings - Fork 36
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
1 parent
fd77cf5
commit c72d061
Showing
12 changed files
with
380 additions
and
55 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,25 @@ | ||
import { getStreamingConfig } from '@/api/streaming' | ||
import type { ComputedRef } from 'vue' | ||
import { computed } from 'vue' | ||
import { useStore } from 'vuex' | ||
|
||
export default (): { | ||
isStreamingEnabled: ComputedRef<boolean> | ||
getStreamingIsEnabled: () => Promise<void> | ||
} => { | ||
const { state, commit } = useStore() | ||
const isStreamingEnabled = computed(() => state.isStreamingEnabled) | ||
const updateStreamingStatus = (isStreamingEnabled: boolean) => { | ||
commit('SET_IS_STREAMING_ENABLED', isStreamingEnabled) | ||
} | ||
const getStreamingIsEnabled = async () => { | ||
try { | ||
const { enable } = await getStreamingConfig() | ||
updateStreamingStatus(enable ?? false) | ||
return Promise.resolve() | ||
} catch (error) { | ||
return Promise.reject(error) | ||
} | ||
} | ||
return { isStreamingEnabled, getStreamingIsEnabled } | ||
} |
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,42 @@ | ||
export default { | ||
endpoints: { | ||
zh: '端点', | ||
en: 'Endpoints', | ||
}, | ||
streamingPlaceholder: { | ||
zh: '请先启用 Streaming', | ||
en: 'Please enable streaming first', | ||
}, | ||
streamingConfigurations: { | ||
zh: 'Streaming 配置', | ||
en: 'Streaming Configurations', | ||
}, | ||
hornbillEndpoints: { | ||
zh: 'Hornbill 端点', | ||
en: 'Hornbill Endpoints', | ||
}, | ||
hornbillEndpointsDesc: { | ||
zh: `Hornbill 节点的 http 接口端点,使用逗号分隔多个地址。<br /> | ||
例如:<code>127.0.0.1:8080, 127.0.0.1:8081</code><br /> | ||
未指定端口时,默认值为 8080。`, | ||
en: `The http interface endpoints of the Hornbill nodes to be linked, use commas to separate multiple addresses.<br /> | ||
i.e: <code>127.0.0.1:8080, 127.0.0.1:8081</code><br /> | ||
When the port is not specified, its default value is 8080.`, | ||
}, | ||
streamingEndpoints: { | ||
zh: 'Streaming 端点', | ||
en: 'Streaming Endpoints', | ||
}, | ||
streamingEndpointsDesc: { | ||
zh: `Hornbill 节点的 kafka 接口端点,使用逗号分隔多个地址。<br /> | ||
例如:<code>127.0.0.1:9092, 127.0.0.1:9093</code><br /> | ||
未指定端口时,默认值为 9092。`, | ||
en: `The streaming interface endpoints of the Hornbill nodes to be linked, use commas to separate multiple addresses.<br /> | ||
i.e: <code>127.0.0.1:9092,127.0.0.1:9093</code><br /> | ||
When the port is not specified, its default value is 9092.`, | ||
}, | ||
enableStreaming: { | ||
zh: '启用 Streaming', | ||
en: 'Enable Streaming', | ||
}, | ||
} |
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.