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