Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into merge-release-into…
Browse files Browse the repository at this point in the history
…-master
  • Loading branch information
Azanul committed Jan 9, 2024
2 parents 24a8fde + ef29f84 commit b47016f
Show file tree
Hide file tree
Showing 28 changed files with 578 additions and 89 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* @mlabouardy @ShubhamPalriwala @AvineshTripathi @greghub @Traxmaxx @Kolawole9 @Azanul @jakepage91
* @mlabouardy @ShubhamPalriwala @AvineshTripathi @greghub @Traxmaxx @Kolawole99 @Azanul @jakepage91
docs @jakepage91
README.md @jakepage91
CONTRIBUTING.md @jakepage91
8 changes: 6 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ updates:
directory: "/dashboard"
schedule:
interval: "weekly"
time: "23:00"
timezone: Europe/London
labels:
- "npm dependencies"
- "dependencies"
open-pull-requests-limit: 10
reviewers:
- "mlabouardy"
- "ShubhamPalriwala"
- "Azanul"
- "AvineshTripathi"

16 changes: 16 additions & 0 deletions cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package cmd

import (
"errors"
"os"
"path/filepath"
"time"

"github.com/getsentry/sentry-go"
Expand Down Expand Up @@ -31,7 +33,21 @@ var startCmd = &cobra.Command{
if file == "" {
return errors.New("you must specify a config file with '--config PATH'")
}
if file == "config.toml" {
filename, err := filepath.Abs(file)
if err != nil {
return err
}

if _, err := os.Stat(filename); errors.Is(err, os.ErrNotExist) {
log.Info("unable to use given config file:", err)
log.Info("Creating default config.toml")
err = os.WriteFile("config.toml", []byte{}, 0644)
if err != nil {
return err
}
}
}
regions, err := cmd.Flags().GetStringArray("regions")
if err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,39 @@ function DashboardCostExplorerCard({
<div className="mt-8"></div>
<div className="h-full min-h-[22rem]">
{chartData && <Bar data={chartData} options={options} />}
{!chartData && (
{/* ⤵ will be removed when cost is supported at Resource level */}
{queryGroup === 'Resource' && (
<div className="relative flex flex-col items-center bg-empty-cost-explorer h-[330px] w-full">
<div className="mt-10 text-lg text-black-900 border border-gray-200 px-8 py-6 flex bg-white">
<div>
<p className="text-lg">
Cost at resource level not yet supported
</p>
<p className="text-sm text-gray-400 mb-4">
We recommend our cloud version, Tailwarden, <br />
as it supports accurate costs at the resource level
</p>

<Button
size="sm"
gap="md"
asLink
href="https://tailwarden.com/?utm_source=komiser"
target="_blank"
>
<CloudIcon width="24" /> Discover Tailwarden
</Button>
</div>
<Image
src="/assets/img/purplin/rocket.svg"
alt="Purplin on a Rocket"
width="115"
height="124"
/>
</div>
</div>
)}
{!chartData && queryGroup !== 'Resource' && (
<div className="relative flex flex-col items-center bg-empty-cost-explorer h-[330px] w-full">
<div className="mt-10 text-lg text-black-900 border border-gray-200 px-8 py-6 flex bg-white">
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export type CostExplorerQueryGroupProps =
| 'service'
| 'region'
| 'account'
| 'view';
| 'view'
| 'Resource';
export type CostExplorerQueryGranularityProps = 'monthly' | 'daily';
export type CostExplorerQueryDateProps =
| 'thisMonth'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ function useCostExplorerChart({
}; */

const groupBySelect: GroupBySelectProps = {
values: ['provider', 'service', 'region', 'account'],
values: ['provider', 'service', 'region', 'account','Resource'],
displayValues: [
'Cloud provider',
'Cloud service',
'Cloud region',
'Cloud account'
'Cloud account',
'Resource'
]
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export type ResourcesManagerQuery =
| 'service'
| 'region'
| 'account'
| 'view';
| 'view'
| 'Resource';

export type ResourcesManagerGroupBySelectProps = {
values: ResourcesManagerQuery[];
Expand Down
17 changes: 17 additions & 0 deletions dashboard/components/inventory/components/InventorySidePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,23 @@ function InventorySidePanel({
)}
</h2>
</div>
{data && data.metadata !== null && (
<div className="space-y-2">
<h2 className="font-['Noto Sans'] text-neutral-500 text-sm font-normal leading-tight">
Metadata
</h2>
<h2 className="font-['Noto Sans'] text-neutral-900 text-sm font-normal leading-tight">
{!data && (
<p className="h-3 w-48 animate-pulse rounded-xl bg-cyan-200"></p>
)}
{data && (
<pre>
{JSON.stringify(data.metadata, null, 2)}
</pre>
)}
</h2>
</div>
)}
</div>
</SidepanelPage>
)}
Expand Down
2 changes: 1 addition & 1 deletion dashboard/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function Layout({ children }: LayoutProps) {
title="We could not find a cloud account"
message="Get Started Onboarding"
action={() => {
router.push('/onboarding/choose-cloud');
router.push('/onboarding/choose-database');
}}
actionLabel="Begin Onboarding"
secondaryAction={() => {
Expand Down
1 change: 1 addition & 0 deletions dashboard/components/onboarding-wizard/LabelledInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function LabelledInput({
}`}
onChange={onChange}
defaultValue={value}
autoComplete="off"
/>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion dashboard/components/select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function Select({
function toggle() {
setIsOpen(!isOpen);
}

return (
<div className="relative">
<div
Expand Down
36 changes: 8 additions & 28 deletions dashboard/package-lock.json

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

2 changes: 1 addition & 1 deletion dashboard/pages/onboarding/cloud-accounts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function CloudAccounts() {
))}
</div>
<div className="fixed bottom-0 -mx-20 flex w-[calc(100%*6/11)] justify-end border-t border-gray-300 bg-white px-20 py-4">
<Button onClick={() => router.push('/onboarding/choose-database')}>
<Button onClick={() => router.push('/onboarding/complete')}>
Next
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion dashboard/pages/onboarding/database/postgres.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function PostgreSQLCredentials() {
message:
'Your Postgres database has been successfully connected to Komiser.'
});
router.push('/onboarding/complete/');
router.push('/onboarding/choose-cloud/');
}
});
};
Expand Down
2 changes: 1 addition & 1 deletion dashboard/pages/onboarding/database/sqlite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function SqliteCredentials() {
message:
'Your Postgres database has been successfully connected to Komiser.'
});
router.push('/onboarding/complete/');
router.push('/onboarding/choose-cloud/');
}
});
};
Expand Down
Loading

0 comments on commit b47016f

Please sign in to comment.