mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-07 14:28:07 -06:00
[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:
parent
04bcde08a1
commit
d79c2f2688
15 changed files with 395 additions and 22 deletions
|
|
@ -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"`
|
||||
|
|
|
|||
|
|
@ -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"`
|
||||
|
|
|
|||
|
|
@ -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{}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue