Skip to content

Commit

Permalink
Preparing Watchdog
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Oct 19, 2023
1 parent 8c93b1c commit b3cc60e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
18 changes: 14 additions & 4 deletions src/Portal/Sucrose.Portal/Views/Controls/OtherAbout.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,52 +35,62 @@
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
<ui:HyperlinkButton
Cursor="Hand"
CornerRadius="15"
Appearance="Transparent"
BorderBrush="Transparent"
NavigateUri="https://www.youtube.com/@iTaiizor"
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}">
<ui:Image
Height="32"
CornerRadius="16"
Source="pack://application:,,,/Assets/Social/YouTube.png" />
</ui:HyperlinkButton>
<ui:HyperlinkButton
Cursor="Hand"
CornerRadius="15"
Appearance="Transparent"
BorderBrush="Transparent"
NavigateUri="https://www.facebook.com/iTaiizor"
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}">
<ui:Image
Height="32"
CornerRadius="16"
Source="pack://application:,,,/Assets/Social/Facebook.png" />
</ui:HyperlinkButton>
<ui:HyperlinkButton
Cursor="Hand"
CornerRadius="15"
Appearance="Transparent"
BorderBrush="Transparent"
NavigateUri="https://www.instagram.com/Taiizor"
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}">
<ui:Image
Height="32"
CornerRadius="16"
Source="pack://application:,,,/Assets/Social/Instagram.png" />
</ui:HyperlinkButton>
<ui:HyperlinkButton
Cursor="Hand"
CornerRadius="15"
Appearance="Transparent"
BorderBrush="Transparent"
NavigateUri="https://www.twitter.com/iTaiizor"
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}">
<ui:Image
Height="32"
CornerRadius="16"
Source="pack://application:,,,/Assets/Social/Twitter.png" />
</ui:HyperlinkButton>
<ui:HyperlinkButton
Cursor="Hand"
CornerRadius="15"
Appearance="Transparent"
BorderBrush="Transparent"
NavigateUri="https://www.linkedin.com/in/Taiizor"
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}">
<ui:Image
Height="32"
CornerRadius="16"
Source="pack://application:,,,/Assets/Social/LinkedIn.png" />
</ui:HyperlinkButton>
</StackPanel>
Expand All @@ -89,13 +99,13 @@
<ui:HyperlinkButton
Cursor="Hand"
Grid.Column="1"
CornerRadius="30"
Appearance="Transparent"
BorderBrush="Transparent"
NavigateUri="https://github.com/Taiizor">
<ui:Image
Height="96"
CornerRadius="90"
BorderBrush="#33000000"
CornerRadius="48"
Source="pack://application:,,,/Assets/Taiizor.jpeg" />
</ui:HyperlinkButton>
</Grid>
Expand All @@ -121,13 +131,13 @@
<WrapPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 10 0 0" Cursor="">
<ui:HyperlinkButton
Cursor="Hand"
CornerRadius="15"
Appearance="Transparent"
BorderBrush="Transparent"
NavigateUri="https://github.com/Taiizor">
<ui:Image
Height="32"
CornerRadius="90"
BorderBrush="#33000000"
CornerRadius="16"
Source="pack://application:,,,/Assets/Avatar/Taiizor.jpeg" />
</ui:HyperlinkButton>
</WrapPanel>
Expand Down
28 changes: 20 additions & 8 deletions src/Shared/Sucrose.Shared.Space/Helper/Watchdog.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using SMR = Sucrose.Memory.Readonly;
using System.IO;
using SMR = Sucrose.Memory.Readonly;
using SSDECT = Sucrose.Shared.Dependency.Enum.CommandsType;
using SSSHP = Sucrose.Shared.Space.Helper.Processor;
using SSSMI = Sucrose.Shared.Space.Manage.Internal;
Expand All @@ -9,19 +10,30 @@ internal static class Watchdog
{
public static void Start(string Message, string Path)
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Watchdog}{SMR.ValueSeparator}{SSSMI.Watchdog}{SMR.ValueSeparator}{Message}{SMR.ValueSeparator}{Path}");
if (Check())
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Watchdog}{SMR.ValueSeparator}{SSSMI.Watchdog}{SMR.ValueSeparator}{Message}{SMR.ValueSeparator}{Path}");
}
}

public static void Start(string Message, string Path, string Source, string Text)
{
if (string.IsNullOrEmpty(Source) || string.IsNullOrEmpty(Text))
{
Start(Message, Path);
}
else
if (Check())
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Watchdog}{SMR.ValueSeparator}{SSSMI.Watchdog}{SMR.ValueSeparator}{Message}{SMR.ValueSeparator}{Path}{SMR.ValueSeparator}{Source}{SMR.ValueSeparator}{Text}");
if (string.IsNullOrEmpty(Source) || string.IsNullOrEmpty(Text))
{
Start(Message, Path);
}
else
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Watchdog}{SMR.ValueSeparator}{SSSMI.Watchdog}{SMR.ValueSeparator}{Message}{SMR.ValueSeparator}{Path}{SMR.ValueSeparator}{Source}{SMR.ValueSeparator}{Text}");
}
}
}

private static bool Check()
{
return File.Exists(SSSMI.Commandog) && File.Exists(SSSMI.Watchdog);
}
}
}

0 comments on commit b3cc60e

Please sign in to comment.