[feature/frontend] Add debug sections to settings panel (#2950)

* [feature/frontend] Add debug sections to settings panel

* max-width

* swagger
This commit is contained in:
tobi 2024-06-03 11:20:53 +02:00 committed by GitHub
commit d79c2f2688
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 395 additions and 22 deletions

View file

@ -59,6 +59,8 @@ type InstanceV1 struct {
//
// example: 0.1.1 cb85f65
Version string `json:"version"`
// Whether or not instance is running in DEBUG mode. Omitted if false.
Debug *bool `json:"debug,omitempty"`
// Primary language of the instance.
// example: ["en"]
Languages []string `json:"languages"`

View file

@ -40,6 +40,8 @@ type InstanceV2 struct {
//
// example: 0.1.1 cb85f65
Version string `json:"version"`
// Whether or not instance is running in DEBUG mode. Omitted if false.
Debug *bool `json:"debug,omitempty"`
// The URL for the source code of the software running on this instance, in keeping with AGPL license requirements.
// example: https://github.com/superseriousbusiness/gotosocial
SourceURL string `json:"source_url"`

View file

@ -26,6 +26,7 @@ import (
"strings"
"time"
"codeberg.org/gruf/go-debug"
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/db"
@ -1200,6 +1201,10 @@ func (c *Converter) InstanceToAPIV1Instance(ctx context.Context, i *gtsmodel.Ins
instance.Version = toMastodonVersion(instance.Version)
}
if debug.DEBUG {
instance.Debug = util.Ptr(true)
}
// configuration
instance.Configuration.Statuses.MaxCharacters = config.GetStatusesMaxChars()
instance.Configuration.Statuses.MaxMediaAttachments = config.GetStatusesMediaMaxFiles()
@ -1307,6 +1312,10 @@ func (c *Converter) InstanceToAPIV2Instance(ctx context.Context, i *gtsmodel.Ins
instance.Version = toMastodonVersion(instance.Version)
}
if debug.DEBUG {
instance.Debug = util.Ptr(true)
}
// thumbnail
thumbnail := apimodel.InstanceV2Thumbnail{}