Skip to content

Commit

Permalink
Merge branch 'master' into amoro-2875
Browse files Browse the repository at this point in the history
  • Loading branch information
huyuanfeng2018 authored Jul 19, 2024
2 parents 5e71bf5 + 1db63a6 commit 8542efa
Show file tree
Hide file tree
Showing 60 changed files with 525 additions and 530 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/trino-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ jobs:
cache: maven

- name: Validate checkstyle first
run: mvn validate -P trino-spotless
run: mvn validate -P format-mixed-format-trino

- name: Build trino module with Maven
run: mvn clean install -pl 'amoro-mixed-format/amoro-mixed-format-trino' -am -B -P hadoop2,trino-spotless,build-mixed-format-trino
run: mvn clean install -pl 'amoro-mixed-format/amoro-mixed-format-trino' -am -B -P hadoop2,format-mixed-format-trino,build-mixed-format-trino

- name: Code coverage
uses: codecov/codecov-action@v3
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ Amoro is built using Maven with JDK 8 and JDK 17(only for `amoro-mixed-format/am
* Build all modules without `amoro-mixed-format-trino`: `mvn clean package`
* Build and skip tests: `mvn clean package -DskipTests`
* Build and skip dashboard: `mvn clean package -Pskip-dashboard-build`
* Build and disable disk storage, RocksDB will NOT be introduced to avoid memory overflow: `mvn clean package -DskipTests -Pno-extented-disk-storage`
* Build with hadoop 2.x(the default is 3.x) dependencies: `mvn clean package -DskipTests -Phadoop2`
* Specify Flink version for Flink optimizer(the default is 1.18.1): `mvn clean package -DskipTests -Dflink-optimizer.flink-version=1.15.4`
* If the version of Flink is below 1.15.0, you also need to add the `-Pflink-optimizer-pre-1.15` parameter: `mvn clean package -DskipTests -Pflink-optimizer-pre-1.15 -Dflink-optimizer.flink-version=1.14.6`
* Specify Spark version for Spark optimizer(the default is 3.3.3): `mvn clean package -DskipTests -Dspark-optimizer.spark-version=3.2.2`
* Build `amoro-mixed-format-trino` module under JDK 17: `mvn clean package -DskipTests -Ptrino-spotless,build-mixed-format-trino -pl 'amoro-mixed-format/amoro-mixed-format-trino' -am`.
* Build `amoro-mixed-format-trino` module under JDK 17: `mvn clean package -DskipTests -Pformat-mixed-format-trino,build-mixed-format-trino -pl 'amoro-mixed-format/amoro-mixed-format-trino' -am`.
* Build all modules: `mvn clean package -DskipTests -Ptoolchain,build-mixed-format-trino`, besides you need config `toolchains.xml` in `${user.home}/.m2/` dir with content below.

```
Expand Down
2 changes: 1 addition & 1 deletion amoro-ams/amoro-ams-dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This is the Dashboard frontend for Amoro Management Service (AMS).

## Requirements

- node >= `16.x`
- node >= `18.18.0`
- pnpm

## Installing Dependencies
Expand Down
6 changes: 3 additions & 3 deletions amoro-ams/amoro-ams-dashboard/mock/modules/catalogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ export default [
url: '/mock/ams/v1/catalogs/test_catalog/databases',
method: 'get',
response: () => {
return { "message": "success", "code": 200, "result": ["db"] }
return { "message": "success", "code": 200, "result": ["db", "test", "acc"] }
},
},
{
url: '/mock/ams/v1/catalogs/test_catalog/databases/db/tables',
method: 'get',
response: () => {
return { "message": "success", "code": 200, "result": [{ "name": "user", "type": "ICEBERG" }] };
return { "message": "success", "code": 200, "result": [{ "name": "user", "type": "ICEBERG" },{ "name": "wf", "type": "ICEBERG" }, { "name": "xcvz", "type": "ICEBERG" }] };
},
},
{
Expand Down Expand Up @@ -131,7 +131,7 @@ export default [
response: () => ({ "message": "success", "code": 200, "result": true }),
},
{
url: '/mock/ams/v1/catalog/metastore/types',
url: '/mock/ams/v1/catalogs/metastore/types',
method: 'get',
response: () => ({
"message": "success",
Expand Down
3 changes: 3 additions & 0 deletions amoro-ams/amoro-ams-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"vite-plugin-svg-icons": "^2.0.1",
"vue-tsc": "^2.0.21"
},
"engines": {
"node": ">=18.18.0"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
Expand Down
2 changes: 1 addition & 1 deletion amoro-ams/amoro-ams-dashboard/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<url>https://amoro.apache.org</url>

<properties>
<node.version>v18.0.0</node.version>
<node.version>v18.18.0</node.version>
<pnpm.version>8.15.5</pnpm.version>
<maven-frontend-plugin.version>1.12.0</maven-frontend-plugin.version>
</properties>
Expand Down
6 changes: 4 additions & 2 deletions amoro-ams/amoro-ams-dashboard/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import enUS from 'ant-design-vue/es/locale/en_US'
import dayjs from 'dayjs'
import { ref, watch } from 'vue'
import { watch } from 'vue'
import { useI18n } from 'vue-i18n'
import 'dayjs/locale/zh-cn'

const locale = ref(enUS.locale)
const { locale } = useI18n()
dayjs.locale('en')

watch(locale, (val) => {
Expand Down
1 change: 0 additions & 1 deletion amoro-ams/amoro-ams-dashboard/src/components/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export default defineComponent({
transition: width 0.3s;
overflow: auto;
.content {
// padding: 16px 24px;
height: calc(100% - 48px);
overflow: auto;
}
Expand Down
141 changes: 62 additions & 79 deletions amoro-ams/amoro-ams-dashboard/src/components/Topbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
limitations under the License.
/ -->

<script lang="ts">
import { defineComponent, onMounted, reactive } from 'vue'
<script setup lang="ts">
import { onMounted, reactive } from 'vue'
import { Modal } from 'ant-design-vue'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'

import { DownOutlined, LogoutOutlined, QuestionCircleOutlined, TranslationOutlined } from '@ant-design/icons-vue'
import useStore from '@/store'
import { getVersionInfo } from '@/services/global.service'
import loginService from '@/services/login.service'
Expand All @@ -31,72 +32,61 @@ interface IVersion {
commitTime: string
}

export default defineComponent ({
name: 'Topbar',
setup() {
const verInfo = reactive<IVersion>({
version: '',
commitTime: '',
})

const { t, locale } = useI18n()
const router = useRouter()

const getVersion = async () => {
const res = await getVersionInfo()
if (res) {
verInfo.version = res.version
verInfo.commitTime = res.commitTime
}
}
const verInfo = reactive<IVersion>({
version: '',
commitTime: '',
})

const goLoginPage = () => {
router.push({ path: '/login' })
}
const { t, locale } = useI18n()
const router = useRouter()
const store = useStore()

const handleLogout = async () => {
Modal.confirm({
title: t('logoutModalTitle'),
okText: t('confirm'),
cancelText: t('cancel'),
onOk: async () => {
try {
await loginService.logout()
}
catch (error) {
}
finally {
const store = useStore()
store.updateUserInfo({
userName: '',
})
goLoginPage()
}
},
})
}
async function getVersion() {
const res = await getVersionInfo()
if (res) {
verInfo.version = res.version
verInfo.commitTime = res.commitTime
}
}

const goDocs = () => {
window.open('https://amoro.apache.org/docs/latest/')
}
function goLoginPage() {
router.push({ path: '/login' })
}

const setLocale = ({ key }: { key: string }) => {
if(locale.value !== key) {
locale.value = key
async function handleLogout() {
Modal.confirm({
title: t('logoutModalTitle'),
onOk: async () => {
try {
await loginService.logout()
}
};
catch (error) {
}
finally {
store.updateUserInfo({
userName: '',
})
goLoginPage()
}
},
})
}

onMounted(() => {
getVersion()
})
function goDocs() {
window.open('https://amoro.apache.org/docs/latest/')
}

return {
verInfo,
goDocs,
handleLogout,
setLocale,
}
},
function setLocale() {
if (locale.value === 'zh') {
locale.value = 'en'
}
else {
locale.value = 'zh'
}
}

onMounted(() => {
getVersion()
})
</script>

Expand All @@ -106,29 +96,22 @@ export default defineComponent ({
<span class="g-mr-8">{{ `${$t('version')}: ${verInfo.version}` }}</span>
<span class="g-mr-8">{{ `${$t('commitTime')}: ${verInfo.commitTime}` }}</span>
</div>
<a-tooltip placement="bottomRight" arrow-point-at-center overlay-class-name="topbar-tooltip">
<template #title>
{{ $t('userGuide') }}
</template>
<question-circle-outlined class="question-icon" @click="goDocs" />
</a-tooltip>
<a-dropdown>
<TranslationOutlined class="g-ml-8" />
<span>{{ store.userInfo.userName }} <DownOutlined /></span>
<template #overlay>
<a-menu @click="setLocale">
<a-menu-item key="en">English</a-menu-item>
<a-menu-item key="zh">中文</a-menu-item>
<a-menu>
<a-menu-item key="userGuide" @click="goDocs">
<QuestionCircleOutlined /> {{ $t('userGuide') }}
</a-menu-item>
<a-menu-item key="locale" @click="setLocale">
<TranslationOutlined /> {{ locale === 'zh' ? '切换至英文' : 'Switch To Chinese' }}
</a-menu-item>
<a-menu-item key="logout" @click="handleLogout">
<LogoutOutlined /> {{ $t('logout') }}
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
<a-tooltip>
<template #title>
{{ $t('logout') }}
</template>
<a-button class="logout-button" @click="handleLogout">
<LogoutOutlined style="font-size: 1.2em" />
</a-button>
</a-tooltip>
</div>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ export default defineComponent({
function getSearchTableList() {
debounce(() => {
getAllTableList()
})
})()
}

function getSearchDBList() {
debounce(() => {
getAllDatabaseList(true)
})
})()
}

function handleClickDb(item: IDatabaseItem) {
Expand Down Expand Up @@ -308,7 +308,7 @@ export default defineComponent({
v-model:value="DBSearchInput"
:placeholder="placeholder.filterDBPh"
class="theme-dark"
@change="() => handleSearch('db')"
@change="handleSearch('db')"
>
<template #prefix>
<SearchOutlined />
Expand All @@ -333,7 +333,7 @@ export default defineComponent({
v-model:value="tableSearchInput"
:placeholder="placeholder.filterTablePh"
class="theme-dark"
@change="() => handleSearch('table')"
@change="handleSearch('table')"
>
<template #prefix>
<SearchOutlined />
Expand Down
8 changes: 8 additions & 0 deletions amoro-ams/amoro-ams-dashboard/src/language/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,12 @@ export default {
noResourceGroupsTitle: 'No resource groups available.',
noResourceGroupsContent: 'Please create an optimizer group first.',
goToButtonText: 'Go',
snapshots: 'Snapshots',
details: 'Details',
operations: 'Operations',
Running: 'Running',
Canceled: 'Canceled',
Failed: 'Failed',
Finished: 'Finished',
Created: 'Created',
}
8 changes: 8 additions & 0 deletions amoro-ams/amoro-ams-dashboard/src/language/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,12 @@ export default {
noResourceGroupsTitle: '没有任何优化组',
noResourceGroupsContent: '需要首先创建一个默认优化组',
goToButtonText: '前往',
snapshots: '快照',
details: '详情',
operations: '操作',
Running: '运行中',
Canceled: '已取消',
Failed: '已失败',
Finished: '已结束',
Created: '已创建',
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type { IMap } from '@/types/common.type'
import request from '@/utils/request'

export function getCatalogsTypes() {
return request.get('ams/v1/catalog/metastore/types')
return request.get('ams/v1/catalogs/metastore/types')
}
export function getCatalogsSetting(catalogName: string) {
return request.get(`ams/v1/catalogs/${catalogName}`)
Expand Down
2 changes: 2 additions & 0 deletions amoro-ams/amoro-ams-dashboard/src/utils/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export function generateLineChartOption(titleText: string, data: ILineChartOrigi
grid: {
top: 40,
bottom: 50,
left: '1%',
containLabel: true,
},
}
titleText && (option.title = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const open = ref(true)
<AModal
v-model:open="open"
:width="560"
:title="`${$t('errorMessage')}`"
:title="$t('errorMessage')"
:footer="null"
class="upgrade-error"
@cancel="emit('cancel')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async function getDetails() {
}
}

function onCofirm() {
function onConfirm() {
getParams()
}

Expand Down Expand Up @@ -158,7 +158,7 @@ onMounted(() => {
</a-form>
</div>
<div class="footer-btn">
<a-button type="primary" :loading="loading" class="btn g-mr-12" @click="onCofirm">
<a-button type="primary" :loading="loading" class="btn g-mr-12" @click="onConfirm">
{{ $t('ok') }}
</a-button>
<a-button type="ghost" class="btn" @click="cancel">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ function releaseModal(record: any) {
}
Modal.confirm({
title: t('releaseOptModalTitle'),
content: '',
okText: '',
cancelText: '',
onOk: () => {
releaseJob(record)
},
Expand Down
Loading

0 comments on commit 8542efa

Please sign in to comment.