github.com/erda-project/erda-infra@v1.0.9/providers/component-protocol/components/cardlist/operation.go (about) 1 // Copyright (c) 2021 Terminus, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package cardlist 16 17 import ( 18 "github.com/erda-project/erda-infra/providers/component-protocol/cptype" 19 ) 20 21 type ( 22 // OpCardListGoto define click operation of cardList . 23 OpCardListGoto struct { 24 cptype.Operation 25 ServerData *OpCardListGotoData `json:"serverData,omitempty"` 26 } 27 28 // OpCardListGotoData define click operation data of cardList . 29 OpCardListGotoData struct { 30 // if JumpOut is true ,open new window, else open slide window 31 JumpOut bool `json:"jumpOut"` 32 Target string `json:"target"` 33 Query cptype.ExtraMap `json:"query,omitempty"` 34 Params cptype.ExtraMap `json:"params,omitempty"` 35 } 36 ) 37 38 // OpKey . 39 func (o OpCardListGoto) OpKey() cptype.OperationKey { return "clickGoto" } 40 41 type ( 42 // OpCardListStar give card star. 43 OpCardListStar struct { 44 cptype.Operation 45 Icon string `json:"icon"` 46 Tip string `json:"tip"` 47 } 48 ) 49 50 // OpKey . 51 func (o OpCardListStar) OpKey() cptype.OperationKey { return "star" }