Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Transformerlab App
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
TransformerLab
Transformerlab App
Commits
7bc6e795
Commit
7bc6e795
authored
2 weeks ago
by
ali asaria
Browse files
Options
Downloads
Patches
Plain Diff
separate view jobs into new component
parent
1bbae18a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/renderer/components/Settings/TransformerLabSettings.tsx
+2
-47
2 additions, 47 deletions
src/renderer/components/Settings/TransformerLabSettings.tsx
src/renderer/components/Settings/ViewJobsTab.tsx
+70
-0
70 additions, 0 deletions
src/renderer/components/Settings/ViewJobsTab.tsx
with
72 additions
and
47 deletions
src/renderer/components/Settings/TransformerLabSettings.tsx
+
2
−
47
View file @
7bc6e795
...
@@ -27,6 +27,7 @@ import { EyeIcon, EyeOffIcon, RotateCcwIcon } from 'lucide-react';
...
@@ -27,6 +27,7 @@ import { EyeIcon, EyeOffIcon, RotateCcwIcon } from 'lucide-react';
// Import the AIProvidersSettings component.
// Import the AIProvidersSettings component.
import
AIProvidersSettings
from
'
./AIProvidersSettings
'
;
import
AIProvidersSettings
from
'
./AIProvidersSettings
'
;
import
ViewJobsTab
from
'
./ViewJobsTab
'
;
const
fetcher
=
(
url
)
=>
fetch
(
url
).
then
((
res
)
=>
res
.
json
());
const
fetcher
=
(
url
)
=>
fetch
(
url
).
then
((
res
)
=>
res
.
json
());
...
@@ -208,53 +209,7 @@ export default function TransformerLabSettings() {
...
@@ -208,53 +209,7 @@ export default function TransformerLabSettings() {
</
Button
>
</
Button
>
</
TabPanel
>
</
TabPanel
>
<
TabPanel
value
=
{
1
}
>
<
TabPanel
value
=
{
1
}
>
<
Typography
level
=
"title-lg"
marginBottom
=
{
2
}
>
<
ViewJobsTab
/>
View Jobs (debug):
{
'
'
}
<
IconButton
onClick
=
{
()
=>
jobsMutate
()
}
>
<
RotateCcwIcon
size
=
"14px"
/>
</
IconButton
>
</
Typography
>
<
Select
sx
=
{
{
width
:
'
400px
'
}
}
value
=
{
showJobsOfType
}
onChange
=
{
(
e
,
newValue
)
=>
{
setShowJobsOfType
(
newValue
);
}
}
>
<
Option
value
=
"NONE"
>
None
</
Option
>
<
Option
value
=
""
>
All
</
Option
>
<
Option
value
=
"DOWNLOAD_MODEL"
>
Download Model
</
Option
>
<
Option
value
=
"LOAD_MODEL"
>
Load Model
</
Option
>
<
Option
value
=
"TRAIN"
>
Train
</
Option
>
<
Option
value
=
"GENERATE"
>
Generate
</
Option
>
<
Option
value
=
"EVAL"
>
Evaluate
</
Option
>
</
Select
>
{
showJobsOfType
!==
'
NONE
'
&&
(
<
Table
sx
=
{
{
tableLayout
:
'
auto
'
,
overflow
:
'
scroll
'
}
}
>
<
thead
>
<
tr
>
<
td
>
Job ID
</
td
>
<
td
>
Job Type
</
td
>
<
td
>
Job Status
</
td
>
<
td
>
Job Progress
</
td
>
<
td
>
Job Data
</
td
>
</
tr
>
</
thead
>
<
tbody
>
{
jobs
?.
map
((
job
)
=>
(
<
tr
key
=
{
job
.
id
}
>
<
td
>
{
job
.
id
}
</
td
>
<
td
>
{
job
.
type
}
</
td
>
<
td
>
{
job
.
status
}
</
td
>
<
td
>
{
job
.
progress
}
</
td
>
<
td
>
<
pre
>
{
JSON
.
stringify
(
job
.
job_data
,
null
,
2
)
}
</
pre
>
</
td
>
</
tr
>
))
}
</
tbody
>
</
Table
>
)
}
</
TabPanel
>
</
TabPanel
>
</
Tabs
>
</
Tabs
>
</
Sheet
>
</
Sheet
>
...
...
This diff is collapsed.
Click to expand it.
src/renderer/components/Settings/ViewJobsTab.tsx
0 → 100644
+
70
−
0
View file @
7bc6e795
import
*
as
React
from
'
react
'
;
import
{
Typography
,
IconButton
,
Select
,
Option
,
Table
}
from
'
@mui/joy
'
;
import
{
RotateCcwIcon
}
from
'
lucide-react
'
;
import
useSWR
from
'
swr
'
;
import
*
as
chatAPI
from
'
renderer/lib/transformerlab-api-sdk
'
;
const
fetcher
=
(
url
)
=>
fetch
(
url
).
then
((
res
)
=>
res
.
json
());
export
default
function
ViewJobsTab
()
{
const
[
showJobsOfType
,
setShowJobsOfType
]
=
React
.
useState
(
'
NONE
'
);
const
{
data
:
jobs
,
error
:
jobsError
,
isLoading
:
jobsIsLoading
,
mutate
:
jobsMutate
,
}
=
useSWR
(
chatAPI
.
Endpoints
.
Jobs
.
GetJobsOfType
(
showJobsOfType
,
''
),
fetcher
);
return
(
<>
<
Typography
level
=
"title-lg"
marginBottom
=
{
2
}
>
View Jobs (debug):
{
'
'
}
<
IconButton
onClick
=
{
()
=>
jobsMutate
()
}
>
<
RotateCcwIcon
size
=
"14px"
/>
</
IconButton
>
</
Typography
>
<
Select
sx
=
{
{
width
:
'
400px
'
}
}
value
=
{
showJobsOfType
}
onChange
=
{
(
e
,
newValue
)
=>
{
setShowJobsOfType
(
newValue
);
}
}
>
<
Option
value
=
"NONE"
>
None
</
Option
>
<
Option
value
=
""
>
All
</
Option
>
<
Option
value
=
"DOWNLOAD_MODEL"
>
Download Model
</
Option
>
<
Option
value
=
"LOAD_MODEL"
>
Load Model
</
Option
>
<
Option
value
=
"TRAIN"
>
Train
</
Option
>
<
Option
value
=
"GENERATE"
>
Generate
</
Option
>
<
Option
value
=
"EVAL"
>
Evaluate
</
Option
>
</
Select
>
{
showJobsOfType
!==
'
NONE
'
&&
(
<
Table
sx
=
{
{
tableLayout
:
'
auto
'
,
overflow
:
'
scroll
'
}
}
>
<
thead
>
<
tr
>
<
td
>
Job ID
</
td
>
<
td
>
Job Type
</
td
>
<
td
>
Job Status
</
td
>
<
td
>
Job Progress
</
td
>
<
td
>
Job Data
</
td
>
</
tr
>
</
thead
>
<
tbody
>
{
jobs
?.
map
((
job
)
=>
(
<
tr
key
=
{
job
.
id
}
>
<
td
>
{
job
.
id
}
</
td
>
<
td
>
{
job
.
type
}
</
td
>
<
td
>
{
job
.
status
}
</
td
>
<
td
>
{
job
.
progress
}
</
td
>
<
td
>
<
pre
>
{
JSON
.
stringify
(
job
.
job_data
,
null
,
2
)
}
</
pre
>
</
td
>
</
tr
>
))
}
</
tbody
>
</
Table
>
)
}
</>
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment