SP へUsageInfo オブジェクト (sp.js)
ルックアップ フィールドのこのインスタンスが参照しているリスト アイテムの概要を取得します。
**適用対象:**apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013
var object = new SP.UsageInfo()
メンバー
UsageInfoオブジェクトでは、次のメンバーがあります。
Constructor
UsageInfoオブジェクトでは、次のコンスがあります。
コンストラクター |
説明 |
---|---|
Initializes a new instance of the SP.UsageInfo object. |
プロパティ
UsageInfoオブジェクトでは、次のプロパティがあります。
プロパティ |
説明 |
---|---|
Gets a value that specifies the cumulative bandwidth, in bytes, used by the site collection during an implementation specific period. |
|
Gets a value that specifies the total amount of disk space, in bytes, currently being used to store Web discussion comments in the site collection. |
|
Gets a value that specifies the cumulative number of requests for pages in the site collection during an implementation specific period. |
|
Gets a value that specifies the total amount of disk space, in bytes, currently being used by the site collection. |
|
Gets a value that specifies the ratio of the amount of disk space currently being used by the site collection to the maximum disk space specified in the site collection quota. |
|
このメンバーは内部使用のために予約済みです。ユーザーのコードから直接使用されるものではありません。 |
|
Gets a value that specifies the cumulative number of requests for pages in the site collection, with no referring URL, or a referring URL outside of the current site collection during an implementation specific period. |
例
次の例では、現在のサイトについての情報を表示するアプリケーション ページの [入力] ボタンを作成します。
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<script type="text/ecmascript" language="ecmascript">
var usageInfo;
var site;
var clientContext;
function runCode() {
this.clientContext = new SP.ClientContext.get_current();
if (this.clientContext != undefined && this.clientContext != null) {
this.site = clientContext.get_site();
this.clientContext.load(this.site, 'Usage');
this.clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
}
function onQuerySucceeded() {
this.usageInfo = this.site.get_usage();
var info = 'Storage: ' + this.usageInfo.get_storage() + '\nStorage percentage: ' + this.usageInfo.get_storagePercentageUsed() + '\nVisits: ' + this.usageInfo.get_visits();
alert(info);
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
</script>
<input id="Button1" type="button" value="Run Code" onclick="runCode()" />
</asp:Content>