Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
slapos.core
Commits
a3aff077
Commit
a3aff077
authored
Jul 13, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Make it compatible with the ERP5 UI
parent
d5274e84
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
111 additions
and
14 deletions
+111
-14
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Base_getParameterEditorDict.py
.../portal_skins/slapos_cloud/Base_getParameterEditorDict.py
+16
-0
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Base_getParameterEditorDict.xml
...portal_skins/slapos_cloud/Base_getParameterEditorDict.xml
+62
-0
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/gadget_erp5_page_slap_load_schema.html.html
.../slapos_cloud/gadget_erp5_page_slap_load_schema.html.html
+1
-1
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/gadget_erp5_page_slap_parameter_form.css.css
...slapos_cloud/gadget_erp5_page_slap_parameter_form.css.css
+9
-1
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/gadget_erp5_page_slap_parameter_form.html.zpt
...lapos_cloud/gadget_erp5_page_slap_parameter_form.html.zpt
+1
-1
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/gadget_erp5_page_slap_parameter_form.js.js
...s/slapos_cloud/gadget_erp5_page_slap_parameter_form.js.js
+22
-11
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Base_getParameterEditorDict.py
0 → 100644
View file @
a3aff077
import
base64
text_content
=
context
.
getTextContent
()
if
context
.
getTextContent
()
is
None
:
text_content
=
'<?xml version="1.0" encoding="utf-8" ?><instance></instance>'
parameter_dict
=
{
'parameter'
:
{
'json_url'
:
"."
.
join
([
context
.
getUrlString
(),
"json"
]),
'softwaretype'
:
context
.
getSourceReference
(),
'shared'
:
context
.
getRootSlave
(),
'parameter_hash'
:
base64
.
b64encode
(
text_content
)
}
}
import
json
return
json
.
dumps
(
parameter_dict
)
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Base_getParameterEditorDict.xml
0 → 100644
View file @
a3aff077
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_getParameterEditorDict
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/gadget_erp5_page_slap_load_schema.html.html
View file @
a3aff077
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<script
src=
"URI.js"
type=
"text/javascript"
></script>
<script
src=
"URI.js"
type=
"text/javascript"
></script>
<script
src=
"ref-parser.min.js"
type=
"text/javascript"
></script>
<script
src=
"ref-parser.min.js"
type=
"text/javascript"
></script>
<script
src=
"cfworker-jsonschema-validator.js"
type=
"text/javascript"
></script>
<script
src=
"cfworker-jsonschema-validator.js"
type=
"text/javascript"
></script>
<script
src=
"jio
dev
.js"
type=
"text/javascript"
></script>
<script
src=
"jio.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_erp5_page_slap_load_schema.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_erp5_page_slap_load_schema.js"
type=
"text/javascript"
></script>
</head>
</head>
<body>
<body>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/gadget_erp5_page_slap_parameter_form.css.css
View file @
a3aff077
#software-type
{
padding
:
10px
0
0
;}
#software-type
{
padding
:
10px
0
0
;
border
:
0px
;
}
#software-type
.field
[
title
=
'serialisation_type'
]
.input
{
padding-top
:
0
;
}
#software-type
.field
[
title
=
'serialisation_type'
]
.input
{
padding-top
:
0
;
}
.subfield
,
#software-type
.input
{
.subfield
,
#software-type
.input
{
padding-top
:
10px
;
padding-top
:
10px
;
...
@@ -25,6 +28,11 @@ textarea.slapos-parameter {
...
@@ -25,6 +28,11 @@ textarea.slapos-parameter {
height
:
100px
;
height
:
100px
;
}
}
div
.parameter-editor
fieldset
{
border
:
0px
;
}
.field
input
~
span
{
.field
input
~
span
{
position
:
relative
;
position
:
relative
;
top
:
-27px
;
top
:
-27px
;
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/gadget_erp5_page_slap_parameter_form.html.zpt
View file @
a3aff077
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<link
href=
"gadget_erp5_page_slap_parameter_form.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"gadget_erp5_page_slap_parameter_form.css"
rel=
"stylesheet"
type=
"text/css"
/>
</head>
</head>
<body>
<body>
<div>
<div
class=
"parameter-editor"
>
<fieldset
id=
"software-type"
>
<fieldset
id=
"software-type"
>
<div
class=
"field"
title=
"software_type"
>
<div
class=
"field"
title=
"software_type"
>
<label
i18n:translate=
""
i18n:domain=
"ui"
>
Software Type
</label>
<label
i18n:translate=
""
i18n:domain=
"ui"
>
Software Type
</label>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/gadget_erp5_page_slap_parameter_form.js.js
View file @
a3aff077
...
@@ -504,24 +504,35 @@
...
@@ -504,24 +504,35 @@
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
restricted_softwaretype
=
false
,
var
restricted_softwaretype
=
false
,
software_type_list
=
[],
software_type_list
=
[],
parameter_hash
=
options
.
value
.
parameter
.
parameter_hash
,
parameter_dict
,
parameter_hash
,
parameter_xml
;
if
((
options
.
value
!==
undefined
)
&&
(
typeof
options
.
value
===
"
string
"
))
{
parameter_dict
=
JSON
.
parse
(
options
.
value
).
parameter
}
else
{
parameter_dict
=
options
.
value
.
parameter
;
}
parameter_hash
=
parameter_dict
.
parameter_hash
,
// XXX Do we directly get parameter_xml parameter?
// XXX Do we directly get parameter_xml parameter?
parameter_xml
=
options
.
value
.
parameter
.
parameter_xml
;
parameter_xml
=
parameter_dict
.
parameter_xml
;
if
(
parameter_hash
!==
undefined
)
{
if
(
parameter_hash
!==
undefined
)
{
// A JSON where provided via gadgetfield
// A JSON where provided via gadgetfield
parameter_xml
=
atob
(
parameter_hash
);
parameter_xml
=
atob
(
parameter_hash
);
}
}
if
(
options
.
value
.
parameter
.
software_type_list
!==
undefined
)
{
if
(
parameter_dict
.
software_type_list
!==
undefined
)
{
software_type_list
=
options
.
value
.
parameter
.
software_type_list
;
software_type_list
=
parameter_dict
.
software_type_list
;
}
}
if
(
options
.
value
.
parameter
.
softwaretype
!==
undefined
)
{
if
(
parameter_dict
.
softwaretype
!==
undefined
)
{
restricted_softwaretype
=
true
;
restricted_softwaretype
=
true
;
// exceptional situation where the default item must be in
// exceptional situation where the default item must be in
// the list.
// the list.
software_type_list
.
push
(
options
.
value
.
parameter
.
softwaretype
);
software_type_list
.
push
(
parameter_dict
.
softwaretype
);
}
}
return
this
.
changeState
({
return
this
.
changeState
({
...
@@ -529,13 +540,13 @@
...
@@ -529,13 +540,13 @@
// hidden: options.hidden,
// hidden: options.hidden,
// key: options.key,
// key: options.key,
serialisation
:
options
.
serialisation
,
serialisation
:
options
.
serialisation
,
json_url
:
options
.
value
.
parameter
.
json_url
,
json_url
:
parameter_dict
.
json_url
,
parameter_xml
:
parameter_xml
,
parameter_xml
:
parameter_xml
,
restricted_softwaretype
:
restricted_softwaretype
,
restricted_softwaretype
:
restricted_softwaretype
,
shared
:
options
.
value
.
parameter
.
shared
,
shared
:
parameter_dict
.
shared
,
softwaretype
:
options
.
value
.
parameter
.
softwaretype
,
softwaretype
:
parameter_dict
.
softwaretype
,
software_type_list
:
software_type_list
,
software_type_list
:
software_type_list
,
softwareindex
:
options
.
value
.
parameter
.
softwareindex
,
softwareindex
:
parameter_dict
.
softwareindex
,
editable
:
options
.
editable
,
editable
:
options
.
editable
,
// Force refresh in any case
// Force refresh in any case
render_timestamp
:
new
Date
().
getTime
()
render_timestamp
:
new
Date
().
getTime
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment