Skip to content

Commit 67222e2

Browse files
committed
fix(endpoint): 创建校验修改
1 parent 0ed6422 commit 67222e2

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

web/dashboard/src/business/network/endpoints/create/index.vue

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<el-form label-position="top" :model="form" ref="form" :rules="rules">
55
<el-row :gutter="20">
66
<el-col :span="6">
7-
<el-form-item :label="$t('commons.table.name')" required prop="metadata.name">
7+
<el-form-item :label="$t('commons.table.name')" prop="metadata.name">
88
<el-input clearable v-model="form.metadata.name"></el-input>
99
</el-form-item>
1010
</el-col>
1111
<el-col :span="3">
12-
<el-form-item :label="$t('business.namespace.namespace')" required prop="metadata.namespace">
12+
<el-form-item :label="$t('business.namespace.namespace')" prop="metadata.namespace">
1313
<ko-select :namespace.sync="form.metadata.namespace"></ko-select>
1414
</el-form-item>
1515
</el-col>
@@ -46,7 +46,7 @@
4646
</table>
4747
</ko-card>
4848
</el-tab-pane>
49-
<el-tab-pane name="Port" label="ports">
49+
<el-tab-pane name="Port" :label="$t('business.network.port')">
5050
<ko-card :title="$t('business.network.port')">
5151
<table style="width: 100%;padding: 0" class="tab-table">
5252
<tr>
@@ -111,7 +111,6 @@ import Rule from "@/utils/rules"
111111
import KoCard from "@/components/ko-card"
112112
import { listNodes } from "@/api/nodes"
113113
import { checkPermissions } from "@/utils/permission"
114-
// import KoFormItem from "@/components/ko-form-item/index"
115114
116115
export default {
117116
name: "EndpointCreate",
@@ -150,8 +149,21 @@ export default {
150149
this.$router.push({ name: "Endpoints" })
151150
},
152151
onEditYaml() {
153-
this.showYaml = true
154-
this.yaml = this.transformYaml()
152+
this.$refs["form"].validate((valid) => {
153+
if (!valid) {
154+
this.$confirm(this.$t("commons.validate.params_not_complete") + this.$t("commons.confirm_message.open_yaml"), this.$t("commons.message_box.prompt"), {
155+
confirmButtonText: this.$t("commons.button.confirm"),
156+
cancelButtonText: this.$t("commons.button.cancel"),
157+
type: "warning",
158+
}).then(() => {
159+
this.showYaml = true
160+
this.yaml = this.transformYaml()
161+
})
162+
} else {
163+
this.showYaml = true
164+
this.yaml = this.transformYaml()
165+
}
166+
})
155167
},
156168
backToForm() {
157169
this.$confirm(this.$t("commons.confirm_message.back_form"), this.$t("commons.message_box.prompt"), {
@@ -174,7 +186,7 @@ export default {
174186
})
175187
},
176188
handleAdd(subset) {
177-
const item = {ip: ""}
189+
const item = { ip: "" }
178190
subset.addresses.push(item)
179191
},
180192
handleDelete(subset, index) {
@@ -239,4 +251,4 @@ export default {
239251
</script>
240252

241253
<style scoped>
242-
</style>
254+
</style>

web/terminal/src/app/logging/logging.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ export class LoggingComponent implements AfterViewInit {
7777
this.term.write(msg.data)
7878
}
7979
this.conn_.onclose = () => {
80-
alert("The connection has been disconnected. Please close the current page and check the system login status...")
80+
this.term.write("\n\n******** Connection failure, terminal not supported or connection timeout... *******")
8181
}
8282
this.term.focus();
8383
this.cdr_.markForCheck()
8484
}
8585
} catch (e) {
86-
alert(e.error.message)
86+
this.term.write(e.error.message)
8787
}
8888

8989
}

web/terminal/src/app/terminal/terminal.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export class TerminalComponent implements AfterViewInit {
174174
this.initTerm()
175175
this.cdr_.markForCheck();
176176
} catch (e) {
177-
console.log(e.error.message)
177+
this.term.write(e.error.message)
178178
}
179179
}
180180

@@ -198,7 +198,7 @@ export class TerminalComponent implements AfterViewInit {
198198
}
199199

200200
private onConnectionClose(_evt?: SJSCloseEvent): void {
201-
alert("The connection has been disconnected. Please close the current page and check the system login status...")
201+
this.term.write("\n\n******** Connection failure, terminal not supported or connection timeout... *******")
202202
if (!this.connected_) {
203203
return;
204204
}

0 commit comments

Comments
 (0)