Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Adding install and uninstall command to the terminal #845

Merged
merged 34 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
67b1882
Prettier
win11bot Jan 1, 2024
d048a48
working on it
franck403 Jan 1, 2024
d20cd11
Adding new thing
franck403 Jan 1, 2024
3bfc795
Adding install command to install app
franck403 Jan 1, 2024
89fcb3f
Prettier
win11bot Jan 1, 2024
7703fc0
Fixed install command and add auto app start on install command
franck403 Jan 1, 2024
d09b065
Prettier
win11bot Jan 1, 2024
4864414
working
franck403 Jan 1, 2024
b173e23
Testing value
franck403 Jan 1, 2024
5f20e0c
Prettier
win11bot Jan 1, 2024
5e8dfe1
Even more log
franck403 Jan 1, 2024
a269f35
Prettier
win11bot Jan 1, 2024
52ac62c
Changing how the arg is send to the install command
franck403 Jan 1, 2024
ad05ee4
Prettier
win11bot Jan 1, 2024
b0fe731
Prettier return value and adding uninstall to uninstall app
franck403 Jan 1, 2024
9ad2fd8
Prettier
win11bot Jan 1, 2024
7b70f09
WHY
franck403 Jan 1, 2024
7a54df1
Prettier
win11bot Jan 1, 2024
a18aa6b
More logs
franck403 Jan 1, 2024
e886ec4
Prettier
win11bot Jan 1, 2024
087a06c
Fixed a bug in the code with variable
franck403 Jan 1, 2024
47958ec
Prettier
win11bot Jan 1, 2024
ed7523b
Change the desc for the 2 new command
franck403 Jan 1, 2024
d708ff3
Uninstall command fixing error in appName check
franck403 Jan 3, 2024
6f761ef
Removing need with -n -i -u but default appName and etc info getting
franck403 Jan 3, 2024
fe41559
typo error
franck403 Jan 3, 2024
da0546e
Adding debuging to find the error in install App
franck403 Jan 3, 2024
5a04920
Changing id to get parm in command
franck403 Jan 3, 2024
1b17921
changing how app uninstall to prevent bug with app.pwa
franck403 Jan 3, 2024
8e8293d
Prettier
win11bot Jan 3, 2024
51e7ad0
More debugin
franck403 Jan 3, 2024
e16b7c2
Prettier
win11bot Jan 3, 2024
9e4c873
Add more log to console for debug
franck403 Jan 3, 2024
24f2eab
Prettier
win11bot Jan 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion signatures/version1/cla.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,4 @@
"pullRequestNo": 840
}
]
}
}
2 changes: 1 addition & 1 deletion src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const delApp = (act, menu) => {
var app = Object.keys(apps).filter((x) => apps[x].action == data.type);
if (app) {
app = apps[app];
if (app.pwa == true) {
if (app.pwa == true || app.pwa == False /*what is that for ?*/) {
store.dispatch({ type: app.action, payload: "close" });
store.dispatch({ type: "DELAPP", payload: app.icon });

Expand Down
49 changes: 48 additions & 1 deletion src/containers/applications/apps/terminal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React, { useState, useEffect } from "react";
import { useSelector, useDispatch } from "react-redux";
import i18next from "i18next";
import login from "../../../components/login";
import { installApp, delApp } from "../../../actions";

import { ToolBar } from "../../../utils/general";
import { Icon, ToolBar } from "../../../utils/general";
import dirs from "./assets/dir.json";

export const WnTerminal = () => {
Expand Down Expand Up @@ -74,6 +75,50 @@ export const WnTerminal = () => {
if (arg.length) {
tmpStack.push(eval(arg).toString());
}
} else if (type == "install") {
if (arg.length) {
tmpStack.push("Installing app");
var arg = arg.toString().split(" ");
console.log(arg);
var AppName = arg[0];
var IframeUrl = arg[1];
var IconUrl = arg[2];
var Json = {
name: AppName,
icon: IconUrl,
type: "game",
data: {
type: "IFrame",
url: IframeUrl,
invert: true,
},
};
installApp(Json);
tmpStack.push("App installed");
}
} else if (type == "uninstall") {
if (arg.length) {
tmpStack.push("Uninstalling app");
var arg = arg.toString().split(" ");
var AppName = arg[0];
tmpStack.push(AppName);
var apps = document.getElementsByClassName("dskApp");
var Mainmenu = "";
for (let i = 0; i < apps.length; i++) {
var app = apps[i];
var Appcname = app.getElementsByClassName("appName")[0];
var menu = app.getElementsByClassName("uicon")[0];
console.log(Appcname.innerHTML);
if (Appcname.innerHTML == AppName) {
var Mainmenu = menu;
console.log(menu);
}
}
console.log(Mainmenu);

delApp("delete", Mainmenu);
tmpStack.push("App uninstalled");
}
} else if (type == "python") {
if (arg.length) {
if (window.pythonRunner) {
Expand Down Expand Up @@ -272,6 +317,8 @@ export const WnTerminal = () => {
"VER Displays the Windows version.",
"PYTHON EXECUTE PYTHON CODE.",
"EVAL RUNS JavaScript statements.",
"INSTALL Instal a app with app name and iframe url",
"UNINSTALL Uninstal a app with app name",
];

for (var i = 0; i < helpArr.length; i++) {
Expand Down
Loading