Skip to content

Commit

Permalink
fix(endpoint): 创建校验修改
Browse files Browse the repository at this point in the history
  • Loading branch information
ssongliu committed Jul 21, 2022
1 parent 0ed6422 commit 67222e2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
28 changes: 20 additions & 8 deletions web/dashboard/src/business/network/endpoints/create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<el-form label-position="top" :model="form" ref="form" :rules="rules">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item :label="$t('commons.table.name')" required prop="metadata.name">
<el-form-item :label="$t('commons.table.name')" prop="metadata.name">
<el-input clearable v-model="form.metadata.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item :label="$t('business.namespace.namespace')" required prop="metadata.namespace">
<el-form-item :label="$t('business.namespace.namespace')" prop="metadata.namespace">
<ko-select :namespace.sync="form.metadata.namespace"></ko-select>
</el-form-item>
</el-col>
Expand Down Expand Up @@ -46,7 +46,7 @@
</table>
</ko-card>
</el-tab-pane>
<el-tab-pane name="Port" label="ports">
<el-tab-pane name="Port" :label="$t('business.network.port')">
<ko-card :title="$t('business.network.port')">
<table style="width: 100%;padding: 0" class="tab-table">
<tr>
Expand Down Expand Up @@ -111,7 +111,6 @@ import Rule from "@/utils/rules"
import KoCard from "@/components/ko-card"
import { listNodes } from "@/api/nodes"
import { checkPermissions } from "@/utils/permission"
// import KoFormItem from "@/components/ko-form-item/index"
export default {
name: "EndpointCreate",
Expand Down Expand Up @@ -150,8 +149,21 @@ export default {
this.$router.push({ name: "Endpoints" })
},
onEditYaml() {
this.showYaml = true
this.yaml = this.transformYaml()
this.$refs["form"].validate((valid) => {
if (!valid) {
this.$confirm(this.$t("commons.validate.params_not_complete") + this.$t("commons.confirm_message.open_yaml"), this.$t("commons.message_box.prompt"), {
confirmButtonText: this.$t("commons.button.confirm"),
cancelButtonText: this.$t("commons.button.cancel"),
type: "warning",
}).then(() => {
this.showYaml = true
this.yaml = this.transformYaml()
})
} else {
this.showYaml = true
this.yaml = this.transformYaml()
}
})
},
backToForm() {
this.$confirm(this.$t("commons.confirm_message.back_form"), this.$t("commons.message_box.prompt"), {
Expand All @@ -174,7 +186,7 @@ export default {
})
},
handleAdd(subset) {
const item = {ip: ""}
const item = { ip: "" }
subset.addresses.push(item)
},
handleDelete(subset, index) {
Expand Down Expand Up @@ -239,4 +251,4 @@ export default {
</script>

<style scoped>
</style>
</style>
4 changes: 2 additions & 2 deletions web/terminal/src/app/logging/logging.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ export class LoggingComponent implements AfterViewInit {
this.term.write(msg.data)
}
this.conn_.onclose = () => {
alert("The connection has been disconnected. Please close the current page and check the system login status...")
this.term.write("\n\n******** Connection failure, terminal not supported or connection timeout... *******")
}
this.term.focus();
this.cdr_.markForCheck()
}
} catch (e) {
alert(e.error.message)
this.term.write(e.error.message)
}

}
Expand Down
4 changes: 2 additions & 2 deletions web/terminal/src/app/terminal/terminal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class TerminalComponent implements AfterViewInit {
this.initTerm()
this.cdr_.markForCheck();
} catch (e) {
console.log(e.error.message)
this.term.write(e.error.message)
}
}

Expand All @@ -198,7 +198,7 @@ export class TerminalComponent implements AfterViewInit {
}

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

0 comments on commit 67222e2

Please sign in to comment.