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 {
|
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)
|
||||||
|
1
frontend/types/gotypes.d.ts
vendored
1
frontend/types/gotypes.d.ts
vendored
@ -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;
|
||||||
|
@ -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"`
|
||||||
|
@ -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(),
|
||||||
|
Loading…
Reference in New Issue
Block a user