ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / extensions / copilot / test / simulation / workbench / components / toolbar.tsx 160 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import { Select , Text , ToggleButton , Tooltip } from '@fluentui/react-components' ;
import { WeatherMoon20Regular , WeatherSunny20Regular } from '@fluentui/react-icons' ;
import * as mobx from 'mobx' ;
import * as mobxlite from 'mobx-react-lite' ;
import * as React from 'react' ;
import { InitArgs
initArgs
runner
runnerOptions
nesExternalOptions
amlProvider
simulationRunsProvider
simulationTestsProvider
workbenchMode
testSource
filter
allLanguageIds
theme
mobxlite
initArgs
runner
runnerOptions
nesExternalOptions
amlProvider
simulationRunsProvider
simulationTestsProvider
workbenchMode
testSource
onFiltererChange
allLanguageIds
theme
toggleTheme
toolbarContent
workbenchMode
testSource
toolbarContent
theme toggleTheme theme
modeOptions value label source
value label source
value label source
value label source
value label
workbenchMode testSource onFiltererChange workbenchMode testSource filter
modeOptions o
o
}
from
'../initArgs'
;
import
{ AMLProvider }
from
'../stores/amlSimulations'
;
import
{ NesExternalOptions }
from
'../stores/nesExternalOptions'
;
import
{ RunnerOptions }
from
'../stores/runnerOptions'
;
import
{ SimulationRunsProvider }
from
'../stores/simulationBaseline'
;
import
{ SimulationRunner }
from
'../stores/simulationRunner'
;
import
{ SimulationTestsProvider }
from
'../stores/simulationTestsProvider'
;
import
{ TestSource , TestSourceValue }
from
'../stores/testSource'
;
import
{ WorkbenchModeValue }
from
'../stores/workbenchMode'
;
import
{ AMLModeToolbar }
from
'./amlModeToolbar'
;
import
{ ThemeKind }
from
'./app'
;
import
{ LocalModeToolbar }
from
'./localModeToolbar'
;
import
{ NesExternalModeToolbar }
from
'./nesExternalModeToolbar'
;
import
{ TestFilterer }
from
'./testFilterer'
;
type
ToolbarProps
=
{
:
InitArgs
|
undefined
;
:
SimulationRunner
;
:
RunnerOptions
;
:
NesExternalOptions
;
:
AMLProvider
;
:
SimulationRunsProvider
;
:
SimulationTestsProvider
;
:
WorkbenchModeValue
;
:
TestSourceValue
;
onFiltererChange
:
(
:
TestFilterer
|
undefined
)
=>
void
;
:
readonly
string
[
]
;
:
ThemeKind
;
toggleTheme
:
(
)
=>
void
;
}
;
export
const
Toolbar
=
.
observer
(
(
{
,
,
,
,
,
,
,
,
,
,
,
,
,
}
:
ToolbarProps
)
=>
{
const
=
(
(
)
=>
{
if
(
.
value
===
'adhocRequest'
)
{
return
(
< div className = ' toolbar' style = { { display: 'flex' , alignItems: 'center' } } >
< Text size = { 400 } >
Adhoc request sender
</ Text >
</ div>
)
;
}
switch
(
.
value
)
{
case
TestSource
.
Local
:
return
(
< LocalModeToolbar
initArgs = { initArgs}
runner = { runner}
runnerOptions = { runnerOptions}
simulationRunsProvider = { simulationRunsProvider}
simulationTestsProvider = { simulationTestsProvider}
onFiltererChange = { onFiltererChange}
/>
)
;
case
TestSource
.
NesExternal
:
return
(
< NesExternalModeToolbar
runner = { runner}
runnerOptions = { runnerOptions}
nesExternalOptions = { nesExternalOptions}
simulationRunsProvider = { simulationRunsProvider}
onFiltererChange = { onFiltererChange}
/>
)
;
case
TestSource
.
External
:
return
(
< AMLModeToolbar
amlProvider = { amlProvider}
simulationTestsProvider = { simulationTestsProvider}
onFiltererChange = { onFiltererChange}
allLanguageIds = { allLanguageIds}
/>
)
;
}
}
)
(
)
;
return
(
< div style = { { padding: '5px' , display: 'flex' } } >
{
}
< div style = { { display: 'flex' , justifyContent: 'end' , maxHeight: '35px' } } >
< ThemeToggler theme = { theme} toggleTheme = { toggleTheme} />
< ModeToggler workbenchMode = { workbenchMode} testSource = { testSource} onFiltererChange = { onFiltererChange} />
</ div>
</ div>
)
;
}
)
;
const
ThemeToggler
=
(
{
,
}
:
{
:
ThemeKind
;
toggleTheme
:
(
)
=>
void
}
)
=>
(
< Tooltip content = ' Toggle workbench theme' relationship = ' label' >
< ToggleButton
appearance = ' subtle'
icon = { theme === 'dark' ? < WeatherSunny20Regular /> : < WeatherMoon20Regular /> }
onClick = { toggleTheme}
/>
</ Tooltip >
)
;
const
ADHOC_REQUEST_OPTION
=
'adhocRequest'
;
const
:
{
:
string
;
:
string
;
?
:
TestSource
}
[
]
=
[
{
:
String
(
TestSource
.
Local
)
,
:
'Local'
,
:
TestSource
.
Local
}
,
{
:
String
(
TestSource
.
NesExternal
)
,
:
'NES External'
,
:
TestSource
.
NesExternal
}
,
{
:
String
(
TestSource
.
External
)
,
:
'AML'
,
:
TestSource
.
External
}
,
{
:
ADHOC_REQUEST_OPTION
,
:
'Adhoc Request'
}
,
]
;
const
ModeToggler
=
(
{
,
,
}
:
{
:
WorkbenchModeValue
;
:
TestSourceValue
;
onFiltererChange
:
(
:
TestFilterer
|
undefined
)
=>
void
}
)
=>
(
< Select
style = { { marginLeft: '8px' , minWidth: '140px' } }
value = { workbenchMode. value === 'adhocRequest' ? ADHOC_REQUEST_OPTION : String ( testSource. value ) }
onChange = { mobx. action ( ( _e, data) => {
const selected = modeOptions. find ( o => o. value === data. value ) ;
if ( ! selected) {
return ;
}
if ( selected. source === undefined ) {
workbenchMode. value = 'adhocRequest' ;
} else {
workbenchMode. value = 'tests' ;
testSource. value = selected. source ;
}
onFiltererChange ( undefined ) ;
} ) }
>
{
.
map
(
=>
(
< option key = { o. value } value = { o. value } >
{
.
label
}
</ option>
)
)
}
</ Select >
)
;