{
	"name": "form/nc/nc-admin/nc-nats/nc-nats.json",
	"layout": {
		"component": "nc-form",
		"attribute": {
			"id": "nc_nats"
		},
		"element": [
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-tab",
						"attribute": {
							"model": "rec.tab",
							"v-on:change": "tabChanged('tab')"
						}
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": {
					"class": ["nc-margin-top"]
				},
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-header",
								"attribute": {
									"model": "hdr.nats.connection_status"
								}
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "auto"
										},
										"element": [
											{
												"component": "nc-label",
												"attribute": {
													"model": "hdr.nats.connection_status"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "auto"
										},
										"element": [
											{
												"component": "nc-icon",
												"attribute": {
													"icon": "rec.nats_connection_status == hdr.nats.connected ? 'check-circle' : 'times-circle'"
												}
											},
											{
												"component": "nc-label",
												"attribute": {
													"model": "rec.nats_connection_status"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-margin-top"]
								},
								"element": [
									{
										"component": "nc-divider"
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-margin-top"]
								},
								"element": [
									{
										"component": "nc-header",
										"attribute": {
											"model": "hdr.nats.statistics"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-margin-top"]
								},
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "1/2",
											"class": ["nc-stat-card"]
										},
										"element": [
											{
												"component": "nc-panel",
												"attribute": {
													"title": "hdr.nats.sent",
													"icon": "arrow-up"
												},
												"element": [
													{
														"component": "nc-row",
														"element": [
															{
																"component": "nc-label",
																"attribute": {
																	"model": "rec.stat_sent_count"
																}
															}
														]
													},
													{
														"component": "nc-row",
														"attribute": {
															"class": ["nc-margin-top"]
														},
														"element": [
															{
																"component": "nc-label",
																"attribute": {
																	"model": "rec.nats_stat_sent_bytes"
																}
															}
														]
													}
												]
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "1/2",
											"class": ["nc-stat-card"]
										},
										"element": [
											{
												"component": "nc-panel",
												"attribute": {
													"title": "hdr.nats.received",
													"icon": "arrow-down"
												},
												"element": [
													{
														"component": "nc-row",
														"element": [
															{
																"component": "nc-label",
																"attribute": {
																	"model": "rec.stat_received_count"
																}
															}
														]
													},
													{
														"component": "nc-row",
														"attribute": {
															"class": ["nc-margin-top"]
														},
														"element": [
															{
																"component": "nc-label",
																"attribute": {
																	"model": "rec.nats_stat_received_bytes"
																}
															}
														]
													}
												]
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-margin-top"]
								},
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "1/2",
											"class": ["nc-stat-card"]
										},
										"element": [
											{
												"component": "nc-panel",
												"attribute": {
													"title": "hdr.nats.message_rate",
													"icon": "tachometer-alt"
												},
												"element": [
													{
														"component": "nc-row",
														"element": [
															{
																"component": "nc-label",
																"attribute": {
																	"model": "rec.stat_message_rate"
																}
															}
														]
													},
													{
														"component": "nc-row",
														"attribute": {
															"class": ["nc-margin-top"]
														},
														"element": [
															{
																"component": "nc-label",
																"attribute": {
																	"model": "hdr.nats.per_second"
																}
															}
														]
													}
												]
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "1/2",
											"class": ["nc-stat-card"]
										},
										"element": [
											{
												"component": "nc-panel",
												"attribute": {
													"title": "hdr.nats.grid_rows",
													"icon": "table"
												},
												"element": [
													{
														"component": "nc-row",
														"element": [
															{
																"component": "nc-label",
																"attribute": {
																	"model": "rec.grid_row_count"
																}
															}
														]
													},
													{
														"component": "nc-row",
														"attribute": {
															"class": ["nc-margin-top"]
														},
														"element": [
															{
																"component": "nc-label",
																"attribute": {
																	"model": "hdr.nats.rows_in_grid"
																}
															}
														]
													}
												]
											}
										]
									}
								]
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": {
					"class": ["nc-margin-top"]
				},
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"width": "30em"
						},
						"element": [
							{
								"component": "nc-header",
								"attribute": {
									"model": "hdr.nats.test_controls"
								}
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-label-dropdown",
										"attribute": {
											"model": "rec.test_type",
											"hdrModel": "hdr.nats.test_type"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-margin-top"]
								},
								"element": [
									{
										"component": "nc-label-input",
										"attribute": {
											"model": "rec.test_row_count",
											"hdrModel": "hdr.nats.row_count",
											":disabled": "rec.test_type !== 'custom' || rec.test_running"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-margin-top"]
								},
								"element": [
									{
										"component": "nc-button",
										"attribute": {
											"model": "hdr.nats.start_test",
											"icon": "play",
											"v-on:click": "startTest()",
											":disabled": "rec.test_running"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-margin-top"]
								},
								"element": [
									{
										"component": "nc-button",
										"attribute": {
											"model": "hdr.nats.stop_test",
											"icon": "stop",
											"v-on:click": "stopTest()",
											":disabled": "!rec.test_running"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-margin-top"]
								},
								"element": [
									{
										"component": "nc-button",
										"attribute": {
											"model": "hdr.nats.clear_grid",
											"icon": "trash",
											"v-on:click": "clearGrid()"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-margin-top"]
								},
								"element": [
									{
										"component": "nc-label",
										"attribute": {
											"model": "hdr.nats.progress"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-margin-top"]
								},
								"element": [
									{
										"component": "nc-progress-bar",
										"attribute": {
											"percent": "rec.test_total_rows > 0 ? (rec.test_progress / rec.test_total_rows * 100) : 0",
											"status": "rec.test_running ? 'success' : null"
										}
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-label",
										"attribute": {
											"model": "nats_progress_label"
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"width": "auto"
						},
						"element": [
							{
								"component": "nc-header",
								"attribute": {
									"model": "hdr.nats.grid_display"
								}
							},
							{
								"component": "nc-grid",
								"attribute": {
									"id": "test_message",
									"model": "grid.test_message",
									"height": "80vh"
								}
							}
						]
					}
				]
			}
		]
	}
}
