This commit is contained in:
2022-02-23 22:04:15 +00:00
parent a793b3a5f5
commit 9223635c18
6 changed files with 17 additions and 9 deletions

View File

@@ -972,8 +972,14 @@ export default {
ret.push(6);
}
return ret;
},
///////////////////////////////////////////////
// Random integer from 0 to max
//
//
getRandomInt: function(max) {
return Math.floor(Math.random() * max);
}
/**
*
*

View File

@@ -181,11 +181,10 @@ export default {
}
},
created() {
//this.refresh();
if (this.updateFrequency > 0) {
this.timer = setInterval(() => {
this.refresh();
}, this.updateFrequency);
}, this.updateFrequency + window.$gz.util.getRandomInt(30000)); //add up to 30 seconds so they don't all fire at once
}
},
beforeDestroy() {

View File

@@ -3,7 +3,7 @@
icon="$ayiStickyNote"
:add-url="'home-reminders/0'"
:show-more-button="false"
:update-frequency="65000"
:update-frequency="300000"
:error-message="errorMessage"
v-bind="$attrs"
@dash-refresh="getDataFromApi()"

View File

@@ -2,7 +2,7 @@
<gz-dash
icon="$ayiCalendarCheck"
:show-more-button="false"
:update-frequency="65000"
:update-frequency="300000"
:error-message="errorMessage"
v-bind="$attrs"
@dash-refresh="getDataFromApi()"

View File

@@ -3,7 +3,7 @@
icon="$ayiUserClock"
:add-url="'svc-workorders/0'"
:show-more-button="false"
:update-frequency="60000"
:update-frequency="300000"
:error-message="errorMessage"
v-bind="$attrs"
@dash-refresh="getDataFromApi()"

View File

@@ -66,9 +66,12 @@
</component>
</v-col>
<v-col cols="12">
<v-btn outlined @click.native="showSelector = true">{{
$ay.t("Add")
}}</v-btn>
<v-btn
v-if="formState.ready"
text
@click.native="showSelector = true"
>{{ $ay.t("Add") }}</v-btn
>
</v-col>
</v-row>
</div>