mirror of
https://github.com/openziti/zrok.git
synced 2025-01-03 04:29:19 +01:00
'activity' (#234)
This commit is contained in:
parent
d0a565d769
commit
d1688c450d
@ -76,7 +76,7 @@ func (h *environmentDetailHandler) Handle(params metadata.GetEnvironmentDetailPa
|
||||
FrontendEndpoint: feEndpoint,
|
||||
BackendProxyEndpoint: beProxyEndpoint,
|
||||
Reserved: shr.Reserved,
|
||||
SparkData: sparkData,
|
||||
Activity: sparkData,
|
||||
CreatedAt: shr.CreatedAt.UnixMilli(),
|
||||
UpdatedAt: shr.UpdatedAt.UnixMilli(),
|
||||
})
|
||||
|
@ -77,7 +77,7 @@ func (h *shareDetailHandler) Handle(params metadata.GetShareDetailParams, princi
|
||||
FrontendEndpoint: feEndpoint,
|
||||
BackendProxyEndpoint: beProxyEndpoint,
|
||||
Reserved: shr.Reserved,
|
||||
SparkData: sparkData,
|
||||
Activity: sparkData,
|
||||
CreatedAt: shr.CreatedAt.UnixMilli(),
|
||||
UpdatedAt: shr.UpdatedAt.UnixMilli(),
|
||||
})
|
||||
|
@ -18,6 +18,9 @@ import (
|
||||
// swagger:model share
|
||||
type Share struct {
|
||||
|
||||
// activity
|
||||
Activity SparkData `json:"activity,omitempty"`
|
||||
|
||||
// backend mode
|
||||
BackendMode string `json:"backendMode,omitempty"`
|
||||
|
||||
@ -39,9 +42,6 @@ type Share struct {
|
||||
// share mode
|
||||
ShareMode string `json:"shareMode,omitempty"`
|
||||
|
||||
// spark data
|
||||
SparkData SparkData `json:"sparkData,omitempty"`
|
||||
|
||||
// token
|
||||
Token string `json:"token,omitempty"`
|
||||
|
||||
@ -56,7 +56,7 @@ type Share struct {
|
||||
func (m *Share) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateSparkData(formats); err != nil {
|
||||
if err := m.validateActivity(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
@ -66,16 +66,16 @@ func (m *Share) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Share) validateSparkData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.SparkData) { // not required
|
||||
func (m *Share) validateActivity(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Activity) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.SparkData.Validate(formats); err != nil {
|
||||
if err := m.Activity.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("sparkData")
|
||||
return ve.ValidateName("activity")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("sparkData")
|
||||
return ce.ValidateName("activity")
|
||||
}
|
||||
return err
|
||||
}
|
||||
@ -87,7 +87,7 @@ func (m *Share) validateSparkData(formats strfmt.Registry) error {
|
||||
func (m *Share) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateSparkData(ctx, formats); err != nil {
|
||||
if err := m.contextValidateActivity(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
@ -97,13 +97,13 @@ func (m *Share) ContextValidate(ctx context.Context, formats strfmt.Registry) er
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Share) contextValidateSparkData(ctx context.Context, formats strfmt.Registry) error {
|
||||
func (m *Share) contextValidateActivity(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if err := m.SparkData.ContextValidate(ctx, formats); err != nil {
|
||||
if err := m.Activity.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("sparkData")
|
||||
return ve.ValidateName("activity")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("sparkData")
|
||||
return ce.ValidateName("activity")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
@ -1266,6 +1266,9 @@ func init() {
|
||||
"share": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"activity": {
|
||||
"$ref": "#/definitions/sparkData"
|
||||
},
|
||||
"backendMode": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -1287,9 +1290,6 @@ func init() {
|
||||
"shareMode": {
|
||||
"type": "string"
|
||||
},
|
||||
"sparkData": {
|
||||
"$ref": "#/definitions/sparkData"
|
||||
},
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -2713,6 +2713,9 @@ func init() {
|
||||
"share": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"activity": {
|
||||
"$ref": "#/definitions/sparkData"
|
||||
},
|
||||
"backendMode": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -2734,9 +2737,6 @@ func init() {
|
||||
"shareMode": {
|
||||
"type": "string"
|
||||
},
|
||||
"sparkData": {
|
||||
"$ref": "#/definitions/sparkData"
|
||||
},
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -844,7 +844,7 @@ definitions:
|
||||
type: string
|
||||
reserved:
|
||||
type: boolean
|
||||
sparkData:
|
||||
activity:
|
||||
$ref: "#/definitions/sparkData"
|
||||
createdAt:
|
||||
type: integer
|
||||
|
@ -200,7 +200,7 @@
|
||||
* @property {string} frontendEndpoint
|
||||
* @property {string} backendProxyEndpoint
|
||||
* @property {boolean} reserved
|
||||
* @property {module:types.sparkData} sparkData
|
||||
* @property {module:types.sparkData} activity
|
||||
* @property {number} createdAt
|
||||
* @property {number} updatedAt
|
||||
*/
|
||||
|
@ -47,7 +47,7 @@ const SharesTab = (props) => {
|
||||
grow: 0.5,
|
||||
cell: row => {
|
||||
return <ResponsiveContainer width={"100%"} height={"100%"}>
|
||||
<AreaChart data={row.sparkData}>
|
||||
<AreaChart data={row.activity}>
|
||||
<Area type={"basis"} dataKey={(v) => v.rx ? v.rx : 0} stroke={"#231069"} fill={"#04adef"} isAnimationActive={false} dot={false} />
|
||||
<Area type={"basis"} dataKey={(v) => v.tx ? v.tx * -1 : 0} stroke={"#231069"} fill={"#9BF316"} isAnimationActive={false} dot={false} />
|
||||
</AreaChart>
|
||||
|
@ -40,7 +40,7 @@ const ShareDetail = (props) => {
|
||||
}, [props.selection]);
|
||||
|
||||
const customProperties = {
|
||||
sparkData: row => (
|
||||
activity: row => (
|
||||
<ResponsiveContainer width={"100%"} height={"100%"}>
|
||||
<AreaChart data={row.value}>
|
||||
<Area type={"basis"} dataKey={(v) => v.rx ? v.rx : 0} stroke={"#231069"} fill={"#04adef"} isAnimationActive={false} dot={false} />
|
||||
|
Loading…
Reference in New Issue
Block a user