Skip to content

Commit

Permalink
Prepare 0.2 (#122)
Browse files Browse the repository at this point in the history
Fix #120
  • Loading branch information
olevitt authored May 4, 2020
1 parent 2791958 commit 3ccea8e
Show file tree
Hide file tree
Showing 18 changed files with 150 additions and 82 deletions.
96 changes: 48 additions & 48 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@storybook/preset-create-react-app": "^2.1.1",
"@storybook/react": "^5.3.18",
"@testing-library/jest-dom": "^5.5.0",
"@testing-library/react": "^10.0.3",
"@testing-library/react": "^10.0.4",
"clean-webpack-plugin": "^3.0.0",
"coveralls": "^3.1.0",
"prettier": "^2.0.5",
Expand All @@ -28,20 +28,20 @@
"@types/jest": "^25.2.1",
"@types/node": "^13.13.4",
"@types/react": "^16.9.34",
"@types/react-dom": "^16.9.6",
"@types/react-dom": "^16.9.7",
"animejs": "^3.2.0",
"axios": "^0.19.2",
"classnames": "^2.2.6",
"clipboard-polyfill": "^2.8.6",
"dayjs": "^1.8.25",
"dayjs": "^1.8.26",
"file-saver": "^2.0.2",
"filereader-stream": "^2.0.0",
"generate-password": "^1.5.1",
"jsoneditor": "^8.6.6",
"jsoneditor-react": "^3.0.0",
"jwt-decode": "^2.2.0",
"keycloak-js": "^10.0.0",
"minio": "^7.0.15",
"minio": "^7.0.16",
"mustache": "^4.0.1",
"node-sass": "^4.14.0",
"query-params": "0.0.1",
Expand Down
19 changes: 8 additions & 11 deletions src/js/api/my-lab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,34 @@ export const getServices = async (groupId?: String) => {
.then((resp) => resp.data);
};

export const getService = async (id: string, type?: string) => {
export const getService = async (id: string) => {
return await axiosAuthTyped
.get<Service>(apiPaths.getService, {
params: {
serviceId: id,
type: type,
},
})
.then((resp) => resp.data);
};

export const deleteService = (service: Service) => {
export const deleteServices = (path?: string, bulk?: boolean) => {
if (path && !path.startsWith('/')) {
path = '/' + path;
}
return axiosAuthTyped.delete(`${apiPaths.deleteService}`, {
params: {
serviceId: service.id,
type: service.type,
path: path,
bulk: bulk,
},
});
};

export const getLogs = async (
serviceId: string,
taskId: string,
type?: string
) => {
export const getLogs = async (serviceId: string, taskId: string) => {
return await axiosAuthTyped
.get<string>(apiPaths.getLogs, {
params: {
serviceId: serviceId,
taskId: taskId,
type: type,
},
})
.then((resp) => resp.data);
Expand Down
3 changes: 2 additions & 1 deletion src/js/components/commons/fil-d-ariane/fil-d-ariane.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ export const fil = {
component: <span>{title}</span>,
},
],
myServices: [
myServices: (id) => [
{ pathname: '/home', component: <Icon className="home-icone">home</Icon> },
{ pathname: '/my-services', component: <span>My lab</span> },
id && { pathname: `/my-services/${id}`, component: <span>{id}</span> },
],
myService: (id) => [
{ pathname: '/home', component: <Icon className="home-icone">home</Icon> },
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/commons/service-card/card-my-service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const getActions = (service) => (launch) => () => (

const getLaunchIcon = (service: Service) => (handleClickLaunch) =>
service.status === ServiceStatus.Running ? (
service.urls ? (
service.urls && service.urls.length > 0 ? (
<IconButton
color="secondary"
aria-label="ouvrir"
Expand Down
4 changes: 3 additions & 1 deletion src/js/components/my-service/service-details/details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import { AppBar, Tabs, Tab } from '@material-ui/core';
import ServiceConf from './service-conf';
import ServiceTasks from './service-tasks';
import D from 'js/i18n';
import Debug from './service-debug';

interface Props {
service?: Service;
}

const TAB_CONFIGURATION = 0;
const TAB_TASKS = 1;
//const TAB_DEBUG = 2;
const TAB_DEBUG = 2;

const ServiceDetails = ({ service }: Props) => {
const [activeTab, setActiveTab] = useState(TAB_CONFIGURATION);
Expand Down Expand Up @@ -39,6 +40,7 @@ const ServiceDetails = ({ service }: Props) => {
tasks={service.tasks}
/>
)}
{activeTab === TAB_DEBUG && <Debug events={service.events} />}
</>
) : (
<div>{D.serviceNotFound}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ interface Props {
}

const ServiceConf = ({ service }: Props) => {
return <ServiceEnv env={service.env} />;
return (
<ServiceEnv
env={service.env}
urls={service.urls}
internalUrls={service.internalUrls}
/>
);
};

export default ServiceConf;
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import { Event } from 'js/model/Event';
import dayjs from 'dayjs';

interface Props {
events?: Event[];
}

const Debug = ({ events = [] }: Props) => {
return (
<>
{events.map((event) => (
<div>
{event.message} (
{dayjs(event.timestamp).format('DD/MM/YYYY à HH:mm:ss')})
</div>
))}
</>
);
};

export default Debug;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './debug';
Loading

0 comments on commit 3ccea8e

Please sign in to comment.