Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openfaas-faas
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Team Jaz CS 598 CCC Final Project
openfaas-faas
Commits
edc2c4b2
Commit
edc2c4b2
authored
8 years ago
by
Alex
Committed by
Alex Ellis
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Initial pop-up design
parent
f097c75b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gateway/assets/newfunction.html
+34
-0
34 additions, 0 deletions
gateway/assets/newfunction.html
gateway/assets/script/bootstrap.js
+55
-24
55 additions, 24 deletions
gateway/assets/script/bootstrap.js
with
89 additions
and
24 deletions
gateway/assets/newfunction.html
0 → 100644
+
34
−
0
View file @
edc2c4b2
<md-dialog
aria-label=
"List dialog"
layout=
"column"
flex=
"80"
>
<md-dialog-content
class=
"md-padding"
>
<label>
Define a function:
</label>
<form
name=
"userForm"
>
<div
layout-gt-xs=
"row"
>
<md-input-container
class=
"md-block"
flex-gt-sm
>
<label>
Image:
</label>
<input
name=
"dockerImage"
ng-model=
"item.image"
required
md-maxlength=
"200"
minlength=
"4"
>
</md-input-container>
</div>
<div
layout-gt-xs=
"row"
>
<md-input-container
class=
"md-block"
flex-gt-sm
>
<label>
Name:
</label>
<input
name=
"serviceName"
ng-model=
"item.name"
required
md-maxlength=
"200"
minlength=
"4"
>
</md-input-container>
</div>
<div
layout-gt-xs=
"row"
>
<md-input-container
class=
"md-block"
flex-gt-sm
>
<label>
fProcess:
</label>
<input
name=
"fprocess"
ng-model=
"item.fprocess"
required
md-maxlength=
"200"
minlength=
"4"
>
</md-input-container>
</div>
</form>
</md-dialog-content>
<md-dialog-actions>
<md-button
ng-click=
"closeDialog()"
class=
"md-secondary"
>
Close Dialog
</md-button>
<md-button
ng-click=
"createFunc()"
class=
"md-primary"
>
Create
</md-button>
</md-dialog-actions>
</md-dialog>
This diff is collapsed.
Click to expand it.
gateway/assets/script/bootstrap.js
+
55
−
24
View file @
edc2c4b2
"
use strict
"
var
app
=
angular
.
module
(
'
faasGateway
'
,
[
'
ngMaterial
'
]);
app
.
controller
(
"
home
"
,
[
'
$scope
'
,
'
$log
'
,
'
$http
'
,
'
$location
'
,
'
$timeout
'
,
'
$mdDialog
'
,
function
(
$scope
,
$log
,
$http
,
$location
,
$timeout
,
$mdDialog
)
{
app
.
controller
(
"
home
"
,
[
'
$scope
'
,
'
$log
'
,
'
$http
'
,
'
$location
'
,
'
$timeout
'
,
'
$mdDialog
'
,
function
(
$scope
,
$log
,
$http
,
$location
,
$timeout
,
$mdDialog
)
{
$scope
.
functions
=
[];
$scope
.
invocationRequest
=
""
;
$scope
.
invocationResponse
=
""
;
...
...
@@ -9,6 +10,9 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$timeout', '$md
$scope
.
invocation
=
{
contentType
:
"
text
"
};
$scope
.
functionTemplate
=
{
image
:
""
};
$scope
.
invocation
.
request
=
""
setInterval
(
function
()
{
refreshData
();
...
...
@@ -32,9 +36,6 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$timeout', '$md
$scope
.
invocationResponse
=
error1
;
$scope
.
invocationStatus
=
null
;
});
// console.log("POST /function/"+ $scope.selectedFunction.name);
// console.log("Body: " + $scope.invocation.request);
};
var
refreshData
=
function
()
{
...
...
@@ -77,29 +78,59 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$timeout', '$md
}
};
var
showDialog
=
function
()
{
var
alert
=
$mdDialog
.
alert
({
title
:
'
New function
'
,
textContent
:
'
New functions are not supported yet, but will be defined here.
'
,
ok
:
'
Close
'
});
$mdDialog
.
show
(
alert
)
.
finally
(
function
()
{
alert
=
undefined
;
});
var
showDialog
=
function
(
$event
)
{
var
parentEl
=
angular
.
element
(
document
.
body
);
$mdDialog
.
show
({
parent
:
parentEl
,
targetEvent
:
$event
,
templateUrl
:
"
newfunction.html
"
,
locals
:
{
item
:
$scope
.
functionTemplate
},
controller
:
DialogController
});
};
var
DialogController
=
function
(
$scope
,
$mdDialog
,
item
)
{
$scope
.
item
=
item
;
$scope
.
closeDialog
=
function
()
{
$mdDialog
.
hide
();
};
$scope
.
createFunc
=
function
()
{
console
.
log
(
$scope
.
item
);
$scope
.
closeDialog
();
};
};
// TODO: popup + form to create new Docker service.
// More to follow @ https://material.angularjs.org/latest/demo/dialog
$scope
.
newFunction
=
function
()
{
// $scope.functions.push({
// name: "f" + ($scope.functions.length + 2),
// replicas: 0,
// invokedCount: 0
// });
showDialog
()
showDialog
();
};
fetch
();
}]);
\ No newline at end of file
}]);
// '<md-dialog aria-label="List dialog">' +
// ' <md-dialog-content class="md-padding">'+
// '<label>Define a function</label>'+
// '<form name="userForm">'+
// '<md-input-container>'+
// '<label>Image:</label>'+
// '<input name="dockerImage" ng-model="item.image" required md-maxlength="200" minlength="4">'+
// '</md-input-container>'+
// '<md-input-container>'+
// '<label>Name:</label>'+
// '<input name="serviceName" ng-model="item.name" required md-maxlength="200" minlength="4">'+
// '</md-input-container>'+
// '</form>'+
// ' </md-dialog-content>' +
// ' <md-dialog-actions>' +
// ' <md-button ng-click="closeDialog()" class="md-secondary">' +
// ' Close Dialog' +
// ' </md-button>' +
// ' <md-button ng-click="createFunc()" class="md-primary">' +
// ' Create' +
// ' </md-button>' +
// ' </md-dialog-actions>' +
// '</md-dialog>'
\ No newline at end of file
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