Skip to content

Commit

Permalink
docs: readme + minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen Nijhuis committed Jan 9, 2024
1 parent f466f71 commit 74a5d28
Show file tree
Hide file tree
Showing 33 changed files with 216 additions and 115 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<p align="center">

<img src="https://raw.githubusercontent.com/unxsist/jet-pilot/main/public/logo.png"/>
# JET Pilot

<p align="center">
<img src="https://raw.githubusercontent.com/unxsist/jet-pilot/main/public/header.png"/>
</p>

<p align="center">JET Pilot is an open-source K8s IDE. It was created out of frustration, as all "good-looking" K8s IDEs went commercial. Power-users nowaday resort to tools like `k9s`, which works great, but heavily relies on keyboard input. JET Pilot tries to overcome these usability challenges.</p>
## Introduction
JET Pilot is an open-source K8s IDE. It was created out of frustration, as all "good-looking" K8s IDEs went commercial. Power-users nowaday resort to tools like `k9s`, which works great, but heavily relies on keyboard input. JET Pilot tries to overcome these usability challenges.

![Screenshot](./public/screenshot.png)
## Features
- **Real-time Logs**: Instantly access logs for active monitoring of Kubernetes workloads.
- **Kubernetes Object Management**: Easily manage Kubernetes objects.
- **Command Palette**: A user-friendly interface with customizable shortcuts for efficient navigation and operation.
Binary file added public/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions public/tauri.svg

This file was deleted.

6 changes: 0 additions & 6 deletions public/vue.svg

This file was deleted.

1 change: 1 addition & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ istio-sdk = { version = "0.1.3", features = ["v1_18"] }
fix-path-env = { git = "https://github.com/tauri-apps/fix-path-env-rs", branch = "dev" }
portable-pty = "0.8.1"
uuid = "1.4.1"
either = "1.9.0"

[target.'cfg(target_os = "macos")'.dependencies]
tauri-nspanel = { git = "https://github.com/ahkohd/tauri-nspanel" }
Expand All @@ -30,7 +31,7 @@ window-vibrancy = "0.4.2"
[features]
# by default Tauri runs in production mode
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
default = [ "custom-protocol" ]
default = ["custom-protocol"]
# this feature is used used for production builds where `devPath` points to the filesystem
# DO NOT remove this
custom-protocol = [ "tauri/custom-protocol" ]
custom-protocol = ["tauri/custom-protocol"]
Binary file modified src-tauri/icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/icons/JetPilotIconV2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square107x107Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square142x142Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square150x150Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square284x284Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square30x30Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square310x310Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square44x44Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square71x71Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/Square89x89Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/icon.icns
Binary file not shown.
Binary file modified src-tauri/icons/icon.ico
Binary file not shown.
Binary file modified src-tauri/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 34 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

use either::Either;
use istio_sdk::networking::v1beta1::virtual_service::VirtualService;
use k8s_openapi::api::batch::v1::{CronJob, Job};
use k8s_openapi::api::networking::v1::Ingress;
Expand All @@ -10,7 +11,7 @@ use k8s_openapi::api::apps::v1::Deployment;
use k8s_openapi::api::core::v1::{
ConfigMap, Namespace, PersistentVolume, PersistentVolumeClaim, Pod, Secret, Service,
};
use kube::api::ListParams;
use kube::api::{DeleteParams, ListParams};
use kube::config::{KubeConfigOptions, Kubeconfig, KubeconfigError};
use kube::{api::Api, Client, Config, Error};
use portable_pty::{native_pty_system, CommandBuilder, PtySize};
Expand All @@ -25,6 +26,12 @@ use std::{
};
use uuid::Uuid;

#[derive(Serialize)]
enum DeletionResult {
Deleted(String),
Pending(String),
}

#[derive(Debug, Serialize)]
struct SerializableKubeError {
message: String,
Expand Down Expand Up @@ -159,6 +166,31 @@ async fn get_pod(context: &str, namespace: &str, name: &str) -> Result<Pod, Seri
.map_err(|err| SerializableKubeError::from(err));
}

#[tauri::command]
async fn delete_pod(
context: &str,
namespace: &str,
name: &str,
grace_period_seconds: u32,
) -> Result<DeletionResult, SerializableKubeError> {
let client = client_with_context(context).await?;
let pod_api: Api<Pod> = Api::namespaced(client, namespace);

match pod_api
.delete(
name,
&DeleteParams::default().grace_period(grace_period_seconds),
)
.await
{
Ok(Either::Left(_pod)) => Ok(DeletionResult::Deleted(name.to_string())),
Ok(Either::Right(_status)) => {
Ok(DeletionResult::Pending("Deletion in progress".to_string()))
}
Err(err) => Err(SerializableKubeError::from(err)),
}
}

#[tauri::command]
async fn list_deployments(
context: &str,
Expand Down Expand Up @@ -416,6 +448,7 @@ fn main() {
list_namespaces,
list_pods,
get_pod,
delete_pod,
list_deployments,
list_jobs,
list_cronjobs,
Expand Down
15 changes: 14 additions & 1 deletion src/components/tables/pods.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { V1Pod } from "@kubernetes/client-node";
import { ColumnDef } from "@tanstack/vue-table";
import { RowAction } from "@/components/tables/types";
import { formatDateTimeDifference } from "@/lib/utils";

export const columns: ColumnDef<V1Pod>[] = [
{
accessorKey: "metadata.name",
header: "Name",
meta: {
class: (row) => {
return row.status?.phase === "Pending" ? "text-orange-500" : "";
},
},
},
{
header: "Ready",
Expand Down Expand Up @@ -36,4 +41,12 @@ export const columns: ColumnDef<V1Pod>[] = [
header: "Node",
accessorKey: "spec.nodeName",
},
{
header: "Age",
accessorFn: (row) =>
formatDateTimeDifference(
row.metadata?.creationTimestamp || new Date(),
new Date()
),
},
];
4 changes: 3 additions & 1 deletion src/components/ui/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const setContextMenuSubject = (subject: TData | null) => {
const props = defineProps<{
columns: ColumnDef<TData, TValue>[];
rowActions?: RowAction<TData>[];
rowClasses?: (row: TData) => string;
data: TData[];
}>();
Expand Down Expand Up @@ -76,12 +77,13 @@ const table = useVueTable({
v-for="row in table.getRowModel().rows"
:key="row.id"
:data-state="row.getIsSelected() ? 'selected' : undefined"
:class="rowClasses?.(row.original)"
@click.right="setContextMenuSubject(row.original)"
>
<TableCell
v-for="cell in row.getVisibleCells()"
:key="cell.id"
:class="cell.column.columnDef.meta?.class"
:class="cell.column.columnDef.meta?.class?.(row.original)"
class="truncate overflow-hidden"
>
<FlexRender
Expand Down
16 changes: 12 additions & 4 deletions src/components/ui/toast/ToastViewport.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<script setup lang="ts">
import { ToastViewport, type ToastViewportProps } from 'radix-vue'
import { cn } from '@/lib/utils'
import { ToastViewport, type ToastViewportProps } from "radix-vue";
import { cn } from "@/lib/utils";
const props = defineProps<ToastViewportProps & { class?: string }>()
const props = defineProps<ToastViewportProps & { class?: string }>();
</script>

<template>
<ToastViewport v-bind="props" :class="cn('fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]', props.class)" />
<ToastViewport
v-bind="props"
:class="
cn(
'fixed top-0 z-[100] flex space-y-2 max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',
props.class
)
"
/>
</template>
Loading

0 comments on commit 74a5d28

Please sign in to comment.