view

package
v0.0.0-...-90fb85e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DialogClosed - a user clicked close button on the dialog title
	DialogClosed = -1
	// DialogAlive - a user does not close the dialog yet, exit code is unavailable
	DialogAlive = 0
	// DialogButton1 - a user clicked the first button in the dialog (by default, it is 'Yes' or 'OK')
	DialogButton1 = 1
	// DialogButton2 - a user clicked the second button in the dialog
	DialogButton2 = 2
	// DialogButton3 - a user clicked the third button in the dialog
	DialogButton3 = 3
	// DialogButton4 - a user clicked the fourth button in the dialog
	DialogButton4 = 4
)

Variables

View Source
var (
	WindowMain *ui.Window

	FrameMenu           *ui.Frame
	FrameMainMenu       *ui.Frame
	FrameContent        *ui.Frame
	FrmVerifier         *ui.Frame
	FrmMainSettings     *ui.Frame
	FrmDiscordSettings  *ui.Frame
	FrmDatabaseSettings *ui.Frame
	FrmPlugins          *ui.Frame

	// --- Menu buttons -------------------------
	BtnRunVerifier      *ui.Button
	BtnMainSettings     *ui.Button
	BtnDiscordSettings  *ui.Button
	BtnDatabaseSettings *ui.Button
	BtnPlugins          *ui.Button
	BtnLogs             *ui.Button
	BtnQuit             *ui.Button

	// --- Verifier control buttons -------------
	BtnVerifierStart   *ui.Button
	BtnVerifierRestart *ui.Button
	BtnVerifierStop    *ui.Button

	// --- Main Settings buttons ----------------
	BtnLogLevel         *ui.Button
	BtnMainSettingsSave *ui.Button

	// --- Discord settings buttons -------------
	BtnAssetDetails        *ui.Button
	BtnDiscordSettingsSave *ui.Button

	// --- Database Settings buttons ------------
	BtnDatabaseProvider     *ui.Button
	BtnDatabaseSettingsSave *ui.Button

	// --- Plugins buttons ----------------------
	BtnPluginsSave *ui.Button
)

--- Application Elements ----------------------------------------------

View Source
var LogChan chan bool
View Source
var LogChanView chan bool
View Source
var LogRunning = false
View Source
var LogRunningView = false
View Source
var Tails, _ = tail.TailFile("../logs/verifier.log", tail.Config{Follow: true, ReOpen: true, Logger: tail.DiscardingLogger})

Functions

func AnimateButton

func AnimateButton()

func ChangeTheme

func ChangeTheme(btn *ui.ButtonNoShadow)

func CommandDatabaseSettings

func CommandDatabaseSettings()

func CommandDiscordSettings

func CommandDiscordSettings()

func CommandMainSettings

func CommandMainSettings()

func CommandPlugins

func CommandPlugins()

func CommandRunVerifier

func CommandRunVerifier()

func CreateTableDialog

func CreateTableDialog(btn *ui.Button) *ui.TableView

--- Window type for data table ----------------------------------------

func CreateViewContent

func CreateViewContent()

func CreateViewDatabaseSettings

func CreateViewDatabaseSettings()

func CreateViewDiscordSettings

func CreateViewDiscordSettings()

func CreateViewMainSettings

func CreateViewMainSettings()

func CreateViewMenu

func CreateViewMenu()

func CreateViewPlugins

func CreateViewPlugins()

func CreateViewPopupTheme

func CreateViewPopupTheme()

func CreateViewVerifier

func CreateViewVerifier(status *ServerStatus)

func LoadLogs

func LoadLogs() error

func LoadVerifierLogs

func LoadVerifierLogs() error

func SaveData

func SaveData(assetData AssetContainer) []*AssetDetails

--- Copy data back to container to be written to config ---------------

func SavePendingDatabase

func SavePendingDatabase()

func SavePendingDiscord

func SavePendingDiscord()

func SavePendingMainSettings

func SavePendingMainSettings()

func SavePendingPlugins

func SavePendingPlugins()

func SelectLogLevel

func SelectLogLevel(btn *ui.Button, currentLogLevel int) int

Types

type DataDiscord

type DataDiscord struct {
	GuildId  string
	BotUsers []string
	Roles    map[string]string
}

type EditDialog

type EditDialog struct {
	View  *ui.Window
	Frame *ui.Frame
	// contains filtered or unexported fields
}

type EditableDialog

type EditableDialog struct {
	View  *ui.Window
	Frame *ui.Frame
	// contains filtered or unexported fields
}

func CreateEditableDialog

func CreateEditableDialog(editTitle string, oldVal string) *EditableDialog

func (*EditableDialog) EditResult

func (d *EditableDialog) EditResult() string

EditResult returns the text from editfield

func (*EditableDialog) OnClose

func (d *EditableDialog) OnClose(fn func())

OnClose sets the callback that is called when the dialog is closed

func (*EditableDialog) Result

func (d *EditableDialog) Result() int

Result returns what button closed the dialog. See DialogButton constants. It can equal DialogAlive that means that the dialog is still visible and a user still does not click any button

func (*EditableDialog) Value

func (d *EditableDialog) Value() int

Value returns the number of the selected item or -1 if nothing is selected or the dialog is cancelled

type LogDialog

type LogDialog struct {
	View  *ui.Window
	Frame *ui.Frame

	Log *ui.TextView
	// contains filtered or unexported fields
}
var LogViewer *LogDialog

func CreateLogDialog

func CreateLogDialog(logTitle string) *LogDialog

func (*LogDialog) EditResult

func (d *LogDialog) EditResult() string

EditResult returns the text from editfield

func (*LogDialog) OnClose

func (d *LogDialog) OnClose(fn func())

OnClose sets the callback that is called when the dialog is closed

func (*LogDialog) Result

func (d *LogDialog) Result() int

Result returns what button closed the dialog. See DialogButton constants. It can equal DialogAlive that means that the dialog is still visible and a user still does not click any button

func (*LogDialog) Value

func (d *LogDialog) Value() int

Value returns the number of the selected item or -1 if nothing is selected or the dialog is cancelled

type LogLevels

type LogLevels struct {
	LogLevel        []string
	CurrentLogLevel int
	DefaultLogLevel int
}
var (
	Log LogLevels
)

type ServerStatus

type ServerStatus struct {
	VerifierRunning bool
	RPCRunning      bool
}

type TableDialog

type TableDialog struct {
	View  *ui.Window
	Frame *ui.Frame
	// contains filtered or unexported fields
}

type TableEdit

type TableEdit struct {
	Row    int
	Col    int
	NewVal string
	OldVal string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL