Skip to content

Commit

Permalink
[UPDATED]- Estimate button updated for the env, code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ndasanayaka committed Nov 25, 2024
1 parent 39087b7 commit 8b79f4c
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 78 deletions.
5 changes: 0 additions & 5 deletions src/api/DeconvolutionAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ export default {
let endpoint = `${Vue.prototype.$Config.endpoints.pref}`
// let apihost = /^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(endpoint)[1]
let apihost = /^(?:\w+:\/\/)?([^/]+)(.*)$/.exec(endpoint)[1]
console.log("----run estimate api API call---")
let today = new Date();
let date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
let time = today.getHours() + "-" + today.getMinutes() + "-" + today.getSeconds();
console.log(date+'_'+time)
const { data } = await request.get(_requestUrl, {
params: {
output: output,
Expand Down
1 change: 0 additions & 1 deletion src/api/MacroAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default {
// execute
async execute_macro_script(output, instances, mem, devices,macroinfo ) {
let _requestUrl =`${Vue.prototype.$Config.endpoints.bunya}/api/execute/executeMacroBase64`
console.log(_requestUrl)
let arrayMax = parseInt(instances) - 1
let endpoint = `${Vue.prototype.$Config.endpoints.pref}`

Expand Down
13 changes: 5 additions & 8 deletions src/components/DesktopManagerComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
this.apps.push(element)
this.selectedApp = this.apps[0].id
});
console.log( this.apps)
},
async getFlavours(){
let response = await DesktopAPI.listdesktopflavours()
Expand Down Expand Up @@ -347,8 +347,7 @@
},
async launchDesktop(){
console.log("selectedDesktop")
console.log(this.selectedDesktop.value)
if (this.selectedDesktop.value === 'ipp_desktop') {
await DesktopAPI.launchfile()
}
Expand All @@ -364,14 +363,13 @@
// set files
setFiles(filelist) {
console.log("setFiles ")
console.log(filelist)
if(filelist.length>0){
filelist.map(item => {
if(!item.endsWith("/") && !this.files.includes(item)){
this.files.push(item)
console.log("a file")
} else {
console.log("a folder")
}
Expand Down Expand Up @@ -418,8 +416,7 @@
//this.getFlavours()
//this.startTimer(20000)
this.loading = false
console.log("this.desktopManagerOnly")
console.log(this.desktopManagerOnly)
},
destroyed() {
Expand Down
11 changes: 5 additions & 6 deletions src/components/deconvolution/Devices.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</v-col> -->
<v-col align="center" justify="center">

<v-col v-if="api=='Microvolution'" >
<v-col v-if="api=='Microvolution' && env!=='prod'" >


<v-tooltip bottom >
Expand Down Expand Up @@ -138,7 +138,7 @@
</template>

<script>
// import Vue from 'vue';
import Vue from 'vue';
import series from '@/utils/series.js'
// api
import DeconvolutionAPI from "@/api/DeconvolutionAPI.js"
Expand Down Expand Up @@ -174,6 +174,7 @@
api:"",
selectedtag: null,
queueTime:"",
env:null,
/* positiveInteger: [
value => value && value > 0 && Number.isInteger(parseFloat(value)) || 'Must be a positive integer'
],
Expand All @@ -195,6 +196,7 @@
let _current_api = await PreferenceAPI.get_config()
this.api=_current_api.apiname
this.selectedtag = _current_api.metadatatag
this.env = Vue.prototype.$Config.env
this.getQueueTime()
this.getUserLimits()
Expand Down Expand Up @@ -278,14 +280,11 @@
let response = await DeconvolutionAPI.execute_microvolution(this.serie.outputPath, parseInt(this.serie.instances),
this.serie.mem, this.serie.gpus, this.serie, jobs, false, true, false)
console.log("Estimate response")
console.log(response)
this.overlay =false
this.loading=false
this.message = ' Estimate complete'
let output = response.commandResult
console.log(output)
if (output.length > 0) {
for (let i=0; i < output.length ; i++) {
Expand Down
5 changes: 2 additions & 3 deletions src/components/vuetify-file-browser/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ export default {
this.total_files = 0
this.total_folders = 0
this.items = response.commandResult.map(responseItem => {
//console.log(responseItem.name)
responseItem.type = "file"
responseItem.basename = responseItem.name
responseItem.extension = ""
Expand Down Expand Up @@ -691,7 +690,7 @@ export default {
this.displayItems = this.filteredItems.slice((this.pageindex - 1) * this.itemsperpage,
this.pageindex * this.itemsperpage)
console.log(this.displayItems)
},
canView(item){
let extension = item.basename.split(".").pop()
Expand Down Expand Up @@ -740,7 +739,7 @@ export default {
}
},
async viewItem(item){
console.log("reading:" + item.path)
console.log("reading:" + item.path)
try{
let _readFileResponse = await FilesAPI.readTextFile(item.path)
Expand Down
14 changes: 3 additions & 11 deletions src/components/vuetify-file-browser/Toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,16 @@ export default {
let destination = options.path
let copy = false
console.log("Destination outside if")
console.log(destination)
if ( options.selectedItems.length > 0 ) {
destination = destination + options.selectedItems[0].name
console.log("Destination in if")
console.log(destination)
}
if(_copiedItems.length > 0) {
_copiedItems.forEach((item) => {
let lastindex = item.lastIndexOf('/');
console.log("index ", lastindex)
console.log("current item ", item)
let directoryPath2 = item.substring(0, (lastindex + 1));
console.log("directoryPath2 ", directoryPath2)
if (directoryPath2 === destination ) {
/* let dotindex = item.indexOf('.')
let pathtoextenstion = item.substring(0,dotindex)
Expand All @@ -290,10 +285,7 @@ export default {
})
}
//let index = _copiedItems[0].lastIndexOf('/');
console.log(_copiedItems)
console.log(btoa(_copiedItems.join(";")))
console.log(btoa(destination))
console.log(copy)
Vue.$log.info("Copying " + _copiedItems + " to "+ destination)
let confirmOptions = await this.$refs.copyconfirm.open(_copiedItems, destination)
if (!confirmOptions.cancelled) {
Expand Down
12 changes: 5 additions & 7 deletions src/components/vuetify-file-browser/Tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,13 @@ export default {
}
},
findItem(path) {
// console.log("[findItem@Tree] path=" + path)
let stack = [];
stack.push(this.items[0]);
// console.log(stack)
while (stack.length > 0) {
let node = stack.pop();
// console.log("[findItem@Tree] node= ")
// console.log(node)
if(!node)
break;
if (node.path == path) {
Expand All @@ -191,11 +190,10 @@ export default {
return null;
},
async openPath(path) {
// console.log("[openPath@Tree] path = " + path)
// console.log("[openPath@Tree] item0 = " + this.items[0])
this.$emit("loading", true);
let pathsegments = path.replace(/^\//, "").replace(/\/$/, "").split("/");
console.log(pathsegments)
// now we have pathSegments = ["a", "b", "c"] root folder is ignored
let stack = [];
stack.push(this.items[0]);
Expand Down
12 changes: 4 additions & 8 deletions src/views/Jobshistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@
this.loading = true
// only list running and submitted jobs
this.jobs = await PreferenceAPI.list_jobs(false)
console.log("this.jobs")
console.log(this.jobs)
/* const options = {
timeZone: 'Australia/Brisbane',
year: 'numeric',
Expand All @@ -129,9 +128,6 @@
for(let i=0; i<this.jobs.length; i++) {
let job = this.jobs[i]
if(job.submitted) {
console.log("submitted time")
console.log(job.submitted)
let ms = Date.parse(job.submitted)
let utcdate = new Date()
utcdate.setTime(ms)
Expand All @@ -140,20 +136,20 @@
//let localtime = new Date(utcdate.getTime() - offsetMinutes * 60 * 1000)
let localTimeString = utcdate.toLocaleString()
this.jobs[i].submitted = localTimeString
console.log("job submitted "+ this.jobs[i].submitted)
}
if(job.start) {
let utcdate = new Date(job.start);
let localTimeString = utcdate.toLocaleString();
this.jobs[i].start = localTimeString
console.log(localTimeString);
}
if(job.end) {
let utcdate = new Date(job.end);
let localTimeString = utcdate.toLocaleString();
this.jobs[i].end = localTimeString
console.log(localTimeString);
}
Expand Down
Loading

0 comments on commit 8b79f4c

Please sign in to comment.