Skip to content

Commit

Permalink
isBlocked.valueがうまく動かないので一旦こっちからは削除
Browse files Browse the repository at this point in the history
  • Loading branch information
atsu1125 committed Jan 30, 2024
1 parent 61fdd86 commit 17ba84c
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions src/client/pages/instance/instance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
<div class="operations section">
<span class="label">{{ $ts.operations }}</span>
<MkSwitch v-model:value="isSuspended" class="switch">{{ $ts.stopActivityDelivery }}</MkSwitch>
<MkSwitch :disabled="!$i.isAdmin" :value="isBlocked" class="switch" @update:value="changeBlock">{{ $ts.blockThisInstance }}</MkSwitch>
<details>
<summary>{{ $ts.deleteAllFiles }}</summary>
<MkButton @click="deleteAllFiles()" style="margin: 0.5em 0 0.5em 0;"><Fa :icon="faTrashAlt"/> {{ $ts.deleteAllFiles }}</MkButton>
Expand Down Expand Up @@ -174,7 +173,6 @@ export default defineComponent({
chartInstance: null,
chartSrc: 'requests',
chartSpan: 'hour',
meta: null,
faTimes, faCrosshairs, faCloudDownloadAlt, faCloudUploadAlt, faUsers, faPencilAlt, faFileImage, faDatabase, faTrafficLight, faLongArrowAltUp, faLongArrowAltDown, faMinusCircle, faTrashAlt
};
},
Expand Down Expand Up @@ -204,14 +202,6 @@ export default defineComponent({
null;
return stats;
},
meta() {
return this.meta;
},
isBlocked() {
return this.meta && this.meta.blockedHosts && this.meta.blockedHosts.includes(this.instance.host);
}
},
Expand All @@ -235,10 +225,9 @@ export default defineComponent({
async created() {
this.now = new Date();
const [perHour, perDay, meta] = await Promise.all([
const [perHour, perDay] = await Promise.all([
os.api('charts/instance', { host: this.instance.host, limit: chartLimit, span: 'hour' }),
os.api('charts/instance', { host: this.instance.host, limit: chartLimit, span: 'day' }),
os.api('meta', { detail: true }),
]);
const chart = {
Expand All @@ -247,7 +236,6 @@ export default defineComponent({
};
this.chart = chart;
this.meta = meta;
this.renderChart();
},
Expand All @@ -257,14 +245,6 @@ export default defineComponent({
this.canvas = el;
},
changeBlock(e) {
os.api('admin/update-meta', {
blockedHosts: !this.isBlocked ? this.meta.blockedHosts.concat([this.instance.host]) : this.meta.blockedHosts.filter(x => x !== this.instance.host)
}).then(() => {
location.reload();
});
},
setSrc(src) {
this.chartSrc = src;
},
Expand Down

0 comments on commit 17ba84c

Please sign in to comment.