Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into improve-target-table
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangshenghang committed Jan 9, 2025
2 parents b7eee91 + 837a235 commit 0824d16
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.seatunnel.app.service.IJobDefinitionService;
import org.apache.seatunnel.app.service.IJobTaskService;
import org.apache.seatunnel.server.common.CodeGenerateUtils;
import org.apache.seatunnel.server.common.SeatunnelErrorEnum;

import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
Expand Down Expand Up @@ -60,7 +61,11 @@ Result<Long> createJobDefinition(
@ApiParam(value = "userId", required = true) @RequestAttribute("userId") Integer userId,
@RequestBody JobReq jobReq)
throws CodeGenerateUtils.CodeGenerateException {
return Result.success(jobService.createJob(userId, jobReq));
if (jobService.getJob(jobReq.getName()).isEmpty()) {
return Result.success(jobService.createJob(userId, jobReq));
} else {
return Result.failure(SeatunnelErrorEnum.TASK_NAME_ALREADY_EXISTS);
}
}

@GetMapping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public enum SeatunnelErrorEnum {
MISSING_PARAM(1777000, "param miss [{0}]", "param miss [{0}]"),
PARAM_CAN_NOT_BE_NULL(60018, "", "param [%s] can not be null or empty"),
INVALID_PARAM(60019, "", "param [%s] is invalid. %s"),
TASK_NAME_ALREADY_EXISTS(60020, "task name already exists", "task [%s] already exists"),
RESOURCE_NOT_FOUND(404, "", "%s"),
;

Expand Down
4 changes: 1 addition & 3 deletions seatunnel-ui/src/assets/styles/default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
* limitations under the License.
*/

$box-node-content: "Double click to configure. After configure, Connect each node ends to another.";

.x6-graph-scroller {
overflow: hidden !important;
&:hover {
Expand All @@ -35,7 +33,7 @@
.x6-widget-selection-box.x6-widget-selection-box-node:hover {
position: relative;
&::before {
content: $box-node-content;
content: var(--node-config-hint);
width: 210px;
height: 40px;
background: #eeecec;
Expand Down
5 changes: 4 additions & 1 deletion seatunnel-ui/src/locales/en_US/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,8 @@ export default {
theme,
project,
hook,
transforms
transforms,
dag: {
nodeConfigHint: 'Double click to configure. After configure, Connect each node ends to another.'
}
}
5 changes: 4 additions & 1 deletion seatunnel-ui/src/locales/zh_CN/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,8 @@ export default {
theme,
project,
hook,
transforms
transforms,
dag: {
nodeConfigHint: '双击节点进行配置。配置完成后,连接每个节点的端点到其他节点。'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { defineComponent, ref, onMounted } from 'vue'
import { defineComponent, ref, onMounted, watch } from 'vue'
import { DagSidebar } from './sidebar'
import { DagCanvas } from './canvas'
import { DagToolbar } from './toolbar'
Expand All @@ -32,7 +32,7 @@ const SynchronizationDefinitionDag = defineComponent({
type: '',
name: ''
}
const { t } = useI18n()
const { t, locale } = useI18n()
const { state, detailInit, onDelete, onSave } = useDagDetail()
const handelDragstart = (type: any, name: any) => {
tempNode.type = type
Expand Down Expand Up @@ -85,8 +85,22 @@ const SynchronizationDefinitionDag = defineComponent({
result.nodesAndEdges.edges
)
}
document.documentElement.style.setProperty(
'--node-config-hint',
`"${t('dag.nodeConfigHint')}"`
)
})

watch(
() => locale.value,
() => {
document.documentElement.style.setProperty(
'--node-config-hint',
`"${t('dag.nodeConfigHint')}"`
)
}
)

return () => (
<NSpin show={state.loading}>
<NSpace vertical>
Expand Down

0 comments on commit 0824d16

Please sign in to comment.