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
Roque
slapos.core
Commits
05552d03
Commit
05552d03
authored
Jun 20, 2012
by
Thomas Lechauve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Final push for vifib version 1
parent
6a991a50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
25 deletions
+30
-25
vifib/index.html
vifib/index.html
+0
-1
vifib/static/js/core.js
vifib/static/js/core.js
+30
-24
No files found.
vifib/index.html
View file @
05552d03
...
...
@@ -24,7 +24,6 @@
}
#slider
{
height
:
200px
;
repeat
:
no-repeat
;
margin-left
:
-15px
;
margin-top
:
-19px
;
margin-right
:
-119px
;
...
...
vifib/static/js/core.js
View file @
05552d03
...
...
@@ -137,7 +137,7 @@
$
.
router
.
routes
.
add
(
'
/library
'
,
nextLevel
,
methods
.
showLibrary
,
$
(
"
:jqmData(role=page)
"
));
$
.
router
.
routes
.
add
(
'
/documentation
'
,
nextLevel
,
methods
.
showDocumentation
,
$
(
"
:jqmData(role=page)
"
));
$
.
router
.
routes
.
add
(
'
/dashboard
'
,
nextLevel
,
methods
.
showDashboard
,
$
(
"
:jqmData(role=page)
"
));
$
.
router
.
routes
.
add
(
'
/instance
'
,
nextLevel
,
methods
.
showInstance
Lis
t
,
$
(
"
:jqmData(role=page)
"
));
$
.
router
.
routes
.
add
(
'
/instance
'
,
nextLevel
,
methods
.
showInstance
Roo
t
,
$
(
"
:jqmData(role=page)
"
));
$
.
router
.
routes
.
add
(
'
/login
'
,
nextLevel
,
methods
.
showLogin
,
$
(
"
:jqmData(role=page)
"
));
// default page
if
(
$
.
router
.
routes
.
isCurrent
(
params
.
route
))
{
...
...
@@ -372,6 +372,31 @@
});
},
showInstanceRoot
:
function
(
params
)
{
return
this
.
each
(
function
()
{
var
nextLevel
=
$
.
router
.
routes
.
current
.
level
+
1
,
options
=
{
'
title
'
:
'
Service
'
,
'
menu
'
:
'
true
'
,
'
leftbutton
'
:
{
'
link
'
:
$
(
this
).
vifib
(
'
isAuthenticated
'
)
?
'
#/dashboard
'
:
'
#/homepage
'
,
'
icon
'
:
'
home
'
,
'
title
'
:
'
Homepage
'
},
'
menulinks
'
:
[
{
'
link
'
:
'
#/instance
'
,
'
name
'
:
'
All services
'
}
],
};
$
(
this
).
vifib
(
'
render
'
,
'
instance
'
,
options
);
$
.
router
.
routes
.
add
(
'
/instance/list
'
,
nextLevel
,
methods
.
showInstanceList
,
$
(
this
).
find
(
'
.content-primary
'
));
$
.
router
.
routes
.
add
(
'
/instance/id/:id
'
,
nextLevel
,
methods
.
showInstance
,
$
(
this
).
find
(
'
.content-primary
'
));
$
.
router
.
routes
.
add
(
'
/instance/id/:id/bang
'
,
nextLevel
,
methods
.
showBangInstance
,
$
(
this
).
find
(
'
.content-primary
'
));
if
(
$
.
router
.
routes
.
isCurrent
(
params
)
===
false
)
{
$
.
router
.
start
(
params
.
route
);
}
});
},
showInstance
:
function
(
params
)
{
return
this
.
each
(
function
()
{
var
statusCode
=
{
...
...
@@ -381,10 +406,6 @@
500
:
serverError
},
nextLevel
=
$
.
router
.
routes
.
current
.
level
+
1
;
$
.
router
.
routes
.
add
(
'
/instance/id/:id/bang
'
,
nextLevel
,
methods
.
showBangInstance
,
$
(
this
).
find
(
'
.content-primary
'
));
if
(
$
.
router
.
routes
.
isCurrent
(
params
.
route
)
===
false
)
{
$
.
router
.
start
(
params
.
route
);
}
$
(
this
).
slapos
(
'
instanceInfo
'
,
params
.
id
,
{
success
:
function
(
response
)
{
if
(
typeof
(
response
)
!==
"
object
"
)
{
...
...
@@ -401,29 +422,13 @@
{
'
name
'
:
'
Bang
'
,
'
link
'
:
methods
.
genBangUrl
(
params
.
id
)},
{
'
name
'
:
'
Rename
'
,
'
link
'
:
'
#/instance/rename
'
}
]
},
options
=
{
'
title
'
:
response
.
instance_id
,
'
mainPanel
'
:
$
(
this
).
vifib
(
'
getRender
'
,
'
instancePanel
'
,
content
),
'
leftbutton
'
:
{
'
link
'
:
$
(
this
).
vifib
(
'
isAuthenticated
'
)
?
'
#/dashboard
'
:
'
#/homepage
'
,
'
icon
'
:
'
home
'
,
'
title
'
:
'
Homepage
'
},
'
menu
'
:
true
,
'
menulinks
'
:
[
{
'
link
'
:
'
#/instance
'
,
'
name
'
:
'
All services
'
}
],
'
menu-extension
'
:
'
instances bound
'
,
'
menuextlinks
'
:
[
{
'
link
'
:
'
#/instance/id/kvm
'
,
'
name
'
:
'
INST-2
'
}
]
};
};
//response.status = $(this).vifib('getRender', 'instance.' + response.status);
response
.
actions
=
[
{
'
name
'
:
"
Bang
"
,
'
url
'
:
methods
.
genBangUrl
(
decodeURIComponent
(
params
.
id
))}
];
$
(
this
).
vifib
(
'
render
'
,
'
instance
'
,
options
);
$
.
extend
(
response
,
content
);
$
(
this
).
vifib
(
'
render
'
,
'
instancePanel
'
,
response
);
//var form = $(this).find("#instance-form");
//form.vifib('prepareForm');
},
...
...
@@ -441,6 +446,7 @@
500
:
serverError
};
return
this
.
each
(
function
()
{
console
.
log
(
"
plop
"
)
$
(
this
).
vifib
(
'
render
'
,
'
instance.bangPanel
'
);
$
(
this
).
find
(
'
#form-bang
'
).
submit
(
function
()
{
var
data
=
$
(
this
).
serializeObject
(),
...
...
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