mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
return clientid in WaveInfoData, print for wsh version -v (#1252)
This commit is contained in:
parent
3216bc2389
commit
c34a5912e7
@ -54,6 +54,7 @@ func runVersionCmd(cmd *cobra.Command, args []string) error {
|
||||
if versionJSON {
|
||||
info := map[string]interface{}{
|
||||
"version": resp.Version,
|
||||
"clientid": resp.ClientId,
|
||||
"buildtime": resp.BuildTime,
|
||||
"configdir": resp.ConfigDir,
|
||||
"datadir": resp.DataDir,
|
||||
@ -69,6 +70,7 @@ func runVersionCmd(cmd *cobra.Command, args []string) error {
|
||||
|
||||
// Default verbose text output
|
||||
fmt.Printf("v%s (%s)\n", resp.Version, resp.BuildTime)
|
||||
fmt.Printf("clientid: %s\n", resp.ClientId)
|
||||
fmt.Printf("configdir: %s\n", resp.ConfigDir)
|
||||
fmt.Printf("datadir: %s\n", resp.DataDir)
|
||||
fmt.Printf("update-channel: %s\n", updateChannel)
|
||||
|
1
frontend/types/gotypes.d.ts
vendored
1
frontend/types/gotypes.d.ts
vendored
@ -869,6 +869,7 @@ declare global {
|
||||
// wshrpc.WaveInfoData
|
||||
type WaveInfoData = {
|
||||
version: string;
|
||||
clientid: string;
|
||||
buildtime: string;
|
||||
configdir: string;
|
||||
datadir: string;
|
||||
|
@ -448,6 +448,7 @@ type VDomUrlRequestResponse struct {
|
||||
|
||||
type WaveInfoData struct {
|
||||
Version string `json:"version"`
|
||||
ClientId string `json:"clientid"`
|
||||
BuildTime string `json:"buildtime"`
|
||||
ConfigDir string `json:"configdir"`
|
||||
DataDir string `json:"datadir"`
|
||||
|
@ -618,8 +618,13 @@ func (ws *WshServer) BlockInfoCommand(ctx context.Context, blockId string) (*wsh
|
||||
}
|
||||
|
||||
func (ws *WshServer) WaveInfoCommand(ctx context.Context) (*wshrpc.WaveInfoData, error) {
|
||||
client, err := wstore.DBGetSingleton[*waveobj.Client](ctx)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting client: %w", err)
|
||||
}
|
||||
return &wshrpc.WaveInfoData{
|
||||
Version: wavebase.WaveVersion,
|
||||
ClientId: client.OID,
|
||||
BuildTime: wavebase.BuildTime,
|
||||
ConfigDir: wavebase.GetWaveConfigDir(),
|
||||
DataDir: wavebase.GetWaveDataDir(),
|
||||
|
Loading…
Reference in New Issue
Block a user