return clientid in WaveInfoData, print for wsh version -v (#1252)

This commit is contained in:
Mike Sawka 2024-11-08 14:19:56 -08:00 committed by GitHub
parent 3216bc2389
commit c34a5912e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 0 deletions

View File

@ -54,6 +54,7 @@ func runVersionCmd(cmd *cobra.Command, args []string) error {
if versionJSON { if versionJSON {
info := map[string]interface{}{ info := map[string]interface{}{
"version": resp.Version, "version": resp.Version,
"clientid": resp.ClientId,
"buildtime": resp.BuildTime, "buildtime": resp.BuildTime,
"configdir": resp.ConfigDir, "configdir": resp.ConfigDir,
"datadir": resp.DataDir, "datadir": resp.DataDir,
@ -69,6 +70,7 @@ func runVersionCmd(cmd *cobra.Command, args []string) error {
// Default verbose text output // Default verbose text output
fmt.Printf("v%s (%s)\n", resp.Version, resp.BuildTime) 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("configdir: %s\n", resp.ConfigDir)
fmt.Printf("datadir: %s\n", resp.DataDir) fmt.Printf("datadir: %s\n", resp.DataDir)
fmt.Printf("update-channel: %s\n", updateChannel) fmt.Printf("update-channel: %s\n", updateChannel)

View File

@ -869,6 +869,7 @@ declare global {
// wshrpc.WaveInfoData // wshrpc.WaveInfoData
type WaveInfoData = { type WaveInfoData = {
version: string; version: string;
clientid: string;
buildtime: string; buildtime: string;
configdir: string; configdir: string;
datadir: string; datadir: string;

View File

@ -448,6 +448,7 @@ type VDomUrlRequestResponse struct {
type WaveInfoData struct { type WaveInfoData struct {
Version string `json:"version"` Version string `json:"version"`
ClientId string `json:"clientid"`
BuildTime string `json:"buildtime"` BuildTime string `json:"buildtime"`
ConfigDir string `json:"configdir"` ConfigDir string `json:"configdir"`
DataDir string `json:"datadir"` DataDir string `json:"datadir"`

View File

@ -618,8 +618,13 @@ func (ws *WshServer) BlockInfoCommand(ctx context.Context, blockId string) (*wsh
} }
func (ws *WshServer) WaveInfoCommand(ctx context.Context) (*wshrpc.WaveInfoData, error) { 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{ return &wshrpc.WaveInfoData{
Version: wavebase.WaveVersion, Version: wavebase.WaveVersion,
ClientId: client.OID,
BuildTime: wavebase.BuildTime, BuildTime: wavebase.BuildTime,
ConfigDir: wavebase.GetWaveConfigDir(), ConfigDir: wavebase.GetWaveConfigDir(),
DataDir: wavebase.GetWaveDataDir(), DataDir: wavebase.GetWaveDataDir(),