list

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterInfoDetail

type ClusterInfoDetail struct {
	Name        string
	Version     string
	NodeCnt     int
	ClusterType string
	Management  string
	CreateTime  string
	UpdateTime  string
	Status      string
	RawStatus   string // "pending","online","offline" ,"initializing","initialize error","unknown"
}

type Command

type Command struct {
	Key     string       `json:"key,omitempty"`
	Command CommandState `json:"state,omitempty"`
	Target  string       `json:"target,omitempty"`
	JumpOut bool         `json:"jumpOut,omitempty"`
}

type CommandState

type CommandState struct {
	Params   Params                 `json:"params,omitempty"`
	Visible  bool                   `json:"visible,omitempty"`
	FormData FormData               `json:"formData,omitempty"`
	Query    map[string]interface{} `json:"query,omitempty"`
}

type DataItem

type DataItem struct {
	ID            int                  `json:"id"`
	Title         string               `json:"title"`
	Description   string               `json:"description"`
	PrefixImg     string               `json:"prefixImg"`
	BackgroundImg string               `json:"backgroundImg"`
	ExtraInfos    []ExtraInfos         `json:"extraInfos"`
	Status        ItemStatus           `json:"status"`
	ExtraContent  ExtraContent         `json:"extraContent"`
	Operations    map[string]Operation `json:"operations"`
}

type ExtraContent

type ExtraContent struct {
	Type      string      `json:"type"`
	RowNum    int         `json:"rowNum"`
	ExtraData []ExtraData `json:"data"`
}

type ExtraData

type ExtraData struct {
	Name        string          `json:"name"`
	Value       float64         `json:"value"`
	CenterLabel string          `json:"centerLabel"`
	Total       int             `json:"total"`
	Color       string          `json:"color"`
	Info        []ExtraDataItem `json:"info"`
}

type ExtraDataItem

type ExtraDataItem struct {
	Main string `json:"main"`
	Sub  string `json:"sub"`
}

type ExtraInfos

type ExtraInfos struct {
	Icon    string `json:"icon"`
	Text    string `json:"text"`
	Tooltip string `json:"tooltip"`
}

type FormData

type FormData struct {
	RecordId string `json:"recordId,omitempty"`
}

type ItemStatus

type ItemStatus struct {
	Text   string `json:"text"`
	Status string `json:"status"`
}

type List

type List struct {
	SDK        *cptype.SDK
	Bdl        *bundle.Bundle
	Ctx        context.Context
	ClusterSvc clusterpb.ClusterServiceServer
	Data       map[string][]DataItem `json:"data"`
	State      State                 `json:"state"`
}

func (*List) GetBgImage

func (l *List) GetBgImage(c *clusterpb.ClusterInfo) string

func (*List) GetComponentValue

func (l *List) GetComponentValue() error

func (*List) GetData

func (l *List) GetData(ctx context.Context) (map[string][]DataItem, error)

func (*List) GetExtraContent

func (l *List) GetExtraContent(res *ResData) ExtraContent

func (*List) GetExtraInfos

func (l *List) GetExtraInfos(clusterInfo *ClusterInfoDetail) []ExtraInfos

func (*List) GetNodes

func (l *List) GetNodes(clusterName string) ([]data.Object, error)

func (*List) GetOperations

func (l *List) GetOperations(clusterInfo *clusterpb.ClusterInfo, status string) map[string]Operation

func (*List) GetState

func (l *List) GetState() State

func (*List) GetVersion

func (l *List) GetVersion(clusterName string) (string, error)

func (*List) Init

func (l *List) Init(ctx servicehub.Context) error

func (*List) Render

func (*List) SetComponentValue

func (l *List) SetComponentValue(c *cptype.Component) error

SetComponentValue mapping properties to Component

func (*List) WithMachine

func (l *List) WithMachine(clusterInfo *ClusterInfoDetail) string

func (*List) WithManage

func (l *List) WithManage(clusterInfo *ClusterInfoDetail) string

func (*List) WithType

func (l *List) WithType(clusterInfo *ClusterInfoDetail) string

func (*List) WithUpdateTime

func (l *List) WithUpdateTime(clusterInfo *ClusterInfoDetail) string

func (*List) WithVersion

func (l *List) WithVersion(clusterInfo *ClusterInfoDetail) string

type Operation

type Operation struct {
	Key    string      `json:"key"`
	Reload bool        `json:"reload"`
	Show   bool        `json:"show"`
	Meta   interface{} `json:"meta"`
	Text   string      `json:"text"`
}

type Params

type Params struct {
	NodeId string `json:"nodeId,omitempty"`
	NodeIP string `json:"nodeIP,omitempty"`
}

type ResData

type ResData struct {
	CpuUsed     float64
	CpuTotal    float64
	MemoryUsed  float64
	MemoryTotal float64
	PodUsed     float64
	PodTotal    float64
}

type State

type State struct {
	PageNo bool `json:"pageNo"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL