-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from steveiliop56/feat/refactor-and-start-stop
a lot of new stuff
- Loading branch information
Showing
26 changed files
with
444 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE shells ADD `running` text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"version": "5", | ||
"dialect": "sqlite", | ||
"id": "4e855da6-f319-4b0c-aaf8-9177a674bf7e", | ||
"prevId": "8bb98af3-fe24-4378-8a91-f420b7cccf82", | ||
"tables": { | ||
"shells": { | ||
"name": "shells", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"distro": { | ||
"name": "distro", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"port": { | ||
"name": "port", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"password": { | ||
"name": "password", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"extraArgs": { | ||
"name": "extraArgs", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"running": { | ||
"name": "running", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
} | ||
}, | ||
"enums": {}, | ||
"_meta": { | ||
"schemas": {}, | ||
"tables": {}, | ||
"columns": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "getashell", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
|
9 changes: 5 additions & 4 deletions
9
src/server/actions/change-password-action.ts → src/app/actions/change-password-action.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
src/server/actions/remove-action.ts → src/app/actions/remove-action.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"use server"; | ||
|
||
import { changeShellRunningStatus } from "@/server/queries/queries"; | ||
import { containerData } from "@/types/types"; | ||
import { containerHelpers } from "@/utils/container-helpers"; | ||
import { revalidatePath } from "next/cache"; | ||
|
||
export const start = async (shell: containerData) => { | ||
shell.running = true; | ||
const { success, error } = await new containerHelpers(shell).startContainer(); | ||
|
||
if (success) { | ||
console.log("Shell started!"); | ||
revalidatePath("/", "layout"); | ||
await changeShellRunningStatus(shell); | ||
return { success: true }; | ||
} | ||
|
||
console.error(`Failed to start ${shell.name}! Error: ${error}`); | ||
return { success: false }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"use server"; | ||
|
||
import { changeShellRunningStatus } from "@/server/queries/queries"; | ||
import { containerData } from "@/types/types"; | ||
import { containerHelpers } from "@/utils/container-helpers"; | ||
import { revalidatePath } from "next/cache"; | ||
|
||
export const stop = async (shell: containerData) => { | ||
shell.running = false; | ||
const { success, error } = await new containerHelpers(shell).stopContainer(); | ||
|
||
if (success) { | ||
console.log("Shell stopped!"); | ||
revalidatePath("/", "layout"); | ||
await changeShellRunningStatus(shell); | ||
return { success: true }; | ||
} | ||
|
||
console.error(`Failed to stop ${shell.name}! Error: ${error}`); | ||
return { success: false }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/app/components/render-shell/components/info-dialog/index.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { SettingsDialog } from "./settings-dialog"; |
Oops, something went wrong.