diff --git a/api/swagger-ui/index.html b/api/swagger-ui/index.html index 0c1967ecb..f3aebb076 100755 --- a/api/swagger-ui/index.html +++ b/api/swagger-ui/index.html @@ -49,39 +49,50 @@ diff --git a/common/events/user.go b/common/events/user.go index 1694c1384..7aa0fd5ce 100644 --- a/common/events/user.go +++ b/common/events/user.go @@ -18,6 +18,8 @@ package events +import m "github.com/e154/smart-home/models" + // EventUpdateUserLocation ... type EventUpdateUserLocation struct { UserID int64 `json:"user_id"` @@ -32,3 +34,7 @@ type EventDirectMessage struct { Query string `json:"query"` Message interface{} `json:"message"` } + +type EventUserSignedIn struct { + User *m.User `json:"user"` +} diff --git a/endpoint/auth.go b/endpoint/auth.go index 6147716ae..31a14af6e 100644 --- a/endpoint/auth.go +++ b/endpoint/auth.go @@ -26,6 +26,7 @@ import ( "github.com/pkg/errors" "github.com/e154/smart-home/common/apperr" + "github.com/e154/smart-home/common/events" m "github.com/e154/smart-home/models" "github.com/e154/smart-home/plugins/email" "github.com/e154/smart-home/plugins/notify" @@ -76,6 +77,10 @@ func (a *AuthEndpoint) SignIn(ctx context.Context, email, password string, ip st log.Infof("Successful login, user: %s", user.Email) + a.eventBus.Publish(fmt.Sprintf("system/users/%d", user.Id), events.EventUserSignedIn{ + User: user, + }) + return } diff --git a/static_source/admin/src/components/Terminal/src/Terminal.vue b/static_source/admin/src/components/Terminal/src/Terminal.vue index 0d46cea52..90b1e1519 100644 --- a/static_source/admin/src/components/Terminal/src/Terminal.vue +++ b/static_source/admin/src/components/Terminal/src/Terminal.vue @@ -188,7 +188,7 @@ const sendCommand = (text?: string) => { @resize="handleResize" :name="'terminal'" v-show="showTerminal" - :initial-width="600" + :initial-width="800" :initial-height="400" >