mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
bug fixes for webshare
This commit is contained in:
@@ -1652,12 +1652,13 @@ func ScreenWebShareCommand(ctx context.Context, pk *scpacket.FeCommandPacketType
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot create viewkey: %v", err)
|
||||
}
|
||||
webShareOpts := sstore.ScreenWebShareOpts{ShareName: shareName, ViewKey: base64.RawURLEncoding.EncodeToString(viewKeyBytes)}
|
||||
viewKey := base64.RawURLEncoding.EncodeToString(viewKeyBytes)
|
||||
webShareOpts := sstore.ScreenWebShareOpts{ShareName: shareName, ViewKey: viewKey}
|
||||
err = sstore.ScreenWebShareStart(ctx, ids.ScreenId, webShareOpts)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot web-share screen: %v", err)
|
||||
}
|
||||
infoMsg = fmt.Sprintf("screen is now shared to the web at %s", "[screen-share-url]")
|
||||
infoMsg = fmt.Sprintf("screen is now shared to the web at %s", fmt.Sprintf("screenid=%s viewkey=%s", ids.ScreenId, viewKey))
|
||||
} else {
|
||||
err = sstore.ScreenWebShareStop(ctx, ids.ScreenId)
|
||||
if err != nil {
|
||||
|
||||
@@ -62,6 +62,20 @@ func GetMappable[PT DBMappablePtr[T], T any](tx *txwrap.TxWrap, query string, ar
|
||||
return rtn
|
||||
}
|
||||
|
||||
func SelectMappable[PT DBMappablePtr[T], T any](tx *txwrap.TxWrap, query string, args ...interface{}) []PT {
|
||||
var rtn []PT
|
||||
marr := tx.SelectMaps(query, args...)
|
||||
for _, m := range marr {
|
||||
if len(m) == 0 {
|
||||
continue
|
||||
}
|
||||
val := PT(new(T))
|
||||
FromDBMap(val, m)
|
||||
rtn = append(rtn, val)
|
||||
}
|
||||
return rtn
|
||||
}
|
||||
|
||||
func SelectMapsGen[PT MapConverterPtr[T], T any](tx *txwrap.TxWrap, query string, args ...interface{}) []PT {
|
||||
var rtn []PT
|
||||
marr := tx.SelectMaps(query, args...)
|
||||
|
||||
@@ -50,8 +50,8 @@ func (ur *WebShareUpdateResponseType) GetSimpleKey() int64 {
|
||||
}
|
||||
|
||||
type WebShareRemotePtr struct {
|
||||
Alias string `json:"remotealias,omitempty"`
|
||||
CanonicalName string `json:"remotecanonicalname"`
|
||||
Alias string `json:"alias,omitempty"`
|
||||
CanonicalName string `json:"canonicalname"`
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user