Browse Source

add check url

master
zeus 3 years ago
parent
commit
dc6ac6be01
  1. 2
      dist/index.html
  2. 2
      dist/js/app.21fd4f4b.js
  3. 1
      dist/js/app.21fd4f4b.js.map
  4. 2
      dist/js/app.f5103eb0.js
  5. 1
      dist/js/app.f5103eb0.js.map
  6. 17
      src-local/community/config/cse242017102-test.js
  7. 1
      src-local/community/rootapostolos@swarmlab.io_ansibletest_microservice-alpine313
  8. 44
      src-local/llo/new.js
  9. 3
      src/components/mynetwork/availablemicroservicescustom.vue
  10. 43
      src/components/mynetwork/customservices.vue
  11. 30
      src/store/modules/create_pipelineLLO.js

2
dist/index.html

@ -1 +1 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vue App</title><link href="/css/app.389c85c2.css" rel="preload" as="style"><link href="/css/chunk-vendors.e469b508.css" rel="preload" as="style"><link href="/js/app.21fd4f4b.js" rel="preload" as="script"><link href="/js/chunk-vendors.d8d18fe6.js" rel="preload" as="script"><link href="/css/chunk-vendors.e469b508.css" rel="stylesheet"><link href="/css/app.389c85c2.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.d8d18fe6.js"></script><script src="/js/app.21fd4f4b.js"></script></body></html>
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vue App</title><link href="/css/app.389c85c2.css" rel="preload" as="style"><link href="/css/chunk-vendors.e469b508.css" rel="preload" as="style"><link href="/js/app.f5103eb0.js" rel="preload" as="script"><link href="/js/chunk-vendors.d8d18fe6.js" rel="preload" as="script"><link href="/css/chunk-vendors.e469b508.css" rel="stylesheet"><link href="/css/app.389c85c2.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.d8d18fe6.js"></script><script src="/js/app.f5103eb0.js"></script></body></html>

2
dist/js/app.21fd4f4b.js

File diff suppressed because one or more lines are too long

1
dist/js/app.21fd4f4b.js.map

File diff suppressed because one or more lines are too long

2
dist/js/app.f5103eb0.js

File diff suppressed because one or more lines are too long

1
dist/js/app.f5103eb0.js.map

File diff suppressed because one or more lines are too long

17
src-local/community/config/cse242017102-test.js

@ -0,0 +1,17 @@
{
"servicedata": {
"service": "test",
"baseservice": "microservice-nodejs",
"user": "cse242017102@uniwa.gr",
"port1": "",
"url1": "",
"name1": "",
"port2": "",
"url2": "",
"name2": "",
"port3": "",
"url3": "",
"name3": ""
},
"baseservicedata": {"name":"microservice-nodejs","custom":"true","customostext":"Base OS: alpine:3.13","customos":"apk add --no-cache net-tools ","customshtext":"It is executed after all the normal builds","customsh":" #!/bin/sh","app":false,"url":"http","port":"80/tcp","ttyd":true,"ttydport":"3787/tcp","ttydurl":"http"}
}

1
src-local/community/rootapostolos@swarmlab.io_ansibletest_microservice-alpine313

@ -1 +0,0 @@
Subproject commit 90b1c87737d0baad3effd1f72c45f5e6261a1c67

44
src-local/llo/new.js

@ -2873,6 +2873,50 @@ app.get('/rm_swarmlab', (req, res, next) => {
});
});
app.get('/rm_swarmlabuser', (req, res, next) => {
var mypath = process.cwd()
var RES = new Object();
var value = JSON.parse(req.query["instance"])
console.log(value)
var baseservicetmp1 = value.user.split('@')
var service = `${baseservicetmp1[0]}-${value.service}`
var myservice = `${value.user}_${value.service}_${value.baseservice}`
if(myservice){
var services_path = './community/'+myservice
console.log(services_path)
console.log(value.service)
docker_image_rm(mypath, value.service);
fs.rm(services_path, {
recursive: true,
force: true
}, (error) => {
if (error) {
RES.error = true
RES.path = mypath
RES.error_msg = "no"
res.json(RES)
} else {
RES.error = false
RES.path = mypath
RES.error_msg = "ok"
res.json(RES)
}
});
}else{
RES.error = true
RES.path = 'nodir'
RES.error_msg = "no"
res.json(RES)
}
});
app.get('/rm_swarmlabstorage', (req, res, next) => {
var mypath = process.cwd()

3
src/components/mynetwork/availablemicroservicescustom.vue

@ -253,7 +253,6 @@
@click="onAction('rm-install', props.rowData, props.rowData._id)"
round
>
{{ testtestdir[props.rowData.baseservice] }}
</button>
</div>
</div>
@ -687,7 +686,7 @@ export default {
this.hybridoptions.swarmlabname = data.swarmlabname
this.$wait.start('myRunInstancetutor');
//console.log(this.hybridoptions.swarmlabname)
var res = await store.dispatch('pipelineLLO/rmswarmlablocal', this.hybridoptions.swarmlabname)
var res = await store.dispatch('pipelineLLO/rmswarmlablocaluser', data)
this.$wait.end('myRunInstancetutor');
var obj = {}
obj.token = this.token

43
src/components/mynetwork/customservices.vue

@ -132,6 +132,12 @@
<span class="hybrid-field-error">{{ errors[0] }}</span>
</ValidationProvider>
<ValidationProvider
ref="hybrid_stackversion"
name="myGitrepo"
rules="required|alpha_num_url"
v-slot="{ errors, ariaMsg, ariaInput, valid, invalid }"
>
<div class="row">
<div class="col-sm-12 sm-12">
<div class="input-group">
@ -142,8 +148,14 @@
type="text"
class="form-control"
v-model="form_gitrepo"
name="validationTooltipUsername"
name="myGitrepo"
v-bind:class="{'is-valid': isDeployValid.gitrepo == 1, 'is-invalid': isDeployValid.gitrepo == 2}"
aria-describedby="validationTooltipUsernamePrepend"
v-on:keyup="isValid('gitrepo')"
v-on:blur="isValid('gitrepo')"
v-on:input="isValid('gitrepo')"
v-on:change="isValid('gitrepo')"
v-on:focus="isValid('gitrepo')"
>
<div class="input-group-prepend">
<button
@ -156,12 +168,14 @@
</div>
</div>
</div>
<span class="hybrid-field-error">{{ errors[0] }}</span>
</ValidationProvider>
<div class="row"
<b-col class="text-center" cols="12" sm="12" md="12">
<div class="form-group">
<label for="customreadme" class="text-dark"> <b> <span class="text-info">README </span></b> <br>
<label for="customreadme" class="text-dark"> <b> <span class="text-dark">README </span></b> <br>
<button
class="ti-info btn btn-outline-secondary btn-sm"
title="Info"
@ -182,7 +196,7 @@
<div class="row"
<b-col class="text-center" cols="12" sm="12" md="12">
<div class="form-group">
<label for="custompackages" class="text-dark"><b> <span class="text-info">Add Extrapackages</span></b> <br>
<label for="custompackages" class="text-dark"><b> <span class="text-dark">Add Extrapackages</span></b> (e.g. apt, apk etc) <br>
<button
class="ti-info btn btn-outline-secondary btn-sm"
title="Info"
@ -206,7 +220,7 @@
<div class="row"
<b-col class="text-center" cols="12" sm="12" md="12">
<div class="form-group">
<label for="customshell" class="text-dark"><b><span class="text-info">Custom sh script </span></b> <br>
<label for="customshell" class="text-dark"><b><span class="text-dark">Custom sh script </span></b> <br>
<button
class="ti-info btn btn-outline-secondary btn-sm"
title="Info"
@ -380,7 +394,7 @@
<div class="row"
<b-col class="text-center" cols="12" sm="12" md="12">
<div class="form-group">
<label for="rclocal" class="text-dark"><b><span class="text-info">rc.local</span></b> <br>
<label for="rclocal" class="text-dark"><b><span class="text-dark">rc.local</span></b> <br>
<button
class="ti-info btn btn-outline-secondary btn-sm"
title="Info"
@ -447,6 +461,14 @@ extend('alpha_num_name', value => {
return 'The {_field_} field may contain alphabetic characters and numbers'
});
extend('alpha_num_url', value => {
// var regex = new RegExp(/^[A-Za-z0-9]+$/, 'i');
var regex = new RegExp(/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/, 'i');
if(regex.test(value)){
return true;
}
return 'The {_field_} field may contain Valid url'
});
@ -507,7 +529,8 @@ export default {
issocket:'close',
isDeployValid:{
"stackname":3,
"stackversion":3
"stackversion":3,
"gitrepo":3
},
isDeployError:{
},
@ -917,6 +940,14 @@ export default {
this.isDeployValid.stackversion = 2
}
}
else if(f == 'gitrepo'){
var field = await this.$refs.hybrid_stackversion.validate();
if(field.valid == true){
this.isDeployValid.gitrepo = 1
}else{
this.isDeployValid.gitrepo = 2
}
}
}

30
src/store/modules/create_pipelineLLO.js

@ -1588,6 +1588,36 @@ export default {
}
}
},
async rmswarmlablocaluser({commit,rootGetters}, value) {
//console.log('value '+JSON.stringify(value))
try {
var token = value.token
var params = {
instance: value
}
var options = {
params: params,
headers: { 'content-type': 'application/x-www-form-urlencoded',Authorization: `Bearer ${token}` },
};
var sock_server_l = ApiConfig.url_80+'/rm_swarmlabuser'
var p = await axios.get(sock_server_l,options);
//var p = await axios.get('https://localhost:3000/get_config',options);
return p
} catch (e) {
if(e.message == "Request failed with status code 401" || /401/i.test(e.message)){
//console.log('error '+JSON.stringify(e))
window.location.href = 'https://api-login.swarmlab.io:8089';
}else{
var R = {
ERROR_str: e,
ERROR: 'yes'
}
return R;
}
}
},
async rmswarmlablocalpoc({commit,rootGetters}, value) {
//console.log('value '+JSON.stringify(value))

Loading…
Cancel
Save