1. Finished GUI

2. Implemented Geolocation API
This commit is contained in:
brotoskyj
2025-01-28 14:51:14 -05:00
parent a703ec3149
commit 18ab70c299
11 changed files with 1412 additions and 16 deletions
+157
View File
@@ -0,0 +1,157 @@
import { AboutSlint, VerticalBox, GridBox, Button, LineEdit, HorizontalBox, TextEdit, SpinBox } from "std-widgets.slint";
export component ComputerModules inherits Window {
VerticalLayout {
spacing: 5px;
padding: 15px;
HorizontalLayout {
VerticalLayout {
padding: 5px;
spacing: 5px;
height: 75px;
Text {
text: "Computer Tag / IP:";
}
LineEdit {
height: 35px;
}
}
VerticalLayout {
height: 200px;
padding: 5px;
spacing: 5px;
Button {
text: "Computer File Explorer";
}
Button {
text: "Current Logged on User";
}
Button {
text: "LAPS Password Viewer";
}
Button {
text: "Reboot Computer";
}
Button {
text: "Reboot w/ Auto Remote In";
}
Button {
text: "SCCM Log Parser";
}
}
VerticalLayout {
padding: 5px;
height: 350px;
width: 400px;
TextEdit {
height: 400px;
wrap: word-wrap;
read-only: true;
}
HorizontalLayout {
alignment: start;
spacing: 5px;
padding-top: 20px;
padding: 5px;
Text {
text: "Timeout for Computer Modules:";
}
}
HorizontalLayout {
spacing: 5px;
SpinBox {
minimum: 2;
maximum: 10;
step-size: 1;
horizontal-alignment: center;
width: 100px;
}
Text {
vertical-alignment: center;
text: "Seconds";
}
}
}
VerticalLayout {
spacing: 5px;
padding: 5px;
width: 150px;
Button {
text: "Bitlocker";
}
Button {
text: "Director";
}
Button {
text: "HSC IT";
}
Button {
text: "Imprivata";
}
Button {
text: "ISE";
}
Button {
text: "Kronos";
}
Button {
text: "Kuiper";
}
Button {
text: "One Content";
}
Button {
text: "Printer Logic";
}
Button {
text: "Site Scan";
}
Button {
text: "SnapComm";
}
Button {
text: "TelecommNG";
}
Button {
text: "UMS";
}
Button {
text: "Unify";
}
Button {
text: "Whats Up";
}
Button {
text: "Workday";
}
}
}
}
}
+117
View File
@@ -0,0 +1,117 @@
import { AboutSlint, VerticalBox, TabWidget, Button, LineEdit } from "std-widgets.slint";
export global OtherToolCallbacks {
pure callback killCherwell();
pure callback ipapi();
in-out property <string> ipaddressbar;
in property <string> isp;
in property <string> country;
in property <string> state;
in property <string> city;
}
export component OtherTools inherits Window {
TabWidget {
Tab {
title: @tr("General");
Button {
text: "Kill all local Cherwell Processes";
clicked => {
OtherToolCallbacks.killCherwell();
}
}
}
Tab {
title: @tr("Helpdesk");
}
Tab {
title: @tr("PC Technician");
}
Tab {
title: @tr("IRT");
TabWidget {
Tab {
title: @tr("IP Geolocation API");
HorizontalLayout {
alignment: center;
spacing: 5px;
padding: 15px;
height: 200px;
VerticalLayout {
spacing: 5px;
padding: 15px;
Text {
height: 30px;
text: "IP Address:";
}
LineEdit {
height: 35px;
edited(text) => {
OtherToolCallbacks.ipaddressbar = self.text;
}
}
Button {
height: 35px;
text: "Search";
clicked => {
OtherToolCallbacks.ipapi();
}
}
}
HorizontalLayout {
spacing: 5px;
width: 400px;
VerticalLayout {
y: 10px;
Text {
text: "ISP:";
}
Text {
text: "Country:";
}
Text {
text: "State:";
}
Text {
text: "City:";
}
}
VerticalLayout {
spacing: 5px;
LineEdit {
read-only: true;
text: OtherToolCallbacks.isp;
}
LineEdit {
read-only: true;
text: OtherToolCallbacks.country;
}
LineEdit {
read-only: true;
text: OtherToolCallbacks.state;
}
LineEdit {
read-only: true;
text: OtherToolCallbacks.city;
}
}
}
}
}
}
}
}
}
+5
View File
@@ -0,0 +1,5 @@
import { AboutSlint, VerticalBox, ComboBox, Button, StandardListView, TabWidget } from "std-widgets.slint";
export component SettingsModules inherits Window {
}
+259
View File
@@ -0,0 +1,259 @@
import { AboutSlint, VerticalBox, GridBox, Button, LineEdit, HorizontalBox, TextEdit, SpinBox, StandardListView } from "std-widgets.slint";
export component UserModules inherits Window {
VerticalLayout {
spacing: 5px;
padding: 15px;
HorizontalLayout {
spacing: 5px;
VerticalLayout {
padding: 5px;
spacing: 5px;
height: 75px;
Text {
text: "Search User";
}
StandardListView {
height: 80px;
model: [{ text: "Username" }, { text: "Last Name" }];
current-item: 0;
}
LineEdit {
height: 35px;
}
VerticalLayout {
padding: 10px;
Button {
text: "Search";
primary: true;
}
}
VerticalLayout {
padding-top: 30px;
Button {
text: "Clear Search";
primary: false;
}
}
}
HorizontalLayout {
spacing: 5px;
VerticalLayout {
y: 10px;
Text {
text: "Account Creation Date:";
}
Text {
text: "Account Enabled:";
}
Text {
text: "MyIdentity Claimed:";
}
Text {
text: "Display Name:";
}
Text {
text: "Email:";
}
Text {
text: "Enterprise ID:";
}
Text {
text: "Job Title:";
}
Text {
text: "Last Bad Password:";
}
Text {
text: "Last Logon Time:";
}
Text {
text: "Organizational Unit:";
}
Text {
text: "Mobile Email:";
}
Text {
text: "Outlook Client:";
}
Text {
text: "Passord Last Set:";
}
Text {
text: "Password Expired:";
}
Text {
text: "VPN User:";
}
}
VerticalLayout {
spacing: 5px;
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
LineEdit {
read-only: true;
}
}
}
VerticalLayout {
padding: 5px;
height: 350px;
width: 400px;
Text {
text: "Group Memberships";
height: 30px;
}
TextEdit {
height: 500px;
wrap: word-wrap;
read-only: true;
}
}
VerticalLayout {
spacing: 5px;
padding: 5px;
width: 150px;
Button {
text: "Bitlocker";
}
Button {
text: "Director";
}
Button {
text: "HSC IT";
}
Button {
text: "Imprivata";
}
Button {
text: "ISE";
}
Button {
text: "Kronos";
}
Button {
text: "Kuiper";
}
Button {
text: "One Content";
}
Button {
text: "Printer Logic";
}
Button {
text: "Site Scan";
}
Button {
text: "SnapComm";
}
Button {
text: "TelecommNG";
}
Button {
text: "UMS";
}
Button {
text: "Unify";
}
Button {
text: "Whats Up";
}
Button {
text: "Workday";
}
}
}
}
}
+137
View File
@@ -0,0 +1,137 @@
import { HorizontalBox, VerticalBox, Palette } from "std-widgets.slint";
component SideBarItem inherits Rectangle {
in property <int> tab-index;
in property <bool> selected;
in property <bool> has-focus;
in-out property <string> text <=> label.text;
callback clicked <=> touch.clicked;
min-height: l.preferred-height;
accessible-role: tab;
accessible-label: root.text;
accessible-item-index: root.tab-index;
accessible-item-selectable: true;
accessible-item-selected: root.selected;
accessible-action-default => { self.clicked(); }
states [
pressed when touch.pressed : {
state.opacity: 0.8;
}
hover when touch.has-hover : {
state.opacity: 0.6;
}
selected when root.selected : {
state.opacity: 1;
}
focused when root.has-focus : {
state.opacity: 0.8;
}
]
state := Rectangle {
opacity: 0;
background: Palette.background;
animate opacity { duration: 150ms; }
}
l := HorizontalBox {
y: (parent.height - self.height) / 2;
spacing: 0px;
label := Text {
vertical-alignment: center;
accessible-role: none;
}
}
touch := TouchArea {
width: 100%;
height: 100%;
}
}
export component SideBar inherits Rectangle {
in property <[string]> model: [];
in property <string> title <=> label.text;
out property <int> current-item: 0;
out property <int> current-focused: fs.has-focus ? fs.focused-tab : -1; // The currently focused tab
width: 180px;
forward-focus: fs;
accessible-role: tab-list;
accessible-delegate-focus: root.current-focused >= 0 ? root.current-focused : root.current-item;
accessible-label: root.title;
accessible-item-count: root.model.length;
Rectangle {
background: Palette.background.darker(0.2);
fs := FocusScope {
key-pressed(event) => {
if (event.text == "\n") {
root.current-item = root.current-focused;
return accept;
}
if (event.text == Key.UpArrow) {
self.focused-tab = Math.max(self.focused-tab - 1, 0);
return accept;
}
if (event.text == Key.DownArrow) {
self.focused-tab = Math.min(self.focused-tab + 1, root.model.length - 1);
return accept;
}
return reject;
}
key-released(event) => {
if (event.text == " ") {
root.current-item = root.current-focused;
return accept;
}
return reject;
}
property <int> focused-tab: 0;
x: 0;
width: 0; // Do not react on clicks
}
}
VerticalBox {
padding-left: 0px;
padding-right: 0px;
alignment: start;
label := Text {
font-size: 16px;
horizontal-alignment: center;
}
navigation := VerticalLayout {
alignment: start;
vertical-stretch: 0;
for item[index] in root.model : SideBarItem {
clicked => { root.current-item = index; }
tab-index: index;
has-focus: index == root.current-focused;
text: item;
selected: index == root.current-item;
}
}
VerticalLayout {
bottom := VerticalBox {
padding-top: 0px;
padding-bottom: 0px;
@children
}
}
}
}
+24 -7
View File
@@ -1,12 +1,29 @@
import { AboutSlint, VerticalBox } from "std-widgets.slint";
import { StandardListView } from "std-widgets.slint";
import { UserModules} from "pages/usermodules.slint";
import { ComputerModules } from "pages/computermodules.slint";
import { OtherTools } from "pages/othertools.slint";
import { SettingsModules } from "pages/settings.slint";
import { SideBar } from "sidebar.slint";
export { OtherToolCallbacks } from "pages/othertools.slint";
export component MainWindow inherits Window {
VerticalBox {
Text {
text: "Hello World!";
}
AboutSlint {
preferred-height: 150px;
title: @tr("CHAMP");
preferred-width: 984px;
preferred-height: 661px;
HorizontalLayout {
side-bar := SideBar {
title: @tr("Menu");
model: [
@tr("Menu" => "User Modules"),
@tr("Menu" => "Computer Modules"),
@tr("Menu" => "Other Tools"),
@tr("Menu" => "Settings")
];
}
if(side-bar.current-item == 0): UserModules { }
if(side-bar.current-item == 1): ComputerModules { }
if(side-bar.current-item == 2): OtherTools { }
if(side-bar.current-item == 3): SettingsModules { }
}
}