diff --git a/gui/bindata_assetfs.go b/gui/bindata_assetfs.go index 45c062eac..5ae9e31a1 100644 --- a/gui/bindata_assetfs.go +++ b/gui/bindata_assetfs.go @@ -35709,7 +35709,7 @@ func publicBower_componentsWebcomponentsjsWebcomponentsMinJs() (*asset, error) { return a, nil } -var _publicComponentsXSettingHtml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd4\x57\x4d\x6f\xe3\x36\x10\xbd\xe7\x57\x10\x44\x81\x38\x40\x24\x39\x69\xd3\x2e\xbc\x92\x81\x76\xd1\x53\xb7\xe8\xa2\xee\x7d\x41\x49\x63\x8b\x35\x45\x12\x9c\x91\x1d\x23\xf0\x7f\x2f\x28\x59\xb1\x6c\xc9\x1f\x49\x7b\xe8\xfa\x12\x52\x9c\x37\x1f\x8f\x33\x4f\x4a\xac\xa4\x5e\x32\x07\x2a\xe1\xb2\xb4\xc6\x11\x67\x85\x83\x79\xc2\xa3\xd4\xac\xc1\x7d\xcd\x4c\x69\x8d\x06\x4d\x18\x59\xa3\x36\x25\xb8\xf6\x6f\x58\x50\xa9\xf8\xf4\xe6\x2d\x1e\x84\x05\x17\xe4\xce\xd8\xdc\xac\x75\x50\x82\xae\x86\x9e\xbd\xdb\x73\xc7\xe1\xbf\xf2\x23\x09\xca\xce\xf2\xdd\x7e\xd2\x8a\xc8\xe8\x83\xcd\xfb\x73\xd2\xb6\xa2\xee\xfa\xdd\x9e\xc8\x08\xa4\xee\xfa\xd5\x53\x6e\xca\xa0\x34\x79\xa5\x80\xc9\x3c\xe1\xcf\x01\x02\x91\xd4\x0b\x3e\xbd\x61\x8c\xb1\x98\xa0\xb4\x4a\x10\x34\xdb\xfa\xd1\xc0\xf5\x31\x25\x52\x9f\xcd\x5f\x1b\x0b\x7c\x6f\xda\x31\xaf\xad\x32\x25\x10\x13\xfe\x0a\xcd\x8c\x26\xd0\xc4\x99\x20\x72\xc1\xdc\xb8\x00\x41\x41\x46\x90\x27\x5c\x8b\x12\x38\xdb\xef\x5f\x5e\x4c\xe8\xdd\x6f\xb7\x47\x01\x3a\x41\xfc\xcd\x31\x0f\x4c\x78\xba\xe4\xd3\x5f\x9c\x31\xcb\xb8\x73\xab\xd7\x00\x11\xf9\x74\x56\x88\xdc\xac\xd1\x64\x4b\x7c\x33\xfc\x89\x4f\x67\x1e\xf8\xc4\x7e\xd5\x99\xdb\x58\x3a\xed\x21\xee\x34\x6e\x87\xdf\xa1\xf9\xe8\xd1\x5f\xf7\x43\x4b\xfb\x0c\xdc\x0a\x1c\x67\x12\x13\x2e\x9d\xd1\xcd\x29\x67\x2b\xa1\x2a\x68\xa8\x6b\x4c\xb6\x5b\xce\xac\x12\x19\x14\x46\xe5\xe0\x12\x0e\x76\xc2\x1e\xc2\xc7\xf0\xfb\xf0\x87\xc9\x87\xf1\x87\x31\x9f\xc6\xdd\x86\x3b\x1f\xf6\x8b\x40\x5c\x1b\x97\x9f\x0d\xdc\x1a\xf5\x42\x6f\x4c\xe5\x18\xd6\x69\x31\xdb\x7a\x3a\x19\xbe\xed\xc3\x3a\x94\x6f\x5a\x39\xe7\x4c\xce\x7d\x0c\x89\xf5\x45\x8f\x9a\xfe\xb8\x3b\x68\x90\xa1\xb4\x7f\xaf\x50\x66\x67\x73\xae\x2d\x7a\x09\x97\x15\x12\x43\x51\x02\x13\xc8\x3a\xd9\x1f\x27\x1d\x8b\xdd\x34\x16\x44\x16\x27\x51\xb4\x90\x54\x54\x69\x98\x99\x32\xa2\x67\x2a\xa4\x5e\x4a\xbd\x88\x52\x9f\x74\xb4\x96\x4b\x19\xd5\xf1\x82\xcf\x12\x89\x33\x12\x6e\x01\x94\xf0\xaf\xa9\x12\x7a\xc9\xa7\xa5\x71\xc0\x44\x6a\x2a\x62\xa5\x37\x8b\x23\xd1\xed\x95\x81\xf9\x3c\x4b\xd5\x6c\x76\x3d\x4f\x40\x85\xc9\x39\xcb\x25\x8a\x54\x41\x7e\x8a\x31\x01\x18\x3c\x3e\xfd\x18\x64\xf3\xf4\xf4\xfd\x0d\x25\x9a\xcb\x15\x43\xda\x28\x48\x38\xc1\x33\x05\x42\xc9\x85\x9e\x64\xa0\xc9\x93\x3a\xa4\x22\x8d\xa0\x32\x27\x24\x42\xce\x8c\x0e\x32\x25\xb3\x65\xc2\x17\x86\x4f\x67\x62\x05\xf1\x81\xf0\x76\xc3\xe7\x72\xd5\xab\xb6\x56\xc2\x5a\xf6\xea\x15\x9f\x76\x9f\xef\xf4\xef\x28\xef\x18\x33\x27\x6d\xa7\xb0\x2f\xcd\x9b\x71\xf4\x72\x90\xae\xc4\x09\xeb\x68\xe9\xfd\xc1\xa1\x75\xc6\x82\x23\x09\x38\x61\x87\xb0\xed\xa1\xa1\x03\x91\x6f\x26\x6c\x5e\xe9\x8c\xa4\xd1\xa3\xbb\x97\x9e\x00\x51\x21\x31\x34\x2c\x61\xfd\x23\xff\x6b\x04\x79\xc2\xbc\x1c\xde\x0f\x5b\x7c\x36\x99\x50\xde\xe4\xe1\xf1\xa7\x70\x1c\x8e\xc3\x87\xc9\x83\x17\x82\xbe\xf9\xf6\xe3\x70\x78\xa9\x25\x8d\xee\x3e\x9e\xab\xc4\x9b\x5c\x51\x88\x37\x9b\x35\x9c\x5d\x72\xd8\xcc\x7c\xc7\x27\xd9\x01\xaf\x0e\xa8\x72\x9a\x91\x65\x49\x92\xd4\x2c\x5c\xf0\x3a\x9b\xbd\xd1\x25\xe2\x05\x97\xfb\x92\xce\x13\xb0\x12\x5e\x4f\xd4\x9c\x25\x35\x17\x7d\xae\xff\x0c\x17\x40\xa3\xdb\x68\xd7\x54\xb7\x77\x3d\x8b\x10\xbd\xc1\xcf\x59\x06\x96\x6e\xef\xd9\xad\xb0\x56\xc9\x4c\xf8\x88\xd1\xdf\x68\xf4\x49\xc8\xa7\xe6\x3d\x1c\xf8\x6e\xb9\x16\xb8\x96\x54\x7c\x72\x90\x83\x26\x29\x14\x8e\x06\x4c\x40\xe7\xa3\xd7\x92\xc1\xb9\x7b\xe6\x00\x07\x4a\xf7\x3f\x5c\x4b\xca\x8a\x91\x03\x0c\x91\x04\x55\x78\x77\xa2\xa5\x33\x81\xc0\x1e\xc7\xe3\xc9\xe0\x69\xed\x0a\xd4\xbc\x9e\x09\xef\x2c\x35\xf9\xa6\xcf\xe5\xa1\x69\x58\xcf\x00\x4b\x7a\x33\x70\x1a\x28\xe7\xa3\x1d\xd6\x73\xd6\xb4\x02\x3f\x51\xda\x51\xb0\x06\x30\xd0\x8c\xdd\xdf\xf6\xe4\x49\xea\x40\x2c\x87\x81\x39\xcc\x45\xa5\xe8\x02\x33\xdf\x85\xcd\x17\xa0\x97\xdc\x1d\x49\x7e\x79\x81\xa4\x16\x65\x2c\xe8\xe3\xd9\xbc\x32\xbd\x7e\x4d\xdb\xf3\x43\xbe\x30\xd7\x88\x5f\x4b\x68\x67\x17\x92\x93\xe5\x50\x96\x3b\x9b\xe6\x63\x68\x8f\x69\xf6\x97\x50\xed\x97\xcc\x1e\xd7\x3e\xb9\x84\xac\xdf\xef\x7b\x58\xbd\xbd\x84\x69\x7b\xb2\xbb\x3d\x89\xb9\x42\x3c\xac\xc1\x6f\x4b\x3d\xd0\xcb\x47\x53\xfd\xff\x4c\x5b\x8e\x26\x88\xff\xf1\xdb\x99\x49\xfe\xaf\xa6\xe7\xdb\x1f\xee\x9b\xe3\x93\x38\x6a\xbf\xa6\xe2\x68\xff\x7f\xe8\xf4\xe6\xe6\x9f\x00\x00\x00\xff\xff\xf7\x60\xd0\x3a\xa2\x10\x00\x00") +var _publicComponentsXSettingHtml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd4\x58\x5f\x8f\xe2\xb6\x17\x7d\x9f\x4f\xe1\x9f\xf5\x93\x06\xb4\x93\x84\x99\x76\xdb\x15\x4b\xa8\xda\x55\x1f\xaa\xee\xaa\xab\xd2\xc7\x95\x56\x4e\x72\x01\x17\xc7\xb6\x7c\x6f\x60\xd1\x88\xef\x5e\x39\x21\x43\x20\x09\x30\xd3\xaa\xea\xe6\x65\xe2\xf8\xdc\x7f\xc7\xf7\x1e\xac\x99\x28\xa9\x57\xcc\x81\x8a\xb9\xcc\xad\x71\xc4\xd9\xd2\xc1\x3c\xe6\x51\x62\x36\xe0\x3e\xa7\x26\xb7\x46\x83\x26\x8c\xac\x51\xdb\x1c\x5c\xfd\x37\x5c\x52\xae\xf8\xf4\xe6\x39\x1e\x84\x05\x17\x64\xce\xd8\xcc\x6c\x74\x90\x83\x2e\xba\xbe\xbd\xd8\x73\xc3\xe1\xdf\xf2\x23\x09\xf2\xc6\xeb\x8b\xfd\x24\x05\x91\xd1\x47\x8b\x97\xe7\xa4\x6d\x41\xcd\xf7\x17\x7b\x22\x23\x90\x9a\xef\x4f\x9e\x32\x93\x07\xb9\xc9\x0a\x05\x4c\x66\x31\xff\x12\x20\x10\x49\xbd\xe0\xd3\x1b\xc6\x18\x9b\x10\xe4\x56\x09\x82\x6a\x59\x7e\xea\x38\x3e\xa6\x44\xe2\xb3\xf9\x63\x6b\x81\x1f\xa0\x0d\x78\x89\x4a\x95\x40\x8c\xf9\x93\x69\x6a\x34\x81\x26\xce\x04\x91\x0b\xe6\xc6\x05\x08\x0a\x52\x82\x2c\xe6\x5a\xe4\xc0\xd9\x61\xfd\xf8\x68\x42\xef\x7e\xb7\x3b\x09\xd0\x08\xe2\x4f\x8e\x79\xc3\x98\x27\x2b\x3e\xfd\xc9\x19\xb3\x9a\x34\x4e\xf5\x1a\x43\x44\x3e\x9d\x2d\x45\x66\x36\x68\xd2\x15\x3e\xdb\xfc\x35\x9f\xce\xbc\xe1\x6b\xf6\xb3\x4e\xdd\xd6\x52\xbf\x87\x49\xa3\x71\x1b\xfc\x76\xcd\x47\x8b\xfe\xb2\x1f\x6a\xda\x67\xe0\xd6\xe0\x38\x93\x18\x73\xe9\x8c\xae\x76\x39\x5b\x0b\x55\x40\x45\x5d\x05\xd9\xed\x38\xb3\x4a\xa4\xb0\x34\x2a\x03\x17\x73\xb0\x63\x76\x1f\x3e\x84\xdf\x84\xdf\x8e\xdf\x8c\xde\x8c\xf8\x74\xd2\x6c\xb8\xf3\x61\x3f\x0a\xc4\x8d\x71\xd9\xd9\xc0\x35\xa8\x15\x7a\x6b\x0a\xc7\xb0\x4c\x8b\xd9\xda\x53\x6f\xf8\xba\x0f\xcb\x50\xbe\x69\xe5\x9c\x33\x39\xf7\x31\x24\x96\x07\x3d\xa8\xfa\x63\x78\xd4\x20\x5d\x69\x7f\x28\x50\xa6\x67\x73\x2e\x11\xad\x84\xf3\x02\x89\xa1\xc8\x81\x09\x64\x8d\xec\x4f\x93\x9e\x88\xfd\x34\x2e\x89\x2c\x8e\xa3\x68\x21\x69\x59\x24\x61\x6a\xf2\x88\xbe\xd0\x52\xea\x95\xd4\x8b\x28\xf1\x49\x47\x1b\xb9\x92\x51\x19\x2f\x78\x2f\x91\x38\x23\xe1\x16\x40\x31\xff\x9c\x28\xa1\x57\x7c\x9a\x1b\x07\x4c\x24\xa6\x20\x96\x7b\xd8\x24\x12\xcd\x5e\xe9\x98\xcf\xb3\x54\xcd\x66\xd7\xf3\x04\xb4\x34\x19\x67\x99\x44\x91\x28\xc8\xfa\x18\x13\x80\xc1\xc3\xeb\xef\x82\x74\x9e\xf4\x9f\x5f\x57\xa2\x99\x5c\x33\xa4\xad\x82\x98\x13\x7c\xa1\x40\x28\xb9\xd0\xe3\x14\x34\x79\x52\xbb\x54\xa4\x12\x54\xe6\x84\x44\xc8\x98\xd1\x41\xaa\x64\xba\x8a\xf9\xc2\xf0\xe9\x4c\xac\x61\x72\x24\xbc\xcd\xf0\x99\x5c\xb7\xaa\x2d\x95\xb0\x94\xbd\xf2\x8d\x4f\x9b\xdf\xf7\xfa\x77\x92\xf7\x04\x53\x27\x6d\xa3\xb0\x8f\xd5\x2f\xe3\xe0\xf1\x28\x5d\x89\x63\xd6\xd0\xd2\xbb\xa3\x4d\xeb\x8c\x05\x47\x12\x70\xcc\x8e\xcd\x76\xc7\x40\x07\x22\xdb\x8e\xd9\xbc\xd0\x29\x49\xa3\x07\xc3\xc7\x96\x00\xd1\x52\x62\x68\x58\xcc\xda\x5b\xfe\xa9\x04\x79\xcc\xbc\x1c\xde\x75\x23\xde\x9b\x54\x28\x0f\xb9\x7f\xf8\x3e\x1c\x85\xa3\xf0\x7e\x7c\xef\x85\xa0\x0d\xdf\xbd\xed\x0e\x2f\xb5\xa4\xc1\xf0\xed\xb9\x4a\x3c\xe4\x8a\x42\x3c\x6c\x56\x71\x76\xc9\x61\x35\xf3\x0d\x9f\x64\x3b\xbc\x3a\xa0\xc2\x69\x46\x96\xc5\x71\x5c\xb2\x70\xc1\xeb\x6c\xf6\x4c\x97\x88\x17\x5c\x1e\x4a\x3a\x4f\xc0\x5a\x78\x3d\x51\x73\x16\x97\x5c\xb4\xb9\xfe\x3d\x5c\x00\x0d\x6e\xa3\x7d\x53\xdd\x0e\x5b\x88\x10\x3d\xe0\xc7\x34\x05\x4b\xb7\x77\xec\x56\x58\xab\x64\x2a\x7c\xc4\xe8\x4f\x34\xba\xd7\xe4\x5d\xf5\x3b\x1c\xf8\x6e\xb9\xd6\x70\x23\x69\xf9\xce\x41\x06\x9a\xa4\x50\x38\xe8\x80\x80\xce\x06\x4f\x25\x83\x73\x77\xcc\x01\x76\x94\xee\x1f\xdc\x48\x4a\x97\x03\x07\x18\x22\x09\x2a\x70\xd8\xd3\xd2\xa9\x40\x60\x0f\xa3\xd1\xb8\x73\xb7\x74\x05\x6a\x5e\xce\x84\x77\x96\x98\x6c\xdb\xe6\xf2\x18\x1a\x96\x33\xc0\xe2\xd6\x0c\xf4\x1b\xca\xf9\x60\x6f\xeb\x39\xab\x5a\x81\xf7\x94\x76\x12\xac\x32\xe8\x68\xc6\xe6\xb3\xeb\xdd\x49\x1c\x88\x55\xb7\x61\x06\x73\x51\x28\xba\xc0\xcc\xff\xc3\xea\x06\xe8\x25\x77\x4f\x92\x7f\xbd\x40\x52\x6d\x65\x2c\xe8\xd3\xd9\xbc\x32\xbd\x76\x4d\xbb\xf3\x43\xbe\x30\xd7\x88\x5f\x4d\x68\x63\x15\x92\x93\x79\x57\x96\x7b\x4c\x75\x19\x3a\xd8\x54\xeb\x5e\x2b\x39\x1f\xfc\x2f\x0a\x5f\xfd\xf0\x69\xfc\x29\x7b\x15\x85\x04\x48\x83\x23\xcb\x61\xcf\xc9\x97\xa0\x13\xbe\xf7\x97\x35\xf6\x8b\x5e\x0b\x25\xb3\x9e\x1e\x38\xb2\x3c\xc7\x79\x25\x47\xed\xbd\x36\xd9\xfb\x8c\xeb\xfb\xd8\xa1\xfa\xfa\xcb\xd9\xfa\x4f\xb0\xcf\x29\xf8\x83\x44\x44\xf6\x74\x59\xfc\xb7\x0b\x2e\x2f\x57\x87\x6a\xcb\xe5\xa5\x06\xa9\x05\xa1\xb9\xec\xb5\xb9\x42\xb9\xad\xc1\xaf\x4b\xba\xd1\x6b\x77\x55\xfd\x7f\x4c\xd8\x4f\xbb\xeb\xb7\x5f\xcf\xc8\xe8\x3f\x25\x5d\x5f\xbf\xb2\xde\x9c\xee\x4c\xa2\xfa\x2a\x3b\x89\x0e\xff\x04\x98\xde\xdc\xfc\x15\x00\x00\xff\xff\x5c\x9e\x8f\xef\x1f\x12\x00\x00") func publicComponentsXSettingHtmlBytes() ([]byte, error) { return bindataRead( @@ -35724,7 +35724,7 @@ func publicComponentsXSettingHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "public/components/x-setting.html", size: 4258, mode: os.FileMode(420), modTime: time.Unix(1489833967, 0)} + info := bindataFileInfo{name: "public/components/x-setting.html", size: 4639, mode: os.FileMode(420), modTime: time.Unix(1490143435, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/gui/main.go b/gui/main.go index e378e7223..294d345a0 100644 --- a/gui/main.go +++ b/gui/main.go @@ -32,12 +32,15 @@ func run() { systray.SetTooltip(msg) notice.SetTitle("[Brook] " + msg) } + systray.AddMenuItem("---------", "").Disable() mStart := systray.AddMenuItem("Start", "") mStop := systray.AddMenuItem("Stop", "") mSetting := systray.AddMenuItem("Setting", "") + systray.AddMenuItem("---------", "").Disable() mGithub := systray.AddMenuItem("Github", "") mEmail := systray.AddMenuItem("Author: cloud@txthinking.com", "") - systray.AddMenuItem("Version: 20170316", "") + systray.AddMenuItem("Version: 20170322", "") + systray.AddMenuItem("---------", "").Disable() mQuit := systray.AddMenuItem("Quit", "") showNotice("Status", "stoped") diff --git a/gui/public/components/x-setting.html b/gui/public/components/x-setting.html index 60e4ede0b..10029e73d 100644 --- a/gui/public/components/x-setting.html +++ b/gui/public/components/x-setting.html @@ -73,7 +73,17 @@ go: function(){ this.o.Type = this.o.Type.trim(); this.o.Server = this.o.Server.trim(); + if(!/.+?\:\d+/.test(this.o.Server)){ + this.$.toast.text = "Server Invalid"; + this.$.toast.open(); + return; + } this.o.Password = this.o.Password.trim(); + if(!this.o.Password){ + this.$.toast.text = "Misss Password"; + this.$.toast.open(); + return; + } this.o.Music = this.o.Music.trim(); this.o.Local = this.o.Local.trim(); var self = this; diff --git a/gui/setting.go b/gui/setting.go index 65e2e5495..eb9fdf6bf 100644 --- a/gui/setting.go +++ b/gui/setting.go @@ -2,6 +2,7 @@ package main import ( "encoding/json" + "errors" "io/ioutil" "net/http" "os" @@ -96,7 +97,7 @@ func RetrieveSetting() (*Setting, error) { } f, err := os.OpenFile(fp, os.O_RDONLY, 0600) if os.IsNotExist(err) { - return &Setting{}, nil + return nil, errors.New("No setting") } if err != nil { return nil, err