Skip to content

Commit

Permalink
Merge branch 'apache:main' into chatbot
Browse files Browse the repository at this point in the history
  • Loading branch information
lhpqaq authored Oct 22, 2024
2 parents 8dd32aa + b880b01 commit 9415e8d
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .github/typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[default.extend-words]
ser = "ser"
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ jobs:
cache: 'maven'
- run: ./mvnw clean spotless:check

check-typos:
name: "Check typos"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
with:
config: .github/typos.toml

unit-tests-java:
name: "Run unit test(Java)"
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ mvn clean package -DskipTests
2. Run SQL DDL Script at `bigtop-manager-server/src/main/resources/ddl/MySQL-DDL-CREATE.sql`
3. Insert Test SQL Data at `dev-support/example/bigtop_manager/user.sql`
4. Start bigtop-manager-server `bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/ServerApplication.java`
5. Start bigtop-manager-agent `similiar with run bm-server`
5. Start bigtop-manager-agent `similar with run bm-server`
6. Start bigtop-manager-ui `configure nodejs environmment, default folder is bigtop-manager-ui/node, then run with package.json`
7. Visit `http://localhost:5173/`, default login user & password are `"admin"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ private Map.Entry<Boolean, List<Node>> topologicalSortImpl() {
// save the node whose degree is not 0
Map<Node, Integer> notZeroIndegreeNodeMap = new HashMap<>();

// Scan all the vertices and push vertexes with an entry degree of 0 to queue
// Scan all the vertices and push vertices with an entry degree of 0 to queue
for (Map.Entry<Node, NodeInfo> vertices : nodesMap.entrySet()) {
Node node = vertices.getKey();
int inDegree = getIndegree(node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
<name>security.mrhs.client.protocol.acl</name>
<value>*</value>
<description>ACL for HSClientProtocol, used by job clients to
communciate with the MR History Server job status etc.
communicate with the MR History Server job status etc.
The ACL is a comma-separated list of user and group names. The user and
group list is separated by a blank. For e.g. "alice,bob users,wheel".
A special value of "*" means all users are allowed.
Expand Down Expand Up @@ -213,7 +213,7 @@
<name>security.job.client.protocol.acl</name>
<value>*</value>
<description>ACL for MRClientProtocol, used by job clients to
communciate with the MR ApplicationMaster to query job status etc.
communicate with the MR ApplicationMaster to query job status etc.
The ACL is a comma-separated list of user and group names. The user and
group list is separated by a blank. For e.g. "alice,bob users,wheel".
A special value of "*" means all users are allowed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
<description>
Auxilliary services of NodeManager.
Auxiliary services of NodeManager.
A valid service name should only contain a-zA-Z0-9_ and can not start with numbers
</description>
</property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,7 @@ public static Boolean downloadFile(String fileUrl, String saveDir) {
int responseCode = httpConn.getResponseCode();

if (responseCode == HttpURLConnection.HTTP_OK) {
String fileName = "";
String disposition = httpConn.getHeaderField("Content-Disposition");

if (disposition != null) {
int index = disposition.indexOf("filename=");
if (index > 0) {
fileName = disposition.substring(index + 10, disposition.length() - 1);
}
} else {
fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);
}

String fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);
InputStream inputStream = httpConn.getInputStream();
String saveFilePath = saveDir + File.separator + fileName;

Expand Down
12 changes: 6 additions & 6 deletions bigtop-manager-ui/src/components/chatbot/chat-window.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
const {
loading,
receiving,
messageReciver,
messageReceiver,
fetchSendChatMessage,
fetchThreadChatHistory
} = useChatBot()
Expand All @@ -58,7 +58,7 @@
)
const tempMsg = computed<ChatThreadHistoryItem>(() => ({
sender: 'AI',
message: messageReciver.value || '...'
message: messageReceiver.value || '...'
}))

watch(isExpand, () => handleScrollToBottom())
Expand All @@ -80,7 +80,7 @@
inputText.value = (e.target as Element)?.textContent || ''
}

const reciveMessage = async () => {
const receiveMessage = async () => {
try {
receiving.value = true
const { threadId, authId } = chatPayload.value
Expand Down Expand Up @@ -124,7 +124,7 @@
updateThreadChatHistory('USER', inputText.value as string)
handleScrollToBottom()
clearUpInputContent()
reciveMessage()
receiveMessage()
}

const handleScrollToBottom = () => {
Expand All @@ -138,7 +138,7 @@
</script>

<template>
<div class="platfrom-chat">
<div class="platform-chat">
<section class="chat-container">
<chat-msg-item
v-for="(chatItem, index) of tempHistory"
Expand Down Expand Up @@ -182,7 +182,7 @@
</template>

<style lang="scss" scoped>
.platfrom-chat {
.platform-chat {
@include flexbox($direction: column, $justify: space-between);
position: relative;
height: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
})) as Option[]
})

const platformSeletions = computed<SelectData[]>(() => [
const platformSelections = computed<SelectData[]>(() => [
{
title: t('ai.select_platform_to_authorize'),
hasDel: false,
Expand Down Expand Up @@ -86,7 +86,7 @@
<template>
<div class="platform-selection">
<a-spin :spinning="loading">
<select-menu :select-data="platformSeletions" @select="onSelect" />
<select-menu :select-data="platformSelections" @select="onSelect" />
</a-spin>
</div>
</template>
Expand Down
14 changes: 7 additions & 7 deletions bigtop-manager-ui/src/composables/use-chat-bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const useChatBot = () => {
const receiving = ref(false)
const checkLoading = ref(false)
const canceler = ref<Canceler>()
const messageReciver = ref('')
const messageReceiver = ref('')

function formatAuthCredentials<T extends Object>(
authFormData: T
Expand Down Expand Up @@ -132,10 +132,10 @@ const useChatBot = () => {
}
}

async function fetchCreateChatThread(platfromInfo: ChatThreadCondition) {
async function fetchCreateChatThread(platformInfo: ChatThreadCondition) {
try {
loading.value = true
const data = await createChatThread(platfromInfo)
const data = await createChatThread(platformInfo)
return Promise.resolve(data)
} catch (error) {
console.log('error :>> ', error)
Expand Down Expand Up @@ -198,7 +198,7 @@ const useChatBot = () => {
}

const onMessageReceive = ({ event }: AxiosProgressEvent) => {
messageReciver.value = event.target.responseText
messageReceiver.value = event.target.responseText
.split('data:')
.map((s: string) => {
return s.trimEnd()
Expand All @@ -207,8 +207,8 @@ const useChatBot = () => {
}

const onMessageComplete = () => {
const formatResultMsg = messageReciver.value
messageReciver.value = ''
const formatResultMsg = messageReceiver.value
messageReceiver.value = ''
cancelSseConnect()
return Promise.resolve({ message: formatResultMsg, state: true })
}
Expand All @@ -221,7 +221,7 @@ const useChatBot = () => {
}

return {
messageReciver,
messageReceiver,
loading,
receiving,
checkLoading,
Expand Down
2 changes: 1 addition & 1 deletion dev-support/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ git clone https://github.com/apache/bigtop-manager.git
> You need to change the `node.version` in the `pom.xml` file under the `bigtop-manager-ui` module to `16.x` if you are using CentOS-7.
### **Step 3**: Build develop basic image
Run the setup command, you will get `bigtop-manager/develop:trunk-rocky-8` image. It has the enviroment needed to compile Bigtop-Manager and run servers such as Bigtop-Manager Server, Bigtop-Manager Agent, Mysql, etc.
Run the setup command, you will get `bigtop-manager/develop:trunk-rocky-8` image. It has the environment needed to compile Bigtop-Manager and run servers such as Bigtop-Manager Server, Bigtop-Manager Agent, Mysql, etc.

**RHEL (Rocky 8) :**
```shell
Expand Down

0 comments on commit 9415e8d

Please sign in to comment.