This repository has been archived by the owner on May 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmMain.vb
71 lines (68 loc) · 2.92 KB
/
frmMain.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Imports System.Threading
Imports Awesomium.Windows.Forms
Imports Awesomium.Core
Public Class frmMain
Dim IP As String = "192.168.1.205"
Dim updated As Boolean = False, newversion As String = ""
Dim Updater As New Cyanlabs_Updater.Updater
Private UpdateChecker As System.Threading.Thread = New Thread(AddressOf Updater.IsLatest)
Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
Me.MaximumSize = Screen.PrimaryScreen.WorkingArea.Size
Me.Size = My.Settings.size
Me.Location = My.Settings.location
If My.Settings.state <> FormWindowState.Minimized Then
Me.WindowState = My.Settings.state
Else
Me.WindowState = FormWindowState.Normal
End If
CheckForIllegalCrossThreadCalls = False
If Environment.GetCommandLineArgs.Length > 1 Then
For Each x As String In Environment.GetCommandLineArgs
If x.Contains("-updated=") Then
updated = True
newversion = x.Replace("-updated=", "")
End If
Next
End If
If updated Then
MsgBox("You have successfully updated to V" & newversion, MsgBoxStyle.Information, "Update Successful")
ElseIf My.Settings.update = True Then
ntfyIcon.ShowBalloonTip(5000, "Synology Desktop DSM", "Checking for updates!", ToolTipIcon.Info)
UpdateChecker.IsBackground = True
UpdateChecker.Start()
End If
If My.Settings.IP = "" Then
frmSettings.Show()
Else
WebControl1.Source = New Uri("http://" & My.Settings.IP & ":5000")
End If
End Sub
Private Sub NsButton2_Click(sender As Object, e As EventArgs) Handles imgSSH.Click, btnSSH.Click
Process.Start(Application.StartupPath & "\plink.exe", "root@" & My.Settings.IP)
End Sub
Private Sub btnSettings_Click(sender As Object, e As EventArgs) Handles btnSettings.Click
frmSettings.Show()
End Sub
Private Sub btnMin_Click(sender As Object, e As EventArgs) Handles btnMin.Click
Me.ShowInTaskbar = False
Me.Hide()
ntfyIcon.ShowBalloonTip(3000)
End Sub
Private Sub ntfyIcon_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles ntfyIcon.MouseDoubleClick
Me.Show()
Me.WindowState = FormWindowState.Normal
Me.ShowInTaskbar = True
End Sub
Private Sub frmMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
If Not Me.WindowState = FormWindowState.Maximized Then
My.Settings.size = Me.Size
My.Settings.location = Me.Location
End If
My.Settings.state = Me.WindowState
My.Settings.Save()
WebCore.Shutdown()
End Sub
Private Sub NsButton1_Click(sender As Object, e As EventArgs)
WebControl1.ExecuteJavascriptWithResult("document.cookie;")
End Sub
End Class